Data storage processing method and device, equipment, storage medium and program product

By adopting a hierarchical index structure and blockchain storage mechanism in cloud servers, the problems of data tampering and security in third-party storage systems are solved, ensuring the immutability of data and the reliability of queries, and improving the authenticity and security of data in distributed storage.

CN121644050APending Publication Date: 2026-03-10ZUNYI BRANCH OF CHINA MOBILE GRP GUIZHOU COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-18
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, blockchain systems lack anti-tampering mechanisms after transferring data to third-party storage systems, making it difficult to guarantee data security and authenticity. In particular, when the third-party storage system is attacked, the data may be maliciously tampered with or destroyed.

Method used

By employing a hierarchical index structure and a blockchain storage mechanism, encrypted data is stored in a cloud server, while trusted credential data is stored in the blockchain. The immutability of the blockchain ensures the authenticity and security of the data.

Benefits of technology

It achieves data immutability, improves the authenticity and security of distributed storage data, prevents data from being maliciously tampered with or destroyed, and ensures the reliability and integrity of data queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644050A_ABST
    Figure CN121644050A_ABST
Patent Text Reader

Abstract

The invention discloses a data storage processing method and device, equipment, a storage medium and a program product. The method comprises the following steps: receiving encrypted data sent by a data uploading node; wherein the secret state data comprises encrypted data of data to be stored and a security index; storing the secret state data according to a hierarchical index structure; wherein credible credential data corresponding to the encrypted data is stored in a block chain, and a transaction value in the credible credential data is calculated based on the security index and the encrypted data; through the hierarchical index structure and block chain storage, it is ensured that the data cannot be tampered, the data is prevented from being maliciously tampered or destroyed, and therefore the authenticity and safety of the distributed storage data based on block chain technology support can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a data storage processing method, apparatus, device, storage medium, and program product. Background Technology

[0002] Transferring data from blockchain systems to third-party storage systems for distributed storage, while the blockchain system only stores immutable credentials, is currently the mainstream method for improving the performance of blockchain systems. However, this method has some problems. For example, third-party storage systems themselves lack anti-tampering mechanisms. Anyone with administrator privileges or through external attacks can modify the data stored internally. If a third-party storage system is attacked, the data it stores may be maliciously tampered with or destroyed. Furthermore, because query services are provided directly to users through third-party storage systems rather than directly through the blockchain system, users may obtain maliciously tampered and erroneous data, affecting the authenticity and security of the data queried by users.

[0003] Therefore, ensuring the authenticity and security of data in third-party storage systems supported by blockchain technology is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0004] To address the problems existing in the prior art, embodiments of the present invention provide a data storage processing method, apparatus, device, storage medium, and program product, which can improve the authenticity and security of data in distributed storage supported by blockchain technology.

[0005] In a first aspect, embodiments of the present invention provide a data storage processing method applied to a cloud server, comprising: Receive encrypted data sent by the data upload node; wherein, the encrypted data includes: encrypted data of the data to be stored and a security index; The encrypted data is stored according to a hierarchical index structure; wherein, the trusted credential data corresponding to the encrypted data is stored in the blockchain, and the transaction value in the trusted credential data is calculated based on the security index and the encrypted data.

[0006] As an improvement to the above scheme, storing the dense data according to a hierarchical index structure includes: The dense state data is stored; The security index in the encrypted data is parsed to obtain the timestamp of the data to be stored; Based on the timestamp and the storage location of the encrypted data, the hash index of the encrypted data at each index level and the pointer corresponding to the hash index are determined; wherein, the hash index of the upper level and its corresponding pointer are used to locate the object of the lower level, the object including the hash index of the lower level and its corresponding pointer, or the storage location of the encrypted data.

[0007] As an improvement to the above solution, the method further includes: Real-time monitoring of the hierarchical adjustment indicators of the dense state data; Calculate the priority of the dense state data based on the hierarchical adjustment index; Based on the priority, the index level of the encrypted data in the cloud server is dynamically adjusted.

[0008] As an improvement to the above scheme, the hierarchical adjustment indicators include: the number of times the dense data is accessed and updated within a preset time window, the last access time of the dense data, and the importance index. The step of calculating the priority of the dense data based on the hierarchical adjustment index includes: Calculate the access time index of the encrypted data based on the time interval between the last access time and the current time; Calculate the data update index of the dense state data based on the number of updates and the time window; Calculate the data access index of the dense data based on the number of accesses and the time window; The priority of the dense data is obtained by weighted summation of the access time indicator, the data update indicator, the data access indicator, and the importance indicator.

