Data reading method, system, equipment and computer readable storage medium

文档序号:1860770 发布日期:2021-11-19 浏览:4次 中文

阅读说明:本技术 一种数据读取方法、系统、设备及计算机可读存储介质 (Data reading method, system, equipment and computer readable storage medium ) 是由 张旭升 于 2021-08-13 设计创作,主要内容包括:本申请公开了一种数据读取方法、系统、设备及计算机可读存储介质,应用于分布式存储系统,获取目标业务的目标IO请求;获取与目标业务对应的历史IO请求的数据读取信息;基于数据读取信息判断是否满足预设预读条件;若满足预设预读条件,则基于预读机制响应目标IO请求;若不满足预设预读条件,则直接响应目标IO请求。本申请可以根据目标业务对应的历史IO请求的数据读取信息来判断是否满足预设预读条件,进而决定是否执行预读机制,相当于根据目标业务的历史IO响应结果来判断是否执行预读机制,可以保证预读机制的准确开启与关闭,避免预读机制在无需开启的情况下浪费分布式存储系统的资源,可以提高分布式存储系统资源的有效利用。(The application discloses a data reading method, a system, equipment and a computer readable storage medium, which are applied to a distributed storage system and used for acquiring a target IO request of a target service; acquiring data reading information of a historical IO request corresponding to a target service; judging whether a preset pre-reading condition is met or not based on the data reading information; if the preset read-ahead condition is met, responding to a target IO request based on a read-ahead mechanism; and if the preset read-ahead condition is not met, directly responding to the target IO request. According to the method and the device, whether the preset pre-reading condition is met or not can be judged according to the data reading information of the historical IO request corresponding to the target service, and whether the pre-reading mechanism is executed or not is further determined.)

1. A data reading method is applied to a distributed storage system and comprises the following steps:

acquiring a target IO request of a target service;

acquiring data reading information of a historical IO request corresponding to the target service;

judging whether a preset pre-reading condition is met or not based on the data reading information;

if the preset read-ahead condition is met, responding the target IO request based on a read-ahead mechanism;

and if the preset read-ahead condition is not met, directly responding to the target IO request.

2. The method of claim 1, wherein the determining whether a preset pre-reading condition is satisfied based on the data reading information comprises:

determining a data storage unit of each read data in the distributed storage system based on the data reading information;

determining storage reading information of each data storage unit based on the data reading information;

and judging whether the preset read-ahead condition is met or not based on the storage read information.

3. The method of claim 2, wherein the determining whether the preset read-ahead condition is met based on the stored read information comprises:

judging whether the read data are continuously distributed in the distributed storage system or not based on the storage reading information;

if the read data are continuously distributed in the distributed storage system, judging that the preset pre-reading condition is met;

and if the read data are not distributed in the distributed storage system continuously, judging that the preset pre-reading condition is not met.

4. The method of claim 3, wherein storing read information comprises reading an order of reading the data storage units;

the determining whether the read data is continuously distributed in the distributed storage system based on the storage read information includes:

determining the arrangement sequence of the data storage units in the distributed storage system;

judging whether the reading sequence is consistent with the arrangement sequence;

if the reading sequence is consistent with the arrangement sequence, the read data is judged to be continuously distributed in the distributed storage system;

and if the reading sequence is not consistent with the arrangement sequence, determining that the read data is discontinuously distributed in the distributed storage system.

5. The method of claim 2, wherein the determining whether the preset read-ahead condition is met based on the stored read information comprises:

judging whether the read data are distributed in the distributed storage system in a centralized way or not based on the storage reading information;

if the read data are distributed in the distributed storage system in a centralized manner, judging that the preset pre-reading condition is met;

and if the read data is not distributed in the distributed storage system in a centralized way, judging that the preset pre-reading condition is not met.

6. The method of claim 5, wherein storing read information comprises reading the number of reads of the data storage unit;

the determining whether the read data is centrally distributed in the distributed storage system based on the storage read information includes:

determining a first quantity value of the historical IO;

