Data storage and reading method, device, equipment and storage medium
By segmenting and encrypting the data, generating fragment groups and calculating location information, the problem of low privacy data protection security in the existing technology is solved, and the secure storage and reading of data is achieved.
Patent Information
- Application Number
- CN202210372187.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-04-11
AI Technical Summary
The existing methods for protecting private data have low security and are prone to problems such as theft.
The data to be stored is divided into fragment groups, and the location information is calculated using a dynamic hash algorithm. The user ID is used for encryption to generate a storage code value combination and identification, which is randomly stored in the database and decrypted and deserialized when read.
It realizes hidden storage and secure reading of data, improves the security of user data and prevents illegal acquisition.
Smart Images

Figure CN114707166B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a data storage and reading method, device, equipment and storage medium. Background Art
[0002] In the era of big data and cloud computing, people possess ever-increasing amounts of data. With the increasing demand for large-capacity storage and the rapid development of storage technology, data is often stored on cloud storage servers for easier access, storage, and mobile work. However, when storing private data on third-party cloud storage servers, if the data is not effectively encrypted and monitored during storage, it is likely to lead to the leakage of users' stored private data, making it difficult to ensure the security of users' private data.
[0003] Currently, the main technology used for secure data storage is to trade space for time. This means that before storing massive amounts of user data in a specific database, a specific data encryption method is used to perform complex encryption on the user data. The encrypted data is then stored and a corresponding data monitoring mechanism is established. This ensures that if illegal data access occurs, there is sufficient time to detect the cracking and massive data acquisition required by illegal personnel, thereby protecting the data security. However, this method is also prone to problems such as theft by insiders, which is difficult to supervise. In other words, the current method of protecting private data is not very secure. Summary of the Invention
[0004] The main purpose of the present invention is to solve the problem of low security of current privacy data protection methods.
[0005] A first aspect of the present invention provides a data storage method, which includes: obtaining data to be stored and a corresponding user identifier, and dividing the data to be stored to obtain a group of fragments corresponding to the data to be stored; randomly storing the group of fragments in a preset database, and using a preset dynamic hash algorithm to calculate the position information of each data in the group of fragments in the database; using the user identifier to encrypt the position information, generate a corresponding storage code value combination and storage identifier, and push them.
[0006] Optionally, in a first implementation method of the first aspect of the present invention, the data to be stored is segmented to obtain a group of fragments corresponding to the data to be stored, including: extracting a file format identifier from the data to be stored, and determining a plurality of file formats contained in the data to be stored based on the file format identifier; classifying the data to be stored according to the file format, and using a preset segmentation algorithm to segment the classified data to be stored into multiple data fragments; and generating a group of fragments corresponding to the data to be stored based on each of the data fragments.
[0007] Optionally, in a second implementation of the first aspect of the present invention, the randomly storing the fragment groups in a preset database includes: determining the security level of the fragment groups, and selecting a fragment group combination corresponding to the security level and stored historically from the preset database; storing each of the fragment groups with a storage mark, and randomly splicing the marked fragment groups into the fragment group combination; and storing the fragment group combination after splicing the fragment groups into the database.
[0008] Optionally, in a third implementation of the first aspect of the present invention, the position information of each piece of data in the fragment group in the database is calculated using a preset dynamic hash algorithm, including: using a preset dynamic hash algorithm to perform hash transformation on each piece of data in the fragment group to obtain a corresponding hash hash fragment group; identifying the initial position information of each piece of data in the hash hash fragment group in the fragment group combination; serializing the initial position information to obtain the position information of each piece of data in the fragment group in the database.
[0009] Optionally, in a fourth implementation manner of the first aspect of the present invention, the user identifier includes a sending user identifier and a receiving user identifier, and the user identifier is used to encrypt the location information, generate a corresponding storage code value combination and storage identifier, and push them, including: connecting the sending user identifier and the receiving user identifier to obtain a connection identifier; using the connection identifier to encrypt the location information to generate corresponding multiple storage code values and storage identifiers; selecting one of the multiple storage code values as a selected code value, and selecting other storage code values from the multiple storage code values except the selected code value as defense code values; generating a storage code value combination based on the selected code value and the defense code value, and pushing the storage code value combination and the storage identifier.
[0010] The second aspect of the present invention provides a data reading method, which includes: obtaining a data reading request, and extracting the storage identifier and the storage code value input in the data reading request; querying the target block group associated with the input storage identifier in a preset database, and judging whether the input storage code value is the selected code value corresponding to the target block group; if so, decrypting and deserializing the input storage code value to obtain the position information corresponding to the target block group; according to the position information corresponding to the target block group, reading each piece of data in the target block group and combining them to obtain the response data corresponding to the data reading request.
[0011] The third aspect of the present invention provides a data storage device, comprising: the data storage device, comprising: a data segmentation module, used to obtain the data to be stored and the corresponding user identification, and segment the data to be stored to obtain a group of fragments corresponding to the data to be stored; a position calculation module, used to randomly store the group of fragments in a preset database, and use a preset dynamic hash algorithm to calculate the position information of each data in the group of fragments in the database; a data push module, used to use the user identification to encrypt the position information, generate a corresponding storage code value combination and storage identification, and push it.
[0012] Optionally, in a first implementation of the third aspect of the present invention, the data segmentation module includes: an identifier extraction unit, used to extract the file format identifier from the data to be stored, and determine the multiple file formats contained in the data to be stored based on the file format identifier; a data segmentation unit, used to classify the data to be stored according to the file format, and use a preset segmentation algorithm to segment the classified data to be stored into multiple data segments; and generate a fragment group corresponding to the data to be stored based on each of the data segments.
[0013] Optionally, in a second implementation of the third aspect of the present invention, the position calculation module includes: a level selection unit, used to determine the security level of the fragment group, and select the fragment group combination corresponding to the security level and stored historically from a preset database; a fragment combination unit, used to store and identify each of the fragment groups, and randomly splice the identified fragment groups into the fragment group combination; a fragment storage unit, used to store the fragment group combination after splicing the fragment groups into the database.
[0014] Optionally, in a third implementation of the third aspect of the present invention, the position calculation module further includes: a hash transformation unit, used to use a preset dynamic hash algorithm to perform hash transformation on each piece of data in the fragment group to obtain a corresponding hash fragment group; a position identification unit, used to identify the initial position information of each piece of data in the hash fragment group in the fragment group combination; a serialization processing unit, used to serialize the initial position information to obtain the position information of each piece of data in the fragment group in the database.
[0015] Optionally, in a fourth implementation of the third aspect of the present invention, the data push module includes: an identification connection unit, used to connect the sending user identification and the receiving user identification to obtain a connection identifier; an information encryption unit, used to use the connection identifier to encrypt the location information, and generate corresponding multiple storage code values and storage identifiers; a code value selection unit, used to select one of the multiple storage code values as a selected code value, and select other storage code values of the multiple storage code values except the selected code value as defense code values; an information push unit, used to generate a storage code value combination based on the selected code value and the defense code value, and push the storage code value combination and the storage identifier.
[0016] The fourth aspect of the present invention provides a data reading device, comprising: an identifier extraction module, used to obtain a data reading request, and extract the storage identifier and the input storage code value input in the data reading request; a fragment query module, used to query the target fragment group associated with the input storage identifier in a preset database, and determine whether the input storage code value is the selected code value corresponding to the target fragment group; a code value calculation module, used to decrypt and deserialize the input storage code value if so, to obtain the position information corresponding to the target fragment group; a data reading module, used to read and combine each data in the target fragment group according to the position information corresponding to the target fragment group, to obtain the response data corresponding to the data reading request.
[0017] The fifth aspect of the present invention provides a computer device comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the data storage device executes each step of the above-mentioned data storage method.
[0018] A sixth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, enable the computer to execute the various steps of the above-mentioned data storage method.
[0019] The technical solution provided by the present invention obtains the data to be stored and the corresponding user identifier, and then divides the data to be stored to obtain the corresponding chunk groups of the data to be stored; randomly stores the chunk groups in a preset database, and uses a preset dynamic hash algorithm to calculate the location information of each piece of data in the chunk group in the database; encrypts the location information using the user identifier, generates a corresponding storage code value combination and storage identifier, and pushes them. Furthermore, a data read request is obtained, and the storage identifier and storage code value entered in the data read request are extracted; the target chunk group associated with the entered storage identifier is queried in the preset database, and it is determined whether the entered storage code value is the selected code value corresponding to the target chunk group; if so, the entered storage code value is decrypted and deserialized to obtain the location information corresponding to the target chunk group; and according to the location information corresponding to the target chunk group, each piece of data in the target chunk group is read and combined to obtain response data corresponding to the data read request. Compared to existing technologies, this application segments the data to be stored and stores the resulting fragments corresponding to the data to be stored in a pre-set database. The fragments are then hashed, their location information calculated, and encrypted to generate corresponding storage code value combinations and storage identifiers, which are then pushed. Furthermore, a corresponding read method is generated from the storage method to extract the data corresponding to the user request. This achieves the hidden storage of the data to be stored in a massive database, enabling both data storage and retrieval, ensuring the security of user data. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a schematic diagram of a first embodiment of a data storage method according to an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of a second embodiment of a data storage method according to an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of a third embodiment of a data storage method according to an embodiment of the present invention;
[0023] Figure 4 This is a schematic diagram of a fourth embodiment of a data storage method according to an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of an embodiment of a data reading method according to an embodiment of the present invention;
[0025] Figure 6 A schematic diagram of an embodiment of a data storage device according to an embodiment of the present invention;
[0026] Figure 7 is a schematic diagram of another embodiment of a data storage device according to an embodiment of the present invention;
[0027] Figure 8 A schematic diagram of a data reading device according to an embodiment of the present invention;
[0028] Figure 9 FIG. 1 is a schematic diagram of an embodiment of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] Embodiments of the present invention provide a data storage and reading method, apparatus, device, and storage medium. The method includes: obtaining data to be stored and a corresponding user identifier, segmenting the data to be stored to obtain a group of fragments corresponding to the data to be stored; randomly storing the group of fragments in a preset database, and using a preset dynamic hash algorithm to calculate the location information of each piece of data in the group of fragments in the database; encrypting the location information using the user identifier, generating a corresponding storage code value combination and storage identifier, and pushing them. This application improves the security of user privacy data storage and management.
[0030] The terms "first," "second," "third," "fourth," and the like (if any) in the description and claims of the present invention and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.
[0031] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 The first embodiment of the data storage method in the embodiment of the present invention includes:
[0032] 101. Obtain the data to be stored and the corresponding user identifier, and segment the data to be stored to obtain a group of fragments corresponding to the data to be stored;
[0033] It is understandable that the execution subject of the present invention may be a data storage device, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0034] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0035] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0036] In this embodiment, the user identifier here refers to the user's identity feature information, such as the user's self-set login name, ID information, ID number, etc.; the fragment group here refers to a collection of data fragment blocks. For example, on a public server group, anyone has the authority to read all the data therein without any restrictions, and there are a large number of human books stored on the server (or users upload or customize their own text sea). These stored massive data are split into random fragment blocks of any form such as simple text, phrases, or sentences according to a preset data splitting method, and then these fragment blocks are combined into a cluster to obtain a fragment group.
[0037] In actual applications, users initiate corresponding data storage requests in corresponding login methods (such as dedicated application APPs, WeChat mini-programs, computer web pages, etc.). Users fill in and upload corresponding information data according to the storage setting requirements, and then analyze and process the data storage request. According to the preset data request format, the data to be stored and the user identifier are extracted, thereby obtaining the user's data to be stored and the corresponding user identifier; then, a preset data segmentation method is used to segment the data to be stored, such as by extracting the file format identifier from the data to be stored, and according to the file format identifier, determining the multiple file formats contained in the data to be stored, and then classifying the data to be stored according to the file format, and using a preset segmentation algorithm to segment the classified data to be stored into multiple data fragments, thereby obtaining the fragment group corresponding to the data to be stored. By performing fragment block segmentation on the obtained data to be stored, the fragment blocks corresponding to the data to be stored can be stored in the fragment group corresponding to the database, thereby achieving secure data storage.
[0038] 102. Randomly store the chunk group in a preset database, and use a preset dynamic hash algorithm to calculate the location information of each piece of data in the chunk group in the database;
[0039] In this embodiment, the database here refers to a company-rented or self-built database. The vast amount of data in the database is fragmented according to a pre-set fragmentation method, resulting in the desired database consisting of a vast sea of fragments. The dynamic hash algorithm here refers to traditional hash table implementations, which primarily include the zipper method and open address hashing, which in turn includes linear hashing and quadratic hashing. As the number of elements inserted into a hash table increases, traditional hash tables must expand their capacity and then remap the elements within the hash table to ensure efficient lookups. This overhead is often significant, so in this scenario, a dynamic hash algorithm can be applied. By storing the resulting fragment groups in the database, performing initial polarity encryption using a pre-set dynamic hashing algorithm, and calculating the location information of each fragment in the fragment group, the user's fragment group data can be stored in the database and the stored fragment groups can be marked with location information.
[0040] In actual applications, by analyzing user data storage requests, the storage level required by the user is obtained, thereby determining the security level of the fragment group, and then selecting the fragment group combination with the corresponding security level from the preset database; performing storage identification processing on each fragment group, and randomly splicing the identified fragment groups into the fragment group combination; storing the fragment group combination after splicing the fragment groups into the database; and then using the preset dynamic hash algorithm to perform hash transformation processing on each data in the fragment group to obtain the corresponding hash hash fragment group; identifying the initial position information of each data in the hash hash fragment group in the fragment group combination; serializing the initial position information to obtain the position information of each data in the fragment group in the database.
[0041] 103. Use the user ID to encrypt the location information, generate a corresponding storage code value combination and storage ID, and push them.
[0042] In this embodiment, encryption refers to encrypting the location information using a corresponding encryption algorithm, where the encryption algorithm is capable of generating countless corresponding solutions. Storage code value combinations refer to encrypting the location information to generate countless storage solutions, and then selecting corresponding combinations as storage code value combinations. The preferred storage code value combination is one in which one solution is selected as the selected code value, and the remaining solutions are used as defense code values, thereby generating the desired storage code value combination. Storage identifiers refer to storage identifiers composed of the location information of the fragment group and the user name information. By encrypting the location information using the user identifier, the user's data to be stored is hidden, allowing the data to be securely stored in the database.
[0043] In actual applications, the identification information of the corresponding users (i.e., the sending user and the receiving user) is obtained, and then the sending user identification and the receiving user identification are connected to obtain a connection identifier; the connection identifier is then used to encrypt the location information, wherein the preferred implementation method is that the encryption process will successfully generate an infinite number of decoding keys (similar to solving equations, multivariate linear equations, or sin, cos, and many other functions have a key corresponding to countless solutions), and the function can be reversely calculated to generate corresponding multiple storage code values and storage identifiers; then one of the multiple storage code values is selected as the selected code value, and other storage code values except the selected code value are selected from the multiple storage code values as the defense code value; a storage code value combination is generated based on the selected code value and the defense code value, and the storage code value combination and the storage identifier are pushed.
[0044] In an embodiment of the present invention, the data to be stored and the corresponding user identifier are obtained, and the data to be stored is segmented to obtain a group of fragments corresponding to the data to be stored; the group of fragments is randomly stored in a preset database, and a preset dynamic hash algorithm is used to calculate the position information of each piece of data in the group of fragments in the database; the user identifier is used to encrypt the position information, generate a corresponding storage code value combination and storage identifier, and push them. Compared to the existing technology, the present application segments the data to be stored, and stores the obtained group of fragments corresponding to the data to be stored in a preset database, and then performs a hash transformation, position information calculation, and encryption processing on the group of fragments to generate a corresponding storage code value combination and storage identifier, and push them. This achieves the hidden storage of the data to be stored in a large database, thereby realizing data storage and ensuring the security of user data.
[0045] See also Figure 2 A second embodiment of the data storage method in the embodiment of the present invention includes:
[0046] 201. Extracting a file format identifier from the data to be stored, and determining multiple file formats included in the data to be stored based on the file format identifier;
[0047] In this embodiment, the file format identifier here refers to a special encoding method for information used to store information, and is used to identify internally stored data. For example, some store pictures, some store programs, and some store text information. Each type of information can be stored in a storage device in one or more file formats. Each file format usually has one or more extensions that can be used for identification, but it may not have an extension. The extension can help the application program identify the file format. By identifying different file formats in advance, each file format identifier is obtained. By extracting the file format identifier of the data to be stored, the file format identifier is used to achieve segmentation of the data to be stored.
[0048] In practical application, the corresponding data storage request is initiated through the preset user data storage application mode, and then the data storage request is analyzed to obtain the to-be-stored data and the corresponding user identifier, and the file format identifier contained in the to-be-stored data is extracted. The to-be-stored data is processed by traversing the identification information in the preset file format identifier table, so as to obtain the corresponding file format identifier in the to-be-stored data. Then, the file format identifiers are used to traverse the to-be-stored data, so as to obtain the various file formats contained therein.
[0049] 202、The to-be-stored data is classified according to the file format, and a preset segmentation algorithm is used to segment the classified to-be-stored data into multiple data segments;
[0050] In this embodiment, the segmentation algorithm refers to using a preset segmentation strategy to segment the data into required data blocks. Preferably, the data of different file formats in the to-be-stored data is segmented according to the corresponding segmentation manner according to the corresponding file format, so as to obtain the required data blocks. By segmenting the to-be-stored data according to the file format obtained by the above processing, the data of different formats can be accurately segmented, and the segmented data all have unique data blocks, ensuring the uniqueness of the data and avoiding mutual interference between different data.
[0051] In practical application, the to-be-stored data is classified according to the file format obtained by the above processing, such as pictures, text, tables, etc. The to-be-stored data is classified according to the corresponding file format. Then, the classified to-be-stored data is segmented by using a preset segmentation algorithm. According to different file formats, the data of different file formats is segmented into multiple data segments by using the segmentation manner corresponding to the file format.
[0052] 203、Based on each data segment, a fragment group corresponding to the to-be-stored data is generated;
[0053] In this embodiment, the fragment group corresponding to the to-be-stored data is generated based on each data segment obtained by the above processing.
[0054] 204、The fragment group is randomly stored in the preset database, and the position information of each data in the database is calculated by using a preset dynamic hash algorithm;
[0055] 205、The position information is encrypted by using the user identifier to generate a corresponding storage code value combination and a storage identifier and to push the storage identifier.
[0056] In an embodiment of the present invention, a file format identifier is extracted from the data to be stored, and based on the file format identifier, the multiple file formats contained in the data to be stored are determined; the data to be stored is classified according to the file format, and a preset segmentation algorithm is used to segment the classified data to be stored into multiple data segments; and a fragment group corresponding to the data to be stored is generated based on each data segment. Compared to the prior art, the present application identifies and classifies the file format of the data to be stored, and then uses a preset segmentation algorithm to segment the classified data to be stored to obtain the required fragment group, thereby achieving classification and segmentation of the data to be stored and ensuring that the classified data has uniquely identifiable data segments.
[0057] See also Figure 3 A third embodiment of the data storage method in the embodiment of the present invention includes:
[0058] 301. Obtain the data to be stored and the corresponding user identifier, and segment the data to be stored to obtain a group of fragments corresponding to the data to be stored;
[0059] 302. Determine the security level of the fragment group and select a fragment group combination with a corresponding security level stored historically from a preset database;
[0060] In this embodiment, the security level here refers to the data storage level set in advance. The higher the security of the data storage, the larger the data fragment group is used for combined storage to achieve higher hidden storage, thereby determining the security level of the corresponding fragment group.
[0061] In actual applications, the security level of the corresponding fragment group is obtained by obtaining the user's data storage security level, and then according to the security level, a fragment group combination with a historical storage corresponding to the security level is selected from the preset database.
[0062] 303. Store and mark each fragment group, and randomly splice the marked fragment groups into a fragment group combination;
[0063] In this embodiment, the storage identifier here refers to each data fragment in the fragment group after the data to be stored is fragmented, and each data fragment is identified according to a preset identification method. Among them, the preferred implementation method here is to implement the identification processing of each data fragment by using the user identifier.
[0064] In practical applications, the user identification is obtained by using the above process, each fragment in the fragment group is subjected to storage identification processing, and the identified fragment group is randomly spliced into the fragment group combination in the preset database.
[0065] 304. The combined fragment groups are stored in a database;
[0066] In this embodiment, the above-mentioned spliced fragment groups and fragment group combinations are stored in a pre-set database, thereby realizing hidden storage of data in a huge database.
[0067] 305. Perform hash transformation on each piece of data in the fragment group using a preset dynamic hash algorithm to obtain a corresponding hash fragment group;
[0068] In this embodiment, the resulting chunk group is hashed using a pre-set dynamic hashing algorithm. A preferred implementation involves converting each chunk group's data into a corresponding hash value using the dynamic hashing algorithm, thereby generating a corresponding hashed chunk group. This hashing process makes the corresponding data to be stored similar to the original chunk group data, thereby increasing the security of the stored data.
[0069] 306. Identify the initial position information of each piece of data in the hash fragment group in the fragment group combination;
[0070] In this embodiment, a hash fragment group is obtained according to the above processing, and the storage mark of each data piece therein is marked and identified, thereby identifying the initial position information of each data piece in the hash fragment group in the above fragment group combination.
[0071] 307. Serialize the initial position information to obtain the position information of each piece of data in the fragment group in the database;
[0072] In this embodiment, the serialization processing here refers to performing data conversion processing on the initial position information to enhance the security of the initial position information.
[0073] In practical applications, the initial position information obtained by the above processing is serialized. The best implementation method here is to serialize a long string of position data in the initial position information set, and connect the numbers to form 11-22-33 or the like through a certain connector. For example, json data is represented by [11,22,33] to represent an array set, and then the string is serialized into "[11,22,33]", and the position information of each data in the fragment group in the database can be obtained.
[0074] 308. Use the user ID to encrypt the location information, generate a corresponding storage code value combination and storage ID, and push them.
[0075] In an embodiment of the present invention, the security level of a fragment group is determined, and a combination of fragment groups with corresponding historical storage security levels is selected from a preset database; each fragment group is identified for storage, and the identified fragment groups are randomly spliced into a fragment group combination; the fragment group combination after splicing the fragment groups is stored in the database; a preset dynamic hash algorithm is used to hash each piece of data in the fragment group to obtain a corresponding hashed fragment group; the initial position information of each piece of data in the hashed fragment group in the fragment group combination is identified; the initial position information is serialized to obtain the position information of each piece of data in the fragment group in the database. Compared to the prior art, the present application combines the fragment groups to be stored according to the corresponding security level and stores them in a preset database, and then performs hash transformation on the stored fragments and serializes the position information, thereby achieving data storage in a large database and corresponding tag extraction, thereby facilitating data extraction.
[0076] See also Figure 4 The fourth embodiment of the data storage method in the embodiment of the present invention includes:
[0077] 401. Obtain the data to be stored and the corresponding user identifier, and segment the data to be stored to obtain a group of fragments corresponding to the data to be stored;
[0078] 402. Randomly store the chunk group in a preset database, and use a preset dynamic hash algorithm to calculate the location information of each piece of data in the chunk group in the database;
[0079] 403. Concatenate the sending user ID and the receiving user ID to obtain a connection identifier.
[0080] In this embodiment, a user identifier is obtained according to the above processing, wherein the user identifier includes a sending user identifier and a receiving user identifier, and then the sending user identifier and the receiving user identifier are connected. A preferred implementation method here is to connect the two IDs of the sending user identifier and the receiving user identifier through a certain character into a long string, thereby obtaining a connection identifier.
[0081] 404. Encrypt the location information using the connection identifier to generate corresponding multiple storage code values and storage identifiers;
[0082] In this embodiment, the above-mentioned location information is encrypted by using the connection identifier obtained by the above-mentioned processing. A preferred implementation method here is to encrypt the location information by using the RSA algorithm, making the product public as the encryption key, and thereby generating corresponding multiple storage code values and storage identifiers.
[0083] 405. Select one of the multiple stored code values as the selected code value, and select other stored code values excluding the selected code value from the multiple stored code values as the defense code value.
[0084] In this embodiment, based on the multiple stored code values and storage identifiers obtained through the above process, one of the multiple stored code values is selected as the selected code value, and other stored code values other than the selected code value are selected as the defense code values. The defense code values satisfy the requirement that once a cracker triggers the defense root, the selected root will become invalid, and the selected root can only be used once before becoming invalid.
[0085] 406. Generate a storage code value combination based on the selected code value and the defense code value, and push the storage code value combination and the storage identifier.
[0086] In this embodiment, the selected code value and the defense code value are obtained based on the above processing, a storage code value combination is generated, and then the storage code value combination and the storage identifier are pushed.
[0087] In an embodiment of the present invention, a sending user identifier and a receiving user identifier are concatenated to obtain a connection identifier; the connection identifier is used to encrypt location information to generate corresponding multiple storage code values and storage identifiers; one of the multiple storage code values is selected as a selected code value, and other storage code values other than the selected code value are selected from the multiple storage code values as defense code values; a storage code value combination is generated based on the selected code value and the defense code value, and the storage code value combination and storage identifier are pushed. Compared to the prior art, the present application generates a connection identifier using user information, and then uses the connection identifier to encrypt location information to obtain a storage code value combination and a storage identifier for push, thereby achieving encryption and push of key location information, preventing the corresponding storage extraction code from being cracked, and increasing the security of the data to be stored.
[0088] See also Figure 5 , an embodiment of the data reading method in the embodiment of the present invention includes:
[0089] 501. Obtain a data read request and extract the storage identifier and storage code value input in the data read request;
[0090] In this embodiment, the user's data read request is obtained in a corresponding manner, and then the data read request is analyzed and processed to obtain the input storage identifier and the input storage code value in the data read request.
[0091] 502. Querying a preset database for a target fragment group associated with the input storage identifier, and determining whether the input storage code value is a selected code value corresponding to the target fragment group;
[0092] In this embodiment, based on the input storage identifier and input storage code value obtained through the above process, a pre-set database is searched for the target chunk group associated with the input storage identifier, and a determination is made as to whether the input storage code value is a selected code value corresponding to the target chunk group. This determination is based on whether the selected code value is a selected code value. If so, the fragments are assembled into the actual file content. If the code value is not a selected code value, certain decoy fragments may be triggered during the fragment retrieval process. Once a decoy fragment is triggered, a notification is sent to the sender's client, which can be configured to automatically invalidate all roots.
[0093] 503. If yes, decrypt and deserialize the input storage code value to obtain the location information corresponding to the target fragment group;
[0094] In this embodiment, if the input storage code value is the selected code value corresponding to the target fragment group, the input storage code value is decrypted using the storage identifier and the input selected code value, and then the decrypted data is deserialized to obtain the location information corresponding to the target fragment group.
[0095] 504. According to the location information corresponding to the target fragment group, read and combine the data in the target fragment group to obtain response data corresponding to the data read request.
[0096] In this embodiment, according to the position information corresponding to the target fragment group obtained by the above processing, the various pieces of data corresponding to the position information in the target fragment group are extracted and combined to obtain response data corresponding to the data reading request, and the response data is pushed to the user.
[0097] In an embodiment of the present invention, a data read request is obtained, and the storage identifier and storage code value entered in the data read request are extracted; a target block group associated with the input storage identifier is queried in a preset database, and it is determined whether the input storage code value is the selected code value corresponding to the target block group; if so, the input storage code value is decrypted and deserialized to obtain location information corresponding to the target block group; according to the location information corresponding to the target block group, each piece of data in the target block group is read and combined to obtain response data corresponding to the data read request. Compared to the prior art, the present application uses the input storage identifier and the input storage code value to query the corresponding location information, and then extracts each piece of data based on the location information, thereby obtaining response data corresponding to the data read request. By determining the corresponding storage code value, illegal users are prevented from accessing the stored data, thereby enhancing the security of the stored data.
[0098] The above describes the data storage method and the data reading method in the embodiment of the present invention. The following describes the data storage device and the data reading device in the embodiment of the present invention. Figure 6 In one embodiment of the present invention, a data storage device includes:
[0099] The data segmentation module 601 is configured to acquire to-be-stored data and a corresponding user identifier, and segment the to-be-stored data to obtain a corresponding chunk group of the to-be-stored data.
[0100] The position calculation module 602 is configured to randomly store the chunk group into a preset database, and calculate position information of each piece of data in the chunk group in the database by using a preset dynamic hash algorithm.
[0101] The data pushing module 603 is configured to encrypt the position information by using the user identifier, generate a corresponding storage code value combination and a storage identifier, and push the storage code value combination and the storage identifier.
[0102] In the embodiment of the application, to-be-stored data and a corresponding user identifier are acquired, and the to-be-stored data is segmented to obtain a corresponding chunk group of the to-be-stored data. The chunk group is randomly stored into a preset database, and position information of each piece of data in the chunk group in the database is calculated by using a preset dynamic hash algorithm. The position information is encrypted by using the user identifier, and a corresponding storage code value combination and a storage identifier are generated and pushed. Compared with the prior art, the to-be-stored data is segmented, and the obtained corresponding chunk group of the to-be-stored data is stored into the preset database. Then, the chunk group data is subjected to hash transformation, position information calculation and encryption processing, so that the corresponding storage code value combination and the storage identifier are generated and pushed. The to-be-stored data is hiddenly stored into a large database, so that the storage of the data is realized, and the security of user data is ensured.
[0103] Referring to Figure 7 Another embodiment of the data storage device in the embodiment of the application includes:
[0104] The data segmentation module 601 is configured to acquire to-be-stored data and a corresponding user identifier, and segment the to-be-stored data to obtain a corresponding chunk group of the to-be-stored data.
[0105] The position calculation module 602 is configured to randomly store the chunk group into a preset database, and calculate position information of each piece of data in the chunk group in the database by using a preset dynamic hash algorithm.
[0106] The data pushing module 603 is configured to encrypt the position information by using the user identifier, generate a corresponding storage code value combination and a storage identifier, and push the storage code value combination and the storage identifier.
[0107] Further, the data segmentation module 601 includes:
[0108] The identifier extraction unit 6011 is used to extract the file format identifier from the data to be stored, and determine the multiple file formats contained in the data to be stored based on the file format identifier; the data segmentation unit 6012 is used to classify the data to be stored according to the file format, and use a preset segmentation algorithm to segment the classified data to be stored into multiple data segments; based on each of the data segments, a fragment group corresponding to the data to be stored is generated.
[0109] Furthermore, the position calculation module 602 includes:
[0110] The level selection unit 6021 is used to determine the security level of the fragment group and select the fragment group combination corresponding to the security level and stored historically from the preset database; the fragment combination unit 6022 is used to store and identify each of the fragment groups and randomly splice the identified fragment groups into the fragment group combination; the fragment storage unit 6023 is used to store the fragment group combination after splicing the fragment groups into the database.
[0111] Furthermore, the position calculation module 602 also includes: a hash transformation unit 6024, which is used to use a preset dynamic hash algorithm to perform hash transformation on each piece of data in the fragment group to obtain a corresponding hash hash fragment group; a position identification unit 6025, which is used to identify the initial position information of each piece of data in the hash hash fragment group in the fragment group combination; a serialization processing unit 6026, which is used to serialize the initial position information to obtain the position information of each piece of data in the fragment group in the database.
[0112] Furthermore, the data push module 603 includes: an identification connection unit 6031, which is used to connect the sending user identification and the receiving user identification to obtain a connection identifier; an information encryption unit 6032, which is used to use the connection identifier to encrypt the location information to generate corresponding multiple storage code values and storage identifiers; a code value selection unit 6033, which is used to select one of the multiple storage code values as a selected code value, and select other storage code values except the selected code value from the multiple storage code values as defense code values; an information push unit 6034, which is used to generate a storage code value combination based on the selected code value and the defense code value, and push the storage code value combination and the storage identifier.
[0113] In the embodiment of the present application, the data to be stored is fragmented, the fragmented groups are stored in the fragmented groups in the preset database, and the position information of each fragmented group is generated, the position information is encrypted and serialized, the serialized position information is further encrypted, the storage code value combination and the storage identifier are obtained and pushed. The data to be stored is placed in the data sea, the data is hidden in the vast data sea, the data storage security is exchanged by using the huge data space, and the security of the user's stored data is improved.
[0114] Please refer to Figure 8 In the embodiment of the present application, one embodiment of the data reading device comprises:
[0115] The identifier extraction module 801 is configured to obtain a data reading request, and extract the input storage identifier and the input storage code value in the data reading request;
[0116] The fragmented group query module 802 is configured to query the target fragmented group associated with the input storage identifier in the preset database, and determine whether the input storage code value is the selected code value corresponding to the target fragmented group;
[0117] The code value calculation module 803 is configured to, if yes, decrypt and deserialize the input storage code value to obtain the position information corresponding to the target fragmented group;
[0118] The data reading module 804 is configured to read each piece of data in the target fragmented group according to the position information corresponding to the target fragmented group, and combine the data to obtain the response data corresponding to the data reading request.
[0119] In the embodiment of the present application, the data reading request is obtained, the input storage identifier and the input storage code value in the data reading request are extracted, the target fragmented group associated with the input storage identifier is queried in the preset database, and it is determined whether the input storage code value is the selected code value corresponding to the target fragmented group. If yes, the input storage code value is decrypted and deserialized to obtain the position information corresponding to the target fragmented group. According to the position information corresponding to the target fragmented group, each piece of data in the target fragmented group is read and combined to obtain the response data corresponding to the data reading request. Compared with the prior art, the storage identifier and the storage code value in the data reading request are extracted, and then decrypted and deserialized to obtain the response data, so that the safe reading of data is realized, and the occurrence of data theft is prevented.
[0120] The above Figure 6 and Figure 7 From the perspective of the modular functional entity, the data storage device and the data reading device in the embodiment of the present application Figure 8The data reading device in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the computer equipment in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0121] Figure 9 : is a structural diagram of a computer device provided by an embodiment of the present invention. The computer device 900 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 910 (for example, one or more processors) and a memory 920, and one or more storage media 930 (for example, one or more mass storage devices) storing application programs 933 or data 932. Among them, the memory 920 and the storage medium 930 can be temporary storage or permanent storage. The program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device 900. Furthermore, the processor 910 can be configured to communicate with the storage medium 930 to execute a series of instruction operations in the storage medium 930 on the computer device 900.
[0122] The computer device 900 may further include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input and output interfaces 960, and / or one or more operating systems 931, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 9 The illustrated computer device structure does not limit the computer device and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0123] The present invention also provides a computer device, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes each step of the data storage method in the above embodiments.
[0124] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the various steps of the data storage and reading method.
[0125] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0126] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0127] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0128] The above-described embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data storage method, characterized in that: The data storage method includes: Acquire data to be stored and a corresponding user identifier, and segment the data to be stored to obtain a group of fragments corresponding to the data to be stored; Randomly storing the fragment groups in a preset database, and using a preset dynamic hash algorithm to calculate the position information of each piece of data in the fragment group in the database; the method includes: determining the security level of the fragment group, and selecting a fragment group combination corresponding to the security level and stored historically from the preset database; assigning storage marks to each of the fragment groups, and randomly splicing the identified fragment groups into the fragment group combination; storing the spliced fragment group combination into the database; performing a hash transformation on each piece of data in the fragment group using a preset dynamic hash algorithm to obtain a corresponding hash fragment group; identifying the initial position information of each piece of data in the hash fragment group in the fragment group combination; and serializing the initial position information to obtain the position information of each piece of data in the fragment group in the database; The user identifier is used to encrypt the location information, generate a corresponding storage code value combination and storage identifier, and push them; the method includes: the user identifier includes a sending user identifier and a receiving user identifier, and the sending user identifier and the receiving user identifier are connected to obtain a connection identifier; the location information is encrypted using the connection identifier to generate corresponding multiple storage code values and storage identifiers; one storage code value from the multiple storage code values is selected as a selected code value, and other storage code values from the multiple storage code values except the selected code value are selected as defense code values; a storage code value combination is generated based on the selected code value and the defense code value, and the storage code value combination and the storage identifier are pushed.
2. The data storage method according to claim 1, wherein: The step of dividing the data to be stored to obtain a group of fragments corresponding to the data to be stored includes: Extracting a file format identifier from the data to be stored, and determining multiple file formats included in the data to be stored based on the file format identifier; Classifying the data to be stored according to the file format, and using a preset segmentation algorithm to segment the classified data to be stored into multiple data segments; A fragment group corresponding to the data to be stored is generated based on each of the data segments.
3. A data storage device, characterized in that The data storage device comprises: A data segmentation module is used to obtain the data to be stored and the corresponding user identifier, and segment the data to be stored to obtain a group of fragments corresponding to the data to be stored; a position calculation module for randomly storing the fragment groups in a preset database and calculating the position information of each piece of data in the fragment group in the database using a preset dynamic hash algorithm; the module includes: determining the security level of the fragment group and selecting a fragment group combination corresponding to the security level and stored historically from the preset database; assigning storage identifiers to each fragment group and randomly splicing the identified fragment groups into the fragment group combination; storing the spliced fragment group combination into the database; performing a hash transformation on each piece of data in the fragment group using a preset dynamic hash algorithm to obtain a corresponding hash fragment group; identifying the initial position information of each piece of data in the hash fragment group in the fragment group combination; and serializing the initial position information to obtain the position information of each piece of data in the fragment group in the database; A data push module is configured to encrypt the location information using the user identifier, generate a corresponding storage code value combination and storage identifier, and push the information; the module includes: the user identifier includes a sending user identifier and a receiving user identifier, the sending user identifier and the receiving user identifier are concatenated to obtain a connection identifier; the location information is encrypted using the connection identifier to generate a corresponding plurality of storage code values and storage identifiers; one of the plurality of storage code values is selected as a selected code value, and other storage code values other than the selected code value are selected from the plurality of storage code values as defense code values; a storage code value combination is generated based on the selected code value and the defense code value, and the storage code value combination and the storage identifier are pushed.
4. A computer device, characterized in that: The computer device includes: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the computer device to execute the steps of the data storage method according to any one of claims 1 to 2.
5. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by a processor, the steps of the data storage method according to any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Safe storage method for sensitive file
CN105975877A
Data storage method and device as well as mobile terminal
CN106557706A
Data processing method and device for block chain BAAS service based on encryption algorithm
CN113722749A