[0009] As an improvement to the above scheme, the step of dynamically adjusting the index level of the encrypted data in the cloud server according to the priority includes: The priority is compared with the preset upper priority value and lower priority value; When the priority is less than or equal to the upper priority value and greater than or equal to the lower priority value, the index level of the dense data is maintained; When the priority is greater than the upper limit of the priority, the index level of the dense data is adjusted to the top level; When the priority is less than the lower priority limit, the index level of the dense data is adjusted to the bottom level.

[0010] As an improvement to the above scheme, the encrypted data is obtained by the data upload node encrypting the data to be stored using a pre-distributed public key; the secure index is obtained by the data upload node encrypting the timestamp of the data to be stored using the public key.

[0011] As an improvement to the above scheme, the trusted credential data includes a key value and a transaction value; wherein, the transaction value is obtained by the data uploading node performing attribute-based encryption on the hash value of the security index and the encrypted data; the key value is generated based on the timestamp and random number of the data to be stored.

[0012] As an improvement to the above scheme, the encrypted data is packaged by the data upload node according to a preset data format; the encrypted data carries a first preprocessing field and a second preprocessing field; wherein, the first preprocessing field is used to store the encrypted unique identifier of the data upload node; the second preprocessing field is used to store the node information of all nodes that the encrypted data has passed through before the data upload node.

[0013] Secondly, embodiments of the present invention provide a data storage processing apparatus applied to a cloud server, comprising: The data receiving module is used to receive encrypted data sent by the data uploading node; wherein, the encrypted data includes: encrypted data of the data to be stored and a security index; The data storage module is used to store the encrypted data according to a hierarchical index structure; wherein, the trusted credential data corresponding to the encrypted data is stored in the blockchain, and the transaction value in the trusted credential data is calculated based on the security index and the encrypted data.

[0014] Thirdly, embodiments of the present invention provide a data storage processing apparatus, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the data storage processing method as described in any one of the first aspects.

[0015] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to perform the data storage processing method as described in any one of the first aspects.

[0016] Fifthly, embodiments of the present invention provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the data storage processing method as described in any one of the first aspects.

[0017] Compared to existing technologies, the present invention provides a data storage processing method, apparatus, device, storage medium, and program product. This involves storing the encrypted data to be stored in a cloud server according to a hierarchical index structure. The encrypted data includes encrypted data and a security index. The trusted credential data corresponding to the encrypted data is stored in a blockchain, where the transaction value in the trusted credential data is calculated based on the security index and the encrypted data. Through the hierarchical index structure and blockchain storage, the immutability of the data is ensured, preventing malicious alteration or destruction of the data, thereby improving the authenticity and security of data in distributed storage supported by blockchain technology. Attached Figure Description

[0018] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart of a data storage processing method provided in an embodiment of the present invention; Figure 2 This is a structural block diagram of a data storage processing device provided in an embodiment of the present invention; Figure 3 This is a structural block diagram of a data storage and processing device provided in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.

[0021] It is understood that the various numerical designations used in the embodiments of this invention are merely for descriptive convenience and are not intended to limit the scope of this application. The order of the process numbers does not imply the order of execution; the execution order of each process should be determined by its function and internal logic.

[0022] In embodiments of the invention, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, without necessarily requiring or implying any such actual relationship or order between these entities or operations. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0023] Please see Figure 1 , Figure 1 This is a flowchart illustrating a data storage processing method provided in an embodiment of the present invention. The data storage processing method, applied to a cloud server, includes: S11: Receive encrypted data sent by the data upload node; wherein, the encrypted data includes: encrypted data of the data to be stored and a security index; S12: Store the encrypted data according to a hierarchical index structure; wherein, the trusted credential data corresponding to the encrypted data is stored in the blockchain, and the transaction value in the trusted credential data is calculated based on the security index and the encrypted data.

[0024] This invention, through a hierarchical index structure and blockchain storage, ensures the immutability of data. Encrypted data is stored on a cloud server, while trusted credential data is stored on the blockchain. By leveraging the inherent characteristics of blockchain, data can be prevented from being maliciously tampered with or destroyed, thereby improving the integrity, authenticity, and security of data in distributed storage supported by blockchain technology.