calculating a first ratio of the first quantity value to the reading times;

calculating a second ratio of the total number of bytes of the read data to the number of reads;

determining an average size value of the data storage units;

calculating a third ratio of the second ratio to the average magnitude value;

calculating a product value of the first ratio and the third ratio;

judging whether the product value is larger than a preset value or not;

if the product value is larger than the preset value, judging that the read data are distributed in the distributed storage system in a centralized way;

and if the product value is less than or equal to the preset value, judging that the read data is not distributed in the distributed storage system in a centralized way.

7. The method of claim 1, wherein before the obtaining the target IO request of the target service, further comprising:

the read-ahead mechanism is turned off in advance.

8. A data reading system, applied to a distributed storage system, includes:

the first acquisition module is used for acquiring a target IO request of a target service;

the second acquisition module is used for acquiring data reading information of the historical IO request corresponding to the target service;

the first judgment module is used for judging whether a preset pre-reading condition is met or not based on the data reading information; if the preset read-ahead condition is met, responding the target IO request based on a read-ahead mechanism; and if the preset read-ahead condition is not met, directly responding to the target IO request.

9. A data reading apparatus, characterized by comprising:

a memory for storing a computer program;

a processor for implementing the steps of the data reading method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a data reading method according to any one of claims 1 to 7.

Technical Field

The present application relates to the field of information processing technologies, and in particular, to a data reading method, system, device, and computer-readable storage medium.

Background

In a distributed storage system, in order to improve the response time of IO (Input/Output), a pre-reading mechanism may be started to pre-read underlying data in advance and cache the underlying data in a memory, so that when an IO request of the underlying data is responded, the underlying data may be directly returned from the memory.

However, if the pre-read bottom layer data cannot be used by IO, not only memory resources are occupied, but also performance resources of the distributed storage system are consumed, which is not favorable for efficient operation of the distributed storage system.

In summary, how to improve the effective utilization of the resources of the distributed storage system is an urgent problem to be solved by those skilled in the art.

Disclosure of Invention

The present application aims to provide a data reading method, which can solve the technical problem of how to improve the effective utilization of the distributed storage system resources to a certain extent. The application also provides a data reading system, a device and a computer readable storage medium.

In order to achieve the above purpose, the present application provides the following technical solutions:

a data reading method is applied to a distributed storage system and comprises the following steps:

acquiring a target IO request of a target service;

acquiring data reading information of a historical IO request corresponding to the target service;

judging whether a preset pre-reading condition is met or not based on the data reading information;

if the preset read-ahead condition is met, responding the target IO request based on a read-ahead mechanism;

and if the preset read-ahead condition is not met, directly responding to the target IO request.

Preferably, the determining whether a preset prereading condition is met based on the data reading information includes:

determining a data storage unit of each read data in the distributed storage system based on the data reading information;

determining storage reading information of each data storage unit based on the data reading information;

and judging whether the preset read-ahead condition is met or not based on the storage read information.

Preferably, the determining whether the preset read-ahead condition is met based on the storage read information includes:

judging whether the read data are continuously distributed in the distributed storage system or not based on the storage reading information;

if the read data are continuously distributed in the distributed storage system, judging that the preset pre-reading condition is met;

and if the read data are not distributed in the distributed storage system continuously, judging that the preset pre-reading condition is not met.

Preferably, the storing the read information includes reading an order of reading the data storage units;

the determining whether the read data is continuously distributed in the distributed storage system based on the storage read information includes:

determining the arrangement sequence of the data storage units in the distributed storage system;

judging whether the reading sequence is consistent with the arrangement sequence;

if the reading sequence is consistent with the arrangement sequence, the read data is judged to be continuously distributed in the distributed storage system;

and if the reading sequence is not consistent with the arrangement sequence, determining that the read data is discontinuously distributed in the distributed storage system.

Preferably, the determining whether the preset read-ahead condition is met based on the storage read information includes:

judging whether the read data are distributed in the distributed storage system in a centralized way or not based on the storage reading information;

