WO2025181597A1 - 数据处理方法、设备和存储介质 - Google Patents

数据处理方法、设备和存储介质

Info

Publication number
WO2025181597A1
WO2025181597A1 PCT/IB2025/051346 IB2025051346W WO2025181597A1 WO 2025181597 A1 WO2025181597 A1 WO 2025181597A1 IB 2025051346 W IB2025051346 W IB 2025051346W WO 2025181597 A1 WO2025181597 A1 WO 2025181597A1
Authority
WO
WIPO (PCT)
Prior art keywords
access
groups
target
group
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/IB2025/051346
Other languages
English (en)
French (fr)
Inventor
孙世卓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cloud Intelligence Singapore Holding Pvt Ltd
Original Assignee
Cloud Intelligence Singapore Holding Pvt Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Cloud Intelligence Singapore Holding Pvt Ltd filed Critical Cloud Intelligence Singapore Holding Pvt Ltd
Publication of WO2025181597A1 publication Critical patent/WO2025181597A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers

Definitions

  • the present disclosure relates to the field of cloud computing technology, and in particular to a data processing method, device, and storage medium.
  • Block devices are components of cloud virtual machines.
  • a block device has a certain storage capacity (e.g., 50GB, 100GB, etc.) and contains several consecutive logical block addresses (LBAs).
  • LBAs are the smallest storage unit of a block device. Different LBAs of the same block device can be distributed on different physical devices.
  • the block device uses a log-structured method to append data to the LBA in the form of a log.
  • the garbage collection (GC) mechanism is used to perform offline data cleaning, such as deleting invalid data, performing data dumping, etc.
  • the data is usually compressed and written using a compression algorithm with a certain compression ratio.
  • the GC dumps the data in the LBA the data in the LBA is first decompressed and read into the memory, and then the data is re-compressed and stored in the block device using a compression algorithm with another compression ratio.
  • all data are processed using the same compression algorithm.
  • different LBAs may be distributed in physical machines using the same storage medium, which is not conducive to improving the efficiency of subsequent data access and reducing storage costs.
  • the embodiments of the present disclosure provide a data processing method, device, and storage medium for efficiently and accurately identifying hot and cold data corresponding to multiple LBAs in a block device.
  • an embodiment of the present disclosure provides a data processing method, the method comprising: obtaining first access log information of a block device within a first time period, the block device corresponding to a plurality of logical block addresses; determining a target group length according to the first access log information, and performing group processing on the plurality of logical block addresses based on the target group length to obtain a plurality of groups; wherein the logical block addresses in the same group have similar access behaviors; determining access feature values corresponding to each of the plurality of groups; and determining hot and cold data categories corresponding to each of the plurality of groups according to the access feature values corresponding to each of the plurality of groups.
  • an embodiment of the present disclosure provides a data processing device, the device comprising: an acquisition module for acquiring first access log information of a block device within a first time period, the block device corresponding to There are multiple logical block addresses; a grouping module, configured to determine a target group length based on the first access log information, and group the multiple logical block addresses based on the target group length to obtain multiple groups; wherein the logical block addresses within the same group have similar access behaviors; a classification module, configured to determine access feature values corresponding to each of the multiple groups; and determine the hot and cold data categories corresponding to each of the multiple groups based on the access feature values corresponding to each of the multiple groups.
  • an embodiment of the present disclosure provides an electronic device, comprising: a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the data processing method described in the first aspect.
  • an embodiment of the present disclosure provides a non-transitory machine-readable storage medium, on which executable code is stored.
  • the processor can at least implement the data processing method described in the first aspect.
  • an embodiment of the present disclosure provides a computer program product, comprising: a computer program, which, when executed by a processor of an electronic device, enables the processor to at least implement the data processing method described in the first aspect.
  • a block device corresponds to multiple logical block addresses.
  • the multiple logical block addresses are grouped. This allows the hot and cold data categories corresponding to the groups to be determined based on the access characteristics reflected by each group. This is used as the hot and cold data categories corresponding to the logical block addresses contained in the group, eliminating the need to determine the hot and cold data categories of each logical block address one by one.
  • first, first access log information of the block device within a first time period is obtained, and a target group length is determined based on the first access log information.
  • the target group length is used to group the multiple logical block addresses to obtain multiple groups.
  • the logical block addresses within any group have similar access behaviors. That is, the access behaviors corresponding to the logical block addresses within the same group are largely consistent. For example, more than half of the logical block addresses within the same group have been accessed, or more than half of the logical block addresses within the same group have not been accessed. In other words, by determining the target group length, this solution ensures the rational grouping of the multiple logical block addresses contained in the block device.
  • the access characteristic values corresponding to each of the multiple groups are determined.
  • the corresponding hot and cold data categories are determined for each of the multiple groups.
  • the logical block addresses within each group are guaranteed to have similar access behaviors. Therefore, the ultimately determined hot and cold data categories corresponding to each group accurately represent the hot and cold data categories of the logical block addresses contained within the group.
  • different compression algorithms or storage strategies can be used to process the data within the logical block addresses of different hot and cold data categories, thereby improving subsequent data access efficiency and reducing storage costs.
  • Figure 1 is a flow chart of a data processing method provided in an embodiment of the present disclosure
  • Figure 2 is a schematic diagram of a scenario of a data processing method provided in an embodiment of the present disclosure
  • FIG3 is a flow chart of a method for determining a target packet length according to an embodiment of the present disclosure
  • FIG4 is a schematic diagram of an LBA grouping provided in an embodiment of the present disclosure.
  • FIG. 5 is a flow chart of another data processing method provided by an embodiment of the present disclosure.
  • FIG6 is a schematic diagram of a target score ranking result provided by an embodiment of the present disclosure.
  • Figure 7 is a schematic diagram of the structure of a data processing device provided in an embodiment of the present disclosure.
  • FIG8 and FIG7 are schematic diagrams showing the structure of electronic devices corresponding to the data processing device provided in the embodiment.
  • the user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
  • step sequence in the following method embodiments is only an example and not a strict limitation.
  • the data processing method provided in the embodiments of the present disclosure may be executed by an electronic device, which may be a terminal device such as a PC, a laptop, a smart phone, or a server.
  • the server may be a physical server including an independent host, or a virtual server, or a cloud server or server cluster.
  • FIG1 is a flow chart of a data processing method provided in an embodiment of the present disclosure. As shown in FIG1 , the method may include the following steps 101 to 104. [25]101. Obtain the first access log information of the block device within the first time period, where the block device corresponds to multiple logical block addresses.
  • [26] 102 Determine a target group length based on the first access log information, and group multiple logical block addresses based on the target group length to obtain multiple groups; wherein the logical block addresses in the same group have similar access behaviors.
  • [28] 104 Determine the hot and cold data categories corresponding to the multiple groups based on the access feature values corresponding to the multiple groups.
  • the data processing method provided in this embodiment is used to identify the hot and cold data categories of data corresponding to multiple logical block addresses (LBAs) contained in a block device, that is, to determine whether the data stored in each LBA is cold data or hot data.
  • LBAs logical block addresses
  • the hotness or coldness of data is related to the number of times the data is accessed. Frequently accessed data is generally referred to as hot data, and infrequently accessed data is generally referred to as cold data. Access to data includes but is not limited to operations such as reading data and writing data.
  • the hot and cold data categories of data corresponding to an LBA are referred to as the hot and cold data categories of the LBA.
  • the number of LBAs in a block device is related to the capacity of the block device and the size of the LBA.
  • a block device with a capacity of 100G and a size of each LBA of 4kB contains 25*1024*1024 LBAs. It can be seen that a block device may contain tens of millions of different LBAs, which is a huge number. If the hot and cold data categories corresponding to each LBA are determined one by one, the amount of data to be analyzed will be very large, making the analysis difficult and inefficient.
  • the multiple LBAs are first grouped, and then the data access characteristics corresponding to each group are analyzed in units of groups to determine the hot and cold data categories corresponding to the group.
  • the hot and cold data categories are used as the hot and cold data categories corresponding to the LBAs contained in the group. This eliminates the need to determine the hot and cold data categories of each logical block address one by one, thereby improving the efficiency of hot and cold data classification of multiple LBAs.
  • accesses to LBAs such as writing data to an LBA or reading data from an LBA, are recorded in the form of logs, generating corresponding access logs.
  • This embodiment first obtains access log information for a block device before determining the grouping results of multiple LBAs and the data access characteristics reflected by each group. Since different LBAs may be distributed on different physical devices, the access log information for the block device may be obtained from different physical devices.
  • FIG2 is a schematic diagram of a data processing method provided by an embodiment of the present disclosure.
  • access log information of a block device is first obtained.
  • This access log information can be used to group multiple LBAs contained in the block device and determine the access characteristic values corresponding to each of the multiple groups.
  • the access log information within the first time period used for LBA grouping is referred to as the first access log information
  • the access log information within the second time period used for determining the access characteristics reflected by the grouping is referred to as the second access log information.
  • the first access log and the second access log information can be the same or different.
  • the target group length when the multiple LBAs are grouped is determined according to the first access log information, so as to group the multiple LBAs and obtain multiple groups.
  • the group length represents the target group length when the multiple LBAs are grouped.
  • the target group length indicates the group length required to maximize the grouping of LBAs with similar access behavior.
  • LBAs within a group share similar access behavior, meaning that the access behaviors of the LBAs within the group are largely consistent. This includes, but is not limited to: more than half of the LBAs within the group have been accessed, or more than half of the LBAs within the group have not been accessed.
  • the LBAs within the group For example, more than 90% of the LBAs within the group have been accessed, or more than 90% of the LBAs within the group have not been accessed.
  • Users can customize the proportion of LBAs with the same access behavior within a group. When the proportion of LBAs with the same access behavior within a group is greater than or equal to the customized proportion, the LBAs within the group are considered to have similar access behaviors. It is understandable that when LBAs in the same group have similar access behaviors, the hot and cold data categories of the LBAs in the same group are also consistent, that is, the hot and cold data categories are the same. Therefore, by determining the hot and cold data categories corresponding to the group, the hot and cold data categories of the LBAs contained in the group can be determined.
  • the access characteristic values corresponding to the multiple groups obtained by the LBA grouping are determined based on the second access log information obtained.
  • the access characteristic value corresponding to a group refers to the statistical result of the access behavior corresponding to the LBA in the group during the second time period.
  • the hot and cold data categories corresponding to the multiple groups can be further determined. Given the rationality of the LBA grouping, the hot and cold data categories corresponding to the group are also the hot and cold data categories corresponding to the multiple LBAs in the group.
  • the first time period and the second time period may be the same or different, that is, the first access log information and the second access log information may be the same or different.
  • the past 24 hours can be used as the first time period and the second time period, and the access log information within these 24 hours can be obtained as the first day access log information and the second access log information, that is, the first time period is the same as the second time period, and the first access log information is the same as the second access log information.
  • the one hour closest to the current time in the past 24 hours can be used as the first time period, and the access log information within this one hour can be obtained as the first access log information.
  • the grouping speed is fast, which can improve the efficiency of confirming the hot and cold data categories corresponding to the group;
  • the access log information of a longer time period can be combined, for example: the past 7 days (including the past 24 hours) can be used as the second time period, and the access log information within the past 7 days can be obtained as the second access log information.
  • the time lengths corresponding to the first time period and the second time period can be flexibly selected based on the actual hot and cold data classification requirements. For example, when the accuracy requirement for hot and cold data classification is high, the first time period and the second time period with a larger time coverage range can be selected; when the accuracy requirement for hot and cold data classification is low, the first time period and the second time period with a smaller time coverage range can be selected. In this way, based on the first access log information within the first time period and the second access log information within the second time period, it can be determined that multiple groups corresponding to multiple LBAs of a block device correspond to hot and cold data categories in any historical time period.
  • the hot and cold data categories of the same group in different historical time periods may be the same or different.
  • the hot and cold data classification results of the group are related to its access behavior in the corresponding historical time period. For example, if a group is not accessed in the first historical time period, the corresponding hot and cold data is classified as cold data, but is frequently accessed in the second historical time period, the corresponding hot and cold data is classified as hot data.
  • the access log information may contain a variety of information used to describe access behavior.
  • the access log information in order to further improve the efficiency of determining the hot and cold data categories corresponding to multiple groups, after obtaining the access log information, the access log information can optionally be pre-processed by data screening and format conversion. Subsequently, LBA grouping is performed based on the pre-processed access log information, and the access feature values corresponding to the groups are determined.
  • the target access information related to the access frequency can be filtered out from the access log information, and then the target access information can be organized in a preset data format. In this way, when performing LBA grouping and determining the access characteristics corresponding to the grouping, the processed data has a unified data organization format.
  • the target access information includes but is not limited to: access operation type, offset address, access length, access time, etc.; the preset data organization form includes but is not limited to tuples.
  • a corresponding five-tuple can be generated: (operation, offset, length, IO_start_time, IO_end_time).
  • operation represents the operation type, indicating whether it is a write operation or a read operation, etc.
  • offset represents the offset address of the LBA
  • length represents the length of the data address of a certain access.
  • the offset and length are used to determine which of the multiple LBAs of the block device the accessed LBA is;
  • IO_start_time represents the start time of the access behavior, and IO_end_time represents the end time of the access behavior.
  • the access log information can also be converted into a format that is convenient for calculation and saves storage space.
  • the access log information obtained from physical devices is generally in the Protocol Buffers (protobuf) format. It can be converted into a stream format for storage to speed up the parsing of the access log information and reduce the memory usage when parsing the access log information.
  • Protocol Buffers Protobuf
  • the target group length for grouping multiple LBAs of the block device is determined, and the LBAs with similar access behaviors in the multiple LBAs are divided into one group. Then, based on the second access log information of the block device obtained in the second time period, the access characteristic value of each group is determined, and based on the access characteristic values corresponding to each of the multiple groups, the hot and cold data categories corresponding to each group are determined.
  • the hot and cold data categories determined based on the access characteristic values corresponding to the group can be used to represent the hot and cold data categories corresponding to the LBAs in the group, thereby ensuring the accuracy of the hot and cold data categories corresponding to the LBAs finally determined.
  • the hot and cold data of several LBAs can be determined at one time. Compared to determining the hot and cold data categories of LBAs one by one, this method significantly improves the efficiency of determining the hot and cold data categories of multiple LBAs in a block device.
  • results of this embodiment's determination of the hot and cold data categories of different logical block addresses in a block device can be further applied to data processing within the logical block addresses.
  • different compression algorithms or storage strategies can be used to process data within logical block addresses of different hot and cold data categories, thereby improving subsequent data access efficiency and reducing storage costs.
  • FIG3 is a flowchart of a method for determining a target packet length provided in an embodiment of the present disclosure. As shown in FIG3 , the method includes the following steps 301 to 305.
  • [48]30K determines the multiple first groups obtained when the multiple LBAs are grouped with a first group length, and the multiple second groups obtained when the multiple LBAs are grouped with a second group length, where the first group length is smaller than the second group length.
  • [50]303 Determine the number of first groups corresponding to the second access label in the plurality of first groups, and the number of second groups corresponding to the second access label in the plurality of second groups.
  • the first group length and the second group length are updated to determine the first group length that meets the set conditions, wherein the updated first group length is greater than the first group length before the update, and the updated second group length is greater than the second group length before the update.
  • grouping is performed in sequence according to the order of LBA. For example, if the multiple LBAs of the block device are LBA1, LBA2, LBA3, LBAn (n is a positive integer), and the group length is 3, then the multiple groups obtained by grouping the multiple LBAs are (LBA1, LBA2, LBA3), (LBA4, LBA5, LBA6), (LBA (n-2), LBA (n-1), LBAn).
  • a group may only contain LBAs that have not been accessed, or may only contain LBAs that have been accessed, or may contain both LBAs that have not been accessed and LBAs that have been accessed.
  • a first access tag is set for a group containing accessed LBAs
  • a second access tag is set for a group containing LBAs that have not been accessed.
  • the number of packets with the second access tag corresponding to various packet lengths is used as a reference to set a judgment condition for determining whether multiple packets with similar access behaviors are grouped together when LBA grouping is performed with a certain packet length, that is, a setting condition for determining the target packet length.
  • a recursive approach can be adopted to gradually increase the packet length to determine the maximum packet length that meets the set condition as the target packet length.
  • the set condition includes: whether the ratio of the number of second groups corresponding to the second access tag in the plurality of second groups obtained by grouping the plurality of LBA rows with the second group length to the number of first groups corresponding to the second access tag in the plurality of first groups obtained by grouping the plurality of LBA rows with the first group length is less than or equal to a set threshold.
  • the second group length is greater than the first group length, and the set threshold can be pre-set or determined based on historical LBA grouping results.
  • the ratio of the number of second groups to the number of first groups is less than or equal to the set threshold, it is considered that the LBAs in any second group of the plurality of second groups obtained by grouping with the second group length do not have similar access behaviors, and the first group length is determined as the target group length.
  • the ratio of the number of second groups to the number of first groups is greater than the set threshold, it is considered that the LBAs in any second group of the plurality of second groups obtained by grouping with the second group length have similar access behaviors, and thus the first group length and the second group length can be updated to further determine whether there is a group length greater than the second group length that meets the set condition.
  • Determining the set threshold based on historical LBA grouping results includes: obtaining LBA grouping results corresponding to target group lengths determined based on different set thresholds, determining the target set threshold corresponding to the better grouping result, and using the target set threshold as the set threshold used when currently determining the target group length.
  • the quality of the LBA grouping result can be evaluated by the proportion of LBAs with the same access behavior in the same group. For example, in the LBA grouping result, the greater the proportion of LBAs with the same access behavior in the same group, the better the LBA grouping result.
  • the setting condition also includes: whether the packet length is less than or equal to the packet length upper limit, for example: the packet length is less than or equal to 100.
  • the packet length upper limit can be flexibly set according to the actual LBA grouping requirements. In the specific implementation process, when the second packet length is greater than the packet upper limit and the ratio of the second packet number to the first packet number is greater than the set threshold, or when the second packet length is less than or equal to the packet upper limit and the ratio of the second packet number to the first packet number is greater than the set threshold, When the ratio is less than or equal to a set threshold, the first packet length, which is less than or equal to the upper packet limit, is determined as the target packet length.
  • the first and second packet lengths can be updated to further determine whether there is a packet length greater than the second packet length that meets the set conditions.
  • the block device contains 12 LBAs, namely LBA1, LBA2, LBA3, and LBA12. If “1" represents access and "0" represents non-access, the access status of LBA1 to LBA12 can be expressed as "001100110011", that is, LBA3, LBA4, LBA7, LBA8, LBA1E, and LBA12 are accessed LBAs, and LBA1, LBA2, LBA5, LBA6, LBA9, and LBA10 are non-accessed LBAs. The access status of LBA1 to LBA12 is determined based on the first access log information.
  • each group contains two LBAs. Whether the LBAs in each group have similar access behaviors needs to be judged based on the set threshold.
  • k1 can be updated to 2 and k2 can be updated to 3.
  • 6 first groups are obtained: (LBA1, LBA2), (LBA3, LBA4), (LBA5, LBA6), (LBA7, LBA8), (LBA9, LBA10), and (LBA11, LBA12).
  • the above process has determined that in these 6 first groups, the LBAs in each group have similar access behaviors, and the number of first groups with second access labels in the 6 first groups is 3.
  • each group contains three LBAs, and whether the LBAs in each group have similar access behaviors needs to be judged based on the set threshold.
  • the number of LBAs contained in the block device is determined by the capacity of the block device and the size of the LBA; the packet length upper limit and the set threshold can be flexibly set based on the actual packet requirements; when updating the first packet number and the second packet number, different update strategies can be adopted, for example: the updated second packet number can be N times the second packet number before the update, where N is an integer greater than or equal to 1, and this is not limited in this embodiment.
  • the multiple time segments included in the first time period may be first determined. Then, when the multiple LBAs are grouped with the first packet length, the multiple first packets corresponding to the multiple time segments obtained are determined, and when the multiple LBAs are grouped with the second packet length, the multiple second packets corresponding to the multiple time segments obtained are determined. The multiple first packets corresponding to different time segments are the same, and the multiple second packets corresponding to different time segments are the same. Then, the number of first packets corresponding to the second access label in the multiple first packets in each time segment and the number of second packets corresponding to the second access label in the multiple second packets in each time segment are determined.
  • the number of first packets corresponding to the second access label in the multiple first packets is determined based on the number of first packets corresponding to the multiple time segments
  • the number of second packets corresponding to the second access label in the multiple second packets is determined based on the number of second packets corresponding to the multiple time segments.
  • the sum of the numbers of first groups corresponding to multiple time segments can be determined as the number of first groups corresponding to the second access label in the multiple first groups; the sum of the numbers of second groups corresponding to multiple time segments can be determined as the number of second groups corresponding to the second access label in the multiple second groups.
  • FIG4 is a schematic diagram of an LBA grouping provided by an embodiment of the present disclosure.
  • the block device contains nk LBAs
  • the first group length is k
  • the grouping results of nk LBAs grouped with the first group length k are: (LBA1, . . .
  • the three time segments included in the first time period are: time segment 1 (from time t0 to time t1), time segment 2 (from time t1 to time t2), and time segment 3 (from time t3 to time t4).
  • time segment t1 to time segment t2 time segment 3
  • time segment t3 time segment t2 to time segment t3
  • the grouping results are (LBA1, ..., LBAk), (LNA (k+1), LBA2k) (LBA
  • the target packet length is determined from multiple different packet lengths, which ensures that the LBAs contained in each packet have similar access behaviors on the one hand, and on the other hand, ensures the block device After grouping multiple LBAs, the number of groups obtained is kept as small as possible, thereby achieving higher efficiency in identifying hot and cold data categories.
  • FIG5 is a flowchart of another data processing method provided in an embodiment of the present disclosure. As shown in FIG5 , the method at least includes the following steps 501 to 506.
  • [72]501 Obtain the first access log information of the block device within the first time period, where the block device corresponds to multiple logical block addresses.
  • [73]502. Determine a target group length based on the first access log information, and group multiple logical block addresses based on the target group length to obtain multiple groups; wherein the logical block addresses in the same group have similar access behaviors.
  • [76]505. Determine a target score corresponding to a target group based on multiple access feature values corresponding to the target group and extreme cold thresholds corresponding to the multiple access feature values.
  • the target group is any one of the multiple groups, and the extreme cold threshold is the access feature value corresponding to the target group when it has not been visited.
  • steps 501 to 503 can be referred to the aforementioned embodiment and will not be further described in this embodiment.
  • multiple access feature values corresponding to each group are determined from multiple different dimensions, so that the access features corresponding to each group can be more comprehensively reflected, ensuring the accuracy of the hot and cold data categories corresponding to the determined groups.
  • the multiple access characteristic values include a first access characteristic value, which is used to describe the number of accesses of the target group within a certain time period, such as the maximum number of accesses of the target group within a certain time period.
  • step 504 multiple access characteristic values corresponding to each of the multiple groups are determined based on the second access log information, including: determining multiple time segments included in the second time period; determining the number of accesses corresponding to each of the target groups in the multiple time segments based on the second access log information; and determining the statistical value of the number of accesses corresponding to each of the target groups as the first access characteristic value corresponding to the target group.
  • the number of accesses corresponding to the target group is the sum of the number of accesses to the LBAs within the target group. Each time an LBA within the target group is accessed, the number of accesses corresponding to the target group increases by one.
  • the statistical value of the number of accesses corresponding to each of the target groups includes the maximum value of the number of accesses corresponding to each of the target groups in the multiple time segments.
  • the second time period corresponds to a length of 7 days
  • the second time period contains 7*24*60/10 time segments, that is, one time segment corresponds to every 10 minutes
  • the number of visits corresponding to the target group in each time segment of the 7*24*60/10 time segments can be determined based on the second access log information; then, the maximum number of visits corresponding to the 7*24*60/10 time segments can be determined as the number of visits corresponding to the target group.
  • the first access feature value corresponding to the second time period describes the maximum number of visits that may occur within a short period of time in the second time period (i.e., the time length corresponding to the time segment).
  • multiple first time segments with longer corresponding time lengths may be determined first, and then the multiple second time segments included in each first time segment may be determined. Thereafter, based on the number of visits of the target group in each of the multiple second time segments, the first access characteristic value corresponding to the target group in each of the first time segments may be determined. Finally, the first access characteristic value corresponding to the target group in each of the multiple first time segments may be determined as the first access characteristic value corresponding to the target group in the second time period.
  • the second time period contains 7 first time segments, i.e., one first time segment per day, and each first time segment contains 24*60/10 second time segments, i.e., one second time segment per 10 minutes.
  • the number of visits corresponding to the target group in each of the 24*60/10 second time segments contained in the first time segment can be determined based on the second access log information, and the maximum value of the number of visits is used as the first access feature value corresponding to the first time segment.
  • the first access feature values corresponding to each of the 7 first time segments can be determined. Finally, these 7 first access feature values are collectively used as the first access feature value corresponding to the target group in the second time period.
  • the multiple access characteristic values include a second access characteristic value, which is used to describe the continuous access characteristics of the target group within a certain time period. The greater the proportion of the time that the target group is continuously accessed within a certain time period, the more likely it is that the target group is frequently accessed.
  • step 504 based on the second access log information, multiple access feature values corresponding to each of the multiple groups are determined, including: determining multiple time segments included in the second time period; determining the access tag values corresponding to the target group in the multiple time segments based on the second access log information; and determining the second access feature value corresponding to the target group based on the access tag values corresponding to the target group in the multiple time segments.
  • the access tag value corresponding to the target group in the target time segment is a first bit value, such as 1; if the target group has not been accessed within the target time segment, the access tag value corresponding to the target group in the target time segment is a second bit value, such as 0.
  • a bitmap or an access tag value sequence can be formed based on the access tag values corresponding to the target group in multiple time segments to describe the continuous access characteristics of the target group in the second time period and obtain a second access feature value.
  • the second time period contains 7*24*60/10 time segments, that is, one time segment corresponds to every 10 minutes. Then, based on the second access log information, the access tag value corresponding to the target group in each time segment of the 7*24*60/10 time segments can be determined, and an access tag value sequence can be formed.
  • the second access characteristic value corresponding to the target group in the second time period can be determined based on the ratio of the number of 1s in the access tag sequence to the length of the entire access tag sequence.
  • the ratio is greater than a certain threshold, it is determined that the target group was frequently accessed in the second time period; if the ratio is less than or equal to the certain threshold, it is determined that the target group was infrequently accessed in the second time period.
  • multiple first time segments with longer corresponding time lengths may be first determined; then, multiple second time segments included in each first time segment may be determined. Thereafter, based on the second access log information, the access tag values corresponding to the target group in each of the multiple second time segments within each first time segment may be determined as the second access feature values corresponding to the target group in the first time segment. Finally, based on the second access feature values corresponding to the target group in the multiple first time segments, the second access feature value corresponding to the target group in the second time period may be determined.
  • the multiple access characteristic values include a third access characteristic value, which is used to describe the time difference between the time when the target group was last accessed and the current time. The smaller the time difference is, the more likely it is that the target group will be accessed again.
  • step 504 multiple access feature values corresponding to each of the multiple groups are determined based on the second access log information, including: based on the second access log information, determining the time interval between the time when the second target group was last accessed within the second time period and the current time, as the third access feature value corresponding to the second target group.
  • the multiple access characteristic values corresponding to the target group may include one or more of the first access characteristic value, the second access characteristic value, and the third access characteristic value.
  • a target score for determining the hot and cold data categories corresponding to each group is determined based on the multiple access feature values corresponding to each group.
  • the multiple access feature values corresponding to a group when it has never been visited i.e., the extreme cold threshold.
  • the first and second access feature values in the extreme cold threshold are both 0, indicating that the group has never been visited, and the third access feature value is negative infinity.
  • multiple sub-scores corresponding to the target group can be determined based on the characteristic distances between the multiple access feature values corresponding to the target group and the corresponding extreme cold thresholds, wherein the multiple sub-scores correspond to the multiple access feature values; then, the target score corresponding to the target group is determined based on the multiple sub-scores corresponding to the target group.
  • the target score can be determined by summing the multiple sub-scores corresponding to the target group, or by taking the logarithm of the sum of the multiple sub-scores corresponding to the target group.
  • the target score corresponding to the target group can be determined based on the size of the characteristic distance between the multiple access characteristic values corresponding to the target group and the corresponding extreme cold threshold.
  • the size of the target score is set to be proportional to the characteristic distance.
  • the distance between the hot and cold data is positively correlated. Specifically, a smaller feature distance indicates that the target group's corresponding cold and hot data category is more likely to be cold data, and the corresponding target score can be set to a smaller value.
  • a larger feature distance indicates that the target group's corresponding cold and hot data category is more likely to be hot data, and the corresponding target score can be set to a larger value.
  • the target scores corresponding to the plurality of groups are sorted, for example, in descending order or descending order. Then, if there are adjacent target scores in the sorting result whose target score difference is greater than a set score threshold, any one of the adjacent target scores is used as a first classification threshold to determine the hot and cold data categories corresponding to the plurality of groups; if there are no adjacent target scores, the preset second classification threshold is used to determine the hot and cold data categories corresponding to the plurality of groups.
  • FIG6 is a schematic diagram of a target score sorting result provided by an embodiment of the present disclosure.
  • the hot and cold data categories corresponding to the multiple groups can be determined based on the preset second classification threshold. For example: when the score of the target group is greater than a certain classification threshold, its hot and cold data categories are determined to be hot data; when the score of the target group is less than or equal to a certain classification threshold, its hot and cold data categories are determined to be cold data.
  • the cold and hot data categories be classified into two categories, but they can also be further divided into multiple cold and hot data categories such as cold data, warm data, and hot data.
  • the access features corresponding to each group are described from multiple dimensions, thereby ensuring the accuracy of the hot and cold data categories corresponding to the determined groups.
  • a target score corresponding to the target group is determined, and based on the target score, the hot and cold data categories corresponding to the multiple groups are determined.
  • hot and cold data categories include, but are not limited to, cold data and hot data, and, for example, warm and hot data.
  • the hot and cold data categories include, but are not limited to, cold data and hot data, and, for example, warm and hot data.
  • the data processing method provided in this embodiment can be applied to the data dump stage of GC.
  • the data access efficiency is improved and the storage cost is reduced.
  • the data processing method provided in this embodiment can be used to determine the hot and cold data categories of each of the multiple groups corresponding to the multiple LBAs of the block device, and the hot and cold data categories of each of the multiple groups are fed back to the GC in the format of, for example, a data table in a database, so that the GC can perform a corresponding offline data dump operation based on the hot and cold data categories of each of the multiple groups.
  • the hot and cold data categories corresponding to each group are also the hot and cold data categories corresponding to the LBAs contained in each group.
  • the first time period and the second time period match the time period corresponding to the data that the GC needs to perform data dump, for example, the first time period and the second time period include the time period.
  • the GC may determine compression algorithms corresponding to the multiple groups based on the hot and cold data categories corresponding to the multiple groups, wherein the groups corresponding to the cold data use a compression algorithm with a first compression ratio, and the groups corresponding to the hot data use a compression algorithm with a second compression ratio, where the first compression ratio is higher than the second compression ratio. Subsequently, the GC compresses the data written in the multiple groups using the compression algorithms corresponding to the multiple groups, that is, compresses the data written in each LBA.
  • the first compression algorithm with a higher compression ratio is used for the cold data
  • the second compression algorithm with a lower compression ratio is used for the hot data. This ensures that the hot data is quickly decompressed when it is frequently accessed, improves access efficiency, and saves storage space while ensuring the user data access experience.
  • the GC may further determine the storage medium type corresponding to each of the multiple groups based on the cold and hot data categories corresponding to each of the multiple groups, and store the data written in the multiple groups in the corresponding storage medium based on the storage medium type corresponding to each of the multiple groups.
  • the group corresponding to the cold data uses a storage medium with a first access performance
  • the group corresponding to the hot data uses a second storage medium with a second access performance, wherein the second access performance is better than the first access performance.
  • the storage medium includes but is not limited to a solid-state drive, a mechanical hard drive, etc.
  • the descriptive indicators corresponding to the first access performance and the second access performance include but are not limited to the number of read and write requests per second. (Input/Output Per Second, IOPS), access latency, throughput/bandwidth, etc.
  • IOPS Input/Output Per Second
  • Figure 7 is a schematic structural diagram of a data processing device provided in an embodiment of the present disclosure. As shown in Figure 7, the device includes: an acquisition module 11, a grouping module 12, and a classification module 13.
  • An acquisition module 11 is used to obtain first access log information of a block device within a first time period, wherein the block device corresponds to a plurality of logical block addresses.
  • a grouping module 12 configured to determine a target group length based on the first access log information, and to group the plurality of logical block addresses based on the target group length to obtain a plurality of groups; wherein the logical block addresses within the same group have similar access behaviors.
  • a classification module 13 configured to determine access feature values corresponding to each of the plurality of groups; and to determine the hot and cold data categories corresponding to each of the plurality of groups based on the access feature values corresponding to each of the plurality of groups.
  • the acquisition module 11 is also used to obtain second access log information of the block device within a second time period.
  • the classification module 13 is specifically used to determine the access feature values corresponding to each of the multiple groups based on the second access log information.
  • the grouping module 12 is specifically configured to determine a plurality of first groups obtained when the plurality of logical block addresses are grouped with a first group length, and a plurality of second groups obtained when the plurality of logical block addresses are grouped with a second group length, wherein the first group length is less than the second group length; determine access tags corresponding to each of the plurality of first groups and the plurality of second groups based on the first access log information, wherein if a first target group contains accessed logical block addresses, the first target group has a first access tag; if none of the logical block addresses contained in the first target group have been accessed, the first target group has a second access tag, and the first target group is any group among the plurality of first groups and the plurality of second groups; determine the number of first groups corresponding to the second access tag in the plurality of first groups, and the number of second groups corresponding to the second access tag in the plurality of second groups; and determine the first group length to be the target group length if a
  • the grouping module 12 is further specifically configured to update the first group length and the second group length if the ratio of the second group number to the first group number does not satisfy the set condition, so as to determine a first group length that satisfies the set condition; wherein the updated first group length is greater than the first group length before the update, and the updated second group length is greater than the second group length before the update.
  • the grouping module 12 is further configured to determine a plurality of time slices included in the first time period. determining a plurality of first groups corresponding to the plurality of time segments obtained when the plurality of logical block addresses are grouped using a first grouping length, and a plurality of second groups corresponding to the plurality of time segments obtained when the plurality of logical block addresses are grouped using a second grouping length, wherein the plurality of first groups corresponding to different time segments are the same, and the plurality of second groups corresponding to different time segments are the same.
  • the classification module 13 is specifically configured to determine, based on the second access log information, a plurality of access feature values corresponding to each of the plurality of groups; determine, based on the plurality of access feature values corresponding to the second target group and the extremely cold threshold values corresponding to each of the plurality of access feature values, a target score corresponding to the second target group, wherein the second target group is any one of the plurality of groups, and the extremely cold threshold value is the access feature value corresponding to the second target group when it has not been accessed; and determine, based on the target scores corresponding to each of the plurality of groups, the hot and cold data categories corresponding to each of the plurality of groups.
  • the classification module 13 is further specifically configured to determine a plurality of sub-scores corresponding to the second target group based on characteristic distances between the plurality of access characteristic values corresponding to the second target group and the corresponding extreme cold thresholds, wherein the plurality of sub-scores correspond to the plurality of access characteristic values; and determine a target score corresponding to the second target group based on the plurality of sub-scores corresponding to the second target group.
  • the classification module 13 is further specifically used to determine multiple time segments included in the second time period; determine the number of visits corresponding to the second target group in the multiple time segments according to the second access log information; and determine the statistical value of the number of visits corresponding to the second target group as the first access feature value corresponding to the second target group.
  • the classification module 13 is further specifically used to determine multiple time segments included in the second time period; determine the access tag values corresponding to the second target group in the multiple time segments respectively according to the second access log information; wherein, if the second target group has been accessed within the target time segment, the access tag value corresponding to the second target group in the target time segment is a first bit value; if the second target group has not been accessed within the target time segment, the access tag value corresponding to the second target group in the target time segment is a second bit value, and the target time segment is any one of the multiple time segments; determine the second access feature value corresponding to the second target group according to the access tag values corresponding to the second target group in the multiple time segments respectively.
  • the classification module 13 is further specifically used to determine the time interval between the last access time of the second target group within the second time period and the current time based on the second access log information, as the third access feature value corresponding to the second target group.
  • the classification module 13 is further specifically used to determine the sorting results of the target scores corresponding to each of the multiple groups; if there are adjacent target scores whose target score difference is greater than a set score threshold in the sorting results, any one of the adjacent target scores is used as a first classification threshold to determine the hot and cold data categories corresponding to each of the multiple groups; if there are no adjacent target scores, the preset second classification threshold is used to determine the hot and cold data categories corresponding to each of the multiple groups.
  • the device further includes a processing module for determining a compression algorithm corresponding to each of the multiple groups based on the cold and hot data categories corresponding to each of the multiple groups, wherein the group corresponding to the cold data adopts a compression algorithm with a first compression ratio, and the group corresponding to the hot data adopts a compression algorithm with a second compression ratio, and the first compression ratio is higher than the second compression ratio; and compressing the data written in the multiple groups using the compression algorithms corresponding to each of the multiple groups.
  • the processing module is further used to determine the storage medium type corresponding to each of the multiple groups according to the hot and cold data categories corresponding to each of the multiple groups; and store the data written in the multiple groups into the corresponding storage medium according to the storage medium type corresponding to each of the multiple groups.
  • the device shown in FIG7 can execute the steps described in the aforementioned embodiments.
  • the detailed execution process and technical effects can be found in the description of the aforementioned embodiments and will not be repeated here.
  • the structure of the data processing device shown in FIG7 can be implemented as an electronic device, as shown in FIG8 .
  • the electronic device may include: a memory 21, a processor 22, and a communication interface 23.
  • the memory 21 stores executable code.
  • the processor 22 can at least implement the data processing method provided in the above embodiment.
  • an embodiment of the present disclosure provides a non-transitory machine-readable storage medium, on which executable code is stored.
  • the processor can at least implement the data processing method provided in the aforementioned embodiment.
  • An embodiment of the present disclosure provides a computer program product, comprising: a computer program, which, when executed by a processor of an electronic device, enables the processor to execute the data processing method provided in the aforementioned embodiment.
  • each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software.
  • the above technical solution is essentially or the part that contributes to the existing technology can be embodied in the form of a computer product.
  • the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本公开实施例提供一种数据处理方法、设备和存储介质。该方法包括:获取块设备在第一时间段内的第一访问日志信息,块设备对应有多个逻辑块地址;根据第一访问日志信息确定目标分组长度,以基于目标分组长度对多个逻辑块地址进行分组处理,得到多个分组,同一分组内的逻辑块地址具有相似的访问行为;确定多个分组各自对应的访问特征值;根据多个分组各自对应的访问特征值,确定多个分组各自对应的冷热数据类别。

Description

数据处理方法、 设备和存储介质 技术领域
[01]本公开涉及云计算技术领域, 尤其涉及一种数据处理方法、 设备和存储介质。 背景技术
[02]块设备, 即通常所说的云盘, 是构成云虚拟机的组件。 一个块设备具有一定大小的 存储容量(比如: 50GB、 100GB等), 包含有若干个连续的逻辑块地址( Logical Block Address, 简称 LBA) , LB A是块设备最小的存储单元, 同一个块设备的不同的 LBA可 以分布在不同的物理设备上。
[03]块设备在写入数据时, 采用日志结构( log-structured)以日志的形式追加地向 LBA 中写入数据, 之后, 通过垃圾回收(Garbage Collection, 简称 GC)机制进行离线的数 据清理, 比如删除失效数据, 进行数据转储, 等等。 其中, 在数据写入的时候, 通常以 某种压缩率的压缩算法进行数据的压缩写入。在 GC对 LBA中的数据进行数据转储时, 先将 LBA中的数据解压缩读取到内存, 然后采用其他压缩率的压缩算法将数据重新压 缩写入块设备。在上述数据转储的过程中,对所有的数据采用相同的压缩算法进行处理, 而且, 不同 LBA可能分布在采用同一种存储介质的物理机中, 并不利于后续数据访问 效率的提高以及存储成本的降低。 发明内容
[04]本公开实施例提供一种数据处理方法、设备和存储介质,用以对块设备中的多个 LBA 对应的数据进行高效、 准确的冷热数据识别。
[05]第一方面, 本公开实施例提供一种数据处理方法, 所述方法包括: 获取块设备在第一时间段内的第一访问日志信息,所述块设备对应有多个逻辑块地 址; 根据所述第一访问日志信息确定目标分组长度,以基于所述目标分组长度对所述多 个逻辑块地址进行分组处理, 得到多个分组; 其中, 同一分组内的逻辑块地址具有相似 的访问行为; 确定所述多个分组各自对应的访问特征值; 根据所述多个分组各自对应的访问特征值,确定所述多个分组各自对应的冷热数据 类别。
[06]第二方面, 本公开实施例提供一种数据处理装置, 所述装置包括: 获取模块, 用于获取块设备在第一时间段内的第一访问日志信息, 所述块设备对应 有多个逻辑块地址; 分组模块, 用于根据所述第一访问日志信息确定目标分组长度, 以基于所述目标分 组长度对所述多个逻辑块地址进行分组处理, 得到多个分组; 其中, 同一分组内的逻辑 块地址具有相似的访问行为; 分类模块, 用于确定所述多个分组各自对应的访问特征值; 根据所述多个分组各自 对应的访问特征值, 确定所述多个分组各自对应的冷热数据类别。
[07]第三方面, 本公开实施例提供一种电子设备, 包括: 存储器、 处理器、 通信接口; 其中, 所述存储器上存储有可执行代码, 当所述可执行代码被所述处理器执行时, 使所 述处理器至少可以实现如第一方面所述的数据处理方法。
[08]第四方面, 本公开实施例提供了一种非暂时性机器可读存储介质, 所述非暂时性机 器可读存储介质上存储有可执行代码, 当所述可执行代码被电子设备的处理器执行时 , 使所述处理器至少可以实现如第一方面所述的数据处理方法。
[09]第五方面, 本公开实施例提供一种计算机程序产品, 包括: 计算机程序, 当所述计 算机程序被电子设备的处理器执行时,使所述处理器至少可以实现如第一方面所述的数 据处理方法。
[10]本公开实施例提供的方案中, 块设备对应有多个逻辑块地址, 为准确、 高效的确定 多个逻辑块地址分别对应的数据的冷热数据类别(以下简称逻辑块地址对应的冷热数据 类别) , 对多个逻辑块地址进行了分组, 从而可以以分组为单位, 根据每个分组所反映 的访问特征, 确定分组对应的冷热数据类别, 以作为分组包含的逻辑块地址对应的冷热 数据类别, 无需逐个确定每个逻辑块地址的冷热数据类别。 具体实施过程中, 首先, 获 取块设备在第一时间段内的第一访问日志信息,并根据第一访问日志信息确定目标分组 长度。 其中, 目标分组长度用于对多个逻辑块地址进行分组处理, 得到多个分组。 基于 目标分组长度分组得到的多个分组中, 任一分组内的逻辑块地址具有相似的访问行为 , 也即同一分组的逻辑块地址对应的访问行为大部分一致, 比如: 同一分组内的逻辑块地 址中有半数以上的逻辑块地址被访问过, 或者, 同一分组内的逻辑块地址中有半数以上 的逻辑块地址未被访问过等。 也就是说, 本方案通过确定目标分组长度, 保证了块设备 包含的多个逻辑块地址的合理分组。之后,确定多个分组各自对应的访问特征值。最后, 根据多个分组各自对应的访问特征值, 确定多个分组各自对应的冷热数据类别。 鉴于分 组结果的合理性, 保证了每个分组内的逻辑块地址具有相似的访问行为, 从而, 最终确 定的每个分组对应的冷热数据类别, 能够准确的表示分组内包含的逻辑块地址的冷热数 据类别。 基于对块设备中不同逻辑块地址的冷热数据类别的确定, 可以对不同冷热数据 类别的逻辑块地址中的数据采取不同的压缩算法或存储策略进行处理,从而提高后续数 据访问效率, 降低存储成本。 附图说明
[11]为了更清楚地说明本公开实施例中的技术方案, 下面将对实施例描述中所需要使用 的附图作一简单地介绍, 显而易见地, 下面描述中的附图是本公开的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其 他的附图。
[12]图 1为本公开实施例提供的一种数据处理方法的流程图;
[13]图 2为本公开实施例提供的一种数据处理方法的场景示意图;
[14]图 3为本公开实施例提供的一种目标分组长度确定方法的流程图;
[15]图 4为本公开实施例提供的一种 LBA分组的示意图;
[16]图 5为本公开实施例提供的另一种数据处理方法的流程图;
[17]图 6为本公开实施例提供的一种目标分数排序结果的示意图;
[18]图 7本公开实施例提供的一种数据处理装置的结构示意图;
[19]图 8与图 7示实施例提供的数据处理装置对应的电子设备的结构示意图。 具体实施方式
[20]为使本公开实施例的目的、 技术方案和优点更加清楚, 下面将结合本公开实施例中 的附图, 对本公开实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例 是本公开一部分实施例, 而不是全部的实施例。 基于本公开中的实施例, 本领域普通技 术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范 围。
[21]需要说明的是, 本公开实施例中所涉及的用户信息(包括但不限于用户设备信息、 用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等), 均为经用户授权或者经过各方充分授权的信息和数据, 并且相关数据的收集、使用和处 理需要遵守相关国家和地区的相关法律法规和标准, 并提供有相应的操作入口, 供用户 选择授权或者拒绝。
[22]另外, 下述各方法实施例中的步骤时序仅为一种举例, 而非严格限定。
[23]本公开实施例提供的数据处理方法可以由一电子设备来执行, 该电子设备可以是诸 如 PC机、 笔记本电脑、 智能手机等终端设备, 也可以是月艮务器。 该服务器可以是包含 一独立主机的物理服务器, 或者也可以为虚拟服务器, 或者也可以为云端服务器或服务 器集群。
[24]图 1为本公开实施例提供的一种数据处理方法的流程图, 如图 1所示, 可以包括如 下步骤 101至 104。 [25]101、获取块设备在第一时间段内的第一访问日志信息,块设备对应有多个逻辑块地 址。
[26] 102.根据第一访问日志信息确定目标分组长度, 以基于目标分组长度对多个逻辑块 地址进行分组处理, 得到多个分组; 其中, 同一分组内的逻辑块地址具有相似的访问行 为。
[27] 103、 确定多个分组各自对应的访问特征值。
[28] 104、根据多个分组各自对应的访问特征值,确定多个分组各自对应的冷热数据类别。
[29]本实施例提供的数据处理方法,用于对块设备包含的多个逻辑块地址( Logical Block Address, 简称 LBA)分别对应的数据进行冷热数据类别识别, 也即, 确定每个 LBA中 对应存储的数据是冷数据还是热数据等。 其中, 数据的冷热与数据被访问的次数相关, 通常将被频繁访问的数据称为热数据, 将不常被访问的数据称为冷数据。 其中, 对数据 的访问包括但不限于读数据、 写数据等操作。 本实施例中, 为便于表述, 将 LBA对应 的数据的冷热数据类别简称为 LBA的冷热数据类别。
[30]—个块设备中 LBA的数量与块设备的容量和 LBA的大小相关, 例如, 一块容量为 100G的块设备, 每个 LBA的大小为 4kB, 则其包含的 LBA数量为 25*1024*1024。 可 见, 一个块设备中可能包含有千万个不同的 LBA, 数量巨大。 如果逐个确定每个 LBA 对应的冷热数据类别, 则需要分析的数据量将非常大, 分析困难且效率低下。 因此, 本 实施例中, 在确定块设备中多个 LBA对应的冷热数据类别时, 先对多个 LBA进行了分 组, 然后以分组为单位, 分析每个分组对应的数据访问特征, 确定分组对应的冷热数据 类别, 以作为分组包含的 LBA对应的冷热数据类别, 从而无需逐个确定每个逻辑块地 址的冷热数据类别, 提高了多个 LBA冷热数据分类的效率。
[31]实际上, 对 LBA的访问行为, 比如: 向 LBA中写入数据, 或者, 读取 LBA中的数 据等, 均会以日志的形式被记录, 生成对应的访问日志。 本实施例在确定多个 LBA的 分组结果, 以及确定每个分组所反映的数据访问特征之前, 会先获取块设备的访问日志 信息。 其中, 由于不同的 LBA可能分布在不同的物理设备上, 因此, 块设备的访问日 志信息可能是从不同的物理设备上获取的。
[32]为便于理解, 结合图 2进行说明。 图 2为本公开实施例提供的一种数据处理方法的 场景示意图, 如图 2所示, 本实施例中, 先获取了块设备的访问日志信息, 该访问日志 信息可用于对块设备包含的多个 LBA进行分组, 以及确定多个分组各自对应的访问特 征值。 为了便于区分, 将用于 LBA分组的第一时间段内的访问日志信息称为第一访问 日志信息,将用于确定分组所反映的访问特征的第二时间段内的访问日志信息称为第二 访问日志信息。 可选地, 第一访问日志与第二访问日志信息可以相同或不同。
[33]在 LBA分组阶段, 根据第一访问日志信息, 确定多个 LBA进行分组时的目标分组 长度, 以对多个 LBA进行分组, 得到多个分组。 其中, 分组长度表示多个 LBA在进行 分组时每个分组中包含的 LBA数量。 目标分组长度表示能够最大程度上将具有相似访 问行为的 LBA划分为一组时, 对应的分组长度。 其中, 同一分组内的 LBA具有相似访 问行为, 也即同一分组的 LBA对应的访问行为大部分一致, 包括但不限于: 同一分组 内的 LAB中有半数以上的 LAB被访问过, 或者, 同一分组内的 LBA中有半数以上的 LBA 未被访问过等。例如, 同一分组内的 LBA中 90%以上的 LBA均被访问过,或者, 同一分组内的 LBA中 90%以上的 LBA均未被访问过等。其中, 用户可以自定义同一分 组中具有相同访问行为的 LBA占据该分组中所包含的 LBA的比例, 当某一分组中具有 相同访问行为的 LBA大于或等于该自定义比例时,确定该分组内的 LB A具有相似访问 行为。可以理解的是,当同一分组内的 LBA具有相似的访问行为时,同一分组内的 LBA 的冷热数据类别也具有一致性, 即冷热数据类别相同, 从而可以通过确定分组对应的冷 热数据类别, 来确定分组内包含的 LBA的冷热数据类别。
[34]在确认分组所反映的访问特征阶段,根据获取到的第二访问日志信息,确定 LBA分 组得到的多个分组各自对应的访问特征值。 其中, 某个分组对应的访问特征值, 是指在 第二时间段内该分组内的 LBA对应的访问行为的统计结果。 基于多个分组各自对应的 访问特征值, 能够进一步确定多个分组各自对应的冷热数据类别。 鉴于 LB A分组的合 理性, 分组对应的冷热数据类别, 也即分组内多个 LBA对应的冷热数据类别。
[35]具体实施过程中, 可选地, 第一时间段和第二时间段可以相同或不同, 也即第一访 问日志信息与第二访问日志信息可以相同或不同。
[36]例如, 为了确定过去 24小时内, 块设备的多个 LBA对应的多个分组各自对应的冷 热数据类别, 可以将过去 24小时作为第一时间段以及第二时间段, 获取这 24小时内的 访问日志信息作为第一日访问日志信息以及第二访问日志信息, 即第一时间段与第二时 间段相同, 第一访问日志信息与第二访问日志信息相同。
[37]又例如, 为了确定过去 24小时内, 块设备的多个 LBA对应的多个分组各自对应的 冷热数据类别, 可以将过去 24小时内距离当前时间最近的 1个小时作为第一时间段, 获取这 1小时内的访问日志信息作为第一访问日志信息, 由于第一访问日志信息量少从 而分组速度较快, 能够提升确认分组对应的冷热数据类别的效率; 而在分析每个分组的 访问特征时, 为保证访问特征值的准确性, 可以结合更长时间的访问日志信息, 比如: 以过去的 7天(包含过去的 24小时)为第二时间段, 获取过去 7天内的访问日志信息 作为第二访问日志信息。
[38]具体实施过程中, 可以基于实际的冷热数据分类需求, 灵活的选择第一时间段和第 二时间段对应的时间长度, 比如: 当对冷热数据分类的精度要求较高时, 可以选择时间 覆盖范围较大的第一时间段和第二时间段; 当对冷热数据分类的精度要求较低时, 可以 选择时间覆盖范围较小的第一时间段和第二时间段。从而可以基于第一时间段内的第一 访问日志信息和第二时间段内的第二访问日志信息, 确定块设备的多个 LBA对应的多 个分组在任意历史时间段内对应冷热数据类别。 [39]其中, 同一分组在不同的历史时间段内的冷热数据类别可能相同或不同, 分组的冷 热数据分类结果与其在对应历史时间段内的访问行为相关, 比如: 某一分组在第一历史 时间段内未被访问,对应的冷热数据分类为冷数据,而在第二历史时间段内被频繁访问, 对应的冷热数据分类为热数据 O
[40]需要说明的是, 在确定多个分组在某一历史时间段内对应的冷热数据类别时, 第一 时间段和第二时间段和该历史时间段之间存在重叠。
[41]可以理解的是, 访问日志信息(包括第一访问日志信息和第二访问日志信息) 中可 能包含有多种用于描述访问行为的信息。 本实施例中, 为了进一步提升确定多个分组各 自对应的冷热数据类别的效率, 可选地, 可以在获取访问日志信息之后, 对访问日志信 息进行数据筛选以及格式转换等预处理; 之后, 基于预处理之后的访问日志信息进行 LBA 分组以及确定分组对应的访问特征值。
[42]作为一种可选地访问日志信息的预处理方式,针对任一次访问产生的访问日志信息, 可以先从访问日志信息中筛选出与访问频次相关的目标访问信息,然后以预设的数据形 式组织目标访问信息。 从而在进行 LBA分组以及确定分组对应的访问特征时, 处理的 数据具有统一的数据组织形式。
[43]可选地, 目标访问信息包括但不限于: 访问操作类型、 偏移地址、 访问长度、 访问 时间等; 预设的数据组织形式包括但不限于元组。 例如, 针对上述举例的几种目标访问 信息,可以生成其对应的五元组:( operation , offset, length , IO_start_time , IO_end_time)。 其中, operation表示操作类型, 指示了是写操作还是读操作等; offset表示 LBA的偏移 地址, length表示某次访问的数据地址的长度, offset和 length用于确定被访问的 LBA 是块设备的多个 LBA中的哪一个; IO_start_time表示访问行为的开始时间 , IO_end_time 表示访问行为的结束时间。
[44]作为另一种可选地访问日志信息的预处理方式, 还可以在获取访问日志信息后, 对 访问日志信息进行格式转换, 以转换为方便计算、 节省存储空间的格式。 例如, 一般从 物理设备获取的访问日志信息的格式为协议缓冲区 (Protocol Buffers, 简称 protobuf) 格式, 可以将其转换为流的格式进行存储, 以加快对访问日志信息的解析速度并减少解 析访问日志信息时的内存占用。
[45]综上, 本实施例中, 首先, 基于获取到的块设备在第一时间段内的第一访问日志信 息, 确认出了对块设备的多个 LBA进行分组的目标分组长度, 将多个 LBA中具有相似 访问行为的 LBA划分为一组。 之后, 基于获取到的块设备在第二时间段内的第二访问 日志信息, 确认出了每个分组的访问特征值, 并基于多个分组各自对应的访问特征值 , 确定出了各个分组各自对应的冷热数据类别。 由于同一分组内的 LBA具有相似的访问 行为, 从而基于分组对应的访问特征值确定的冷热数据类别, 能够用于表示分组内的 LBA 对应的冷热数据类别, 保证了最终确定的 LBA对应的冷热数据类别的准确性。 另 外, 采用确定分组对应的冷热数据类别的方式, 能够一次性确定数个 LBA的冷热数据 类别, 相较于逐个确定 LBA的冷热数据类别的方式, 能够显著提高确定块设备中多个 LBA 的冷热数据类别的效率。本实施例对块设备中不同逻辑块地址的冷热数据类别的确 定结果, 可进一步地被应用于逻辑块地址中的数据处理过程, 比如: 对不同冷热数据类 别的逻辑块地址中的数据采取不同的压缩算法或存储策略进行处理等,从而提高后续数 据访问效率, 降低存储成本。
[46]以下结合其他实施例对 LB A分组过程, 以及确定分组的访问特征的过程,进行具体 说明。
[47]图 3为本公开实施例提供的一种目标分组长度确定方法的流程图, 如图 3所示, 该 方法包括如下步骤 301至 305。
[48]30K 确定以第一分组长度对多个 LBA进行分组时, 得到的多个第一分组, 以及以 第二分组长度对多个 LBA进行分组时, 得到的多个第二分组, 第一分组长度小于第二 分组长度。
[49]302、根据第一访问日志信息,确定多个第一分组和多个第二分组各自对应的访问标 签, 其中, 若目标分组中包含被访问过的 LBA, 则目标分组具有第一访问标签, 若目标 分组中包含的逻辑块地址均未被访问过, 则目标分组具有第二访问标签, 目标分组为多 个第一分组和多个第二分组中任一分组。
[50]303、确定多个第一分组中对应于第二访问标签的第一分组数量, 以及多个第二分组 中对应于第二访问标签的第二分组数量。
[51]304、若第二分组数量与第一分组数量的比值满足设定条件,则确定第一分组长度为 目标分组长度。
[52]305、若第二分组数量与第一分组数量的比值不满足设定条件, 则更新第一分组长度 和第二分组长度, 以确定出满足设定条件的第一分组长度, 其中, 更新后的第一分组长 度大于更新前的第一分组长度, 更新后的第二分度长度大于更新前的第二分组长度。
[53]在对块设备中的多个 LBA进行分组时,若分组长度较短,则会产生数量较多的分组, 并不利于提高确定多个分组对应的冷热数据类别的效率; 若分组长度较长, 则无法保证 同一分组内的 LBA的访问行为的相似性。 因此, 需要在保证同一分组内的 LBA具有相 似访问行为的情况下,确定出一个最大的分组长度作为目标分组长度,从而在确定 LBA 对应的冷热数据类别时, 以目标分组长度对多个 LBA进行分组。
[54]在具体的 LBA分组过程中, 按照 LBA的顺序进行依次分组, 比如: 若块设备的多 个 LBA分别为: LBA1,LBA2, LB A3, LBAn ( n为正整数), 分组长度为 3, 则对 多个 LBA进行分组得到的多个分组分别为: ( LBA1,LBA2, LBA3 ) , ( LBA4,LBA5, LBA6 ) , ( LBA ( n-2 ) ,LBA ( n-1 ) , LBAn )。 可见, 以某一分组长度对多个 LBA 进行分组得到的多个分组中,一个分组中可能仅包含未被访问过的 LB A ,也可能仅包含 被访问过的 LBA, 还可能既包含未被访问过的 LBA又包含被访问过的 LBA。 本实施例 中, 为包含被访问过的 LBA的分组设置第一访问标签, 为包含的 LBA均未被访问过的 分组设置第二访问标签。
[55]可以理解的是,在分组长度逐渐增大的过程中,每个分组中包含的 LB A数量在逐渐 增多, 从而, 有更大的可能将没有被访问过的 LBA分入其他的包含有被访问过的 LB A 的分组(即具有第一访问标签的分组)中。 当第一访问标签的分组中未被访问过的 LBA 的数量超出了可接受的误差范围时, 则不能再认为同一分组内的 LBA具有相似的访问 行为。 例如, 针对分组数量为 100的分组, 若具有第一访问标签的分组中 100个 LBA 仅有 1个 LBA是未被访问过的, 则可以认为组内的 LBA具有相似的访问行为; 若具有 第一访问标签的分组中 100个 LBA有 5个 LBA是未被访问过的, 则不能认为组内的 LBA 具有相似的访问行为。
[56]本实施例中,以各种分组长度分别对应的具有第二访问标签的分组数量为参考依据, 设置用于确定当以某一分组长度进行 LBA分组时, 得到的多个分组是否将具有相似访 问行为分为一组的判断条件, 也即确定目标分组长度的设定条件。 在确定目标分组长度 时, 可以采用递归的思想, 通过逐渐扩大分组长度的方式, 确定满足设定条件的最大分 组长度作为目标分组长度。
[57]可选地,设定条件包括: 以第二分组长度对多个 LBA行分组得到的多个第二分组中 对应于第二访问标签的第二分组数量, 与以第一分组长度对多个 LBA行分组得到的多 个第一分组中对应于第二访问标签的第一分组数量的比值, 是否小于或等于设定阈值。 其中, 第二分组长度大于第一分组长度, 设定阈值可以预先设定, 也可以基于历史的 LBA 分组结果确定。 当第二分组数量与第一分组数量的比值小于或等于设定阈值时,认 为以第二分组长度进行分组得到的多个第二分组中, 任一第二分组内的 LBA不具有相 似的访问行为, 此时确定第一分组长度为目标分组长度。 当第二分组数量与第一分组数 量的比值大于设定阈值时, 认为以第二分组长度进行分组得到的多个第二分组中, 任一 第二分组内的 LBA具有相似的访问行为, 从而, 可以更新第一分组长度和第二分组长 度, 以进一步地确定是否存在比第二分组长度更大的满足设定条件的分组长度。
[58]其中,基于历史的 LBA分组结果确定设定阈值, 包括: 获取基于不同的设定阈值确 定出的目标分组长度进行 LBA分组时对应的 LBA分组结果,确定其中较佳的分组结果 所对应的目标设定阈值, 以目标设定阈值作为当前确定目标分组长度时所采用的设定阈 值。 可选地, LBA分组结果的优劣可通过同一分组中具有相同访问行为的 LBA所占据 的比例进行评估, 例如, 在 LBA分组结果中, 同一分组中具有相同访问行为的 LBA占 据的比例越大, 则认为该 LBA分组结果越好。
[59]可选地, 设定条件还包括: 分组长度是否小于或等于分组长度上限, 比如: 分组长 度小于或等于 100。其中,分组长度上限可以根据实际的 LBA分组需求灵活设置。具体 实施过程中, 当第二分组长度大于分组上限且第二分组数量与第一分组数量的比值大于 设定阈值, 或者, 第二分组长度小于或等于分组上限且第二分组数量与第一分组数量的 比值小于或等于设定阈值时,确定小于或等于分组上限的第一分组长度为目标分组长度。 当第二分组长度小于或等于分组上限且第二分组数量与第一分组数量的比值大于设定 阈值时, 可以更新第一分组长度和第二分组长度, 以进一步地确定是否存在比第二分组 长度更大的满足设定条件的分组长度。
[60]为便于理解,举例来说,假设分组长度的上限为 10,第一分组长度 kl的初始值为 1, 第二分组长度的初始值为 k2=2, 设定阈值 s =0.05; 块设备包含有 12个 LBA, 分别为 LBA1 , LBA2, LBA3, LBA12, 若用 “1”表示被访问过, “0”表示未被访问过, 则 LBA1 至 LBA12的访问情况可以表示为 “001100110011” 即 LBA3、LBA4、LBA7、LBA8、 LBA1E LBA12 为被访问过的 LBA, LBA1、 LBA2、 LBA5、 LBA6、 LBA9、 LBA10 为未被访问过的 LBA。其中, LBA1至 LBA12的访问情况基于第一访问日志信息确定。
[61]可以理解的是, 当 kl=l时, 得到 12个第一分组, 一个 LBA对应一个分组, 每个分 组内的 LBA一定具有相似的访问行为。当 k2=2时 ,得到 6个第二分组 : ( LBA1, LBA2 )、
( LBA3, LBA4 )、 ( LBA5, LBA6 )、 ( LBA7, LBA8 )、 ( LBA9, LBA10 )和 ( LBA11, LBA12 ) ,每个分组中包含有两个 LBA,每个分组内的 LBA是否具有相似的访问行为, 需要基于设定阈值进行判断。
[62]基于上述对 LBA1至 LBA12的访问情况的假设, 当 kl=l时, 12个第一分组中具有 第二访问标签的第一分组数量为 6; 当 k2=2时, 6个第二分组中具有第二访问标签的第 二分组为 ( LBA1 , LBA2 ) 、 ( LBA5, LBA6 )和 ( LBA9, LBA10 ) , 即 6个第二分 组中具有第二访问标签的第二分组数量为 3个。由于分组长度 1和 2均小于分组上限 10, 且第二分组数量 3与第一分组数量 6的比值 0.5大于设定阈值 s =0.05, 因此, 确定以第 二分组长度 k2=2进行分组时, 6个第二分组内的 LBA具有相似的访问行为, 而这一结 果与上述假设的 LBA访问情况也是一致的。进一步地,可以更新 kl和 k2, 以确定是否 存在比 2更大的满足设定条件的分组长度。
[63]例如,可以将 kl更新为 2,将 k2更新为 3。当 kl=2时,得到 6个第一分组 : ( LBA1, LBA2 )、 ( LBA3, LBA4 )、 ( LBA5, LBA6 )、 ( LBA7, LBA8 )、 ( LBA9, LBA10 ) 和 ( LBA11 , LBA12 ) , 前述过程已经确定了这 6个第一分组中, 每个分组内的 LBA 具有相似的访问行为, 且 6个第一分组中具有第二访问标签的第一分组数量为 3个。 当 k2=3时, 得到 4个第二分组: ( LBA1 , LBA2, LBA3 )、 ( LBA4, LBA5, LBA6 )、
( LBA7, LBA8, LBA9 )和( LBA10, LBA11, LBA12 ) ,每个分组中包含有三个 LBA, 每个分组内的 LBA是否具有相似的访问行为, 需要基于设定阈值进行判断。
[64]基于上述对 LBA1至 LBA12的访问情况的假设, 当 k2=3时, 4个第二分组中具有 第二访问标签的第二分组数量为 0个。 由于分组长度 2和 3均小于分组上限 10,且第二 分组数量 0与第一分组数量 3的比值 0 1、于设定阈值 £ =0.05 , 因此, 确定 k2=3进行分 组得到的 4个第二分组中, 任一第二分组内的 LBA不具有相似的访问行为, 而这一结 果与上述假设的 LBA访问情况也是一致的, 比如 ( LBA1, LBA2, LBA3 )分组中既包 含被访问的 LBA又包含未被访问的 LBA。 因此, 最终, 以第一分组长度 kl=2作为目 标分组长度。
[65]需要说明的是, 上述举例仅是为了示意性说明目标分组长度的确定过程, 具体实施 过程中, 块设备的包含的 LBA的数量由块设备的容量和 LBA的大小确定; 分组长度上 限和设定阈值可以基于实际分组需求灵活设置;在更新第一分组数量和第二分组数量时 , 可以采用不同的更新策略, 比如: 更新后的第二分组数量可以是更新前的第二分组数量 的 N倍, N为大于等于 1的整数, 本实施例中对此不做限制。
[66]在一可选地实施例中, 在确定目标分组长度的过程中, 还可以先确定第一时间段内 包括的多个时间片段。 然后, 在确定以第一分组长度对多个 LBA进行分组时, 得到的 多个时间片段分别对应的多个第一分组,以及以第二分组长度对多个 LBA进行分组时, 得到的多个时间片段分别对应的多个第二分组。 其中, 不同时间片段对应的多个第一分 组相同, 不同时间片段对应的多个第二分组相同。 之后, 确定每个时间片段内多个第一 分组中对应于第二访问标签的第一分组数量, 以及每个时间片段内多个第二分组中对应 于第二访问标签的第二分组数量。 最后, 才艮据多个时间片段分别对应的第一分组数量, 确定多个第一分组中对应于第二访问标签的第一分组数量, 以及根据多个时间片段分别 对应的第二分组数量, 确定多个第二分组中对应于第二访问标签的第二分组数量。
[67]可选地, 可以确定多个时间片段分别对应的第一分组数量之和, 为多个第一分组中 对应于第二访问标签的第一分组数量; 确定多个时间片段分别对应的第二分组数量之和 , 为多个第二分组中对应于第二访问标签的第二分组数量。
[68]为便于理解, 以第一分组数量的确定过程为例, 结合图 4进行举例说明, 图 4为本 公开实施例提供的一种 LBA分组的示意图。 如图 4所示, 假设块设备中包含有 nk个 LBA,第一分组长度为 k, nk个 LBA以第一分组长度 k进行分组的分组结果为: ( LBA1 , . . . , LBAk ) 、 ( LBA ( k+1 ) , LBA2k )、 ...、 ( LBA ( nk-k+1 ) , LBAnk ) ; 第 一时间段内包括的 3个时间片段分别为: 时间片段 1 ( tO时刻至 tl时刻) , 时间片段 2
( tl时刻至 t2时刻), 时间片段 3 ( t2时刻至 t3时刻)。 其中, 在任一个时间片段内, 其分组结果均为 ( LBA1 , …, LBAk ) 、 ( LNA ( k+1 ) , LBA2k ) ( LBA
( nk-k+1 ) , , LBAnk ) 。
[69]如图 4所示,假设在时间片段 1内, 多个第一分组中 ( LBA1 , LBAk )和 ( LNA ( k+1 ) , LBA2k )对应于第二访问标签, 即时间片段 1 内第一分组数量为 2; 在 时间片段 2内, 多个第一分组中 ( LBA1 , ... . LBAk )和( LNA ( 2k+l LBA3k ) 对应于第二访问标签, 即时间片段 2内第一分组数量为 2; 在时间片段 3内, 多个第二 分组中 ( LBA1 , LBAk )对应于第二访问标签, 即时间片段 3内第一分组数量为 1。 基于该假设, 可以确定多个第一分组中对应于第二访问标签的第一分组数量为 2+2+1=5。
[70]本实施例中, 通过设定条件, 从多个不同的分组长度中确定出了目标分组长度, 一 方面保证了每个分组中包含的 LBA具有相似的访问行为, 另一方面, 保证了块设备的 多个 LBA进行分组后得到的分组数量尽量少,从而实现较高的冷热数据类别识别效率。
[71]图 5为本公开实施例提供的另一种数据处理方法的流程图, 如图 5所示, 该方法至 少包括如下步骤 501至 506。
[72]501、获取块设备在第一时间段内的第一访问日志信息,块设备对应有多个逻辑块地 址。
[73]502、根据第一访问日志信息确定目标分组长度, 以基于目标分组长度对多个逻辑块 地址进行分组处理, 得到多个分组; 其中, 同一分组内的逻辑块地址具有相似的访问行 为。
[74]503、 获取块设备在第二时间段内的第二访问日志信息。
[75]504、 根据第二访问日志信息, 确定多个分组各自对应的多种访问特征值。
[76]505、根据目标分组对应的多种访问特征值以及多种访问特征值各自对应的极冷阈值, 确定目标分组对应的目标分数, 目标分组是多个分组中任一个, 极冷阈值是目标分组在 未被访问过的情况下对应的访问特征值。
[77]506、 根据多个分组各自对应的目标分数, 确定多个分组各自对应的冷热数据类别。
[78]其中, 步骤 501至步骤 503的具体实施过程可参考前述实施例, 本实施例中不再进 行赘述。
[79]本实施例中, 根据第二访问日志信息, 从多种不同的维度确定了每个分组对应的多 种访问特征值, 从而能够更为全面的体现每个分组对应的访问特征, 保证了确定的分组 对应的冷热数据类别的准确性。
[80]在一可选实施例中, 多种访问特征值包括第一访问特征值, 第一访问特征值用于描 述目标分组在某一时间段内的访问次数特征, 比如: 某一时间段内的目标分组的最大访 问次数等。
[81]步骤 504中, 根据第二访问日志信息, 确定多个分组各自对应的多种访问特征值, 包括: 确定第二时间段中包含的多个时间片段; 根据第二访问日志信息, 确定多个时间 片段内目标分组分别对应的访问次数;确定目标分组分别对应的访问次数的统计值为目 标分组对应的第一访问特征值。 其中, 目标分组对应的访问次数为目标分组内的 LBA 被访问次数之和,目标分组内的 LBA每被访问一次,目标分组对应的访问次数就加一。 可选地, 目标分组分别对应的访问次数的统计值包括: 多个时间片段内目标分组分别对 应的访问次数的最大值。
[82]为便于理解, 举例来说, 假设第二时间段对应的时间长度为 7天, 第二时间段中包 含的有 7*24*60/10个时间片段, 即每 10分钟对应一个时间片段, 则可以先根据第二访 问日志信息,确定 7*24*60/10个时间片段中每个时间片内目标分组对应的访问次数;然 后,确定 7*24*60/10个时间片段分别对应的访问次数中最大的访问次数,作为目标分组 在第二时间段内对应的第一访问特征值, 第一访问特征值描述了第二时间段中短时间 (即时间片段对应的时间长度内) 内可能出现的最大访问量。
[83]可选地, 在确定第二时间段包含的多个时间片段时, 可以先确定出对应时间长度较 长的多个第一时间片段,然后,确定每个第一时间片段包含的多个第二时间片段。之后, 根据目标分组在多个第二时间片段内分别对应的访问次数,确定目标分组在每个第 —时 间片段内对应的第一访问特征值。 最后, 确定目标分组在多个第一时间片段内分别对应 的第一访问特征值为目标分组在第二时间段对应的第一访问特征值。
[84]举例来说, 假设第二时间段对应的时间长度为 7天, 第二时间段中包含有 7个第一 时间片段, 即每天对应一个第一时间片段,每个第一时间片段内包含有 24*60/10个第二 时间片段, 即每 10分钟对应一个第二时间片段。 针对任一第一时间片段, 可以先根据 第二访问日志信息,确定该第一时间片段包含的 24*60/10个第二时间片段中,每个第二 时间片段内目标分组对应的访问次数,并将访问次数中的最大值作为该第一时间片段对 应的第一访问特征值。 基于前述假设, 可以确定 7个第一时间片段分别对应的第一访问 特征值, 最后, 将这 7个第一访问特征值共同作为目标分组在第二时间段内对应的第一 访问特征值。
[85]在另一可选实施例中, 多种访问特征值包括第二访问特征值, 第二访问特征值用于 描述目标分组在某一时间段内的被持续访问特征, 目标分组在某一时间段内被持续访问 的时间占该时间段的比例越大, 则表明目标分组越有可能被经常访问。
[86]步骤 504中, 根据第二访问日志信息, 确定多个分组各自对应的多种访问特征值, 包括: 确定第二时间段中包含的多个时间片段; 根据第二访问日志信息, 确定目标分组 在多个时间片段上分别对应的访问标记值;根据目标分组在多个时间片段上分别对应的 访问标记值 , 确定目标分组对应的第二访问特征值。
[87]其中, 针对第二时间段中包含的多个时间片段中的任一个目标时间片段, 若目标分 组在目标时间片段内被访问过,则目标分组在目标时间片段上对应的访问标记值为第一 比特值, 比如 1; 若目标分组在目标时间片段内未被访问过, 则目标分组在目标时间片 段上对应的访问标记值为第二比特值, 比如 0。
[88]实际应用中, 根据目标分组在多个时间片段内分别对应的访问标记值, 可以形成位 图或者访问标记值序列等, 以用于描述目标分组在第二时间段内的持续访问特征, 得到 第二访问特征值。
[89]举例来说, 仍假设第二时间段对应的时间长度为 7 天, 第二时间段中包含的有 7*24*60/10个时间片段, 即每 10分钟对应一个时间片段, 则可以先根据第二访问日志 信息,确定 7*24*60/10个时间片段中每个时间片内目标分组对应的访问标记值,并形成 访问标记值序列。 假设访问标记序列为 1110001 10 (其中, 该序列表示: 目标分组 在第 1至 3个时间片段内被访问过, 目标分组在第 4至 6个时间片段内未被访问过, 依 次类推), 则可以根据访问标记序列中 1的个数与整个访问标记序列长度的比值, 确定 目标分组在第二时间段内对应的第二访问特征值。 可选地, 若该比值大于某一阈值, 则 确定目标分组在第二时间段内经常被访问; 若该比值小于或等于某一阈值, 则确定目标 分组在第二时间段内不经常被访问。
[90]另外, 根据访问标记序列或者位图, 还可以确定目标分组在第二时间段内的哪些时 间片段被持续访问, 以及是否具有周期访问的访问特征。
[91]可选地, 在确定第二时间段包含的多个时间片段时, 还可以先确定出对应时间长度 较长的多个第一时间片段; 然后, 确定每个第一时间片段包含的多个第二时间片段。 之 后, 根据第二访问日志信息, 确定每个第一时间片段内, 目标分组在多个第二时间片段 上分别对应的访问标记值, 以作为该第一时间片段内目标分组对应的第二访问特征值。 最后, 根据目标分组在多个第一时间片段内分别对应的第二访问特征值, 确定目标分组 在第二时间段内对应的第二访问特征值。
[92]在又一可选实施例中, 多种访问特征值包括第三访问特征值, 第三访问特征值用于 描述目标分组最后一次被访问的时间与当前时间之间的时间差值, 该时间差值越小, 认 为目标分组越有可能再次被访问。
[93]步骤 504中, 根据第二访问日志信息, 确定多个分组各自对应的多种访问特征值, 包括: 根据第二访问日志信息, 确定第二目标分组在第二时间段内最后一次被访问的时 间与当前时间的时间间隔, 以作为第二目标分组对应的第三访问特征值。
[94]实际应用中,可选地,目标分组对应的多种访问特征值中可以包括第一访问特征值、 第二访问特征值和第三访问特征值中的一个或多个。
[95]在确定多个分组各自对应的多种访问特征值之后, 根据每个分组对应的多种访问特 征值, 确定每个分组对应的用于确定冷热数据类别的目标分数。
[96]在具体实施过程中, 可以先确定一个分组在未被访问过的情况下对应的多个访问特 征值, 即极冷阈值。 然后, 以极冷阈值为基准, 根据目标分组对应的多种访问特征值与 极冷阈值之间的特征距离(比如:欧式距离等) ,确定目标分组对应的目标分数。其中, 极冷阈值中的第一访问特征值和第二访问特征值均为 0, 表示从未被访问过, 第三访问 特征值为负无穷。
[97]作为一种可选的确定目标分数的方式, 可以根据目标分组对应的多种访问特征值分 别与对应的极冷阈值之间的特征距离, 确定目标分组对应的多个子分数 , 其中, 多个子 分数与多种访问特征值 对应; 之后, 根据目标分组对应的多个子分数, 确定目标分 组对应的目标分数。 其中, 可选地, 可以确定目标分组对应的多个子分数的累加结果为 目标分数, 或者, 确定目标分组对应的多个子分数之和的取对数结果为目标分数。
[98]可选地, 可以根据目标分组对应的多种访问特征值与对应的极冷阈值之间的特征距 离的大小, 确定目标分组对应的目标分数的大小。 例如, 设置目标分数的大小与特征距 离的大小呈正相关。 具体地, 特征距离越小, 表明目标分组对应的冷热数据类别越有可 能是冷数据, 可以设置对应的目标分数越小; 特征距离越大, 表明目标分组对应的冷热 数据类别越有可能是热数据, 可以设置对应的目标分数越大。
[99]在确定多个分组各自对应的目标分数之后, 确定多个分组各自对应的目标分数的排 序结果, 比如: 按照从大到小或者从小到大的顺序进行排序。 之后, 若排序结果中存在 目标分数差值大于设定分数阈值的相邻目标分数,则以相邻目标分数中的任一个作为第 一分类阈值, 确定多个分组各自对应的冷热数据类别; 若不存在相邻目标分数, 则以预 设的第二分类阈值, 确定多个分组分别对应的冷热数据类别。
[100]为便于理解, 举例来说, 假设 LBA分组得到了 3个分组, 其中, 分组 1对应的目 标分数为 Scorel=10, 分组 2对应的目标分数为 Score2=ll , 分组 3 对应的目标分数 Score3=20, 分数阈值为 5, 目标分数大小与上述特征距离大小呈正相关。 对 3个分组的 目标分数按照从大到小的顺序进行排序之后, 由于 Score2与 Score3之间的差值大于分 数阈值 5, 因此, 可以将 Score2或者 Score3作为第一分类阈值, 比如: 当以 Score2为 第一分类阈值时,将目标分数小于或等于 Score2的分组 组 1和分组 2对应的冷热数据类别为冷数据,将目标分数大于 Score2的分组确定为一种 冷热数据类别 分组 3对应的冷热数据类别为热数据。
[101]可选地, 如图 6所示, 也可以确定排序后的目标分数对应的曲线, 然后计算曲线上 各个点对应的斜率, 当斜率出现徒增或徒降的时候, 确定斜率发生徒增或徒降的点对应 的目标分数为第一分类阈值。 图 6为本公开实施例提供的一种目标分数排序结果的示意 图。
[102]当排序结果中不存在目标分数差值大于设定分数阈值的相邻目标分数时,可以基于 预设的第二分类阈值, 确定多个分组分别对应的冷热数据类别, 比如: 当目标分组的分 数大于某一分类阈值时, 确定其冷热数据类别为热数据; 当目标分组的分数小于或等于 某一分类阈值时, 确定其冷热数据类别为冷数据。
[103]另外, 通过第一分类阈值、 第二分类阈值和目标分组对应的目标分数, 不仅能够实 现冷热数据类别的二分类, 还可以进一步地分为冷数据、 温热数据、 热数据等多种冷热 数据类别。
[104]本实施例中,通过根据第二访问日志信息,确定多个分组各自对应的多种访问特征 值, 从多个维度描述了每个分组对应的访问特征, 保证了确定的分组对应的冷热数据类 别的准确性。 另夕卜, 根据目标分组对应的多种访问特征值以及多种访问特征值各自对应 的极冷阈值, 确定目标分组对应的目标分数, 并根据目标分数确定多个分组各自对应的 冷热数据类别, 一方面, 保证了分类结果的准确性, 另一方面, 提供了进行多种冷热数 据类别分类的方案, 即可以设置多种不同的冷热数据类别, 并进行对应的冷热数据类别 分类。 其中, 冷热数据类别包括但不限于冷数据和热数据, 比如还有温热数据等。 [105]在实际应用中, 块设备在写入数据时, 采用日志结构( log- structured)以日志的形 式追加地向 LBA中写入数据, 之后, 通过垃圾回收( Garbage Collection, 简称 GC)机 制进行离线的数据清理, 比如删除失效数据, 进行数据转储, 等等。 其中, GC对 LBA 中的数据进行数据转储时, 通常先将 LBA中的数据解压缩读取到内存, 然后采用其他 压缩率的压缩算法将数据重新压缩写入块设备。
[106]实际上,在数据转储过程中,数据重新压缩写入时采用的压缩算法对应的压缩率越 高, 压缩写入的数据所占的存储空间就越小, 但是, 在后续数据读取的时候, 对应需要 解压的时间就越长, 容易造成访问数据时等待时间过长, 影响用户体验; 数据重新压缩 写入时压缩算法对应的压缩率越低,在数据读取的时候,需要解压的时间就越短,但是, 压缩写入的数据所占的存储空间就越大, 不利于降低存储成本。
[107]本实施例提供的数据处理方法, 可以应用于 GC的数据转储阶段, 通过确定块设备 中不同 LBA分别对应数据的冷热数据类别, 并为不同数据冷热类别的数据提供适当压 缩率的压缩算法或者存储介质, 提高数据的访问效率并降低存储成本。
[108]具体地, 当 GC需要对某一时间段内的数据进行数据转储时, 可以通过本实施提供 的数据处理方法, 确定块设备的多个 LB A对应的多个分组各自的冷热数据类别, 并将 多个分组各自的冷热数据类别以例如数据库中的数据表(table) 的格式反馈给 GC, 以 使 GC基于多个分组各自的冷热数据类别进行相应的离线数据转储操作。 其中, 每个分 组对应的冷热数据类别也即每个分组包含的 LBA对应的冷热数据类别。 在确定块设备 的多个 LBA对应的多个分组各自的冷热数据类别时, 第一时间段、 第二时间段与 GC 需要进行数据转储的数据对应的时间段匹配, 比如: 第一时间段和第二时间段包括该时 间段。
[109]在一可选实施例中, GC可以根据多个分组各自对应的冷热数据类别, 确定多个分 组各自对应的压缩算法, 其中, 冷数据对应的分组采用第一压缩率的压缩算法, 热数据 对应的分组采用第二压缩率的压缩算法, 第一压缩率高于第二压缩率; 之后, 以多个分 组各自对应的压缩算法, 对多个分组内写入的数据进行压缩处理, 也即对每个 LBA内 写入的数据进行压缩处理。 由于冷数据对应的访问频率较低, 热数据的访问频率较高, 因此, 对冷数据采用压缩率较高的第一压缩算法, 对热数据采用压缩率较低的第二压缩 算法, 可以保证热数据在被频繁访问时快速解压缩, 提高访问效率, 在保证用户数据访 问体验的情况下, 节省存储空间。
[110]在另一可选实施例中, GC还可以根据多个分组各自对应的冷热数据类别, 确定多 个分组各自对应的存储介质类型, 并根据多个分组各自对应的存储介质类型, 将多个分 组内写入的数据存储到对应的存储介质中。 其中, 冷数据对应的分组采用具有第一访问 性能的存储介质, 热数据对应的分组采用具有第二访问性能的第二存储介质, 其中第二 访问性能优于第一访问性能。 其中, 存储介质包括但不限于固态硬盘、 机械硬盘等。 第 一访 问性能和第二访 问性能对应的描 述指标包括但 不限于每秒钟读 写请求数 ( Input/Output Per Second, 简称 IOPS ) 、 访问延迟、 吞吐率 /带宽等。 本方案中, 通过 对冷数据和热数据采用不同的存储介质进行存储, 能够在保证访问效率的情况下有效降 低存储成本。
[ 111 ]以下将详细描述本公开的一个或多个实施例的数据处理装置。本领域技术人员可以 理解, 这些装置均可使用市售的硬件组件通过本方案所教导的步骤进行配置来构成。
[112]图 7本公开实施例提供的一种数据处理装置的结构示意图,如图 7示,该装置包括: 获取模块 11、 分组模块 12、 分类模块 13。
[113]获取模块 11 , 用于获取块设备在第一时间段内的第一访问日志信息, 所述块设备 对应有多个逻辑块地址。
[114]分组模块 12, 用于根据所述第一访问日志信息确定目标分组长度, 以基于所述目 标分组长度对所述多个逻辑块地址进行分组处理, 得到多个分组; 其中, 同一分组内的 逻辑块地址具有相似的访问行为。
[115]分类模块 13, 用于确定所述多个分组各自对应的访问特征值; 根据所述多个分组 各自对应的访问特征值, 确定所述多个分组各自对应的冷热数据类别。
[116]可选地, 所述获取模块 11 , 还用于获取所述块设备在第二时间段内的第二访问日 志信息。
[117]所述分类模块 13, 具体用于根据所述第二访问日志信息, 确定所述多个分组各自 对应的访问特征值。
[118]可选地, 所述分组模块 12, 具体用于确定以第一分组长度对所述多个逻辑块地址 进行分组时, 得到的多个第一分组, 以及以第二分组长度对所述多个逻辑块地址进行分 组时, 得到的多个第二分组, 所述第一分组长度小于所述第二分组长度; 才艮据所述第一 访问日志信息,确定所述多个第一分组和所述多个第二分组各自对应的访问标签,其中, 若第一目标分组中包含被访问过的逻辑块地址,则所述第一目标分组具有第一访问标签, 若所述第 —目标分组中包含的逻辑块地址均未被访问过,则所述第 —目标分组具有第二 访问标签, 所述第一目标分组为所述多个第一分组和所述多个第二分组中任一分组; 确 定所述多个第一分组中对应于所述第二访问标签的第一分组数量,以及所述多个第二分 组中对应于所述第二访问标签的第二分组数量;若所述第二分组数量与所述第一分组数 量的比值满足设定条件, 则确定所述第一分组长度为所述目标分组长度。
[119]可选地, 所述分组模块 12, 还具体用于若所述第二分组数量与所述第一分组数量 的比值不满足所述设定条件, 则更新所述第一分组长度和所述第二分组长度, 以确定出 满足所述设定条件的第一分组长度; 其中, 更新后的所述第一分组长度大于更新前的所 述第一分组长度, 更新后的所述第二分度长度大于更新前的所述第二分组长度。
[120]可选地, 所述分组模块 12, 还具体用于确定所述第一时间段中包括的多个时间片 段; 确定以第一分组长度对所述多个逻辑块地址进行分组时, 得到的所述多个时间片段 分别对应的多个第一分组, 以及以第二分组长度对所述多个逻辑块地址进行分组时, 得 到的所述多个时间片段分别对应的多个第二分组, 其中, 不同时间片段对应的多个第一 分组相同, 不同时间片段对应的多个第二分组相同。
[121]可选地, 所述分类模块 13 , 具体用于根据所述第二访问日志信息, 确定所述多个 分组各自对应的多种访问特征值;根据第二目标分组对应的所述多种访问特征值以及所 述多种访问特征值各自对应的极冷阈值, 确定所述第二目标分组对应的目标分数, 所述 第二目标分组是所述多个分组中任一个,所述极冷阈值是所述第二目标分组在未被访问 过的情况下对应的访问特征值; 根据所述多个分组各自对应的目标分数, 确定所述多个 分组各自对应的冷热数据类别。
[122]可选地, 所述分类模块 13 , 还具体用于根据所述第二目标分组对应的所述多种访 问特征值分别与对应的极冷阈值之间的特征距离,确定所述第二目标分组对应的多个子 分数, 所述多个子分数与所述多种访问特征值 -对应; 根据所述第二目标分组对应的 多个子分数, 确定所述第二目标分组对应的目标分数。
[123]可选地, 所述分类模块 13 , 还具体用于确定所述第二时间段中包含的多个时间片 段; 根据所述第二访问日志信息, 确定所述多个时间片段内所述第二目标分组分别对应 的访问次数;确定所述第二目标分组分别对应的访问次数的统计值为所述第二目标分组 对应的第一访问特征值。
[124]可选地, 所述分类模块 13 , 还具体用于确定所述第二时间段中包含的多个时间片 段; 方艮据所述第二访问日志信息, 确定所述第二目标分组在所述多个时间片段上分别对 应的访问标记值; 其中, 若所述第二目标分组在目标时间片段内被访问过, 则所述第二 目标分组在所述目标时间片段上对应的访问标记值为第一比特值,若所述第二目标分组 在目标时间片段内未被访问过,则所述第二目标分组在所述目标时间片段上对应的访问 标记值为第二比特值, 所述目标时间片段为所述多个时间片段中的任一个; 根据所述第 二目标分组在所述多个时间片段上分别对应的访问标记值,确定所述第二目标分组对应 的第二访问特征值。
[125]可选地, 所述分类模块 13 , 还具体用于根据所述第二访问日志信息, 确定所述第 二目标分组在所述第二时间段内最后一次被访问的时间与当前时间的时间间隔,以作为 所述第二目标分组对应的第三访问特征值。
[126]可选地, 所述分类模块 13 , 还具体用于确定所述多个分组各自对应的目标分数的 排序结果; 若所述排序结果中存在目标分数差值大于设定分数阈值的相邻目标分数, 则 以所述相邻目标分数中的任一个作为第一分类阈值,确定所述多个分组各自对应的冷热 数据类别; 若不存在所述相邻目标分数, 则以预设的第二分类阈值, 确定所述多个分组 分别对应的冷热数据类别。 [127]可选地,所述装置还包括处理模块,用于根据所述多个分组各自对应的冷热数据类 别, 确定所述多个分组各自对应的压缩算法, 其中, 冷数据对应的分组采用第一压缩率 的压缩算法, 热数据对应的分组采用第二压缩率的压缩算法, 所述第一压缩率高于所述 第二压缩率; 以所述多个分组各自对应的压缩算法, 对所述多个分组内写入的数据进行 压缩处理。
[128]可选地, 所述处理模块, 还用于根据所述多个分组各自对应的冷热数据类别, 确定 所述多个分组各自对应的存储介质类型; 根据所述多个分组各自对应的存储介质类型, 将所述多个分组内写入的数据存储到对应的存储介质中。
[129]图 7示装置可以执行前述实施例中介绍的步骤,详细的执行过程和技术效果参见前 述实施例中的描述, 在此不再赘述。
[130]在一个可能的设计中,上述图 7示数据处理装置的结构可实现为一电子设备,如图 8示, 该电子设备可以包括: 存储器 21、 处理器 22、 通信接口 23。 其中, 存储器 21上 存储有可执行代码, 当所述可执行代码被处理器 22执行时, 使处理器 22至少可以实现 如前述实施例中提供的数据处理方法。
[131]另外,本公开实施例提供了一种非暂时性机器可读存储介质,所述非暂时性机器可 读存储介质上存储有可执行代码, 当所述可执行代码被电子设备的处理器执行时, 使所 述处理器至少可以实现如前述实施例中提供的数据处理方法。
[132]本公开实施例提供了一种计算机程序产品, 包括: 计算机程序, 当所述计算机程序 被电子设备的处理器执行时, 使所述处理器执行如前述实施例中提供的数据处理方法。
[133]以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以 是或者也可以不是物理上分开的。可以根据实际的需要选择其中的部分或者全部模块来 实现本实施例方案的目的。 本领域普通技术人员在不付出创造性的劳动的情况下, 即可 以理解并实施。
[134]通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借 助加必需的通用硬件平台的方式来实现, 当然也可以通过硬件和软件结合的方式来实现 基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以计算机 产品的形式体现出来,本公开可采用在一个或多个其中包含有计算机可用程序代码的计 算机可用存储介质(包括但不限于磁盘存储器、 CD-ROM. 光学存储器等)上实施的计 算机程序产品的形式。
[135]最后应说明的是: 以上实施例仅用以说明本公开的技术方案, 而非对其限制; 尽管 参照前述实施例对本公开进行了详细的说明, 本领域的普通技术人员应当理解: 其依然 可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替 换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本公开各实施例技术方案的 精神和范围。

Claims

权利要求书
1、 一种数据处理方法, 其中, 包括: 获取块设备在第一时间段内的第一访问日志信息,所述块设备对应有多个逻辑块地 址; 根据所述第一访问日志信息确定目标分组长度,以基于所述目标分组长度对所述多 个逻辑块地址进行分组处理, 得到多个分组; 其中, 同一分组内的逻辑块地址具有相似 的访问行为; 确定所述多个分组各自对应的访问特征值; 根据所述多个分组各自对应的访问特征值,确定所述多个分组各自对应的冷热数据 类别。
2、 根据权利要求 1所述的方法, 其中, 所述确定所述多个分组各自对应的访问特 征值, 包括: 获取所述块设备在第二时间段内的第二访问日志信息; 根据所述第二访问日志信息, 确定所述多个分组各自对应的访问特征值。
3、 根据权利要求 1所述的方法, 其中, 所述根据所述第一访问日志信息确定目标 分组长度, 包括: 确定以第一分组长度对所述多个逻辑块地址进行分组时, 得到的多个第一分组, 以 及以第二分组长度对所述多个逻辑块地址进行分组时, 得到的多个第二分组, 所述第一 分组长度小于所述第二分组长度; 根据所述第一访问日志信息,确定所述多个第一分组和所述多个第二分组各自对应 的访问标签, 其中, 若第一目标分组中包含被访问过的逻辑块地址, 则所述第一目标分 组具有第一访问标签, 若所述第一目标分组中包含的逻辑块地址均未被访问过, 则所述 第一目标分组具有第二访问标签,所述第一目标分组为所述多个第一分组和所述多个第 二分组中任一分组; 确定所述多个第一分组中对应于所述第二访问标签的第一分组数量, 以及所述多个 第二分组中对应于所述第二访 I可标签的第二分组数量; 若所述第二分组数量与所述第一分组数量的比值满足设定条件,则确定所述第一分 组长度为所述目标分组长度。
4、 根据权利要求 3所述的方法, 其中, 所述方法还包括: 若所述第二分组数量与所述第一分组数量的比值不满足所述设定条件,则更新所述 第一分组长度和所述第二分组长度,以确定出满足所述设定条件的第一分组长度;其中, 更新后的所述第一分组长度大于更新前的所述第一分组长度,更新后的所述第二分度长 度大于更新前的所述第二分组长度。
5、 根据权利要求 3所述的方法, 其中, 所述确定以第一分组长度对所述多个逻辑 块地址进行分组时, 得到的多个第一分组, 以及以第二分组长度对所述多个逻辑块地址 进行分组时, 得到的多个第二分组, 包括: 确定所述第一时间段中包括的多个时间片段; 确定以第一分组长度对所述多个逻辑块地址进行分组时,得到的所述多个时间片段 分别对应的多个第一分组, 以及以第二分组长度对所述多个逻辑块地址进行分组时, 得 到的所述多个时间片段分别对应的多个第二分组, 其中, 不同时间片段对应的多个第一 分组相同, 不同时间片段对应的多个第二分组相同。
6、 根据权利要求 2所述的方法, 其中, 所述根据所述第二访问日志信息, 确定所 述多个分组各自对应的访问特征值, 包括: 根据所述第二访问日志信息, 确定所述多个分组各自对应的多种访问特征值; 所述根据所述多个分组各自对应的访问特征值,确定所述多个分组各自对应的冷热 数据类别, 包括: 根据第二目标分组对应的所述多种访问特征值以及所述多种访问特征值各自对应 的极冷阈值, 确定所述第二目标分组对应的目标分数, 所述第二目标分组是所述多个分 组中任一个,所述极冷阈值是所述第二目标分组在未被访问过的情况下对应的访问特征 值; 根据所述多个分组各自对应的目标分数,确定所述多个分组各自对应的冷热数据类 别。
7、 根据权利要求 6所述的方法, 其中, 所述根据第二目标分组对应的所述多种访 问特征值以及所述多种访问特征值各自对应的极冷阈值,确定所述第二目标分组对应的 目标分数, 包括: 根据所述第二目标分组对应的所述多种访问特征值分别与对应的极冷阈值之间的 特征距离, 确定所述第二目标分组对应的多个子分数, 所述多个子分数与所述多种访问 特征值 — 对应; 根据所述第二目标分组对应的多个子分数,确定所述第二目标分组对应的目标分数。
8、 根据权利要求 6所述的方法, 其中, 所述根据所述第二访问日志信息, 确定所 述多个分组各自对应的多种访问特征值, 包括: 确定所述第二时间段中包含的多个时间片段; 根据所述第二访问日志信息,确定所述多个时间片段内所述第二目标分组分别对应 的访问次数; 确定所述第二目标分组分别对应的访问次数的统计值为所述第二目标分组对应的 第一访问特征值。
9、 根据权利要求 6所述的方法, 其中, 所述根据所述第二访问日志信息, 确定所 述多个分组各自对应的多种访问特征值, 包括: 确定所述第二时间段中包含的多个时间片段; 根据所述第二访问日志信息,确定所述第二目标分组在所述多个时间片段上分别对 应的访问标记值; 其中, 若所述第二目标分组在目标时间片段内被访问过, 则所述第二 目标分组在所述目标时间片段上对应的访问标记值为第一比特值,若所述第二目标分组 在目标时间片段内未被访问过,则所述第二目标分组在所述目标时间片段上对应的访问 标记值为第二比特值, 所述目标时间片段为所述多个时间片段中的任一个; 根据所述第二目标分组在所述多个时间片段上分别对应的访问标记值,确定所述第 二目标分组对应的第二访问特征值。
10、 根据权利要求 6所述的方法, 其中, 所述根据所述第二访问日志信息, 确定所 述多个分组各自对应的多种访问特征值, 包括: 根据所述第二访问日志信息,确定所述第二目标分组在所述第二时间段内最后一次 被访问的时间与当前时间的时间间隔, 以作为所述第二目标分组对应的第三访问特征值。
11、 根据权利要求 6所述的方法, 其中, 所述根据所述多个分组各自对应的目标分 数, 确定所述多个分组各自对应的冷热数据类别, 包括: 确定所述多个分组各自对应的目标分数的排序结果; 若所述排序结果中存在目标分数差值大于设定分数阈值的相邻目标分数,则以所述 相邻目标分数中的任一个作为第一分类阈值,确定所述多个分组各自对应的冷热数据类 别; 若不存在所述相邻目标分数, 则以预设的第二分类阈值, 确定所述多个分组分别对 应的冷热数据类别。
12、 根据权利要求 1至 11中任一项所述的方法, 其中, 所述方法还包括: 根据所述多个分组各自对应的冷热数据类别,确定所述多个分组各自对应的压缩算 法, 其中, 冷数据对应的分组采用第一压缩率的压缩算法, 热数据对应的分组采用第二 压缩率的压缩算法, 所述第一压缩率高于所述第二压缩率; 以所述多个分组各自对应的压缩算法,对所述多个分组内写入的数据进行压缩处理。
13、 根据权利要求 1至 11中任一项所述的方法, 其中, 所述方法还包括: 根据所述多个分组各自对应的冷热数据类别,确定所述多个分组各自对应的存储介 质类型; 根据所述多个分组各自对应的存储介质类型,将所述多个分组内写入的数据存储到 对应的存储介质中。
14、 一种电子设备, 其中, 包括: 存储器、 处理器、 通信接口; 其中, 所述存储器 上存储有可执行代码, 当所述可执行代码被所述处理器执行时, 使所述处理器执行如权 利要求 1至 13中任一项所述的数据处理方法。
15、 一种非暂时性机器可读存储介质, 其中, 所述非暂时性机器可读存储介质上存 储有可执行代码, 当所述可执行代码被电子设备的处理器执行时, 使所述处理器执行如 权利要求 1至 13中任一项所述的数据处理方法。
16、 一种计算机程序产品, 其中, 包括: 计算机程序, 当所述计算机程序被电子设 备的处理器执行时, 使所述处理器执行如权利要求 1至 13中任一项所述的数据处理方 法。
PCT/IB2025/051346 2024-02-27 2025-02-08 数据处理方法、设备和存储介质 Pending WO2025181597A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410218114.7A CN120560564A (zh) 2024-02-27 2024-02-27 数据处理方法、设备和存储介质
CN202410218114.7 2024-02-27

Publications (1)

Publication Number Publication Date
WO2025181597A1 true WO2025181597A1 (zh) 2025-09-04

Family

ID=96831708

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/IB2025/051346 Pending WO2025181597A1 (zh) 2024-02-27 2025-02-08 数据处理方法、设备和存储介质

Country Status (2)

Country Link
CN (1) CN120560564A (zh)
WO (1) WO2025181597A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120832310A (zh) * 2025-09-18 2025-10-24 济南浪潮数据技术有限公司 内存分层管理方法、电子设备、存储介质和程序产品

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9501392B1 (en) * 2011-05-12 2016-11-22 Avago Technologies General Ip (Singapore) Pte. Ltd. Management of a non-volatile memory module
US20160371190A1 (en) * 2014-12-23 2016-12-22 Emc Corporation Selective compression in data storage systems
US20170024163A1 (en) * 2015-07-24 2017-01-26 Sk Hynix Memory Solutions Inc. Data temperature profiling by smart counter
CN116974491A (zh) * 2023-08-29 2023-10-31 苏州忆联信息系统有限公司 固态硬盘的存储优化方法、装置、计算机设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9501392B1 (en) * 2011-05-12 2016-11-22 Avago Technologies General Ip (Singapore) Pte. Ltd. Management of a non-volatile memory module
US20160371190A1 (en) * 2014-12-23 2016-12-22 Emc Corporation Selective compression in data storage systems
US20170024163A1 (en) * 2015-07-24 2017-01-26 Sk Hynix Memory Solutions Inc. Data temperature profiling by smart counter
CN116974491A (zh) * 2023-08-29 2023-10-31 苏州忆联信息系统有限公司 固态硬盘的存储优化方法、装置、计算机设备及存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120832310A (zh) * 2025-09-18 2025-10-24 济南浪潮数据技术有限公司 内存分层管理方法、电子设备、存储介质和程序产品

Also Published As

Publication number Publication date
CN120560564A (zh) 2025-08-29

Similar Documents

Publication Publication Date Title
US11036799B2 (en) Low RAM space, high-throughput persistent key value store using secondary memory
CN108268219B (zh) 一种处理io请求的方法及装置
KR20170054299A (ko) 메모리 관리 시의 중복 제거를 위해서 기준 세트로 기준 블록을 취합하는 기법
WO2021073635A1 (zh) 一种数据存储方法及装置
CN112262379B (zh) 存储数据项并且标识存储的数据项
EP4030310A1 (en) Data processing method and storage device
CN111339078A (zh) 数据实时存储方法、数据查询方法、装置、设备、介质
CN111611250A (zh) 数据存储设备、数据查询方法、装置、服务器及存储介质
CN111857574A (zh) 一种写请求数据压缩方法、系统、终端及存储介质
CN113806341A (zh) 数据处理方法及存储设备
JPWO2007116995A1 (ja) データの保存先を複数のテープ記録装置から選択するための装置、方法及びプログラム
US20220164316A1 (en) Deduplication method and apparatus
EP2811410B1 (en) Monitoring record management method and device
CN111083933B (zh) 数据存储及获取方法和装置
CN115483935A (zh) 一种数据处理方法及装置
CN111125033A (zh) 一种基于全闪存阵列的空间回收方法及系统
CN111625531A (zh) 基于可编程装置的合并装置、数据合并方法及数据库系统
CN116561120A (zh) 一种用于时序数据库的数据文件快速合并方法及系统
CN113641681B (zh) 一种空间自适应的海量数据查询方法
WO2024187996A1 (zh) 管理数据的方法和计算设备
CN114461635A (zh) 一种MySQL数据库数据存储方法、装置和电子设备
WO2024169851A1 (zh) 一种数据压缩方法、系统、设备及计算机可读存储介质
CN120560564A (zh) 数据处理方法、设备和存储介质
CN115390751B (zh) 一种基于地址重定向的数据存储方法和装置
US11775515B2 (en) Dataset optimization framework

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25761762

Country of ref document: EP

Kind code of ref document: A1