[0025] Furthermore, before data storage, system initialization is required. This initialization phase is performed by a Trusted Third Party (TTP) and is a necessary step before the system starts running. It is understood that cloud servers, blockchain, and data uplink nodes can form a hybrid storage system with on-chain evidence storage and off-chain storage, enabling distributed data storage and indexing. This system supports searchable encryption algorithms and attribute-based encryption algorithms, such as Attribute-Based Encryption (ABE). Specific encryption algorithms can be selected based on the storage scenario and security level, and are not specifically limited in this embodiment of the invention.

[0026] TTP initializes the data traceability system by calling different encryption methods. The specific process is as follows: TTP calls the Initialize() function to initialize the smart contract. This step only needs to be executed once to complete the system initialization, which includes: Run Docker containers to provide an isolated and standardized runtime environment for blockchain; Launch the blockchain system network to activate each node in the blockchain and establish basic communication connections between the nodes in the blockchain; Initialize the Fabric software development kit to provide applications (such as TTP) with a programming interface and security context for interacting with the Fabric network, such as credentials and methods for network interaction.

[0027] Create a Channel to establish data isolation channels within the Fabric network; Deploy corresponding nodes to join a specified channel; used to include nodes in the blockchain into a specified channel, and authorized nodes that join the specified channel can participate in transaction consensus, data storage and contract execution within that channel; Complete the installation, initialization, and instantiation of the contract to deploy the smart contract (chaincode) to the peer node (a peer node, which is the core business node of the Fabric network, such as the node that deploys the specified channel mentioned above), complete the contract initialization configuration, and enable it to execute.

[0028] After completing the above system initialization, TTP performs dynamic key management, specifically including: TTP selects security parameters and generates security keys for access nodes, including a public key (PK) and a master key (MK), enabling the system to have dynamic authentication capabilities. Furthermore, TTP is responsible for key lifecycle management, including revocation, periodic updates, destruction, and secure storage.

[0029] The master key MK is used for attribute-based access control and generates a private key for each participant (e.g., a data upload node). The public key PK is used to encrypt data. The key generation method is as follows: {PK,MK}=Setup(lambda,U); K cpabe =aesKeyGen(MK, S); Here, lambda represents a security parameter (such as key length); U represents a set of attributes (such as node roles, permission registration, etc.), defining all possible attribute types in the system; Setup represents the initialization function of the cryptographic system (such as attribute-based encryption, public-key encryption), used to generate the system's public key PK and master key MK based on the security parameter lambda and the attribute set U. The specific generation process is existing technology and will not be detailed here. S represents the attribute set of a given node, K cpabe This represents the private key of the node, and aesKey represents the AES (Advanced Encryption Standard) encryption algorithm.

[0030] Specifically, the encrypted data is obtained by the data uploading node encrypting the data to be stored using a pre-distributed public key; the secure index is obtained by the data uploading node encrypting the timestamp of the data to be stored using the public key.

[0031] In other embodiments, the data upload node may also extract key feature words from the data to be stored, and then encrypt the timestamp and key feature words of the data to be stored according to the public key to obtain a secure index.

[0032] In this embodiment of the invention, TTP securely distributes the generated public key PK to each data upload node, enabling these data upload nodes to encrypt the user-uploaded data to be stored based on the distributed public key, thereby obtaining the corresponding encrypted data.

[0033] The timestamp can be the current time, such as the time when the data upload node first submits the data to the blockchain.

[0034] Before the data upload node uploads the encrypted data to the cloud server, a secure index needs to be established to guide the encrypted data to be stored. Then, an upload request is sent to the cloud server to send the secure index and its corresponding encrypted data. By establishing a secure index for the data to be stored, efficient and accurate data retrieval can still be achieved while ensuring that the data is completely encrypted and no information is leaked, thus achieving a balance between security and availability.

[0035] Furthermore, the encrypted data is packaged by the data upload node according to a preset data format; the encrypted data carries a first preprocessing field and a second preprocessing field; wherein, the first preprocessing field is used to store the encrypted unique identifier of the data upload node; the second preprocessing field is used to store the node information of all nodes that the encrypted data has passed through before the data upload node.

[0036] For example, before outsourcing data to the cloud server, the data upload node needs to perform data structure preprocessing, that is, preprocessing using a defined data format, such as JSON storage type. This lightweight data format facilitates verification and encoding. The specific process is as follows: Define the data structure: Each piece of encrypted data is regarded as a data item, and each data item consists of multiple fields. The encrypted data and the security index in the encrypted data are stored through a field respectively.

[0037] Add preprocessed fields to the data items, including: The first preprocessing field: such as the Node_ID field. The value of the Node_ID field is the encrypted unique identifier of the data upload node.