if the read data are distributed in the distributed storage system in a centralized manner, judging that the preset pre-reading condition is met;

and if the read data is not distributed in the distributed storage system in a centralized way, judging that the preset pre-reading condition is not met.

Preferably, the storing the read information includes reading times of reading the data storage unit;

the determining whether the read data is centrally distributed in the distributed storage system based on the storage read information includes:

determining a first quantity value of the historical IO;

calculating a first ratio of the first quantity value to the reading times;

calculating a second ratio of the total number of bytes of the read data to the number of reads;

determining an average size value of the data storage units;

calculating a third ratio of the second ratio to the average magnitude value;

calculating a product value of the first ratio and the third ratio;

judging whether the product value is larger than a preset value or not;

if the product value is larger than the preset value, judging that the read data are distributed in the distributed storage system in a centralized way;

and if the product value is less than or equal to the preset value, judging that the read data is not distributed in the distributed storage system in a centralized way.

Before the obtaining of the target IO request of the target service, the method further includes:

the read-ahead mechanism is turned off in advance.

A data reading system is applied to a distributed storage system and comprises:

the first acquisition module is used for acquiring a target IO request of a target service;

the second acquisition module is used for acquiring data reading information of the historical IO request corresponding to the target service;

the first judgment module is used for judging whether a preset pre-reading condition is met or not based on the data reading information; if the preset read-ahead condition is met, responding the target IO request based on a read-ahead mechanism; and if the preset read-ahead condition is not met, directly responding to the target IO request.

A data reading apparatus comprising:

a memory for storing a computer program;

a processor for implementing the steps of the data reading method as described above when executing the computer program.

A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the data reading method as set forth in any one of the above.

The data reading method is applied to a distributed storage system and used for obtaining a target IO request of a target service; acquiring data reading information of a historical IO request corresponding to a target service; judging whether a preset pre-reading condition is met or not based on the data reading information; if the preset read-ahead condition is met, responding to a target IO request based on a read-ahead mechanism; and if the preset read-ahead condition is not met, directly responding to the target IO request. According to the method and the device, whether the preset pre-reading condition is met or not can be judged according to the data reading information of the historical IO request corresponding to the target service, and whether the pre-reading mechanism is executed or not is further determined. The data reading system, the data reading equipment and the computer readable storage medium solve the corresponding technical problems.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

Fig. 1 is a flowchart of a data reading method according to an embodiment of the present application;

FIG. 2 is a flow chart of determining whether read data is contiguously distributed in a distributed storage system based on storage read information;

FIG. 3 is a flow chart of determining whether read data is centrally distributed in a distributed storage system based on storage read information;

fig. 4 is a schematic structural diagram of a data reading system according to an embodiment of the present application;

fig. 5 is a schematic structural diagram of a data reading apparatus according to an embodiment of the present application;

fig. 6 is another schematic structural diagram of a data reading apparatus according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

Referring to fig. 1, fig. 1 is a flowchart illustrating a data reading method according to an embodiment of the present disclosure.

The data reading method provided by the embodiment of the application is applied to a distributed storage system and can comprise the following steps:

step S101: and acquiring a target IO request of the target service.

In practical application, the distributed storage system may obtain the target IO request of the target service first, specifically, the distributed storage system may receive the target IO request of the target service sent by the client, and both the type of the target service and data required by the target IO request may be determined according to practical needs, which is not specifically limited herein.

Step S102: and acquiring data reading information of the historical IO request corresponding to the target service.

In practical application, because the pre-reading mechanism reads and stores the bottom data in the distributed storage system in the memory in advance, the pre-reading mechanism can improve the response rate of the bottom data, and based on the characteristics of the pre-reading mechanism, whether the pre-reading mechanism is enabled at the current moment can be determined according to the data reading condition of the historical IO request of the target service, that is, after the target IO request of the target service is obtained, the data reading information of the historical IO request corresponding to the target service can be obtained, and the specific type of the data reading information can be determined according to actual needs.

