Information detection method and system for storage device
By monitoring the read and write cycles of storage devices and generating verification hash codes, secure backups and deep encryption are performed, solving the problems of reasonable allocation of physical blocks and insufficient backup data security in storage devices, thereby extending the lifespan of storage devices and improving data security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN JINMEIYAN TECHNOLOGY CO LTD
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-19
AI Technical Summary
Existing storage device information detection technologies cannot properly allocate physical blocks within storage devices based on their health status, resulting in a shortened lifespan of storage devices and insufficient security of backup data, making them susceptible to leakage.
By monitoring the number of read and write operations of stored data, a verification hash code is generated to detect data anomalies, secure backups are performed, and deep encryption is implemented. Data storage is allocated based on read and write restriction parameters.
It improves the overall lifespan of storage devices and the rationality of data storage, ensures the security and integrity of backup data, and prevents data leakage.
Smart Images

Figure CN122240417A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information detection technology for storage devices, specifically to a method and system for information detection of storage devices. Background Technology
[0002] Storage device information detection technology refers to a series of methods and processes that actively or passively collect, analyze, and interpret the internal status, performance, data integrity, and potential risks of storage devices such as hard disk drives (HDDs), solid-state drives (SSDs), USB flash drives, and storage arrays through software and hardware means.
[0003] Existing storage device health assessment technologies typically evaluate a storage device's health solely by detecting the presence and proportion of bad blocks, failing to extend its lifespan. Furthermore, these technologies often employ random access or associative storage, while data within storage devices varies in type. Some data types are read / written very infrequently, while others are read / written very frequently. Simply using random access or associative storage leads to a rapid decline in the lifespan of some physical blocks, while others experience a slower decline, resulting in significant differences in lifespan between different physical blocks. This is detrimental to the overall lifespan of the storage device. Additionally, storage devices often contain backup data, which is typically... Important documents require robust security measures when storing backup data. For example, patent application CN107729199A discloses a "hard drive detection method and system for storage devices." This solution only detects hard drive malfunctions and health status, but it cannot improve hard drive lifespan or rationally allocate physical blocks based on health status. Existing storage device information detection technologies still suffer from limitations in rationally allocating physical blocks based on health status and insufficient protection for backup data, leading to problems such as failing to extend storage device lifespan and the vulnerability of backup data to leakage. Summary of the Invention
[0004] This invention aims to at least partially solve one of the technical problems in the prior art. By monitoring the stored data in the storage device, recording the number of data read and write operations, and simultaneously recording the number of partition read and write operations of logical blocks in the storage device, a verification hash code is generated for the stored data. Based on the verification hash code, the storage data is checked for anomalies. Then, a secure backup is performed on the stored data that needs to be backed up to obtain initial backup data. Next, deep encryption calculation is performed on the initial backup data to obtain secure backup data. Then, the read and write limit parameters of physical blocks in the storage device are identified based on the partition read and write operation count. Finally, storage allocation is performed on the stored data and secure backup data based on the read and write limit parameters and the data read and write operation count. This solves the problems that existing storage device information detection technologies still have the problem of not being able to reasonably allocate physical blocks in the storage device based on the health status and insufficient protection of backup data, which leads to the inability to help extend the service life of the storage device and the vulnerability of backup data to leakage.
[0005] To achieve the above objectives, in a first aspect, this application provides an information detection method for a storage device, comprising the following steps: Monitor the stored data in the storage device, record the number of data read and write operations, and also record the number of partition read and write operations of logical blocks in the storage device; Generate a verification hash code for the stored data, and use the verification hash code to detect whether the stored data is abnormal; The system detects whether the stored data needs to be backed up. If the stored data needs to be backed up, a secure backup is performed to obtain the initial backup data. Then, deep encryption calculations are performed on the initial backup data to obtain the secure backup data. Storage allocation for both stored data and secure backup data is based on the number of data read / write operations and the number of partition read / write operations.
[0006] Furthermore, monitoring the stored data in the storage device and recording the number of data read / write operations, as well as the number of partition read / write operations of logical blocks in the storage device, includes the following sub-steps: When any piece of stored data is first stored in a logical block in the storage device, a data read / write count is generated and set to 1. Whenever the stored data is read or modified, the data read / write count is incremented by one. The data read / write count is associated with the stored data. The number of times a logical block in a storage device is read and written is recorded and named the partition read and write count. The partition read and write count is the sum of all data read and write counts saved in the history of the logical block. The partition read and write count is associated with the logical block.
[0007] Furthermore, generating a verification hash code for the stored data, and detecting whether the stored data is abnormal based on the verification hash code, includes the following sub-steps: A data verification model is constructed, and a verification hash code is obtained by calculating the stored data using a hash algorithm; Set a self-check cycle. Calculate the hash value of the stored data once every self-check cycle, and name it the self-check hash code. If the self-check hash code and the verification hash code are not equal, then the stored data is marked as abnormal; otherwise, the stored data is marked as normal. If there is an anomaly in the stored data, an anomaly report will be sent to the user.
[0008] Furthermore, the process involves detecting whether the stored data needs to be backed up. If so, a secure backup is performed to obtain initial backup data. Then, deep encryption is applied to this initial backup data to obtain secure backup data. This process includes the following sub-steps: Perform a secure backup of the stored data that needs to be backed up to obtain the initial backup data; Deep encryption calculations are performed on the initial backup data to obtain secure backup data.
[0009] Furthermore, performing a secure backup of the stored data that needs to be backed up to obtain the initial backup data includes the following sub-steps: Copy the stored data that needs to be backed up and name it "Data to be Backed Up". Obtain the UTF-8 encoding of the binary format of the data to be backed up and name it "Code to be Backed Up". Number the characters in the code to be backed up from left to right, using the symbol T. n It is represented as follows, where n is a non-zero natural number and n is the index of T; Obtain the device code of the storage device, and then obtain the corresponding decimal ASCII code for the device code. Name this code the key code. Number the characters in the key code from left to right, using the symbol D. m Let m be a non-zero natural number and m be the index of D. Let the maximum value of m be marked as M. Assume there exists a T0 and T0 is 0, starting with n=1, obtain D n%M+1 The D n%M+1 That is, D is m=n%M+1 m Determine D n%M+1 And T n-1 The parity of D, if D n%M+1 With T n-1 If the parity is the same, then T will be... n Perform bit flipping; otherwise, retain T. n Repeat the process of adding n+1 and analyzing again until the maximum value of n is reached; After the analysis of T is completed n Relabeled as P n The P n This is the initial backup data.
[0010] Furthermore, performing deep encryption calculations on the initial backup data to obtain secure backup data includes the following sub-steps: Set the number R n The R n Initially empty; Set R1 to P1, starting with n=2, and determine P. n Is it related to P? n-1 If they are equal, then R will be equal to R. n Set to 1; otherwise, set R. n Set it to 0, increase n by 1 and analyze again until the maximum value of n is reached; Arrange R in ascending order of n n Combine the data to obtain a secure backup.
[0011] Furthermore, the storage allocation for stored data and security backup data based on the number of data read / write operations and the number of partition read / write operations includes the following sub-steps: Identify read / write limit parameters of physical blocks in storage devices based on the number of partition read / write operations; Storage allocation is performed on stored data and security backup data based on read / write limit parameters and the number of data read / write operations.
[0012] Furthermore, identifying the read / write limit parameters of physical blocks in the storage device based on the number of partition read / write operations includes the following sub-steps: Obtain the baseline lifetime of the physical block and mark it as KS, and mark the number of partition read and write operations of the physical block as FS; Calculate FS / KS and name the result the read / write limit parameter.
[0013] Furthermore, the storage allocation for stored data and security backup data based on read / write limit parameters and the number of data read / write operations includes the following sub-steps: Cluster analysis was performed on the read / write limit parameters and the number of data read / write operations to obtain the limit cluster and the read / write cluster. During the cluster analysis, the cluster parameters were adjusted to ensure that the number of the limit cluster and the read / write cluster were both 3. Calculate the average value of the read / write restriction parameters in the restricted clusters and name it the average parameter. Then, name the three restricted clusters as the first restricted set, the second restricted set, and the third restricted set in ascending order of the average parameter. Calculate the average number of data reads and writes in the read-write cluster, and name it the average number of reads and writes. Then, name the three read-write clusters as the first read-write set, the second read-write set, and the third read-write set, in descending order of the average number of reads and writes. The physical blocks belonging to the first restricted set, the second restricted set, and the third restricted set are named the first restricted block, the second restricted block, and the third restricted block, respectively. The storage data within the first read / write set is stored in the first restricted block, and is stored in the first restricted block in descending order of the number of read / write operations. The first restricted block is allocated in ascending order of the read / write restriction parameters. Storage data within the second read / write set is stored in the second restricted block, while storage data within the third read / write set and all security backup data are stored in the third restricted block.
[0014] Secondly, this application provides an information detection system for a storage device, including a read / write monitoring module, a hash verification module, a security backup module, and a storage allocation module; the read / write monitoring module, the hash verification module, and the security backup module are respectively data connected to the storage allocation module; The read / write monitoring module is used to monitor the stored data in the storage device, record the number of data read / write operations, and also record the number of partition read / write operations of logical blocks in the storage device. The hash verification module is used to generate verification hash codes for stored data and to detect whether the stored data is abnormal based on the verification hash codes. The secure backup module is used to detect whether the stored data needs to be backed up. If the stored data needs to be backed up, a secure backup is performed on the stored data to obtain initial backup data. Then, deep encryption calculation is performed on the initial backup data to obtain secure backup data. The storage allocation module is used to allocate storage data and security backup data based on the number of data read / write operations and the number of partition read / write operations.
[0015] The beneficial effects of this invention are as follows: By monitoring the stored data in the storage device and recording the number of data read and write operations, as well as the number of partition read and write operations of logical blocks in the storage device, the read and write limit parameters of physical blocks in the storage device are identified based on the partition read and write operations. Then, storage allocation is performed on the stored data and security backup data based on the read and write limit parameters and the number of data read and write operations. The advantage is that the read and write limit parameters reveal the lifespan of the physical blocks. The smaller the read and write limit parameters, the longer the remaining lifespan, which can accommodate more frequent read and write operations. Conversely, the larger the read and write limit parameters, the shorter the remaining lifespan. Therefore, such physical blocks should store data with low read and write frequency, such as security backup data, as much as possible. This improves the rationality and effectiveness of data storage in storage device information detection and also improves the overall lifespan of the storage device. This invention generates verification hash codes for stored data, detects anomalies in the stored data based on these hash codes, and then performs a secure backup of the stored data that needs to be backed up, obtaining initial backup data. This initial backup data is then subjected to deep encryption calculations to obtain secure backup data. The advantages are that the verification hash codes ensure the integrity of the stored data, and can promptly alert users if data corruption is detected. Furthermore, if a backup of the corresponding stored data exists, it can be automatically restored from the backup data. During the backup process, the backup data is highly protected, and the length of the secure backup data is ensured to remain consistent with the length of the original backup data during the security calculation process. This ensures high security without increasing the data volume, thus improving the security and effectiveness of information detection for storage devices. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the system of the present invention; Figure 2 This is a flowchart illustrating the number of data read / write operations and the number of partition read / write operations in this invention; Figure 3 This is a flowchart of the steps of the method of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device using the method of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Example 1, please refer to Figure 1 As shown, this application provides an information detection system for a storage device, including a read / write monitoring module, a hash verification module, a security backup module, and a storage allocation module; the read / write monitoring module, the hash verification module, and the security backup module are respectively data-connected to the storage allocation module; Please see Figure 2 As shown, the read / write monitoring module is used to monitor the stored data in the storage device, record the number of data reads and writes of the stored data, and at the same time record the number of partition reads and writes of the logical blocks in the storage device; The read / write monitoring module is configured with read / write monitoring policies, which include: When any piece of stored data is first stored in a logical block in the storage device, a data read / write count is generated and set to 1. Whenever the stored data is read or modified, the data read / write count is incremented by one. The data read / write count is associated with the stored data. The number of times a logical block in a storage device is read and written is recorded and named the partition read and write count. The partition read and write count is the sum of all the data read and write counts saved in the history of the logical block. The partition read and write count is associated with the logical block. In practical applications, a flowchart for recording the number of data read / write operations and partition read / write operations is shown below. Figure 2 As shown, storage devices typically refer to hard disks. Assume there is a file α. When α is first stored on the hard disk, a read / write count is generated for α and set to 1. Each time α is read or modified on the hard disk, the read / write count is incremented by one. For example, if α is read 56 times and modified 3 times, then the read / write count for α is 1 + 56 + 3 = 60. For another example, if a physical block on the hard disk is temporarily named β, and β has stored 3 copies of data with read / write counts of 60, 80, and 580 respectively, then the partition read / write count for β is 60 + 80 + 580 = 720.
[0019] The hash verification module is used to generate verification hash codes for stored data, and to detect whether the stored data is abnormal based on the verification hash codes; The hash verification module is configured with hash verification strategies, which include: A data verification model is constructed, and a verification hash code is obtained by calculating the stored data using a hash algorithm; Set a self-check cycle. Calculate the hash value of the stored data once every self-check cycle, and name it the self-check hash code. If the self-check hash code and the verification hash code are not equal, then the stored data is marked as abnormal; otherwise, the stored data is marked as normal. If there is an anomaly in the stored data, an anomaly report will be sent to the user; In practical applications, the existing hash algorithm is used to calculate the hash value of file α, resulting in the verification hash code 3d039e4aadaf00c3a95c2a934d0f92844855508e6f6c739dd47c82197a99cc62. The self-check cycle is set by the manufacturer. In this embodiment, the self-check cycle is 1 day, meaning that the verification hash code of the stored file is calculated every other day and used as the self-check hash code. If the calculated self-check hash code is not equal to the verification hash code obtained in the previous calculation, it means that the stored file is corrupted and needs to be marked as abnormal. When the stored file is abnormal, the user is notified that the corresponding stored file is corrupted. If the stored file has a backup, it can be restored by using the backup.
[0020] The security backup module is used to detect whether the stored data needs to be backed up. If the stored data needs to be backed up, a security backup is performed on the stored data to obtain the initial backup data. Then, deep encryption calculation is performed on the initial backup data to obtain the secure backup data. The security backup module includes an initial secure backup unit and a deep secure backup unit. The initial secure backup unit is used to securely back up the stored data that needs to be backed up, and obtain the initial backup data; The initial security backup unit is configured with an initial security backup policy, which includes: Copy the stored data that needs to be backed up and name it "Data to be Backed Up". Obtain the UTF-8 encoding of the binary format of the data to be backed up and name it "Code to be Backed Up". Number the characters in the code to be backed up from left to right, using the symbol T. n It is represented as follows, where n is a non-zero natural number and n is the index of T; Obtain the device code of the storage device, and then obtain the corresponding decimal ASCII code for the device code. Name this code the key code. Number the characters in the key code from left to right, using the symbol D. m Let m be a non-zero natural number and m be the index of D. Let the maximum value of m be marked as M. In practical applications, α is copied and the copied α is named the data to be backed up. Assuming the data to be backed up is the symbol "α", the backup code corresponding to "α" is obtained as 1100111010110001. T is obtained through the number. n 1≤n≤16, and the device code is obtained as "ACT-2", and the key code is obtained as 6567844550. The number is D. m 1≤m≤10, M is 10.
[0021] Assume there exists a T0 and T0 is 0, starting with n=1, obtain D n%M+1 D n%M+1 That is, D is m=n%M+1 m Determine D n%M+1 And T n-1 The parity of D, if D n%M+1 With T n-1 If the parity is the same, then T will be... n Perform bit flipping; otherwise, retain T. n Repeat the process of adding n+1 and analyzing again until the maximum value of n is reached; After the analysis of T is completed n Relabeled as P n P n This is the initial backup data; In practical applications, taking n=1 as an example, to obtain D n%M+1 That is, to obtain D 1%10+1 D 1%10+1 That is, D2. D2 is 5, which is an odd number, while T... n-1 Let T0 be an even number, where T0 is 0. n%M+1 With T n-1 Since the parity of T1 and T1 are different, we keep T1, which is 1. Therefore, P1 is 1. If T1 undergoes a bit flip, it will change from 1 to 0, and P1 will be 0. However, no bit flip occurred here, so P1 remains 1. We then add n+1 and analyze again, and so on, until we reach the maximum value of n. Finally, we calculate P1 to P... 16 The sequence is 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1 and 1.
[0022] The deep security backup unit is used to perform deep encryption calculations on the initial backup data to obtain secure backup data; The deep security backup unit is configured with a deep security backup policy, which includes: Set the number R n R n Initially empty; Set R1 to P1, starting with n=2, and determine P. n Is it related to P? n-1 If they are equal, then R will be equal to R. n Set to 1; otherwise, set R. n Set it to 0, increase n by 1 and analyze again until the maximum value of n is reached; Arrange R in ascending order of n n Combine the data to obtain a secure backup. In practical applications, if P1 is 1, then R1 = 1. Taking n = 2 as an example, if P2 is 1 and P1 is 1, then P... n With P n-1 Since they are equal, R2 is set to 1. Then n+1 is added and the analysis is repeated, and so on, until R1 to R... 16 The sequence is 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0 and 1, meaning the secure backup data is 1110110110011001.
[0023] The storage allocation module is used to allocate storage data and security backup data based on the number of data read / write operations and the number of partition read / write operations; the storage allocation module includes a read / write limit analysis unit and a storage allocation unit; The read / write limit analysis unit is used to identify the read / write limit parameters of physical blocks in the storage device based on the number of partition read / write operations; The read / write restriction analysis unit is configured with read / write restriction analysis policies, which include: Obtain the baseline lifetime of the physical block and mark it as KS, and mark the number of partition read and write operations of the physical block as FS; Calculate FS / KS and name the result as the read / write limit parameter; In practical applications, assuming that a physical block supports 10,000 read / write cycles, its baseline lifetime KS is 10,000. The partition read / write cycle FS of physical block β is 720, and the read / write limit parameter of β is calculated to be 0.072. Similarly, the read / write limit parameters of all physical blocks are calculated.
[0024] Storage allocation is performed on stored data and secure backup data based on read / write limit parameters and the number of data read / write operations. The storage allocation unit is configured with a storage allocation policy, which includes: Cluster analysis was performed on the read / write limit parameters and the number of data read / write operations to obtain the limit cluster and the read / write cluster. During the cluster analysis, the cluster parameters were adjusted to ensure that the number of the limit cluster and the read / write cluster were both 3. Calculate the average value of the read / write restriction parameters in the restricted clusters and name it the average parameter. Then, name the three restricted clusters as the first restricted set, the second restricted set, and the third restricted set in ascending order of the average parameter. Calculate the average number of data reads and writes in the read-write cluster, and name it the average number of reads and writes. Then, name the three read-write clusters as the first read-write set, the second read-write set, and the third read-write set, in descending order of the average number of reads and writes. In practical applications, cluster analysis is performed on read / write limit parameters and data read / write frequency to obtain limit clusters and read / write clusters. Adjusting the clustering parameters controls the number of clusters obtained. Ensuring that the number of limit clusters and read / write clusters is 3 is to filter out physical blocks with three levels of health: high, medium, and low. At the same time, it is to filter out storage data with three levels of read / write frequency: high, medium, and low. The smaller the average parameter, the higher the health of the physical blocks in the limit cluster, and vice versa. The smaller the average frequency, the less frequently the storage data in the read / write cluster is accessed, and vice versa. Thus, the first limit set, the second limit set, and the third limit set are obtained, as well as the first read / write set, the second read / write set, and the third read / write set.
[0025] The physical blocks belonging to the first restricted set, the second restricted set, and the third restricted set are named the first restricted block, the second restricted block, and the third restricted block, respectively. The storage data within the first read / write set is stored in the first restricted block, and is stored in the first restricted block in descending order of the number of read / write operations. The first restricted block is allocated in ascending order of the read / write restriction parameters. The storage data in the second read-write set is stored in the second restricted block, and the storage data in the third read-write set and all security backup data are stored in the third restricted block. In practical applications, physical blocks belonging to the first, second, and third restriction sets are named the first restriction block, second restriction block, and third restriction block, respectively. Storage data within the first read / write set is stored in the first restriction block. Assume there are three first restriction blocks: γ1, γ2, and γ3, with the read / write restriction parameters in the order γ1 > γ2 > γ3. Also assume there are three sets of stored data: TX1, TX2, and TX3, with the read / write counts in the order TX1 > TX2 > TX3. Therefore, TX1 is stored in γ3, TX2 in γ2, and TX3 in γ1. Storage data within the second read / write set is stored in the second restriction block. Similarly, storage data within the third read / write set, along with all security backup data, is stored in the third restriction block. The allocation of the second and third restriction blocks follows the same rules as the first restriction blocks: data is stored in the first restriction blocks in descending order of read / write counts, and the allocation of the first restriction blocks is based on the read / write restriction parameters from smallest to largest.
[0026] Example 2, please refer to Figure 3 As shown, this application provides a method for detecting information in a storage device, comprising the following steps: Step S1 involves monitoring the stored data in the storage device, recording the number of data read / write operations, and simultaneously recording the number of partition read / write operations for logical blocks within the storage device. Step S1 includes the following sub-steps: Step S101: When any piece of stored data is first stored in a logical block in the storage device, a data read / write count is generated and set to 1. Whenever the stored data is read or modified, the data read / write count is incremented by one. The data read / write count is associated with the stored data. Step S102: Record the number of times the logical block in the storage device is read and written, named the partition read and write count. The partition read and write count is the sum of all the data read and write counts saved in the history of the logical block. The partition read and write count is associated with the logical block. Step S2 involves generating a verification hash code for the stored data and using this hash code to detect whether the stored data is abnormal. Step S2 includes the following sub-steps: Step S201: Construct a data verification model and calculate the verification hash code by using a hash algorithm on the stored data; Step S202: Set a self-test cycle. Calculate the hash value of the stored data once every self-test cycle and name it the self-test hash code. Step S203: If the self-check hash code and the verification hash code are not equal, mark the stored data as abnormal; otherwise, mark the stored data as normal. Step S204: If there is an anomaly in the stored data, an anomaly report is sent to the user; Step S3: Detect whether the stored data needs to be backed up. If the stored data needs to be backed up, perform a secure backup of the stored data to obtain initial backup data. Then, perform deep encryption calculations on the initial backup data to obtain secure backup data. Step S3 includes the following sub-steps: Step S301: Perform a secure backup of the stored data that needs to be backed up to obtain the initial backup data; Step S301 includes the following sub-steps: Step S3011: Copy the storage data to be backed up and name it "Data to be Backed Up". Obtain the UTF-8 encoding of the binary format corresponding to the data to be backed up and name it "Code to be Backed Up". Number the characters in the code to be backed up from left to right, using the symbol T. n It is represented as follows, where n is a non-zero natural number and n is the index of T; Step S3012: Obtain the device code of the storage device, obtain the corresponding decimal ASCII code of the device code, name it the key code, and number the characters in the key code from left to right, using the symbol D. m Let m be a non-zero natural number and m be the index of D. Let the maximum value of m be marked as M. Step S3013, assuming there exists T0 and T0 is 0, starting with n=1, obtain D. n%M D n%M That is, D is m=n%M m Determine D n%M And T n-1 The parity of D, if D n%M With T n-1 If the parity is the same, then T will be... n Perform bit flipping; otherwise, retain T. n Repeat the process of adding n+1 and analyzing again until the maximum value of n is reached; Step S3014, after the analysis of T... n Relabeled as P n P n This is the initial backup data; Step S302: Perform deep encryption calculations on the initial backup data to obtain secure backup data; Step S302 includes the following sub-steps: Step S3021, set the number R n R n Initially empty; Step S3022: Set R1 to P1, starting with n=2, and determine P. n Is it related to P? n-1 If they are equal, then R will be equal to R. n Set to 1; otherwise, set R. n Set it to 0, increase n by 1 and analyze again until the maximum value of n is reached; Step S3023: Arrange R in ascending order of n. n Combine the data to obtain a secure backup. Step S4 involves allocating storage data and security backup data based on the number of data read / write operations and the number of partition read / write operations. Step S4 includes the following sub-steps: Step S401: Identify the read / write limit parameters of physical blocks in the storage device based on the number of partition read / write operations; Step S401 includes the following sub-steps: Step S4011: Obtain the baseline lifetime of the physical block and mark it as KS; at the same time, mark the number of partition read / write operations of the physical block as FS. Step S4012: Calculate FS / KS and name the calculation result as read / write limit parameter; Step S402: Allocate storage for stored data and security backup data based on read / write limit parameters and the number of data read / write operations; Step S402 includes the following sub-steps: Step S4021: Perform cluster analysis on the read / write limit parameters and the number of data read / write operations respectively to obtain the limit cluster and the read / write cluster. During the cluster analysis, adjust the cluster parameters to ensure that the number of the limit cluster and the read / write cluster are both 3. Step S4022: Calculate the average value of the read and write restriction parameters in the restricted clusters, name it the average parameter, and name the three restricted clusters as the first restricted set, the second restricted set, and the third restricted set in order of the average parameter from smallest to largest. Step S4023: Calculate the average number of data read and write times in the read and write clusters, name it the average number of times, and name the three read and write clusters as the first read and write set, the second read and write set, and the third read and write set in descending order of the average number of times. Step S4024: The physical blocks belonging to the first restriction set, the second restriction set, and the third restriction set are named the first restriction block, the second restriction block, and the third restriction block, respectively. Step S4025: Store the storage data in the first read / write set into the first restricted block, and store the data in the first restricted block in descending order of the number of read / write operations, and allocate the first restricted block in ascending order of the read / write restriction parameters; Step S4026: Store the storage data in the second read / write set in the second restricted block, and store the storage data in the third read / write set and all security backup data in the third restricted block. Example 3, please refer to Figure 4 As shown, Figure 4 A schematic diagram of an electronic device is provided, which may include a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores computer-readable instructions, and the processor can invoke these instructions. When a computer-readable instruction is executed by the processor, steps are performed as described in a storage device information detection method to achieve the following functions: recording the number of data read / write operations for the stored data, and simultaneously recording the number of partition read / write operations for logical blocks in the storage device; generating a verification hash code for the stored data to detect whether the stored data is abnormal; performing a secure backup of the stored data to obtain initial backup data, and then performing deep encryption calculations on the initial backup data to obtain secure backup data; and allocating storage space for the stored data and secure backup data based on the data read / write operations and partition read / write operations.
[0027] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0028] Example 4: This application also provides a computer-readable storage medium. This application provides a storage medium storing a computer program thereon. When the computer program is executed by a processor, it performs the steps of the information detection method for the storage device described above to achieve the following functions: recording the number of data read / write operations of the stored data, and simultaneously recording the number of partition read / write operations of logical blocks in the storage device; generating a verification hash code for the stored data to detect whether the stored data is abnormal; performing a secure backup of the stored data to obtain initial backup data, and then performing deep encryption calculations on the initial backup data to obtain secure backup data; and allocating storage space for the stored data and secure backup data based on the number of data read / write operations and the number of partition read / write operations.
[0029] Based on the above description of the embodiments, the embodiments of the present invention can be provided as methods, systems, or computer program products. Based on this understanding, the above technical solutions, in essence or in terms of their contribution to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or certain parts of the embodiments.
[0030] In the embodiments provided in this application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces. The indirect coupling or communication connection between systems, modules, and units may be electrical, mechanical, or other forms.
[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for detecting information in a storage device, characterized in that, Includes the following steps: Monitor the stored data in the storage device, record the number of data read and write operations, and also record the number of partition read and write operations of logical blocks in the storage device; Generate a verification hash code for the stored data, and use the verification hash code to detect whether the stored data is abnormal; The system detects whether the stored data needs to be backed up. If the stored data needs to be backed up, a secure backup is performed to obtain the initial backup data. Then, deep encryption calculations are performed on the initial backup data to obtain the secure backup data. Storage allocation for both stored data and secure backup data is based on the number of data read / write operations and the number of partition read / write operations.
2. The information detection method for a storage device according to claim 1, characterized in that, Monitoring the stored data in the storage device and recording the number of data reads and writes, as well as the number of partition reads and writes of logical blocks in the storage device, includes the following sub-steps: When any piece of stored data is first stored in a logical block in the storage device, a data read / write count is generated and set to 1. Whenever the stored data is read or modified, the data read / write count is incremented by one. The data read / write count is associated with the stored data. The number of times a logical block in a storage device is read and written is recorded and named the partition read and write count. The partition read and write count is the sum of all data read and write counts saved in the history of the logical block. The partition read and write count is associated with the logical block.
3. The information detection method for a storage device according to claim 2, characterized in that, Generating a verification hash code for the stored data, and detecting whether the stored data is abnormal based on the verification hash code, includes the following sub-steps: A data verification model is constructed, and a verification hash code is obtained by calculating the stored data using a hash algorithm; Set a self-check cycle. Calculate the hash value of the stored data once every self-check cycle, and name it the self-check hash code. If the self-check hash code and the verification hash code are not equal, then the stored data is marked as abnormal; otherwise, the stored data is marked as normal. If there is an anomaly in the stored data, an anomaly report will be sent to the user.
4. The information detection method for a storage device according to claim 3, characterized in that, The process involves detecting whether the stored data needs to be backed up. If so, a secure backup is performed to obtain the initial backup data. Then, deep encryption is applied to the initial backup data to obtain the secure backup data. This process includes the following sub-steps: Perform a secure backup of the stored data that needs to be backed up to obtain the initial backup data; Deep encryption calculations are performed on the initial backup data to obtain secure backup data.
5. The information detection method for a storage device according to claim 4, characterized in that, To securely back up the stored data that needs to be backed up, and obtain the initial backup data, the following sub-steps are involved: Copy the stored data that needs to be backed up and name it "Data to be Backed Up". Obtain the UTF-8 encoding of the binary format of the data to be backed up and name it "Code to be Backed Up". Number the characters in the code to be backed up from left to right, using the symbol T. n It is represented as follows, where n is a non-zero natural number and n is the index of T; Obtain the device code of the storage device, and then obtain the corresponding decimal ASCII code for the device code. Name this code the key code. Number the characters in the key code from left to right, using the symbol D. m Let m be a non-zero natural number and m be the index of D. Let the maximum value of m be marked as M. Assume there exists a T0 and T0 is 0, starting with n=1, obtain D n%M+1 The D n%M+1 That is, D is m=n%M+1 m Determine D n%M+1 And T n-1 The parity of D, if D n%M+1 With T n-1 If the parity is the same, then T will be... n Perform bit flipping; otherwise, retain T. n Repeat the process of adding n+1 and analyzing again until the maximum value of n is reached; After the analysis of T is completed n Relabeled as P n The P n This is the initial backup data.
6. The information detection method for a storage device according to claim 5, characterized in that, Performing deep encryption on the initial backup data to obtain secure backup data includes the following sub-steps: Set the number R n The R n Initially empty; Set R1 to P1, starting with n=2, and determine P. n Is it related to P? n-1 If they are equal, then R will be equal to R. n Set to 1; otherwise, set R. n Set it to 0, increase n by 1 and analyze again until the maximum value of n is reached; Arrange R in ascending order of n n Combine the data to obtain a secure backup.
7. The information detection method for a storage device according to claim 6, characterized in that, Storage allocation for stored data and secure backup data based on data read / write counts and partition read / write counts includes the following sub-steps: Identify read / write limit parameters of physical blocks in storage devices based on the number of partition read / write operations; Storage allocation is performed on stored data and security backup data based on read / write limit parameters and the number of data read / write operations.
8. The information detection method for a storage device according to claim 7, characterized in that, Identifying read / write limit parameters of physical blocks in a storage device based on partition read / write counts includes the following sub-steps: Obtain the baseline lifetime of the physical block and mark it as KS, and mark the number of partition read and write operations of the physical block as FS; Calculate FS / KS and name the result the read / write limit parameter.
9. The information detection method for a storage device according to claim 8, characterized in that, Storage allocation for both stored data and secure backup data based on read / write limit parameters and the number of data read / write operations includes the following sub-steps: Cluster analysis was performed on the read / write limit parameters and the number of data read / write operations to obtain the limit cluster and the read / write cluster. During the cluster analysis, the cluster parameters were adjusted to ensure that the number of the limit cluster and the read / write cluster were both 3. Calculate the average value of the read / write restriction parameters in the restricted clusters and name it the average parameter. Then, name the three restricted clusters as the first restricted set, the second restricted set, and the third restricted set in ascending order of the average parameter. Calculate the average number of data reads and writes in the read-write cluster, and name it the average number of reads and writes. Then, name the three read-write clusters as the first read-write set, the second read-write set, and the third read-write set, in descending order of the average number of reads and writes. The physical blocks belonging to the first restricted set, the second restricted set, and the third restricted set are named the first restricted block, the second restricted block, and the third restricted block, respectively. The storage data within the first read / write set is stored in the first restricted block, and is stored sequentially in the first restricted block in descending order of the number of read / write operations. The first restricted block is allocated in ascending order of the read / write restriction parameters. Storage data within the second read / write set is stored in the second restricted block, while storage data within the third read / write set and all security backup data are stored in the third restricted block.
10. An information detection system for a storage device, used to implement the information detection method for a storage device according to any one of claims 1-9, characterized in that, It includes a read / write monitoring module, a hash verification module, a security backup module, and a storage allocation module; the read / write monitoring module, hash verification module, and security backup module are respectively connected to the storage allocation module. The read / write monitoring module is used to monitor the stored data in the storage device, record the number of data read / write operations, and also record the number of partition read / write operations of logical blocks in the storage device. The hash verification module is used to generate verification hash codes for stored data and to detect whether the stored data is abnormal based on the verification hash codes. The security backup module is used to detect whether the stored data needs to be backed up. If the stored data needs to be backed up, a security backup is performed on the stored data to obtain the initial backup data. Then, deep encryption calculation is performed on the initial backup data to obtain the secure backup data. The storage allocation module is used to allocate storage data and security backup data based on the number of data read / write operations and the number of partition read / write operations.
Citation Information
Patent Citations
Storage device hard disk detecting method and system
CN107729199A