[0038] The first preprocessing field, such as the Previous field, contains node information about all nodes the data has passed through before the current data upload node. This includes encrypted unique identifiers of the nodes from data generation to the current data upload node, as well as information about operations performed on the data. If the Previous field is NULL, it indicates that the current data upload node is the starting point.

[0039] By adding preprocessing fields, this invention can construct a reliable data flow trajectory, clarify the data starting point and flow path, and provide structured support for data security management and traceability.

[0040] Specifically, the trusted credential data includes a key value and a transaction value; wherein, the transaction value is obtained by the data uploading node performing attribute-based encryption on the hash value of the security index and the encrypted data; the key value is generated based on the timestamp and random number of the data to be stored.

[0041] For example, before uploading the trusted credential data of the encrypted data to the blockchain, the data uploading node needs to perform data structure preprocessing.

[0042] First, each trusted credential data stored in the blockchain is defined, specifically the data structure of trusted credential data is defined as a transaction tuple Zi.

[0043] Where Zi = keyi, valuei Each transaction tuple Zi consists of a set of key-value pairs bound by a relation (i.e., key value keyi and transaction value valuei).

[0044] The key value keyi and its constituent elements are defined as follows: keyi = (time_stamp | randnum); Where: keyi represents the unique identifier of the transaction value valuei in the blockchain, which is composed of the timestamp (time_stamp) of the corresponding data to be stored and a random number randnum, with || representing the concatenation operation. The timestamp (time_stamp) can be obtained through the system_time.Now.Unix() function and can be the time when the corresponding data was first submitted to the blockchain, provided by the system. The random number randnum can be generated through the rand.Seed(nodeid) seed function to ensure the uniqueness of the transaction.

[0045] Understandably, when a piece of data is successfully submitted to the system, the system will obtain the timestamp of the data transaction submission as part of the key value keyi of this transaction item.

[0046] The transaction value `valuei` and its constituent elements are defined as follows: valuei=attr_enc(Li∣∣hashi(Mi)); Where: Li = sym_enc(Ei) represents the security index; hashi(Mi) represents the hash value of the encrypted data Mi; sym_enc() represents the symmetric searchable encryption algorithm; hashi() represents the hash function; Ei represents the key index information for locating and retrieving the encrypted data Mi, such as a timestamp. attr_enc() represents the attribute-based encryption algorithm, indicating that Li and hashi(Mi) are encrypted using the attribute-based encryption algorithm to obtain the transaction value valuei. It can be understood that the attribute-based encryption algorithm, symmetric searchable encryption algorithm, and hash function involved in the calculation of the transaction value valuei can be encapsulated according to the actual needs of the system.

[0047] Based on the above data structure, the data upload node generates a corresponding transaction item for the encrypted data, which serves as trusted credential data, and sets the transaction item Zi= keyi, valuei The key value keyi and its corresponding transaction value valuei are transmitted to the blockchain for storage.

[0048] The embodiments of the present invention construct trusted credential data in the form of transaction tuples, which can better adapt to the underlying architecture of blockchain, and form synergistic advantages in standardization, security, operability and traceability, providing an efficient and reliable foundation for the full life cycle management of trusted credentials.

[0049] In one optional embodiment, storing the dense data according to a hierarchical index structure includes: The dense state data is stored; The security index in the encrypted data is parsed to obtain the timestamp of the data to be stored; Based on the timestamp and the storage location of the encrypted data, the hash index of the encrypted data at each index level and the pointer corresponding to the hash index are determined; wherein, the hash index of the upper level and its corresponding pointer are used to locate the object of the lower level, the object including the hash index of the lower level and its corresponding pointer, or the storage location of the encrypted data.

[0050] Specifically, the cloud server parses the received encrypted data, extracting a secure index and encrypted data. The encrypted data is then stored, and a hierarchical structure is created within the cloud server. This hierarchical index structure includes top-level, intermediate-level, and bottom-level indexes. Compressed storage technology and a consistent hashing algorithm improve search efficiency. The top-level index contains a few key nodes, each pointing to the starting position of the next level index, quickly narrowing the search scope. The intermediate-level index is configured with multiple levels as needed, each containing more key nodes, pointing to lower-level indexes or directly to the data, further narrowing the search scope and gradually approaching the data. The bottom-level index directly points to the specific data, enabling precise data retrieval. This embodiment of the invention, through its hierarchical design, can quickly narrow the search scope at the top-level index and then perform precise searches at lower levels.