Step S103: judging whether a preset pre-reading condition is met or not based on the data reading information; if the preset read-ahead condition is met, executing step S104; if the preset read-ahead condition is not satisfied, step S105 is executed.

Step S104: and responding the target IO request based on a read-ahead mechanism.

Step S105: directly responding to the target IO request.

In practical application, after the data reading information is acquired, whether a preset pre-reading condition is met or not can be judged based on the data reading information, the preset pre-reading condition is also a condition for determining whether a pre-reading mechanism is started or not, and if the preset pre-reading condition is met, a target IO request can be responded based on the pre-reading mechanism; if the preset read-ahead condition is not met, the target IO request can be directly responded, and at the moment, a read-ahead mechanism does not need to be started.

In a specific application scenario, the pre-reading mechanism may be defaulted to be in a closed state, that is, the pre-reading mechanism is closed in advance, and accordingly, after a preset pre-reading condition is met, the pre-reading mechanism may be started before a target IO request is responded based on the pre-reading mechanism; and after the preset read-ahead condition is not met, the read-ahead mechanism can be kept in an off state.

The data reading method is applied to a distributed storage system and used for obtaining a target IO request of a target service; acquiring data reading information of a historical IO request corresponding to a target service; judging whether a preset pre-reading condition is met or not based on the data reading information; if the preset read-ahead condition is met, responding to a target IO request based on a read-ahead mechanism; and if the preset read-ahead condition is not met, directly responding to the target IO request. According to the method and the device, whether the preset pre-reading condition is met or not can be judged according to the data reading information of the historical IO request corresponding to the target service, and whether the pre-reading mechanism is executed or not is further determined.

In the data reading method provided by the embodiment of the application, if data required by an IO request is regularly stored in a distributed storage system, a pre-reading mechanism can better play a role, and the data required by the IO request is regularly expressed in the distributed storage system that data storage units in the distributed storage system have regularity, so that in the process of judging whether a preset pre-reading condition is met or not based on data reading information, the distributed storage system can determine the data storage unit where each read data is located in the distributed storage system based on the data reading information in order to improve the judgment efficiency; determining storage reading information of each data storage unit based on the data reading information; and judging whether a preset pre-reading condition is met or not based on the stored reading information.

In a specific application scenario, if data required by an IO request is continuously distributed in a distributed storage system, the required data can be well read through a pre-reading mechanism, so that the distributed storage system can judge whether the read data is continuously distributed in the distributed storage system based on the storage reading information in the process of judging whether the preset pre-reading condition is met based on the storage reading information; if the read data are continuously distributed in the distributed storage system, judging that a preset read-ahead condition is met; and if the read data are not distributed in the distributed storage system continuously, judging that the preset read-ahead condition is not met.

In an actual application scenario, if the read data is continuously distributed in the distributed storage system, the data storage units corresponding to the read data are also continuously arranged in the distributed storage system, and at this time, the reading sequence of the read data is consistent with the arrangement sequence of the data storage units, that is, it can be determined whether the read data is continuously distributed in the distributed storage system according to the reading sequence of the read data and the arrangement sequence of the data storage units, at this time, the storage reading information includes the reading sequence of the read data storage units, and a process of determining whether the read data is continuously distributed in the distributed storage system based on the storage reading information may refer to fig. 2, which may include the following steps:

step S201: the arrangement order of the data storage units in the distributed storage system is determined.

Step S202: judging whether the reading sequence is consistent with the arrangement sequence; if the reading sequence is consistent with the arrangement sequence, executing step S203; if the reading sequence is not consistent with the arranging sequence, step S204 is executed.

Step S203: the read data is determined to be contiguously distributed in the distributed storage system.

Step S204: it is determined that the read data is not contiguously distributed in the distributed storage system.

For convenience of understanding, it is assumed that the data storage units are A, B, C, the arrangement order of the data storage units from left to right in the distributed storage system is A, C, B, if the data storage units are read in the sequence of A, C, B, the required data can be obtained by directly performing pre-reading according to the arrangement order, and if the data storage units are read in the sequence of C, A, B, the order of the required data is disturbed after the pre-reading according to the arrangement order, which is not beneficial to the response of the IO request.

