A method and device for processing data based on disk data identification
Patent Information
- Application Number
- CN202310087292.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-08
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2043-02-08
AI Technical Summary
[0008]针对现有技术的通过虚拟内存扩展实际内存的方式,存在实际内存与虚拟内存之间数据置换,造成磁盘磨损,且现有的方式数据置换方式不能避免磁盘磨损,且数据置换的数据量仍然比较大的缺陷,本发明提供一种基于磁盘数据标识的置换数据处理方法及装置,以解决上述技术问题
[0074] The replacement data processing method and apparatus based on disk data identification provided by this invention, when there is insufficient internal space and it is necessary to replace data in memory with data in virtual memory, compares the address identification of the replacement data. For data that already exists on the disk, the data in memory is not written back to the disk, but is directly deleted, thereby speeding up the data replacement speed, increasing the server response speed, improving the reliability of system operation, reducing the number of disk data writes, and increasing the lifespan of the disk.
Smart Images

Figure CN116049039B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of virtual memory data processing technology, specifically relating to a replacement data processing method and apparatus based on disk data identifiers. Background Technology
[0002] Virtual memory refers to using a portion of the disk as virtual memory. By using virtual memory, programs can run even when memory is insufficient. Although virtual memory uses the disk as part of memory, the actual running part of the program must be in memory at any given time. In other words, to implement virtual memory, the contents of physical memory and the contents of virtual memory on the disk must be partially swapped while the program runs simultaneously. Reading virtual memory content from the disk into physical memory is called Page In, and writing content from physical memory into virtual memory on the disk is called Page Out.
[0003] Because Page In and Page Out operations when using virtual memory are often accompanied by slow disk access, the application will become sluggish during this process, and each Page In and Page Out operation will cause disk wear and reduce the lifespan of the disk.
[0004] The invention patent application CN201610696055.X, entitled "A Method for Managing Computer Virtual Memory," confirms the successful construction of virtual memory by monitoring failures, comparing data, and controlling virtual machine memory. After that, it monitors multiple applications running on the computer to identify the usage frequency and duration of these applications. Then, it compares the usage frequency and duration data with standard data pre-set by the computer system and judges the comparison results. Finally, based on the usage, it partitions the application running data in the virtual memory of the solid-state disk into a hidden area and a running area.
[0005] This method of detecting virtual memory refers to detecting whether the virtual memory has been modified. If it has been modified, it checks whether the modified memory size meets the computer's usage requirements. If the memory usage is too high, a warning will be issued. When the application is started, the data stored in the fast execution area is moved out of the fast execution area and saved separately. When the application is closed, the virtual memory is released, and a fake system call is used to restore the code A to its initial storage location.
[0006] However, this method still involves a large amount of Page In and Page Out between physical and virtual memory, resulting in disk wear and tear, and the amount of data swapped between physical and virtual memory remains relatively large.
[0007] This is a shortcoming of the existing technology. Therefore, it is very necessary to provide a replacement data processing method and apparatus based on disk data identification to address the above-mentioned defects in the existing technology. Summary of the Invention
[0008] To address the shortcomings of existing technologies that use virtual memory to expand physical memory, such as data swapping between physical and virtual memory leading to disk wear, the current data swapping methods cannot avoid disk wear, and the amount of swapped data is still relatively large, this invention provides a data swapping processing method and apparatus based on disk data identification to solve the above-mentioned technical problems.
[0009] In a first aspect, the present invention provides a replacement data processing method based on disk data identifiers, comprising the following steps:
[0010] S 1. Detect all data on the disk, assign addresses to the data according to the data size and type, and assign data addresses according to the data weight if the address assignment does not meet the disk data volume requirements;
[0011] S 2. Move data with a weight higher than the threshold from the disk to physical memory;
[0012] S 3. When physical memory space is insufficient, the data to be replaced in physical memory is compared with the data on the disk according to the address identifier. The data to be replaced that exists on the disk is directly deleted from the physical memory, while the data to be replaced that does not exist on the disk is replaced with the virtual memory of the disk according to the address identifier.
[0013] Furthermore, the specific steps of step S1 are as follows:
[0014] S 11. Detect all data on the disk and obtain the size and type of the data;
[0015] S 12. Identify the address of the data according to its size and type. The address identifier includes a size identifier bit and a type identifier bit.
[0016] S 13. Determine whether the address identifier meets the disk data volume requirements;
[0017] If so, proceed to step S16;
[0018] If not, proceed to step S14;
[0019] S 14. Calculate data weights based on data size and data type;
[0020] S 15. Refresh the data weights according to the data replacement frequency, and prioritize the address identification of data with high data weights;
[0021] S 16. Pair the data with the corresponding address identifiers. Generate different address identifiers based on the size and type of the data. When there are many types of data on the disk and it is impossible to identify all the data, a weighted value calculation method can be used to identify the data with larger weight values first. When data is deleted and a free identifier is generated, the free identifier is then used to mark the remaining data.
[0022] Furthermore, the specific steps of step S14 are as follows:
[0023] S 141. Obtain the size and data type of each data item;
[0024] S 142. Calculate the first weight based on the ratio of the amount of data of the same type to the square root of the total number of cached data types;
[0025] S 143. Calculate the second weight based on the ratio of the number of data in a uniform size range to the square root of the total number of data ranges divided by the cached data;
[0026] S 144. Calculate the total weight value based on the sum of the first weight and the second weight.
[0027] Furthermore, the specific steps of step S15 are as follows:
[0028] S 151. Obtain the data swapping frequency between physical memory and virtual memory, and determine whether the weight calculation needs to be refreshed;
[0029] If so, return to step S 141;
[0030] If not, proceed to step S 152;
[0031] S 152. Identify addresses according to data weight from high to low;
[0032] S 153. Determine whether the deletion of address identifier data has been completed;
[0033] If so, proceed to step S154;
[0034] If not, proceed to step S16;
[0035] S 154. Reclaim the address identifiers of deleted data and make the reclaimed address identifiers available for use by unidentified data.
[0036] Furthermore, in step S14, data weights are calculated based on the size and data type of the most frequently used data blocks on the server with the disk model.
[0037] In step S15, the data replacement frequency is set according to the server's memory size. Servers with large memory have a lower data replacement frequency, while servers with small memory have a higher data replacement frequency.
[0038] Furthermore, the specific steps of step S2 are as follows:
[0039] S 21. Sort the data on the disk according to their weights;
[0040] S 22. Place high-weight data into physical memory according to its capacity for fast access. This step uses existing technology to select data to be placed into memory, and will not be described further here.
[0041] Furthermore, the specific steps of step S3 are as follows:
[0042] S 31. Determine whether the physical memory space meets the current operating requirements;
[0043] If so, do not initiate data replacement, and end;
[0044] If not, proceed to step S32;
[0045] S 32. Locate data in physical memory that is not used within a specified time period and designate it as data to be replaced;
[0046] S 33. Determine whether the data to be replaced exists on the disk based on the address identifier;
[0047] If so, proceed to step S34;
[0048] If not, proceed to step S35;
[0049] S 34. Directly delete the data to be replaced from physical memory without writing data to disk, and return to step S1;
[0050] S 35. Obtain the data type of the data to be replaced, create an address identifier for the data to be replaced, and write it into virtual memory;
[0051] S 36. Read the data required for current operation from virtual memory into physical memory and complete the data swapping.
[0052] In a second aspect, the present invention provides a displacement data processing apparatus based on disk data identifiers, comprising:
[0053] The disk data address identification module is used to detect all data on the disk, identify the address of the data according to the data size and type, and identify the data address according to the data weight when the address identification does not meet the disk data volume requirements.
[0054] The data memory placement module is used to place data with a weight higher than a threshold from the disk into physical memory;
[0055] The data replacement module is used to compare the data to be replaced in physical memory with the data on the disk according to the address identifier when physical memory space is insufficient. The data to be replaced that exists on the disk is directly deleted from the physical memory, while the data to be replaced that does not exist on the disk is replaced with the virtual memory of the disk according to the address identifier.
[0056] Furthermore, the disk data address identification module includes:
[0057] The data detection unit is used to detect all data on the disk and obtain the size and type of the data;
[0058] The data address identification unit is used to identify the address of data according to the data size and type. The address identification includes a size identifier bit and a type identifier bit.
[0059] The disk requirement satisfaction judgment unit is used to determine whether the address identifier meets the disk data volume requirement;
[0060] The data weight calculation unit is used to calculate the data weight based on the data size and data type when the address identifier does not meet the disk data volume requirements.
[0061] The data weight refresh unit is used to refresh the data weight according to the data replacement frequency, and to give priority to the address identification of data with high data weight;
[0062] The data splicing unit is used to splice and pair data with the corresponding address identifier when the address identifier meets the disk data volume requirements or when the address identifier does not meet the disk data volume requirements but is identified according to weight.
[0063] Furthermore, the data memory placement module includes:
[0064] A data sorting unit is used to sort data on the disk according to weights.
[0065] The data memory placement unit is used to place high-weight data into physical memory according to the capacity of physical memory for fast reading;
[0066] The data replacement module includes:
[0067] The memory space operation satisfaction judgment unit is used to determine whether the physical memory space meets the current operation requirements;
[0068] The data to be replaced location unit is used to locate data that has not been used within a set time period in physical memory when the physical memory space does not meet the current operating requirements, and use it as data to be replaced.
[0069] The disk existence determination unit for the data to be replaced is used to find out whether the data to be replaced exists on the disk based on the address identifier;
[0070] The data deletion unit is used to directly delete the data to be replaced from the physical memory when the data to be replaced already exists on the disk, without writing data to the disk;
[0071] The data identifier creation unit is used to obtain the data type of the data to be replaced when the data to be replaced does not exist on the disk, and to create an address identifier for the data to be replaced and write it into virtual memory;
[0072] The data replacement unit is used to read the data required for the current operation from virtual memory into physical memory, thus completing the data replacement.
[0073] The beneficial effects of this invention are as follows:
[0074] The replacement data processing method and apparatus based on disk data identification provided by this invention, when there is insufficient internal space and it is necessary to replace data in memory with data in virtual memory, compares the address identification of the replacement data. For data that already exists on the disk, the data in memory is not written back to the disk, but is directly deleted, thereby speeding up the data replacement speed, increasing the server response speed, improving the reliability of system operation, reducing the number of disk data writes, and increasing the lifespan of the disk.
[0075] Furthermore, the design principle of this invention is reliable, the structure is simple, and it has a very wide range of application prospects.
[0076] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description
[0077] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0078] Figure 1 This is a schematic flowchart of Embodiment 1 of the replacement data processing method based on disk data identification of the present invention.
[0079] Figure 2 This is a schematic flowchart of Embodiment 2 of the replacement data processing method based on disk data identification of the present invention.
[0080] Figure 3 This is a schematic diagram of the replacement data processing device based on disk data identification according to the present invention.
[0081] In the diagram, 1-Disk data address identification module; 1.1-Data detection unit; 1.2-Data address identification unit; 1.3-Disk requirement satisfaction judgment unit; 1.4-Data weight calculation unit; 1.5-Data weight refresh unit; 1.6-Data splicing unit; 2-Data memory placement module; 2.1-Data sorting unit; 2.2-Data memory placement unit; 3-Data replacement module; 3.1-Memory space operation satisfaction judgment unit; 3.2-Data to be replaced location unit; 3.3-Data to be replaced disk existence judgment unit; 3.4-Data deletion unit; 3.5-Data identifier creation unit; 3.6-Data replacement unit. Detailed Implementation
[0082] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0083] Example 1:
[0084] like Figure 1 As shown, the present invention provides a replacement data processing method based on disk data identifiers, comprising the following steps:
[0085] S 1. Detect all data on the disk, assign addresses to the data according to the data size and type, and assign data addresses according to the data weight if the address assignment does not meet the disk data volume requirements;
[0086] S 2. Move data with a weight higher than the threshold from the disk to physical memory;
[0087] S 3. When physical memory space is insufficient, the data to be replaced in physical memory is compared with the data on the disk according to the address identifier. The data to be replaced that exists on the disk is directly deleted from the physical memory, while the data to be replaced that does not exist on the disk is replaced with the virtual memory of the disk according to the address identifier.
[0088] Example 2:
[0089] like Figure 2 As shown, the present invention provides a replacement data processing method based on disk data identifiers, comprising the following steps:
[0090] S1. Detect all data on the disk, assign addresses to data based on data size and type, and assign addresses to data based on data weight if the address assignments do not meet the disk data volume requirements; the specific steps of step S1 are as follows:
[0091] S 11. Detect all data on the disk and obtain the size and type of the data;
[0092] S 12. Identify the address of the data according to its size and type. The address identifier includes a size identifier bit and a type identifier bit.
[0093] S 13. Determine whether the address identifier meets the disk data volume requirements;
[0094] If so, proceed to step S16;
[0095] If not, proceed to step S14;
[0096] S 14. Calculate data weights based on data size and data type;
[0097] S 15. Refresh the data weights according to the data replacement frequency, and prioritize the address identification of data with high data weights;
[0098] S 16. Concatenate and pair the data with the corresponding address identifier;
[0099] S2. Place data with a weight higher than the threshold from the disk into physical memory; the specific steps of step S2 are as follows:
[0100] S 21. Sort the data on the disk according to their weights;
[0101] S 22. Place high-weight data into physical memory according to the physical memory capacity for fast access;
[0102] S3. When physical memory space is insufficient, the data to be replaced in physical memory is compared with the data on disk according to the address identifier. The data to be replaced that exists on disk is directly deleted from physical memory, while the data to be replaced that does not exist on disk is replaced with the virtual memory on disk according to the address identifier. The specific steps of step S3 are as follows:
[0103] S 31. Determine whether the physical memory space meets the current operating requirements;
[0104] If so, do not initiate data replacement, and end;
[0105] If not, proceed to step S32;
[0106] S 32. Locate data in physical memory that is not used within a specified time period and designate it as data to be replaced;
[0107] S 33. Determine whether the data to be replaced exists on the disk based on the address identifier;
[0108] If so, proceed to step S34;
[0109] If not, proceed to step S35;
[0110] S 34. Directly delete the data to be replaced from physical memory without writing data to disk, and return to step S1;
[0111] S 35. Obtain the data type of the data to be replaced, create an address identifier for the data to be replaced, and write it into virtual memory;
[0112] S 36. Read the data required for current operation from virtual memory into physical memory and complete the data swapping.
[0113] Example 3:
[0114] like Figure 2 As shown, the present invention provides a replacement data processing method based on disk data identifiers, comprising the following steps:
[0115] S1. Detect all data on the disk, assign addresses to data based on data size and type, and assign addresses to data based on data weight if the address assignments do not meet the disk data volume requirements; the specific steps of step S1 are as follows:
[0116] S 11. Detect all data on the disk and obtain the size and type of the data;
[0117] S 12. Identify the address of the data according to its size and type. The address identifier includes a size identifier bit and a type identifier bit.
[0118] S 13. Determine whether the address identifier meets the disk data volume requirements;
[0119] If so, proceed to step S16;
[0120] If not, proceed to step S14;
[0121] S14. Calculate data weights based on data size and data type; the specific steps of step S14 are as follows:
[0122] S 141. Obtain the size and data type of each data item;
[0123] S 142. Calculate the first weight based on the ratio of the amount of data of the same type to the square root of the total number of cached data types;
[0124] S 143. Calculate the second weight based on the ratio of the number of data in a uniform size range to the square root of the total number of data ranges divided by the cached data;
[0125] S 144. Calculate the total weight value based on the sum of the first weight and the second weight;
[0126] S15. Refresh the data weights according to the data replacement frequency, and prioritize the address identification of data with high data weights; the specific steps of step S15 are as follows:
[0127] S 151. Obtain the data swapping frequency between physical memory and virtual memory, and determine whether the weight calculation needs to be refreshed;
[0128] If so, return to step S 141;
[0129] If not, proceed to step S 152;
[0130] S 152. Identify addresses according to data weight from high to low;
[0131] S 153. Determine whether the deletion of address identifier data has been completed;
[0132] If so, proceed to step S154;
[0133] If not, proceed to step S16;
[0134] S 154. Reclaim the address identifiers of deleted data and make the reclaimed address identifiers available for use by unidentified data;
[0135] S 16. Concatenate and pair the data with the corresponding address identifier;
[0136] S2. Place data with a weight higher than the threshold from the disk into physical memory; the specific steps of step S2 are as follows:
[0137] S 21. Sort the data on the disk according to their weights;
[0138] S 22. Place high-weight data into physical memory according to the physical memory capacity for fast access;
[0139] S3. When physical memory space is insufficient, the data to be replaced in physical memory is compared with the data on disk according to the address identifier. The data to be replaced that exists on disk is directly deleted from physical memory, while the data to be replaced that does not exist on disk is replaced with the virtual memory on disk according to the address identifier. The specific steps of step S3 are as follows:
[0140] S 31. Determine whether the physical memory space meets the current operating requirements;
[0141] If so, do not initiate data replacement, and end;
[0142] If not, proceed to step S32;
[0143] S 32. Locate data in physical memory that is not used within a specified time period and designate it as data to be replaced;
[0144] S 33. Determine whether the data to be replaced exists on the disk based on the address identifier;
[0145] If so, proceed to step S34;
[0146] If not, proceed to step S35;
[0147] S 34. Directly delete the data to be replaced from physical memory without writing data to disk, and return to step S1;
[0148] S 35. Obtain the data type of the data to be replaced, create an address identifier for the data to be replaced, and write it into virtual memory;
[0149] S 36. Read the data required for the current operation from virtual memory into physical memory and complete the data swapping.
[0150] In the above embodiment 3, in step S14, data weight is calculated based on the size and data type of the most frequently used data block of the server with the disk model.
[0151] In step S15, the data replacement frequency is set according to the server's memory size. Servers with large memory have a lower data replacement frequency, while servers with small memory have a higher data replacement frequency.
[0152] In the above embodiment 3, the address identifier uses any number from aa00 to z zFF. Through disk data processing, each segment of disk data is divided into two segments: one is the reserved address identifier position, and the other is the data itself. The data identifier has four bits. The first two bits can be used to distinguish the size of the data content. Based on the total amount of data in the hard disk, aa-z z totals 676 intervals that can be used to divide the data size. The last two bits of the identifier are used to distinguish the data type, which can represent 256 data types from 00 to FF. The four bits of data can provide a total of 173,056 data identifiers.
[0153] When there are many categories of data on the disk, making it impossible to identify all the data, a weighted value calculation method can be used to prioritize the identification of data with higher weight values. When data is deleted and a free space is generated, the remaining data is then marked with a free space identifier. The weight value can be calculated based on the size and data type of the most frequently used data blocks in that server model, and the weight value calculation can be refreshed based on the time when data replacement occurs on the server. For example, it can be set to 6 hours. When a data replacement occurs for the first time, the system records the time point. After 6 hours, the system recalculates the weight value of the hard disk data. For servers with large memory where data replacement occurs only occasionally, this time setting can be extended. For machines with small memory that frequently experience data replacement, this time setting can be shortened, i.e., the data replacement frequency can be changed.
[0154] For servers or computers with limited memory, situations may arise where the physical memory is insufficient to support the operation of a large program or additional programs running when memory usage is high. In such cases, it is necessary to swap temporarily unused data in physical memory with data in virtual memory to free up sufficient memory space. Taking paging-based data swapping as an example, the original data swapping process is as follows: when memory needs space to swap with virtual memory on disk, temporarily unused data in memory is directly swapped to disk, and then the required data is retrieved.
[0155] In this invention, the data comparison step occurs before the data replacement is initiated. For the data to be replaced to the disk, the data is compared with the data address identifier in the disk. If the data already exists on the disk, it is directly deleted from memory without performing the Page Out data writing process. Since the data in physical memory is high-weighted, the hit rate between the data to be replaced to the disk and the data already on the disk is very high. That is, most of the data during data replacement can be directly deleted from physical memory, thereby greatly increasing the speed of the data replacement process, reducing the number of disk data writes, and improving the lifespan of the disk.
[0156] Example 4:
[0157] like Figure 3 As shown, the present invention provides a replacement data processing apparatus based on disk data identifiers, comprising:
[0158] Disk data address identification module 1 is used to detect all data in the disk, identify the address of the data according to the data size and type, and identify the data address according to the data weight when the address identification does not meet the disk data volume requirements.
[0159] Data memory placement module 2 is used to place data with a weight higher than a threshold from the disk into physical memory;
[0160] The data replacement module 3 is used to compare the data to be replaced in physical memory with the data in disk according to the address identifier when physical memory space is insufficient. The data to be replaced that exists in disk is directly deleted in physical memory, while the data to be replaced that does not exist in disk is replaced with the virtual memory of disk according to the address identifier.
[0161] Example 5:
[0162] like Figure 3 As shown, the present invention provides a replacement data processing apparatus based on disk data identifiers, comprising:
[0163] Disk data address identification module 1 is used to detect all data on the disk, identify the address of the data according to its size and type, and identify the data address according to the data weight when the address identification does not meet the disk data volume requirements; disk data address identification module 1 includes:
[0164] Data detection unit 1.1 is used to detect all data on the disk and obtain the size and type of the data;
[0165] The data address identification unit 1.2 is used to identify the address of data according to the data size and type. The address identification includes a size identifier bit and a type identifier bit.
[0166] Disk requirement satisfaction judgment unit 1.3 is used to determine whether the address identifier meets the disk data volume requirement;
[0167] Data weight calculation unit 1.4 is used to calculate data weight based on data size and data type when the address identifier does not meet the disk data volume requirements;
[0168] The data weight refresh unit 1.5 is used to refresh the data weight according to the data replacement frequency, and to give priority to the address identification of data with high data weight;
[0169] The data splicing unit 1.6 is used to splice and pair data with the corresponding address identifier when the address identifier meets the disk data volume requirement or when the address identifier does not meet the disk data volume requirement but is identified according to weight.
[0170] Data memory placement module 2 is used to place data with a weight higher than a threshold from the disk into physical memory; data memory placement module 2 includes:
[0171] Data sorting unit 2.1 is used to sort data on the disk according to weights;
[0172] Data memory placement unit 2.2 is used to place high-weight data into physical memory according to the capacity of physical memory for fast reading;
[0173] Data replacement module 3 is used to compare the data to be replaced in physical memory with the data on the disk according to address identifiers when physical memory space is insufficient. Data to be replaced that exists on the disk is directly deleted from physical memory, while data to be replaced that does not exist on the disk is replaced with data in the disk's virtual memory according to address identifiers. Data replacement module 3 includes:
[0174] The memory space operation satisfaction judgment unit 3.1 is used to determine whether the physical memory space meets the current operation requirements;
[0175] The data to be replaced location unit 3.2 is used to locate data that has not been used within a set time period in the physical memory when the physical memory space does not meet the current operating requirements, and use it as data to be replaced;
[0176] The disk existence determination unit 3.3 for the data to be replaced is used to find out whether the data to be replaced exists on the disk based on the address identifier;
[0177] The data deletion unit 3.4 is used to directly delete the data to be replaced from the physical memory when the data to be replaced already exists on the disk, without writing data to the disk;
[0178] The data identifier creation unit 3.5 is used to obtain the data type of the data to be replaced when the data to be replaced does not exist on the disk, and to create an address identifier for the data to be replaced and write it into virtual memory;
[0179] Data replacement unit 3.6 is used to read the data required for current operation from virtual memory into physical memory to complete the data replacement.
[0180] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention, and such modifications or substitutions should all be within the scope of the invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should also be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.
Claims
1. A method for permutation data processing based on disk data identifiers, characterized in that, Includes the following steps: S1. Detect all data on the disk, assign addresses to the data according to the data size and type, and assign data addresses according to the data weight when the address assignment does not meet the disk data volume requirements. The specific steps of step S1 are as follows: S11. Detect all data on the disk and obtain the size and type of the data; S12. Identify the address of the data according to its size and type; S13. Determine whether the address identifier meets the disk data volume requirements; If so, proceed to step S16; If not, proceed to step S14; S14. Calculate data weights based on data size and data type; S15. Refresh the data weights according to the data replacement frequency, and prioritize the address identification of data with high data weights; S16. Concatenate and pair the data with the corresponding address identifier; S2. Move data with a weight higher than the threshold from the disk into physical memory; S3. When physical memory space is insufficient, the data to be replaced in physical memory is compared with the data on the disk according to the address identifier. The data to be replaced that exists on the disk is directly deleted from the physical memory, while the data to be replaced that does not exist on the disk is replaced with the virtual memory of the disk according to the address identifier.
2. The replacement data processing method based on disk data identifier as described in claim 1, characterized in that, The address identifier in step S12 includes a size identifier bit and a type identifier bit.
3. The replacement data processing method based on disk data identifier as described in claim 2, characterized in that, The specific steps of step S14 are as follows: S141. Obtain the size and data type of each data item; S142. Calculate the first weight based on the ratio of the amount of data of the same type to the square root of the total number of cached data types; S143. Calculate the second weight based on the ratio of the number of data in a uniform size range to the square root of the total number of data ranges divided by the cached data; S144. Calculate the total weight value based on the sum of the first weight and the second weight.
4. The replacement data processing method based on disk data identifier as described in claim 3, characterized in that, The specific steps of step S15 are as follows: S151. Obtain the data swapping frequency between physical memory and virtual memory, and determine whether the weight calculation needs to be refreshed; If so, return to step S141; If not, proceed to step S152; S152. Identify addresses according to data weight from high to low; S153. Determine whether the deletion of address identifier data has been completed; If so, proceed to step S154; If not, proceed to step S16; S154. Reclaim the address identifier of the deleted data and make the reclaimed address identifier available for use by unidentified data.
5. The replacement data processing method based on disk data identifier as described in claim 3, characterized in that, In step S14, data weights are calculated based on the size and data type of the most frequently used data blocks on the server with the disk model. In step S15, the data replacement frequency is set according to the server's memory size. Servers with large memory have a lower data replacement frequency, while servers with small memory have a higher data replacement frequency.
6. The replacement data processing method based on disk data identifier as described in claim 1, characterized in that, The specific steps of step S2 are as follows: S21. Sort the data on the disk according to their weights; S22. Place high-weight data into physical memory according to the physical memory capacity for fast access.
7. The replacement data processing method based on disk data identifier as described in claim 1, characterized in that, The specific steps of step S3 are as follows: S31. Determine whether the physical memory space meets the current operating requirements; If so, do not initiate data replacement, and end; If not, proceed to step S32; S32. Locate data in physical memory that is not used within a specified time period and use it as data to be replaced; S33. Determine whether the data to be replaced exists on the disk based on the address identifier; If so, proceed to step S34; If not, proceed to step S35; S34. Directly delete the data to be replaced from physical memory without writing data to disk, and return to step S1; S35. Obtain the data type of the data to be replaced, create an address identifier for the data to be replaced, and write it into virtual memory; S36. Read the data required for current operation from virtual memory into physical memory and complete the data replacement.
8. A replacement data processing apparatus based on disk data identifiers, characterized in that, include: The disk data address identification module (1) is used to detect all data in the disk, identify the address of the data according to the data size and type, and identify the data address according to the data weight when the address identification does not meet the disk data volume requirements. The disk data address identification module (1) includes: The data detection unit (1.1) is used to detect all data on the disk and obtain the size and type of the data; The data address identification unit (1.2) is used to identify the address of data according to the data size and type; The disk requirement satisfaction judgment unit (1.3) is used to determine whether the address identifier meets the disk data volume requirement; The data weight calculation unit (1.4) is used to calculate the data weight based on the data size and data type when the address identifier does not meet the disk data volume requirements; The data weight refresh unit (1.5) is used to refresh the data weight according to the data replacement frequency, and to give priority to the address identification of data with high data weight; The data splicing unit (1.6) is used to splice and pair the data with the corresponding address identifier when the address identifier meets the disk data volume requirement or when the address identifier does not meet the disk data volume requirement but is identified according to weight. The data memory placement module (2) is used to place data with a weight higher than the threshold from the disk into physical memory; The data replacement module (3) is used to compare the data to be replaced in the physical memory with the data in the disk according to the address identifier when the physical memory space is insufficient. The data to be replaced that exists in the disk is directly deleted in the physical memory, while the data to be replaced that does not exist in the disk is replaced with the virtual memory of the disk according to the address identifier.
9. The replacement data processing apparatus based on disk data identifier as described in claim 8, characterized in that, The address identifier in the data address identifier unit (1.2) includes a size identifier bit and a type identifier bit.
10. The replacement data processing apparatus based on disk data identifier as described in claim 8, characterized in that, The data memory placement module (2) includes: The data sorting unit (2.1) is used to sort the data on the disk according to weights; The data memory placement unit (2.2) is used to place high-weight data into physical memory according to the capacity of physical memory for fast reading; The data replacement module (3) includes: The memory space operation satisfaction judgment unit (3.1) is used to determine whether the physical memory space meets the current operation requirements; The data to be replaced location unit (3.2) is used to locate data that has not been used within a set time period in the physical memory when the physical memory space does not meet the current operating requirements, and use it as data to be replaced; The disk existence determination unit (3.3) for the data to be replaced is used to find out whether the data to be replaced exists on the disk based on the address identifier; The data deletion unit (3.4) is used to directly delete the data to be replaced from the physical memory when the data to be replaced already exists on the disk, without writing data to the disk; The data identifier creation unit (3.5) is used to obtain the data type of the data to be replaced when the data to be replaced does not exist on the disk, and to create an address identifier for the data to be replaced and write it into virtual memory; The data replacement unit (3.6) is used to read the data required for the current operation from the virtual memory into the physical memory to complete the data replacement.
Citation Information
Patent Citations
A method for managing computer virtual memory
CN106339250B
Apparatus, system, and method for caching data on a solid-state storage device
CN102696010A
Virtual memory management method and virtual memory management device for mass data processing
CN104111896A