[0051] The hierarchical index structure of this invention employs compression storage technology to reduce storage space. The hierarchical index compresses the timestamp and pointer structures. Specifically, timestamp compression stores only the incremental portion of the timestamp; the difference between adjacent timestamps is typically small, allowing for storage with fewer bits. Pointer compression stores pointer addresses relatively, storing only the offset relative to the previous pointer. Furthermore, a hash index is introduced in each level of the index to quickly locate the data's storage position. A consistent hashing algorithm is used to ensure uniform data distribution, reduce hash collisions, and improve search efficiency.

[0052] Here is an example of a hierarchical structure for specific encrypted data storage: The underlying index divides the cloud server's storage space into multiple blocks, such as block 1, block 2, etc. Each block can store 1000 data entries, and each block can maintain a timestamp list to record the timestamps of that block. The storage location of each block is pointed to by a hash index and its corresponding pointer. The specific representation is as follows: Block 1: [timestamp_1, pointer_1], [timestamp_2, pointer_2], ..., [timestamp_1000, pointer_1000]; Block 2: [timestamp_1001, pointer_1001], ..., [timestamp_2000, pointer_2000]; Each pointer in the pointer structure points to the specific encrypted data within a Merkle leaf node. Example: pointer_1 points to the specific encrypted data.

[0053] Intermediate-level indexes are pointers to underlying indexes and include multiple intermediate nodes, such as Mid1, Mid2, etc. Specifically, they are represented as follows: Mid1: [timestamp_1, pointer_1_to_block1], [timestamp_1001, pointer_2_to_block2], ..., [timestamp_9001, pointer_10_to_block10]; Mid2: [timestamp_10001, pointer_11_to_block11], [timestamp_1002, pointer_12_to_block12], ..., [timestamp_90001, pointer_20_to_block20]; Each intermediate layer node can index 10 blocks. Example: pointer_1_to_block1 points to the starting position of block 1.

[0054] The top-level index design uses pointers to point to intermediate-level indexes, and includes multiple top-level nodes, such as top-level node 1, top-level node 2, etc. Specifically, it is represented as follows: Top-level node 1: [timestamp_1, pointer_1_to_mid1], [timestamp_10001, pointer_2_to_mid2], ..., [timestamp_50001, pointer_5_to_mid5]; Top-level node 2: [timestamp_1, pointer_1_to_mid1], [timestamp_10001, pointer_2_to_mid2], ..., [timestamp_50001, pointer_5_to_mid5]; Each top-level node can index 5 intermediate-level nodes. Example: pointer_1_to_mid1 points to the starting position of intermediate-level node 1.

[0055] Understandably, encrypted data initially stored on a cloud server is typically indexed in an intermediate layer.

[0056] For encrypted data with a hierarchical structure, the specific query process is as follows: (1) Top-level index query: Based on the timestamp being queried, the corresponding intermediate node is first found in the top-level index. For example, to query timestamp_15000, the pointer pointer_2_to_mid2 corresponding to timestamp_1500 is found in the top-level node 1.

[0057] (2) Intermediate layer index query: Find the corresponding underlying block in the intermediate layer node. For example, find the pointer pointer_6_to_block6 corresponding to timestamp_15000 in the intermediate layer node mid2.

[0058] (3) Underlying index query: Find the specific transaction data pointer in the underlying block.

[0059] Example: Find the pointer pointer_15000 corresponding to timestamp_15000 in block 6.

[0060] (4) Data access: Access the specific encrypted data in the Merkle tree leaf node according to the pointer. For example, the specific encrypted data content pointed to by pointer_1500.

[0061] The embodiments of the present invention employ a hierarchical index structure, which can quickly locate the storage location of data and improve search efficiency.

[0062] Furthermore, the method also includes: Real-time monitoring of the hierarchical adjustment indicators of the dense data; wherein, the hierarchical adjustment indicators include: the number of times the dense data is accessed and updated within a preset time window, the last access time of the dense data, and the importance index; Calculate the priority of the dense state data based on the hierarchical adjustment index; Specifically, calculating the priority of the dense-state data based on the hierarchical adjustment index includes: Calculate the access time index of the encrypted data based on the time interval between the last access time and the current time; Calculate the data update index of the dense state data based on the number of updates and the time window; Calculate the data access index of the dense data based on the number of accesses and the time window; The priority of the dense data is obtained by weighted summation of the access time indicator, the data update indicator, the data access indicator, and the importance indicator.