It should be noted that, in the process of reading data, if the size of the data read each time is closer to the size of the data storage unit, that is, closer to reading data in units of the data storage unit, for example, reading data of half, quarter, etc. data storage units at a time, the pre-reading mechanism is more prone to reading data of one data storage unit, and at this time, the arrangement order of the data storage units will affect the reading result of the pre-reading mechanism more, so that when the size of the data read each time by the distributed storage system is closer to the size of the data storage unit, the method of the present embodiment can be applied more to determine that the pre-reading condition is satisfied.

In a specific application scenario, if data required by an IO request is distributed in a distributed storage system in a centralized manner, the required data can be well read through a pre-reading mechanism, so that the distributed storage system can judge whether the read data is distributed in the distributed storage system in a centralized manner based on the stored read information in the process of judging whether the preset pre-reading condition is met based on the stored read information; if the read data are distributed in a centralized manner in the distributed storage system, judging that a preset read-ahead condition is met; and if the read data is not distributed in a centralized manner in the distributed storage system, judging that the read data does not meet the preset pre-reading condition.

In an actual application scenario, if the read data is distributed in a centralized manner in the distributed storage system, the ratio of the read data in a single data storage unit is higher, that is, the read data is distributed in the same data storage unit in a centralized manner, that is, whether a preset pre-reading condition is met can be determined according to the ratio of the read data to the data storage unit, and at this time, the storage and reading information includes the reading times of the read data storage unit; the process of determining whether the read data is centrally distributed in the distributed storage system based on the storage read information may be as shown in fig. 3, which may include the following steps:

step S301: a first quantity value of historical IO is determined.

Step S302: a first ratio of the first quantity value to the number of readings is calculated.

Step S303: and calculating a second ratio of the total number of bytes of the read data to the number of reads.

Step S304: an average size value of the data storage units is determined.

Step S305: a third ratio of the second ratio to the average magnitude value is calculated.

Step S306: and calculating the product value of the first ratio and the third ratio.

Step S307: judging whether the product value is larger than a preset value or not; if the product value is greater than the preset value, go to step S308; if the product value is less than or equal to the predetermined value, step S309 is executed.

Step S308: the read data is determined to be centrally distributed in the distributed storage system.

Step S309: it is determined that the read data is not centrally distributed in the distributed storage system.

It should be noted that the preset value may be determined according to actual needs, for example, the preset value may be 0.6. In the process, if the size of the data read each time is smaller, for example, much smaller than the size of the data storage unit, the data required by the IO request may be stored in one data storage unit, the pre-reading mechanism may only read one data storage unit to obtain the required data, and the size value of the data read each time by the distributed storage system may affect the reading result of the pre-reading mechanism more, so that the method of the embodiment may be applied more to determine that the pre-reading condition is satisfied when the size of the data read each time by the distributed storage system is smaller than the size of the data storage unit. Of course, it may also be determined each time whether the read data is continuously or intensively distributed in the distributed storage system, and if one of the distributions is satisfied, it may be considered that the pre-read condition is satisfied, and the like, and the application is not specifically limited herein.

Referring to fig. 4, fig. 4 is a schematic structural diagram of a data reading system according to an embodiment of the present disclosure.

The data reading system provided by the embodiment of the application is applied to a distributed storage system, and may include:

a first obtaining module 101, configured to obtain a target IO request of a target service;

a second obtaining module 102, configured to obtain data reading information of a historical IO request corresponding to a target service;

the first judging module 103 is configured to judge whether a preset pre-reading condition is met based on the data reading information; if the preset read-ahead condition is met, responding to a target IO request based on a read-ahead mechanism; and if the preset read-ahead condition is not met, directly responding to the target IO request.

The data reading system provided in the embodiment of the present application is applied to a distributed storage system, and the first determining module may include:

