A model data management method, device, storage medium and electronic device
Through key encryption and redundant coding of model data, the problem of model data leakage and damage in storage devices is solved, and the safe management and recovery of data are realized.
Patent Information
- Application Number
- CN202410821445.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-24
AI Technical Summary
During the model training process, the model data in the storage device is easily leaked or damaged, leading to data security risks. It is difficult to effectively manage and protect this data with existing technology.
By dividing the model data into data pages, encrypting it using the key generated at the current moment, generating a hash value to encrypt the key, constructing data strips for redundant encoding, writing to the storage device, and reading and During the recovery process, redundant data pages are used for data recovery.
It effectively avoids the risk of data leakage and recovers through redundant data pages when the data pages are damaged, ensuring the security and integrity of the data.
Smart Images

Figure CN118377436B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for managing model data. Background Art
[0002] With the development of science and technology, intelligent model algorithms have begun to be widely used in many fields such as aerospace, unmanned driving, anomaly detection, image recognition, etc. In the process of model training, a large amount of model data is usually generated, such as training samples, model parameters, gradient information, etc. This information is usually stored in storage devices such as solid state drives (SSDs) to perform subsequent management of model data in the storage devices.
[0003] Then, when writing and reading the model data in the storage device, and subsequently managing the data in the storage device, there is often a risk of data leakage and damage. Once the model data is leaked or cannot be read normally, it will cause huge losses to the model developers.
[0004] Therefore, how to ensure the data security of model data in storage devices is an urgent problem to be solved. Summary of the invention
[0005] This specification provides a model data management method, device, storage medium and electronic device to partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] Acquire model data to be stored, and divide the model data into a plurality of data pages as first data pages according to a preset data page storage space;
[0008] Encrypting each first data page based on the key generated at the current moment to obtain each encrypted data page, and generating a hash value according to each encrypted data page;
[0009] Encrypting the key by using the hash value to obtain an encrypted key, and using the data page corresponding to the encrypted key as a key data page;
[0010] Constructing a data stripe including the encrypted data pages and the key data page, and performing redundant encoding on each data page in the data stripe to obtain at least two redundant data pages, wherein the total number of data pages required for redundant decoding of the data stripe is not less than the total number of data pages in the data stripe;
[0011] Each data page and each redundant data page in the data stripe is written into a storage device, and data management is performed on the data stored in the storage device.
[0012] Optionally, before writing the data stripe and each redundant data page into a preset storage device for storage, the method further includes:
[0013] Partitioning the storage device, determining a storage channel corresponding to each data page included in the data stripe as each data storage channel, and determining a storage channel corresponding to each redundant data page as a redundant storage channel;
[0014] Writing the data stripe and each redundant data page into a preset storage device for storage specifically includes:
[0015] The encrypted data pages and the key data pages are stored in the memory of the storage device through the data storage channels, and the redundant data pages are stored in the cache of the storage device through the redundant storage channels.
[0016] Optionally, storing the redundant data pages in a cache of the storage device through the redundant storage channels specifically includes:
[0017] If the cache space of the cache is insufficient, each historical redundant data whose duration from the last access time to the current time in the cache exceeds the preset duration is written into the memory, and the cache space occupied by the each historical redundant data is released.
[0018] Optionally, storing the redundant data pages in a cache of the storage device through the redundant storage channels specifically includes:
[0019] Determining whether the cache contains storage information corresponding to each redundant data page;
[0020] If not, then the redundant data pages are written into the cache; if so, the redundant data pages are used to overwrite the historical redundant data pages corresponding to the storage information.
[0021] Optionally, performing data management on the data stored in the storage device specifically includes:
[0022] receiving a read request for model data, and reading, according to the data read request, from the storage device the redundant data pages and at least a portion of the data pages included in the data stripe;
[0023] When the number of data pages read from the data stripe exceeds a specified number, redundant decoding is performed according to each of the read data pages to restore all the data pages included in the data stripe, wherein the sum of the specified number and the number of each redundant data page is not less than the total number of data pages in the data stripe;
[0024] generating the hash value according to each encrypted data page;
[0025] Decrypting the encrypted key corresponding to the key data page according to the hash value to obtain the key;
[0026] The encrypted data pages are decrypted using the key to obtain the model data.
[0027] Optionally, the method further comprises:
[0028] If at least part of the data pages in the data stripe and / or the redundant data pages are damaged, undamaged redundant data pages and / or undamaged data pages in the data stripe are read, wherein the sum of the number of undamaged redundant data pages and the number of undamaged data pages included in the data stripe is not less than the total number of data pages in the data stripe;
[0029] Redundancy decoding is performed according to the read data pages that are not damaged, so as to recover the damaged data pages, and the damaged data pages in the storage device are overwritten by the recovered data pages.
[0030] Optionally, performing data management on the data stored in the storage device specifically includes:
[0031] receiving a deletion instruction for the model data;
[0032] According to the deletion instruction, logically delete each data page contained in the data stripe stored on the storage device to obtain each invalid data page, and physically erase each redundant data page stored in the storage device, wherein the invalid data page cannot be directly read;
[0033] An invalid data page corresponding to at least one encrypted data page is determined as a data page to be erased, and the data page to be erased is physically erased.
[0034] This specification provides a model data management device, including:
[0035] an acquisition module, used for acquiring model data to be stored, and dividing the model data into a plurality of data pages as first data pages according to a preset storage space corresponding to each data page;
[0036] A first encryption module encrypts each first data page based on a key generated at a current moment to obtain each encrypted data page, and generates a hash value according to each encrypted data page;
[0037] A second encryption module is used to encrypt the key by using the hash value to obtain an encrypted key, and use the data page corresponding to the encrypted key as the key data page;
[0038] an encoding module, used for constructing a data stripe including the encrypted data pages and the key data page, and performing redundant encoding on each data page in the data stripe to obtain at least two redundant data pages, wherein the total number of data pages required for redundant decoding of the data stripe is not less than the total number of data pages in the data stripe;
[0039] The storage module is used to write each data page and each redundant data page in the data stripe into a storage device, and perform data management on the data stored in the storage device.
[0040] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned model data management method is implemented.
[0041] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned model data management method when executing the program.
[0042] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0043] In the model data management method provided in the present specification, the model data to be stored is obtained, and the model data is divided into several first data pages according to the preset data page storage space; based on the key generated at the current moment, each first data page is encrypted to obtain each encrypted data page, and the key is encrypted according to the hash value generated by each encrypted data page to obtain a key data page; a data stripe including each encrypted data page and a key data page is constructed, and redundant encoding is performed to obtain at least two redundant data pages; each data page and each redundant data page in the data stripe is written to a storage device, and data management operations such as reading, restoring, updating, and deleting are performed on the data stored in the storage device.
[0044] It can be seen from the above method that this scheme encrypts each divided data page based on the key, and then further encrypts the key through the hash value. Compared with the current method of encryption only by secret key, this scheme can effectively avoid the risk of data leakage during data transmission; in addition, in the process of data management, even if some stored data pages are damaged, data can be recovered through redundant data pages and undamaged data, which further ensures data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0046] Figure 1 A flowchart of a method for managing model data provided in this specification;
[0047] Figure 2 A schematic diagram of a data writing process provided in this specification;
[0048] Figure 3 A schematic diagram of a data reading process provided in this specification;
[0049] Figure 4 A schematic diagram of a data recovery process provided in this manual;
[0050] Figure 5 A schematic diagram of a data update process provided in this specification;
[0051] Figure 6 A flowchart of data deletion provided in this manual;
[0052] Figure 7 A schematic diagram of a data deletion process in an update process provided in this manual;
[0053] Figure 8 This is an architecture diagram of a data management system provided in this specification;
[0054] Fig. 9 A schematic diagram of a cache operation provided in this manual;
[0055] Fig.10 A schematic diagram of a model data management device provided in this specification;
[0056] Fig.11 A method corresponding to the Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0058] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0059] Figure 1 A flow chart of a method for managing model data provided in this specification includes the following steps:
[0060] S101: Acquire model data to be stored, and divide the model data into a plurality of data pages as first data pages according to a preset data page storage space.
[0061] In the actual training and application of intelligent models, a large amount of model data is usually generated. This model data includes sample data, model parameters, gradient information, activation values, etc. Among them, the model data is usually stored in storage devices such as SSDs, and the model data is managed based on the storage devices (such as read and write operations, data recovery, data update, and data deletion, etc.).
[0062] However, during data transmission and subsequent data management in storage devices, there may usually be transmission loopholes or hardware loopholes, which may cause the risk of data leakage or data corruption.
[0063] Based on this, this specification provides a method for managing model data, which ensures the security of data reading and writing by calculating the hash value of the transmission key, and avoids the risk of partial data damage based on redundant data.
[0064] In this specification, the execution subject for implementing a model data management method can be a designated device such as a server. For the sake of ease of description, the following will only take the server as the execution subject as an example to illustrate a model data management method provided in this specification.
[0065] Among them, the server can obtain the model data generated during model training or actual reasoning, and then perform data segmentation on the model data. According to the preset data page storage space, the model data is divided into several data pages as first data pages. For the convenience of subsequent description, the number of first data pages can be expressed as N.
[0066] For example, the model data that the server needs to store at one time is D, which is 1MB in size, and the size of a data page is 0.2MB. The server can divide the data D into 5 equal parts, that is, , wherein each divided portion is a first data page.
[0067] S102: Encrypt each first data page based on the key generated at the current moment to obtain each encrypted data page, and generate a hash value according to each encrypted data page.
[0068] The server can generate a random key by means of random numbers each time data is written, and the key size is consistent with the size of a single data page.
[0069] Afterwards, the server may encrypt each first data page using the key to obtain each encrypted data page, wherein the encrypted data page has the same size as the first data page before encryption, and the encryption method is reversible.
[0070] Here, the model data D described in step S101 is taken as an example. The server can Encrypt each item in to obtain each encrypted data page. The set of encrypted data pages can be expressed as: .
[0071] Of course, the server may also generate the above keys through other methods such as identity-based encryption (IBE), hardware-based key generation, and password-based key derivation, which is not specifically limited in this specification.
[0072] It should be pointed out that in order to ensure the real-time nature of the key and further protect data security, the key generated each time data is written can be different.
[0073] Furthermore, the server may generate a hash value according to each data page, wherein the size of the hash value is the same as the size of the key.
[0074] S103: Encrypt the key using the hash value to obtain an encrypted key, and use the data page corresponding to the encrypted key as a key data page.
[0075] The server can encrypt the key through the generated hash value to obtain an encrypted key, wherein the size of the encrypted key is the same as the size of the data page, so the data page corresponding to the encrypted key can be used as the key data page.
[0076] For example, for an encrypted data page set combine , the server can Execute the hash function to generate a hash value (hash), and then the server can perform an exclusive OR (XOR) operation on the hash and the key to obtain the encrypted key .
[0077] S104: Construct a data stripe including the encrypted data pages and the key data page, and perform redundant encoding on each data page in the data stripe to obtain at least two redundant data pages, wherein the total number of data pages required for redundant decoding of the data stripe is not less than the total number of data pages in the data stripe.
[0078] The server may further construct a data stripe including the encrypted data page and the key data page. The server may then perform easy encoding on each data page (including all the encrypted data pages and the key data page) included in the data stripe, thereby obtaining at least two redundant data pages. For the convenience of subsequent description, the number of redundant data pages may be represented as K.
[0079] By constructing redundant data pages, the server can restore all data pages based on partial data pages during the redundant decoding process.
[0080] The server can determine the constraint condition based on the characteristics of the redundant coding itself. In this specification, the constraint condition can be: the total number of data pages required for redundant decoding of the data stripe is not less than the total number of data pages in the data stripe. That is, if the number of valid redundant data pages obtained is k (k≤K), the number of valid data pages in the data stripe is n (n≤N), and the number of key data pages is 1, then when When , the server can perform redundant decoding based on the k redundant data pages and the data pages in the n data stripes, thereby obtaining N+1 data pages contained in the data stripe.
[0081] For example, for an encrypted data page And the encrypted key The constructed data strip It can be expressed as , the server can use redundant encoding Building redundant data pages ,when The sum of the number of readable data in and the number of readable data in R is greater than or equal to When the number of data in All data in can be reconstructed.
[0082] In example, the server can Read , read from R , then based on and Perform redundant decoding to obtain .
[0083] S105: writing each data page and each redundant data page in the data stripe into a storage device for storage.
[0084] The server may then write each data page and the common redundant data page in the data stripe to the storage device for storage.
[0085] In a stored procedure, the server can Add to Data Strip In order to obtain the updated data strip , and update the data strip Store in a storage device.
[0086] Since updating and modifying any encrypted data page on the storage device will involve the modification of all redundant data pages, the number of read and write times for redundant data pages is much higher than the number of read times for data pages in the data stripe. This leads to an imbalance in the allocation of storage task resources. Multiple read and write operations on redundant data will seriously reduce storage efficiency.
[0087] Based on this, this manual provides a storage deployment architecture based on the RAID4 framework combined with redundant dedicated cache, aiming to achieve efficient redundant data management.
[0088] Specifically, the server can construct storage channels in advance, partition the storage chips on the storage device to form storage channels, and the number of channels is equal to the number of updated data stripes. The total number of data pages in, that is, N+1+K.
[0089] For example, for the updated data bar , SSD has 24 storage chips, so the server can build 8 storage channels, each storage channel has 3 storage chips.
[0090] The server can then further construct data-dedicated channels and redundant dedicated channels, setting N+1 storage channels as data storage channels specifically for storing data strips. For the data pages in the storage medium (i.e., the encrypted data pages and the key data pages), K channels are set as redundant storage channels, which are specifically used to store the redundant data pages.
[0091] for , then 6 storage channels are set as data storage channels and 2 storage channels are set as redundant storage channels.
[0092] Since the read and write efficiency of cache is usually higher than that of memory (the access speed of cache is usually about 50 times that of memory), the server can store redundant data pages with intensive operation frequency in pre-built cache through redundant storage channels, thereby improving the overall efficiency of data reading and writing.
[0093] For data strips The server may write each encrypted data page and key data page into the memory of the storage device through the data storage channel corresponding to each data page. In this specification, the memory of the storage device may include a solid state disk (SSD).
[0094] During the actual data writing process, if the cache space is insufficient, each historical redundant data whose duration from the last access time to the current time in the cache exceeds the preset duration (i.e., the last access time is earlier) will be written into the memory, and the cache space occupied by each historical redundant data will be released.
[0095] Of course, each historical redundant data stored in the cache for a period longer than the preset period (ie, the storage time is earlier) can also be transferred to the memory. The preset period can be set according to actual conditions, and this specification does not make specific restrictions on this.
[0096] Furthermore, in the process of writing redundant data pages into the cache, the server can first determine whether the cache contains storage information corresponding to each redundant data page. If so, it means that no target redundant data has been stored in the cache before. At this time, each redundant data page can be directly written into the cache and storage information can be generated. The format of the storage information can be R={data stripe number, redundant data 1,…, redundant data K}.
[0097] If the cache contains storage information corresponding to each redundant data page, it means that old redundant data pages have been stored in the cache before. At this time, the server can overwrite the historical redundant data pages with the same storage information in the cache with the redundant data pages to be written.
[0098] If so, each historical redundant data corresponding to the storage information will be overwritten by each redundant data page.
[0099] For ease of understanding, this specification provides a data writing process diagram, such as Figure 2 shown.
[0100] Figure 2 The following is a schematic diagram of a data writing process provided in this specification.
[0101] Among them, the data is transmitted to the encryption module, and N encrypted data pages and an encryption key are output; the encrypted data pages and the encryption key are input into the encoder to generate redundant data pages; the encrypted data pages and the encryption key are stored in the data channel of the SSD, and the redundant data pages are stored in the redundant data cache area.
[0102] In practical applications, it is usually necessary to read model data from a storage device to perform practical tasks. For the model data written into the storage device in the above manner, during the data reading process, the server can read each redundant data page and at least part of the data pages contained in the data stripe from the storage device according to the data reading request after receiving the data reading request. When the number of data pages read from the data stripe exceeds the specified number, the server can perform redundant decoding based on each data page read to restore all the data pages contained in the data stripe. The sum of the above specified number and the number of each redundant data page is not less than the total number of data pages in the data stripe.
[0103] The server can then generate a hash value based on each encrypted data page, decrypt the encrypted key corresponding to the key data page based on the hash value to obtain the key, and then decrypt each encrypted data page using the key to obtain the model data.
[0104] It should be noted that, since the occupancy of each data channel is different during the actual data reading process, the time to return data is also different. Compared with the method of waiting for the storage channel to return each data page to obtain all data pages, the time used for the process of reading a part of the data pages and then performing redundant decoding to obtain all data pages recorded in this manual is much shorter than the time used to directly read all data pages, thereby effectively avoiding the problem of channel congestion. The data reading method provided in this manual can further improve the overall efficiency of data reading. For ease of understanding, this manual provides a data reading process diagram, such as Figure 3 shown.
[0105] Figure 3 A schematic diagram of a data reading process provided in this specification.
[0106] Among them, the server can randomly read N+1-K encrypted pages in the memory on the storage device through the data storage channel, and read K redundant data in the cache through the redundant storage channel. If the required redundant data does not exist in the cache, it is read from the memory of the storage device.
[0107] Then, the read N+1-K encrypted pages and K redundant data are redundantly decoded and returned to N encrypted data pages and one key data page.
[0108] A hash function is performed on the N encrypted data pages among the N+1 data pages read to obtain a hash value, and an XOR operation is performed on the hash value and the key data page to obtain the key.
[0109] Then, the N encrypted data pages are decrypted respectively by using the key to obtain unencrypted first data pages, and then the first data pages are merged to obtain model data.
[0110] For example, facing , randomly read { ,… Any four items in the cache are read { }, if the target redundant data does not exist in the cache, the data is read on the redundant channel of the SSD. Then, any four items in the randomly read [S1, ...S6] and {R1, R2} are redundantly decoded to obtain .right Execute the hash function to obtain the hash value. Perform XOR operation with the hash value to obtain the key. Then use the key pair Decrypt each item in to obtain the first data page Merge each of these items and the output will be what needs to be read.
[0111] In the process of managing data through storage devices, SSDs often cause some data to be damaged due to some special internal or external factors (such as device failure caused by frequent current modification of the SSD), which requires recovery operations to be performed on the damaged data.
[0112] Specifically, during the data reading process, if it is found that at least part of the data pages (i.e., the encrypted data pages and the key data pages) and / or the redundant data pages in the data stripe are damaged, then the undamaged redundant data pages and / or the undamaged data pages in the data stripe are read, wherein the sum of the number of undamaged redundant data pages and the number of undamaged data pages contained in the data stripe is not less than the total number of data pages in the data stripe. The server can then perform redundant decoding based on the undamaged data pages read to recover the damaged data pages, and overwrite the damaged data pages in the storage device with the recovered data pages. For ease of understanding, this specification provides a flow chart of data recovery, such as Figure 4 shown.
[0113] Figure 4 The following is a flowchart of a data recovery method provided in this manual.
[0114] The server can locate the damaged page on the data stripe, which can be an encrypted data page, a key data page, or a redundant data page on the memory. In practical applications, since the failure rate of the device cache is low and no current modification operations are performed on the cache, the data pages stored in the cache are usually not damaged.
[0115] After that, N+1 undamaged data pages are randomly read from the memory and cache, and all encrypted pages are restored based on the read data pages. If the redundant data pages are damaged, all encrypted pages are redundantly encoded, the redundant data pages are recovered, and the damaged pages are overwritten based on the repaired data to achieve data repair.
[0116] For example, facing , damage, Damaged, and all stored on the SSD side, then read And perform redundant decoding to obtain , and then perform redundant coding to obtain , and use the newly generated Write memory to overwrite previously damaged , the newly generated Cover the damaged .
[0117] Furthermore, in the actual execution of the task, the server may use an update operation to modify some data pages in the data strip. For ease of understanding, this specification provides a data update flow diagram, such as Figure 5 shown.
[0118] Figure 5 The following is a flowchart of a data update process provided in this specification.
[0119] Among them, the server can read NK encrypted pages on the memory of the storage device and read K redundant data pages on the cache according to the data stripe number that needs to be modified. If the data stripe does not exist in the cache, the server reads K redundant data pages on the cache channel of the SSD; the read N+1-K encrypted pages and K redundant data are redundantly decoded and returned to the N+1 encrypted page; the hash function is executed on the first N of the read N+1 encrypted pages to obtain a hash value, and the hash value is XOR-operated with the last encrypted page to obtain the key; the encrypted data page is reconstructed, the data page that needs to be modified is encrypted, and it is placed in an appropriate position; redundant encoding is performed based on the encrypted data page and the key data page to generate a redundant data page; the encrypted data page of the data that needs to be modified and the new key data page are stored in the memory through the data storage channel, and the new redundant data page is stored in the cache using an insert command or an update command.
[0120] For example, facing , randomly read { ,… Any four items in the cache are read { }, if the target redundant data does not exist in the cache, the data is read on the redundant storage channel. Then, any four items in the randomly read [S1, ...S6] and {R1, R2} are redundantly decoded to obtain .right Execute the hash function to obtain the hash value. Perform XOR operation with the hash value to obtain the key.
[0121] When the server needs to When making a modification, the server can use the key to modify the first data page Encrypt and get the modified encrypted data page and use Replace the original In S3, we get .
[0122] Then Execute the hash function to obtain a new hash value, perform XOR on the key and the new hash value, and obtain the updated key data page , and put Add to In, get .
[0123] Afterwards Redundant encoding is performed to obtain , among which and Write the original encrypted data page into memory and the original key data page Replace, if the original On the cache, the update command is executed through Overwrite it. If it does not exist, just Insert cache.
[0124] In actual applications, the off-site update mechanism of SSD will mark the data pages that are logically deleted as "invalid", making them inaccessible to the file system, but these "invalid" data still exist physically in the hard disk before the SSD performs garbage collection and physical erasure operations. Since the deleted data on these "invalid" pages can be read through specific commands, the risk of sensitive data leakage becomes a problem.
[0125] Directly erasing the "invalid" page can destroy the data in it. However, since the erasing unit of the SSD is a block, and a block contains not only invalid pages but also valid data pages that have not been logically deleted, directly erasing the block containing the "invalid" page requires data transfer of the valid data page, thereby reducing the performance of the SSD.
[0126] Although the current modification method can destroy data while avoiding transfer, frequent current modification will reduce the durability of storage units and significantly shorten the life of SSDs. In addition, current modification may also destroy data in nearby normal pages, causing data corruption. Currently, the current modification-based secure deletion method is mostly deployed using the RAID-5 architecture. Although this method has high read efficiency, it has low write efficiency due to channel congestion caused by cache write back. The storage operations of large models involve frequent write operations, which makes the current data security management system based on current modification unable to be applied to the storage management of large model-related data resources.
[0127] If all data pages are physically erased each time data is deleted, frequent current modifications are required. That is, when N data pages in the storage device are logically deleted, N current modification operations need to be performed, which will undoubtedly cause excessive wear and tear on the storage device.
[0128] Among them, logical deletion does not involve the actual removal of data. In a database or file system, logical deletion is usually implemented by modifying metadata or adding a flag. For example, in a database, it may only be necessary to update a flag indicating "deleted" or change the status field of the record, thereby setting the deleted data page to an invalid state. At this time, the data page is an invalid data page. The invalid data page still physically exists on the storage medium, but is considered deleted at the logical level. This means that the logical deletion operation is reversible, and the data can be restored by simply reversing the flag or status change.
[0129] Physical erasure involves the complete removal of data from storage media. Physical erasure means that the data is overwritten, erased, or zeroed, making it unrecoverable from its original location on the disk or other storage media. At the file system level, physical deletion not only removes references in the file allocation table or directory entry, but also overwrites the original data blocks, making it difficult to recover the data even with data recovery tools.
[0130] Current modification mainly changes the current state of the memory cell to set the memory cell to an initial state, thereby achieving physical erasure of invalid data pages.
[0131] Therefore, in the process of physically deleting the model data, the server can receive a deletion instruction for the model data, and according to the deletion instruction, logically delete each data page contained in the data strip stored on the storage device to obtain each invalid data page, and physically erase each redundant data page stored in the storage device, wherein the invalid data page cannot be directly read; then determine the invalid data page corresponding to at least one encrypted data page as the data page to be erased, and physically erase the data page to be erased.
[0132] Specifically, the server can first securely delete the redundant data pages. If the redundant data pages of the deleted data strip are stored in the cache, the redundant data pages in the cache are directly deleted. If the redundant data pages are stored in the memory, the redundant data pages stored in the memory are physically erased. Then, for the encrypted data pages other than the key data pages, one item is randomly selected for physical erasure.
[0133] For example, for ,if If it is stored in the cache, delete the cache directly. ,if If stored in SSD, The data page performs the current modification and then randomly extracts Perform current modification on a data page in the.
[0134] For ease of understanding, this manual provides a data deletion process diagram, such as Figure 6 shown.
[0135] Figure 6 The following is a flowchart of data deletion provided in this manual.
[0136] Among them, when When performing logical deletion, you can Physically erase and re- Delete or modify the memory Perform a physical wipe.
[0137] The traditional method requires Each item in the current modification is executed 8 times, while the solution only needs to be executed once in the best case and 3 times in the worst case. Therefore, the number of executions can be reduced by 37.5%-87.5%, greatly alleviating the problem of reduced SSD service life caused by current modification.
[0138] In addition, in the process of updating the encrypted data, it is also involved in deleting invalid data pages. In this process, if the redundant data page of the updated data strip is stored in the cache before the update, the redundant data page will not be deleted. If the redundant data page originally exists on the SSD, the redundant data page stored on the SSD will be physically erased. For ease of understanding, this manual provides a flow chart of data deletion during the update process, as shown in FIG. Figure 7 shown.
[0139] Figure 7 The following is a flowchart of data deletion during an update process provided in this manual.
[0140] For example, facing ,if Stored in cache, no operation, if If stored in SSD, The page to perform the current modification.
[0141] Furthermore, this specification also provides a data management system applied to the above-mentioned model data management method, such as Figure 8 shown.
[0142] Figure 8 This is an architecture diagram of a data management system provided in this specification.
[0143] Among them, the data management system includes: a decryptor, an encryptor, a decryptor, an encoder, a decoder, a data recovery module, a metadata area, a redundant data buffer area, a data channel (data storage channel) and a redundant channel (redundant storage channel).
[0144] The encryptor is used to encrypt the first data page to generate an encrypted data page, and to encrypt the key to obtain a key data page;
[0145] The decryptor is used to decrypt the encrypted data page to obtain the first data page, and to decrypt the key data page to obtain the key;
[0146] The encoder is used for performing redundant encoding on the encrypted data page and the key data page to obtain a redundant data page, wherein the redundant encoding may be based on a Reed-Solomon code;
[0147] The decryptor is used to perform redundant decoding based on the read redundant data page and at least a portion of the encrypted data page (including the encrypted data page and the key data page) to restore all the encrypted data;
[0148] The data recovery module is used to decode the redundant data and partially encrypted data read to recover all the encrypted data to repair the damaged data page;
[0149] Metadata area: used for metadata management;
[0150] Redundant data buffer area: used for redundant data management;
[0151] Data channel: used to store encrypted data pages to memory;
[0152] Redundant channel: used to store redundant data pages in cache.
[0153] The write operation process is as follows: input data enters the encryptor, completes data encryption, generates encrypted data, and then enters the encoder to generate redundant data. Metadata assists in storage task scheduling. Encrypted data is stored in the data channel, and redundant data is stored in the redundant data cache. If the storage behavior of redundant data causes the redundant data cache storage space to be exhausted, the last accessed redundant data will be written to the redundant channel.
[0154] The read operation process is as follows: metadata assists in storage task scheduling, reads part of the encrypted data from the data channel, and reads all the redundant data from the redundant data cache. If the redundant data cache does not contain the target data, it is read from the redundant channel. If the data page is found to be damaged during the reading process, data recovery is performed, and a decoder is used to restore the read part of the encrypted data and redundant data into all the encrypted data. The decryptor is executed on the encrypted data to restore the data and output it.
[0155] Furthermore, this specification also provides a schematic diagram of a cache operation based on the above data management system, such as Fig. 9 shown.
[0156] Fig. 9 A schematic diagram of a cache operation provided in this manual.
[0157] Wherein, N represents the node corresponding to each redundant data page, that is, the redundant page node, and the cache operation includes the following steps:
[0158] Node construction: The redundant data page is expressed in the form of {data stripe number, redundant data 1, ..., redundant data K} to form a redundant page node.
[0159] Node connection: Redundant page nodes are stored in an AVL tree structure, and the access order relationship is recorded using the Least Recently Used (LRU) principle.
[0160] Insertion: When a new data stripe is stored, its redundant data is initially stored directly in the redundant data buffer by creating a redundant page node. The node is then inserted into the AVL tree according to its data stripe number; in addition, the node is placed at the front of the LRU queue.
[0161] Update: When the write operation targets an existing data stripe in the redundant data cache, this operation identifies the corresponding buffer node by searching in the AVL tree; after locating the node, it updates the redundant data recorded in the node and places the node at the head of the LRU queue.
[0162] Search: When the read operation targets a data stripe already contained in the redundant data cache, the operator locates the corresponding buffer node by searching in the AVL tree. The process then involves outputting the redundant data recorded in the node and re-placing the node at the head of the LRU queue.
[0163] Preservation: When the redundant data cache reaches its capacity, the node at the end of the LRU queue is identified. The redundant data recorded by the node is then written to the corresponding redundant channel on the SSD. Thereafter, the node is removed from the redundant data cache by deleting it from the AVL tree and the LRU queue.
[0164] It can be seen from the above method that this scheme encrypts each divided data page based on the key, and then further encrypts the key through the hash value. Compared with the current method of encryption only by secret key, this scheme can effectively avoid the risk of data leakage during data transmission; in addition, in the process of data management, even if some stored data pages are damaged, data can be recovered through redundant data pages and undamaged data, which further ensures data security.
[0165] In addition, the integrity of the deleted encrypted data is destroyed by adopting current modification to achieve protection of important data at a lower current modification frequency, thereby protecting the service life of the SSD; further, a storage deployment architecture for the above data operation management framework is announced, and special channels are established for secret keys and redundant data by adopting a RAID-4 architecture to avoid channel congestion problems, thereby achieving high-performance write operations; further, a set of secure data operation methods for the above data streams are announced, and efficient data security management on the SSD is achieved by customizing the read, write, update, data recovery, and secure operation processes for the above public secure deletion methods.
[0166] The above are one or more implementation model data management methods of this specification. Based on the same idea, this specification also provides a corresponding model data management device, such as Fig.10 shown.
[0167] Fig.10 A schematic diagram of a model data management device provided in this specification includes:
[0168] The acquisition module 1001 is used to acquire model data to be stored, and divide the model data into a plurality of data pages as first data pages according to a preset storage space corresponding to each data page;
[0169] The first encryption module 1002 encrypts each first data page based on the key generated at the current moment to obtain each encrypted data page, and generates a hash value according to each encrypted data page;
[0170] The second encryption module 1003 is used to encrypt the key by using the hash value to obtain an encrypted key, and use the data page corresponding to the encrypted key as the key data page;
[0171] The encoding module 1004 is used to construct a data stripe including the encrypted data pages and the key data page, and perform redundant encoding on each data page in the data stripe to obtain at least two redundant data pages, wherein the total number of data pages required for redundant decoding of the data stripe is not less than the total number of data pages in the data stripe;
[0172] The association module 1005 is used to write each data page and each redundant data page in the data stripe into a storage device, and perform data management on the data stored in the storage device.
[0173] Optionally, before writing the data stripe and each redundant data page into a preset storage device for storage, the management module 1005 is further used to partition the storage device, determine the storage channel corresponding to each data page included in the data stripe as each data storage channel, and determine the storage channel corresponding to each redundant data page as a redundant storage channel;
[0174] The management module 1005 is specifically used to store the encrypted data pages and the key data pages in the memory of the storage device through the data storage channels, and to store the redundant data pages in the cache of the storage device through the redundant storage channels.
[0175] Optionally, the management module 1005 is specifically used to write into the memory each historical redundant data whose duration from the last access time to the current time in the cache exceeds a preset duration if the cache space of the cache is insufficient, and release the cache space occupied by each historical redundant data.
[0176] Optionally, the management module 1005 is specifically used to determine whether the cache contains storage information corresponding to the redundant data pages; if not, write the redundant data pages into the cache; if so, overwrite the historical redundant data pages corresponding to the storage information with the redundant data pages.
[0177] Optionally, the management module 1005 is specifically used to receive a read request for model data, and read the redundant data pages and at least part of the data pages contained in the data stripe from the storage device according to the data read request; when the number of data pages read from the data stripe exceeds a specified number, redundant decoding is performed based on the read data pages to restore all the data pages contained in the data stripe, wherein the sum of the specified number and the number of the redundant data pages is not less than the total number of data pages in the data stripe; the hash value is generated based on the encrypted data pages; the encrypted key corresponding to the key data page is decrypted based on the hash value to obtain the key; and the encrypted data pages are decrypted using the key to obtain the model data.
[0178] Optionally, the management module 1005 is also used to, if at least part of the data pages in the data stripe and / or the redundant data pages are damaged, read the undamaged redundant data pages and / or the undamaged data pages in the data stripe, wherein the sum of the number of the undamaged redundant data pages and the number of the undamaged data pages contained in the data stripe is not less than the total number of data pages in the data stripe; perform redundant decoding based on the read undamaged data pages to recover data for the damaged data pages, and overwrite the damaged data pages in the storage device with the recovered data pages.
[0179] Optionally, the management module 1005 is specifically used to receive a deletion instruction for the model data; according to the deletion instruction, logically delete each data page contained in the data strip stored on the storage device to obtain each invalid data page, and physically erase each redundant data page stored in the storage device, wherein the invalid data page cannot be directly read; determine an invalid data page corresponding to at least one encrypted data page as a data page to be erased, and physically erase the data page to be erased.
[0180] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A method for managing model data is provided.
[0181] This manual also provides Fig.11 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Fig.11As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0182] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0183] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0184] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0185] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0186] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0187] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0188] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0190] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0191] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0192] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0193] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0194] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0195] This specification may 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. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0196] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0197] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A method for managing model data, It is characterized in that include: Acquire model data to be stored, and divide the model data into a plurality of data pages as first data pages according to a preset data page storage space; Encrypting each first data page based on the key generated at the current moment to obtain each encrypted data page, and generating a hash value according to each encrypted data page; Encrypting the key by using the hash value to obtain an encrypted key, and using the data page corresponding to the encrypted key as a key data page; Constructing a data stripe including the encrypted data pages and the key data page, and performing redundant encoding on each data page in the data stripe to obtain at least two redundant data pages, wherein the total number of data pages required for redundant decoding of the data stripe is not less than the total number of data pages in the data stripe; The storage device is partitioned, and the storage channels corresponding to each data page included in the data stripe are determined as data storage channels, and the storage channels corresponding to the redundant data pages are determined as redundant storage channels, and the encrypted data pages and the key data pages are stored in the memory of the storage device through the data storage channels, and the redundant data pages are stored in the cache of the storage device through the redundant storage channels, so as to write the data pages and the redundant data pages in the data stripe to the storage device, and perform data management on the data stored in the storage device.
2. The method according to claim 1, It is characterized in that Storing the redundant data pages in the cache of the storage device through the redundant storage channels specifically includes: If the cache space of the cache is insufficient, each historical redundant data whose duration from the last access time to the current time in the cache exceeds the preset duration is written into the memory, and the cache space occupied by the each historical redundant data is released.
3. The method according to claim 1, It is characterized in that Storing the redundant data pages in the cache of the storage device through the redundant storage channels specifically includes: Determining whether the cache contains storage information corresponding to each redundant data page; If not, then the redundant data pages are written into the cache; if so, the redundant data pages are used to overwrite the historical redundant data pages corresponding to the storage information.
4. The method according to claim 1, It is characterized in that Performing data management on the data stored in the storage device specifically includes: receiving a read request for model data, and reading, according to the data read request, from the storage device the redundant data pages and at least a portion of the data pages included in the data stripe; When the number of data pages read from the data stripe exceeds a specified number, redundant decoding is performed according to each of the read data pages to restore all the data pages included in the data stripe, wherein the sum of the specified number and the number of each redundant data page is not less than the total number of data pages in the data stripe; generating the hash value according to each encrypted data page; Decrypting the encrypted key corresponding to the key data page according to the hash value to obtain the key; The encrypted data pages are decrypted using the key to obtain the model data.
5. The method according to claim 4, It is characterized in that The method further comprises: If at least part of the data pages in the data stripe and / or the redundant data pages are damaged, undamaged redundant data pages and / or undamaged data pages in the data stripe are read, wherein the sum of the number of undamaged redundant data pages and the number of undamaged data pages included in the data stripe is not less than the total number of data pages in the data stripe; Redundancy decoding is performed according to the read data pages that are not damaged, so as to recover the damaged data pages, and the damaged data pages in the storage device are overwritten by the recovered data pages.
6. The method according to claim 1, It is characterized in that Performing data management on the data stored in the storage device specifically includes: receiving a deletion instruction for the model data; According to the deletion instruction, logically delete each data page contained in the data stripe stored on the storage device to obtain each invalid data page, and physically erase each redundant data page stored in the storage device, wherein the invalid data page cannot be directly read; An invalid data page corresponding to at least one encrypted data page is determined as a data page to be erased, and the data page to be erased is physically erased.
7. A model data management device, It is characterized in that include: an acquisition module, used for acquiring model data to be stored, and dividing the model data into a plurality of data pages as first data pages according to a preset storage space corresponding to each data page; A first encryption module encrypts each first data page based on a key generated at a current moment to obtain each encrypted data page, and generates a hash value according to each encrypted data page; A second encryption module is used to encrypt the key by using the hash value to obtain an encrypted key, and use the data page corresponding to the encrypted key as the key data page; an encoding module, used for constructing a data stripe including the encrypted data pages and the key data page, and performing redundant encoding on each data page in the data stripe to obtain at least two redundant data pages, wherein the total number of data pages required for redundant decoding of the data stripe is not less than the total number of data pages in the data stripe; A storage module is used to partition a storage device, determine a storage channel corresponding to each data page contained in the data stripe as each data storage channel, and determine a storage channel corresponding to each redundant data page as a redundant storage channel, store each encrypted data page and each key data page in the memory of the storage device through each data storage channel, and store each redundant data page in the cache of the storage device through each redundant storage channel, so as to write each data page and each redundant data page in the data stripe to the storage device, and perform data management on the data stored in the storage device.
8. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method described in any one of claims 1 to 6 is implemented.