[0063] Based on the priority, the index level of the encrypted data in the cloud server is dynamically adjusted.

[0064] Specifically, dynamically adjusting the index level of the encrypted data in the cloud server according to the priority includes: The priority is compared with the preset upper priority value and lower priority value; When the priority is less than or equal to the upper priority value and greater than or equal to the lower priority value, the index level of the dense data is maintained; When the priority is greater than the upper limit of the priority, the index level of the dense data is adjusted to the top level; When the priority is less than the lower priority limit, the index level of the dense data is adjusted to the bottom level.

[0065] For example, this embodiment of the invention performs real-time monitoring of encrypted data (hereinafter referred to as data items) stored in a cloud server, specifically monitoring the following indicators of the data: Number of visits f i : The number of times a data item is accessed within a set time window T (such as a week or a month).

[0066] Last access time (age) i : Indicates the age of the data item, that is, the time interval (e.g., days) since the last access.

[0067] Importance of data items i : A predefined constant.

[0068] Number of times data items are updated u i : The number of times the data item is updated within the time window T.

[0069] Based on the monitored indicators, the priority of data items can be calculated, and then the data items can be dynamically adjusted according to their priority, as shown below: (1); Among them, P i f represents the priority of the i-th data item. i Age represents the number of times the i-th data item is accessed within the time window T. i Indicates the time interval (in days) between the last visit and the current visit; importance i Indicates the importance of a data item; u i This represents the number of times the i-th data item is updated within the time window T. w1, w2, w3, and w4 represent weight coefficients, i.e., the weight of each indicator in the priority calculation, which can be adjusted according to the actual situation.

[0070] Set priority upper limit and priority lower limit value According to priority P i The identifier for dynamically adjusting the index level of data items is as follows: (2); For example, assuming a time window T of 30 days, weighting coefficients w1=0.4, w2=0.3, w3=0.2, w4=0.1, and a priority upper limit value... =1.0 and priority lower limit =0.5, the number of times a certain data item was accessed within 30 days, f. i =25f, Last access time: 5 days ago, Importance i =0.8, Update count u i If the value is 3, then calculate the priority of this data item. .

[0071] Priority is determined according to the above formula (2): Since 0.5533 < 1.0 and 0.5533 ≥ 0.5, the data item is kept in the middle layer index.

[0072] The embodiments of the present invention employ a dynamic hierarchical adjustment mechanism to monitor data access frequency, update time and other indicators in real time, calculate priorities, and dynamically adjust the hierarchical position of data in the index according to the priorities, which can optimize query performance.

[0073] Furthermore, based on dynamic hierarchical adjustments, seamless application-layer switching is achieved through Java database connectors (such as SK-JDBC (SK-Java Database Connector)) and Oracle APIs (such as SK-OCI (SK-Oracle API)). This shortens business recovery time during the switching process and ensures dynamic switching between primary and standby databases based on the unified access platform service in the event of database failures or performance differences, guaranteeing business continuity and high availability. In the event of database failures or performance differences, the index hierarchy is dynamically adjusted based on the unified access platform service to achieve seamless application-layer switching and dynamic switching between primary and standby databases. The connection pooling technology of the unified access platform reduces the number of database connections and improves connection efficiency. Based on business execution and SQL (Structured Query Language) execution, caching strategies are flexibly specified, employing a shared two-level caching mechanism to shorten query paths and improve overall performance.

[0074] Compared with the prior art, the beneficial effects of the embodiments of the present invention are as follows: The data upload phase employs a dual storage mechanism of blockchain and cloud servers (i.e., a shared two-level caching mechanism) to ensure data immutability while shortening query paths and improving overall query performance and system response speed. For example, the `Putstate(key, value)` method in the blockchain stores the encrypted data `valuei` and its corresponding key `keyi`, leveraging the inherent characteristics of blockchain to prevent malicious data tampering or destruction, thus ensuring data immutability and public verifiability. In the cloud server, the `CloudFunc.Insert(Ii, Ci)` method stores the secure index `li` and its corresponding encrypted data `Ci`, utilizing the high efficiency and large capacity of cloud storage.