the first determining unit is used for determining the data storage unit of each read data in the distributed storage system based on the data reading information;

a second determining unit configured to determine storage read information of each data storage unit based on the data read information;

and the first judgment unit is used for judging whether the preset pre-reading condition is met or not based on the stored reading information.

The data reading system provided in the embodiment of the present application is applied to a distributed storage system, and the first determining unit may be specifically configured to: judging whether the read data are continuously distributed in the distributed storage system based on the storage reading information; if the read data are continuously distributed in the distributed storage system, judging that a preset read-ahead condition is met; and if the read data are not distributed in the distributed storage system continuously, judging that the preset read-ahead condition is not met.

The data reading system provided by the embodiment of the application is applied to a distributed storage system, the storing and reading information may include a reading sequence of reading data storage units, and the first determining unit may be specifically configured to: determining the arrangement sequence of each data storage unit in the distributed storage system; judging whether the reading sequence is consistent with the arrangement sequence; if the reading sequence is consistent with the arrangement sequence, the read data is judged to be continuously distributed in the distributed storage system; and if the reading sequence is not consistent with the arrangement sequence, the read data is judged to be discontinuously distributed in the distributed storage system.

The data reading system provided in the embodiment of the present application is applied to a distributed storage system, and the first determining unit may be specifically configured to: judging whether the read data are distributed in a centralized manner in the distributed storage system or not based on the storage reading information; if the read data are distributed in a centralized manner in the distributed storage system, judging that a preset read-ahead condition is met; and if the read data is not distributed in a centralized manner in the distributed storage system, judging that the read data does not meet the preset pre-reading condition.

The data reading system provided by the embodiment of the application is applied to a distributed storage system, the storage read information may include the number of times of reading a data storage unit, and the first determining unit may be specifically configured to: determining a first quantity value of historical IO; calculating a first ratio of the first quantity value to the reading times; calculating a second ratio of the total byte number of the read data to the number of times of reading; determining an average size value of the data storage units; calculating a third ratio of the second ratio to the average magnitude; calculating a product value of the first ratio and the third ratio; judging whether the product value is larger than a preset value or not; if the product value is larger than a preset value, judging that the read data are distributed in a centralized manner in the distributed storage system; and if the product value is less than or equal to the preset value, judging that the read data is not distributed in a centralized manner in the distributed storage system.

The application also provides a data reading device and a computer readable storage medium, which have corresponding effects of the data reading method provided by the embodiment of the application. Referring to fig. 5, fig. 5 is a schematic structural diagram of a data reading apparatus according to an embodiment of the present disclosure.

The data reading device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program:

acquiring a target IO request of a target service;

acquiring data reading information of a historical IO request corresponding to a target service;

judging whether a preset pre-reading condition is met or not based on the data reading information;

if the preset read-ahead condition is met, responding to a target IO request based on a read-ahead mechanism;

and if the preset read-ahead condition is not met, directly responding to the target IO request.

The data reading device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: determining a data storage unit of each read data in the distributed storage system based on the data reading information; determining storage reading information of each data storage unit based on the data reading information; and judging whether a preset pre-reading condition is met or not based on the stored reading information.

The data reading device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: judging whether the read data are continuously distributed in the distributed storage system based on the storage reading information; if the read data are continuously distributed in the distributed storage system, judging that a preset read-ahead condition is met; and if the read data are not distributed in the distributed storage system continuously, judging that the preset read-ahead condition is not met.

The data reading device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: storing the read information includes reading a read order of the data storage units; determining the arrangement sequence of each data storage unit in the distributed storage system; judging whether the reading sequence is consistent with the arrangement sequence; if the reading sequence is consistent with the arrangement sequence, the read data is judged to be continuously distributed in the distributed storage system; and if the reading sequence is not consistent with the arrangement sequence, the read data is judged to be discontinuously distributed in the distributed storage system.

The data reading device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: judging whether the read data are distributed in a centralized manner in the distributed storage system or not based on the storage reading information; if the read data are distributed in a centralized manner in the distributed storage system, judging that a preset read-ahead condition is met; and if the read data is not distributed in a centralized manner in the distributed storage system, judging that the read data does not meet the preset pre-reading condition.

The data reading device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: storing the read information includes reading a number of times the data storage unit is read; determining a first quantity value of historical IO; calculating a first ratio of the first quantity value to the reading times; calculating a second ratio of the total byte number of the read data to the number of times of reading; determining an average size value of the data storage units; calculating a third ratio of the second ratio to the average magnitude; calculating a product value of the first ratio and the third ratio; judging whether the product value is larger than a preset value or not; if the product value is larger than a preset value, judging that the read data are distributed in a centralized manner in the distributed storage system; and if the product value is less than or equal to the preset value, judging that the read data is not distributed in a centralized manner in the distributed storage system.

Referring to fig. 6, another data reading apparatus provided in the embodiment of the present application may further include: an input port 203 connected to the processor 202, for transmitting externally input commands to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing result of the processor 202 to the outside; and the communication module 205 is connected with the processor 202 and is used for realizing the communication between the data reading device and the outside. The display unit 204 may be a display panel, a laser scanning display, or the like; the communication method adopted by the communication module 205 includes, but is not limited to, mobile high definition link technology (HML), Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), and wireless connection: wireless fidelity technology (WiFi), bluetooth communication technology, bluetooth low energy communication technology, ieee802.11s based communication technology.

A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps:

acquiring a target IO request of a target service;

acquiring data reading information of a historical IO request corresponding to a target service;

judging whether a preset pre-reading condition is met or not based on the data reading information;

if the preset read-ahead condition is met, responding to a target IO request based on a read-ahead mechanism;

and if the preset read-ahead condition is not met, directly responding to the target IO request.

A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: determining a data storage unit of each read data in the distributed storage system based on the data reading information; determining storage reading information of each data storage unit based on the data reading information; and judging whether a preset pre-reading condition is met or not based on the stored reading information.

A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: judging whether the read data are continuously distributed in the distributed storage system based on the storage reading information; if the read data are continuously distributed in the distributed storage system, judging that a preset read-ahead condition is met; and if the read data are not distributed in the distributed storage system continuously, judging that the preset read-ahead condition is not met.

A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: storing the read information includes reading a read order of the data storage units; determining the arrangement sequence of each data storage unit in the distributed storage system; judging whether the reading sequence is consistent with the arrangement sequence; if the reading sequence is consistent with the arrangement sequence, the read data is judged to be continuously distributed in the distributed storage system; and if the reading sequence is not consistent with the arrangement sequence, the read data is judged to be discontinuously distributed in the distributed storage system.

A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: judging whether the read data are distributed in a centralized manner in the distributed storage system or not based on the storage reading information; if the read data are distributed in a centralized manner in the distributed storage system, judging that a preset read-ahead condition is met; and if the read data is not distributed in a centralized manner in the distributed storage system, judging that the read data does not meet the preset pre-reading condition.

A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: storing the read information includes reading a number of times the data storage unit is read; determining a first quantity value of historical IO; calculating a first ratio of the first quantity value to the reading times; calculating a second ratio of the total byte number of the read data to the number of times of reading; determining an average size value of the data storage units; calculating a third ratio of the second ratio to the average magnitude; calculating a product value of the first ratio and the third ratio; judging whether the product value is larger than a preset value or not; if the product value is larger than a preset value, judging that the read data are distributed in a centralized manner in the distributed storage system; and if the product value is less than or equal to the preset value, judging that the read data is not distributed in a centralized manner in the distributed storage system.

The computer-readable storage media to which this application relates include Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage media known in the art.

For a description of a relevant part in a data reading system, a device and a computer readable storage medium provided in the embodiments of the present application, refer to a detailed description of a corresponding part in a data reading method provided in the embodiments of the present application, and are not described herein again. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.

It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种多客户端定制卷QoS的方法、装置、设备及可读介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类