[0075] A hierarchical index structure is employed, with top, middle, and bottom layers to achieve fast and accurate data retrieval. The top-level index quickly narrows the search scope, the middle-level indexes further narrow it, and the bottom-level index directly points to the specific data content. This hierarchical structure allows the query process to rapidly narrow the search scope, progressively retrieving data from the top to the middle and then to the bottom layers. Simultaneously, timestamp and pointer compression storage techniques are used. Timestamps store only the incremental portion, and pointers, through relative storage, store only the offset, reducing storage space usage, improving storage efficiency, enhancing data location efficiency, and reducing hash collisions. Through the hierarchical index structure and blockchain storage, data immutability is ensured, enhancing data security and integrity.

[0076] Real-time monitoring of metrics such as data access frequency, access time, data importance, and update frequency; dynamic adjustment of data hierarchy position in the index based on a dynamic hierarchy adjustment mechanism; ensuring that frequently accessed data can be quickly found; improving query performance and system response time; and enhancing system protection for frequently accessed data.

[0077] In this embodiment of the invention, the data does not rely on a third-party storage system, eliminating the risk of data tampering or destruction caused by attacks on third-party storage systems and solving the security problem of third-party storage systems; at the same time, data queries are directly provided by the blockchain, ensuring the authenticity and reliability of the data.

[0078] See Figure 3 , Figure 3 This is a structural block diagram of a data storage processing device provided in an embodiment of the present invention. The data storage processing device is applied to a cloud server and includes: The data receiving module 11 is used to receive encrypted data sent by the data uploading node; wherein, the encrypted data includes: encrypted data of the data to be stored and a security index; The data storage module 12 is used to store the encrypted data according to a hierarchical index structure; wherein, the trusted credential data corresponding to the encrypted data is stored in the blockchain, and the transaction value in the trusted credential data is calculated based on the security index and the encrypted data.

[0079] In one optional embodiment, the data storage module 12 includes: A storage unit is used to store the encrypted data; The parsing unit is used to parse the security index in the encrypted data to obtain the timestamp of the data to be stored. An index hierarchy construction unit is used to determine the hash index of the encrypted data at each index hierarchy and the pointer corresponding to the hash index based on the timestamp and the storage location of the encrypted data; wherein, the hash index of the upper level and its corresponding pointer are used to locate the object of the lower level, and the object includes the hash index of the lower level and its corresponding pointer, or the storage location of the encrypted data.

[0080] In an optional embodiment, the device further includes: The monitoring module is used to monitor the hierarchical adjustment indicators of the dense data in real time. The priority calculation module is used to calculate the priority of the dense data based on the hierarchical adjustment index. The index level adjustment module is used to dynamically adjust the index level of the encrypted data in the cloud server according to the priority.

[0081] In one optional embodiment, the hierarchical adjustment indicators include: the number of times the dense data is accessed and updated within a preset time window, the last access time of the dense data, and an importance indicator; The priority calculation module includes: The first calculation unit is used to calculate the access time index of the dense data based on the time interval between the last access time and the current time. The second calculation unit is used to calculate the data update index of the dense data based on the number of updates and the time window; The third calculation unit is used to calculate the data access index of the dense data based on the number of accesses and the time window; The fourth calculation unit is used to perform a weighted summation of the access time index, the data update index, the data access index, and the importance index to obtain the priority of the dense data.

[0082] In one optional embodiment, the index hierarchy adjustment module includes: The comparison unit is used to compare the priority with a preset upper priority value and a lower priority value; A hierarchy maintenance unit is used to maintain the index hierarchy of the dense data when the priority is less than or equal to the upper priority value and greater than or equal to the lower priority value. The hierarchy adjustment unit is used to adjust the index level of the dense data to the top level when the priority is greater than the upper limit of the priority; The hierarchy downgrade unit is used to adjust the index level of the dense data to the bottom layer when the priority is less than the priority lower limit value.

[0083] In one optional embodiment, the encrypted data is obtained by the data uploading node encrypting the data to be stored using a pre-distributed public key; the secure index is obtained by the data uploading node encrypting the timestamp of the data to be stored using the public key.

[0084] In one optional embodiment, the trusted credential data includes a key value and a transaction value; wherein the transaction value is obtained by the data uploading node performing attribute-based encryption on the hash values ​​of the security index and the encrypted data; and the key value is generated based on the timestamp and random number of the data to be stored.

[0085] In one optional embodiment, the encrypted data is packaged by the data upload node according to a preset data format; the encrypted data carries a first preprocessing field and a second preprocessing field; wherein, the first preprocessing field is used to store the encrypted unique identifier of the data upload node; the second preprocessing field is used to store the node information of all nodes that the encrypted data has passed through before the data upload node.

[0086] It should be noted that the working process of each module in the data storage processing device described in the embodiments of the present invention can refer to the working process of the data storage processing method described in the above embodiments, and the technical effect achieved is the same as that of the data storage processing method described in the above embodiments, so it will not be repeated here.

[0087] See Figure 3 , Figure 3 This is a structural block diagram of a data storage processing device provided in an embodiment of the present invention. The data storage processing device includes a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the above-described embodiments of the various data storage processing methods, such as steps S11 to S12.

[0088] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the data storage and processing device.

[0089] The data storage processing device may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of a data storage processing device and does not constitute a limitation on the device. It may include more or fewer components than illustrated, or combine certain components, or use different components. For example, the data storage processing device may also include input / output devices, network access devices, buses, etc.

[0090] The processor 21 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 21 is the control center of the data storage processing device, connecting various parts of the entire data storage processing device through various interfaces and lines.

[0091] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the data storage and processing device by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0092] If the modules / units integrated into the data storage and processing device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0093] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0094] The above description represents the preferred embodiments of the present invention. It should be noted that, for those skilled in the art, various improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A data storage processing method characterized by, The application is applied to a cloud server, and comprises: receiving ciphertext data sent by a data uploading node; wherein the ciphertext data comprises encrypted data of to-be-stored data and a security index; storing the ciphertext data according to a hierarchical index structure; wherein trusted credential data corresponding to the ciphertext data is stored in a block chain, and a transaction value in the trusted credential data is calculated based on the security index and the encrypted data.

2. The data storage processing method of claim 1, wherein, The method further comprises: monitoring a hierarchical adjustment index of the ciphertext data in real time; calculating a priority of the ciphertext data according to the hierarchical adjustment index; dynamically adjusting an index level of the ciphertext data in the cloud server according to the priority.

3. The data storage processing method of claim 2, wherein, The hierarchical adjustment index comprises a number of access times and a number of update times of the ciphertext data within a preset time window, a last access time of the ciphertext data, and an importance index; The method further comprises: calculating an access time index of the ciphertext data according to a time interval between the last access time and a current time; calculating a data update index of the ciphertext data according to the number of update times and the time window; 4. The data storage processing method of claim 3, wherein, calculating a data access index of the ciphertext data according to the number of access times and the time window; performing weighted summation on the access time index, the data update index, the data access index, and the importance index to obtain the priority of the ciphertext data. The method further comprises: comparing the priority with a preset upper limit value and a lower limit value of the priority; maintaining the index level of the ciphertext data when the priority is less than or equal to the upper limit value and greater than or equal to the lower limit value; adjusting the index level of the ciphertext data to a top layer when the priority is greater than the upper limit value; 5. The data storage processing method of claim 3, wherein, adjusting the index level of the ciphertext data to a bottom layer when the priority is less than the lower limit value. The encrypted data is obtained by encrypting the to-be-stored data by the data uploading node according to a pre-distributed public key; and the security index is obtained by encrypting a timestamp of the to-be-stored data by the data uploading node according to the public key. ​ ​ ​ 6. The data storage processing method of claim 1, wherein, ​ 7. The data storage processing method of claim 6, wherein, The trusted credential data includes a key value and a transaction value; wherein the transaction value is obtained by attribute-based encryption of the data uploading node on the hash value of the security index and the encrypted data; the key value is generated according to the timestamp and the random number of the to-be-stored data.

8. The data storage processing method of claim 1, wherein, The ciphertext data is obtained by the data uploading node according to a preset data format; the ciphertext data carries a first preprocessing field and a second preprocessing field; wherein the first preprocessing field is used to store the encrypted unique identifier of the data uploading node; the second preprocessing field is used to store the node information of all nodes through which the ciphertext data is transmitted before the data uploading node.

9. A data storage processing device, characterized by Applied to a cloud server, comprising: A data receiving module is configured to receive ciphertext data sent by a data uploading node; wherein the ciphertext data includes encrypted data of to-be-stored data and a security index; A data storage module is configured to store the ciphertext data according to a hierarchical index structure; wherein the trusted credential data corresponding to the ciphertext data is stored in a blockchain, and a transaction value in the trusted credential data is calculated based on the security index and the encrypted data.

10. A data storage processing device, characterized by Comprising: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, when the processor executes the computer program, the data storage processing method of any one of claims 1-8 is realized.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein when the computer program runs, the device where the computer readable storage medium is located executes the data storage processing method of any one of claims 1-8.

12. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to realize the data storage processing method of any one of claims 1-8.