CN103902348A - Method and system for reading and writing user data under virtual environment and physical machine - Google Patents

Method and system for reading and writing user data under virtual environment and physical machine Download PDF

Info

Publication number
CN103902348A
CN103902348A CN201210572237.8A CN201210572237A CN103902348A CN 103902348 A CN103902348 A CN 103902348A CN 201210572237 A CN201210572237 A CN 201210572237A CN 103902348 A CN103902348 A CN 103902348A
Authority
CN
China
Prior art keywords
request
read
write
address
queue
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.)
Granted
Application number
CN201210572237.8A
Other languages
Chinese (zh)
Other versions
CN103902348B (en
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.)
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
Original Assignee
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
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 Huawei Technologies Co Ltd, Institute of Computing Technology of CAS filed Critical Huawei Technologies Co Ltd
Priority to CN201210572237.8A priority Critical patent/CN103902348B/en
Publication of CN103902348A publication Critical patent/CN103902348A/en
Application granted granted Critical
Publication of CN103902348B publication Critical patent/CN103902348B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a method and system for reading and writing user data under virtual environment and a physical machine. The method includes the steps that whether every virtual machine has a user data reading and writing request or not is detected; the user data reading and writing requests of all the virtual machines are collected; the reading requests are added into a reading request queue, and the writing requests are added into a writing request queue; when the correspondence degree between first request addresses in the reading request queue and/or the writing request queue and second request addresses in the reading request queue and/or the writing request queue meets a preset condition, the request queue corresponding to the first request address is adjusted according to a request queue adjustment method corresponding to the preset condition; a request in the front of the request queue with the high priority is called and sent to a server where the user data are stored. By means of the method, reading and writing pressure of communication interfaces of the physical machine and the reading and writing pressure of the server where the user data are stored are substantially reduced, and user data reading and writing efficiency is improved.

Description

The reading/writing method of user data, system and physical machine under a kind of virtualized environment
Technical field
The present invention relates to Intel Virtualization Technology, more particularly, relate to reading/writing method, system and the physical machine of user data under a kind of virtualized environment.
Background technology
At present Intel Virtualization Technology is accepted by increasing user, and indication virtual here comprises towards final user's desktop virtual and service-oriented calculating virtual; Intel Virtualization Technology can expand the capacity of hardware, simplify the process that reconfigures of software, can be by single CPU(processor by Intel Virtualization Technology) to be modeled to many CPU parallel, allow a platform to move multiple operating system, as simulated two or many virtual computing machines (being virtual machine) on a physical computer simultaneously.
Two kinds of dissimilar data of main existence in virtualization applications scene: system data and user data.System data refers to the operating system in virtual machine, the data of software, user data refers to that user is using the data that produce when virtualization system, normally Separate Storage of these two classes data.In prior art, a kind of typical storage of subscriber data mode is user data to be kept on the server different from virtual machine place physical machine, as user data being kept in a kind of network file system(NFS); By the read-write of installation data in virtual machine client, as network file system(NFS) client is installed in virtual machine, in the time that needs carry out user data read-write, between the server of virtual machine and storage user data, communicate, realize the read-write of user data, Fig. 1 is the schematic diagram that in prior art, virtual machine carries out user data read-write, together reference.
In virtualization applications scene, virtual machine is in the time carrying out user data read-write, all can communicate by the communication interface of physical machine and the server of storage user data, due to the uncertainty of scheduling virtual machine, causing each virtual machine is inequitable to the use of communication interface, this just causes the competition of the communication interface of many virtual machines to physical machine, this makes the communication interface of physical machine and the server of storage user data have larger read-write pressure, makes the read-write efficiency of user data lower.
Summary of the invention
In view of this, the embodiment of the present invention provides reading/writing method, system and the physical machine of user data under a kind of virtualized environment, to solve the competition due to the communication interface of many virtual machines to physical machine, and make the communication interface of physical machine and the server of storage user data have larger read-write pressure, cause the lower problem of read-write efficiency of user data.
For achieving the above object, the embodiment of the present invention provides following technical scheme:
First aspect, the embodiment of the present invention provides the reading/writing method of user data under a kind of virtualized environment, comprising:
Detect each virtual machine and whether have user data read-write requests;
In the time there is user data read-write requests in virtual machine, collect the user data read-write requests of each virtual machine, read request is joined in read request queue, write request is joined in write request queue;
Work as read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted, described the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, described the second request address be the request that just added at request address corresponding to front request;
That detects read request queue transfers priority, and write request queue transfer priority, transfer in the request queue that priority is relatively high in front request, send to the server of storage user data the request of transferring.
In conjunction with first aspect, in the possible implementation of the first of first aspect,
Described read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, request queue adjust corresponding to the first request address comprises:
The read data address that the read request just having added in read request queue is asked, with the read data address of asking in front read request to response, while meeting default first condition, according to the preset read request queue method of adjustment corresponding with default first condition, read request queue is adjusted; And/or,
What the write request just having added in write request queue was asked writes data address, with ask in front write request write data address to response, while meeting default second condition, according to the preset write request queue regulation method corresponding with default second condition, to write request, queue is adjusted.
In conjunction with the possible implementation of the first of first aspect, in the possible implementation of the second,
The read data address that the described read request just having added is asked, with the read data address of asking in front read request to response, meet default first condition and comprise:
The read data address that the read request just having added is asked, identical with the read data address of asking in front read request, or mutually continuous, or belonging to a file address, file corresponding to described file address carries multiple data;
Described according to the preset read request queue method of adjustment corresponding with default first condition, read request queue adjustment is comprised:
When the read data address that the read request just having added is asked, when identical with the read data address of asking in front read request, described in being merged to, the read request just having added in front read request, forms the same request with identical read data address; Or,
When the read data address that the read request just having added is asked, with the read data address consecutive hours of asking in front read request, the read data address that the read request just having added is asked and described read data address of asking in front read request, consecutive order according to address superposes, by the read request just having added and described front read request be merged into have stack address request; Or,
When the read data address that the read request just having added is asked, while belonging to a file address with the read data address of asking in front read request, read request queue is reset, described in being adjusted to, the sequence of the read request just having added after front read request, make the sequence of the read request that belongs to a file address in described read request queue continuous.
In conjunction with the possible implementation of the first of first aspect, in the third possible implementation,
What the described write request just having added was asked writes data address, with ask in front write request write data address to response, meet default second condition and comprise:
What the write request just having added was asked writes data address, with ask in front write request to write data address identical, or mutually continuous, or belong to a file address, file corresponding to described file address carries multiple data;
Described according to the preset write request queue regulation method corresponding with default second condition, to write request, queue is adjusted and is comprised:
Write data address when what the write request just having added was asked, with ask in front write request write data address when identical, the write request just having added is merged to described in front write request, form and there is the identical same request of writing data address; Or,
Write data address when what the write request just having added was asked, with ask in front write request write data address consecutive hours, the write request just having added is asked write data address and described ask in front write request write data address, consecutive order according to address superposes, by the write request just having added and described front write request be merged into have stack address request; Or,
Write data address when what the write request just having added was asked, with ask in front write request write data address and belong to a file address time, to write request, queue is reset, described in being adjusted to, the sequence of the write request just having added after front write request, make the sequence of the write request that belongs to a file address in described write request queue continuous.
Second aspect, the embodiment of the present invention provides the read-write system of user data under a kind of virtualized environment, comprising:
Whether request detection module, there is user data read-write requests for detection of each virtual machine;
Request collection module, when there is user data read-write requests at virtual machine, collects the user data read-write requests of each virtual machine;
Module is lined up in request, for the read request of user data read-write requests is joined in read request queue, write request is joined in write request queue;
Request queue adjusting module, be used in read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted, described the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, described the second request address be the request that just added at request address corresponding to front request;
Module is transferred in request, for detection of the priority of transferring of read request queue, and write request queue transfer priority, transfer in the request queue that priority is relatively high in front request, send to the server of storage user data the request of transferring.
The third aspect, the embodiment of the present invention provides a kind of physical machine, comprising: processor, communication interface, storer and communication bus;
Wherein said processor, described communication interface, described storer complete mutual communication by described communication bus;
Described communication interface, the user data read-write requests of transferring for obtaining described processor, sends this read-write requests to the server of storage user data;
Described processor, for executive routine;
Described storer, for depositing program;
Its Program is used for:
Detect each virtual machine and whether have user data read-write requests;
In the time there is user data read-write requests in virtual machine, collect the user data read-write requests of each virtual machine, read request is joined in read request queue, write request is joined in write request queue;
Work as read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted, described the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, described the second request address be the request that just added at request address corresponding to front request;
That detects read request queue transfers priority, and write request queue transfer priority, transfer in the request queue that priority is relatively high in front request, send to the server of storage user data the request of transferring.
Based on technique scheme, the reading/writing method of user data under the virtualized environment that the embodiment of the present invention provides, in the time detecting that virtual machine exists user data read-write requests, the user data read-write requests of each virtual machine will be collected, read request is joined in preset read request queue, write request is joined in preset write request queue, and read request queue and/or write request queue are adjusted, by current transfer in the queue that priority is high front request send to storage user data server, realized the read-write of user data under virtualized environment, compared to existing technology, the reading/writing method of user data under the virtualized environment that the embodiment of the present invention provides, the user data read-write requests of virtual machine does not directly send to the server of storage user data by communication interface, but after the read-write requests of user data is intercepted and captured, for virtual machine carries out the agency of the read-write requests of user data, pass through read request queue, write request queue, the adjustment of read request queue and/or write request queue, and transfer in the queue that priority is high in front request, server to storage user data is sent in front request, make the user data read-write requests that is adjusted to communication interface become orderly, between virtual machine, the read-write of user data will be realized by agency, and no longer carry out the competition of the communication interface of physical machine, significantly reduce the read-write pressure of the communication interface of physical machine and the server of storage user data, improve the read-write efficiency of user data.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the schematic diagram that in prior art, virtual machine carries out user data read-write;
The process flow diagram of the reading/writing method of user data under the virtualized environment that Fig. 2 provides for the embodiment of the present invention;
Another process flow diagram of the reading/writing method of user data under the virtualized environment that Fig. 3 provides for the embodiment of the present invention;
The process flow diagram that Fig. 4 adjusts for the read request queue that the embodiment of the present invention provides;
The schematic diagram that the read request that Fig. 5 provides for the embodiment of the present invention merges;
Another process flow diagram that Fig. 6 adjusts for the read request queue that the embodiment of the present invention provides;
Another schematic diagram that the read request that Fig. 7 provides for the embodiment of the present invention merges;
The another process flow diagram that Fig. 8 adjusts for the read request queue that the embodiment of the present invention provides;
The schematic diagram that Fig. 9 resets for the read request queue that the embodiment of the present invention provides;
The method flow diagram that Figure 10 transfers for the read-write requests that the embodiment of the present invention provides;
The another process flow diagram of the reading/writing method of user data under the virtualized environment that Figure 11 provides for the embodiment of the present invention;
The structured flowchart of the read-write system of user data under the virtualized environment that Figure 12 provides for the embodiment of the present invention;
Under the virtualized environment that Figure 13 provides for the embodiment of the present invention, the module of the read-write system of user data arranges schematic diagram;
The structured flowchart of the request queue adjusting module that Figure 14 provides for the embodiment of the present invention;
The structured flowchart of the read request queue adjustment unit that Figure 15 provides for the embodiment of the present invention;
The structured flowchart of the write request regulator unit that Figure 16 provides for the embodiment of the present invention;
The structured flowchart of module is lined up in the request that Figure 17 provides for the embodiment of the present invention;
The structured flowchart of module is transferred in the request that Figure 18 provides for the embodiment of the present invention;
Another structured flowchart of module is transferred in the request that Figure 19 provides for the embodiment of the present invention;
Another structured flowchart of the read-write system of user data under the virtualized environment that Figure 20 provides for the embodiment of the present invention;
The structured flowchart of the physical machine that Figure 21 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The process flow diagram of the reading/writing method of user data under the virtualized environment that Fig. 2 provides for the embodiment of the present invention, the method is applied to simulation to be had in the physical machine of many virtual machines, and with reference to Fig. 2, the method can comprise step:
Step S10, detect each virtual machine and whether have user data read-write requests;
The detection means of virtual machine read-write requests has multiple, can be selected in the operating system of each virtual machine and load driver, thereby realize virtual machine and whether exist the detection of user data read-write requests.
Step S11, in the time there is user data read-write requests in virtual machine, collect the user data read-write requests of each virtual machine, read request is joined in read request queue, write request is joined in write request queue;
In prior art, the read-write requests of the user data of each virtual machine is by by being arranged on the virtual machine reading and writing data client in operating system separately, directly mail to the communication interface of physical machine, thereby communicate with the server of storage user data by the communication interface of physical machine; And in the embodiment of the present invention, the read-write requests of the user data of each virtual machine will directly not mail to communication interface, in the time detecting that virtual machine exists user data read-write requests, will intercept and capture this user data read-write requests, the user data read-write requests of each virtual machine is collected.Optionally, can, by the driver loading, realize the intercepting and capturing of user data read-write requests in the operating system of each virtual machine, thereby the user data read-write requests of each virtual machine is collected.
The embodiment of the present invention is provided with read request queue and write request queue, and read request queue forms after being sorted according to certain ordering rule by several read requests, and write request queue forms after being sorted according to certain ordering rule by several write requests.The embodiment of the present invention, after having converged user data read-write requests, by the type of the user data read-write requests according to collected, joins read request in read request queue, and write request is joined in write request queue; Optionally, join the last position that read request in read request queue is first placed on read request queue, for the read request in read request queue, it is the highest that the preceding read request that sorts is transferred priority to communication interface, it is minimum that the posterior read request that sorts is transferred priority to communication interface, and write request situation and read request in write request queue are similar; Obviously, the embodiment of the present invention also can specify to realize by user the distribution of Request Priority, and as user can customize the priority level that promotes the posterior request of sequence, the posterior request that makes to sort is preferentially adjusted to communication interface.
Step S12, work as read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted;
In the embodiment of the present invention, the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, the second request address be the request that just added at request address corresponding to front request; The request address of the request correspondence just having added is the memory address of request server pointed, and this server stores has user data; For read request queue, the request just having added in read request queue is read request, corresponding request address is read data address, read data address mainly refers to the memory location of the user data that reads of ask in the server of storage user data, and the first request address and the second request address can be read data address; For write request queue, the request just having added in write request queue is write request, corresponding request address is for writing data address, writes the memory location that data address mainly refers to treat the server that write data requests writes, and the first request address and the second request address can be for writing data address.What it should be noted that the read request that just added is also read request in front request, and the write request just having added is similar, and the request type that the first request address is corresponding with the second request address is identical.
In the embodiment of the present invention, the request address of the request correspondence just having added, response is mainly referred at request address corresponding to front request just having joined request with this, whether the request address of the request correspondence just having added is relevant to the request address in front request, the request address just having added with whether exist in front request direct associated, or indirectly associated, direct correlation mainly refers to can derive at once Next request address by the request address of one of them, as there is identical or serial relation between two or more request address, store in the server of user data, the data space that these two or more request address are corresponding is identical or continuous, indirect association mainly refers to by the request address of one of them and cannot derive at once next request address, but there is common file attribute between these two request address, by being subordinated to the request address under identical file, can realize from one of them request address and derive another request address, as the corresponding identical file of two request address address, but two request address are another discontinuous or identical.It should be noted that between request address and may have incoherent situation.
For the request address of the request just having added, with request address in front request to response, the embodiment of the present invention is provided with pre-conditioned, the pre-conditioned request address that is mainly used in weighing the request just having added, whether relevant to the request address in front request, i.e. whether direct correlation or indirect association.
Corresponding, the embodiment of the present invention is also provided with and pre-conditioned corresponding request queue method of adjustment, at the request address of the request just having added, with request address in front read request to response, meet when pre-conditioned, by according to pre-conditioned corresponding request queue method of adjustment, to just joining request, corresponding request queue is adjusted; Optionally, for the situation of multiple request address direct correlation, request corresponding these many request address can be merged, for the situation of multiple request address indirect associations, request queue can be reset, make the sequence of the request address that has indirect association mutually continuous, change for the visual concrete applicable cases of concrete method of adjustment of request queue, above-mentioned optional mode should not become its restriction.
Obviously, the embodiment of the present invention can only be considered the read data address that the read request in read request queue is corresponding, with read data address in front read request to response, thereby only read request queue is adjusted; Also consider only write request corresponding write data address, with front write request write data address to response, thereby only to write request queue adjust; Obviously also can consider the request address of the request correspondence just having added in read request queue and write request queue simultaneously, just joined request with this request address corresponding to front request to response, thereby respectively read request queue and write request queue are adjusted.
Step S13, detect read request queue transfer priority, and write request queue transfer priority, transfer in the request queue that priority is relatively high in front request, send to the server of storage user data the request of transferring.
The embodiment of the present invention can arrange the priority of transferring of multiple read request queue, definite method of transferring priority with write request queue, as the rotational cycle of transferring priority can be set, crossing one week after date, the priority of transferring of read request queue is set to height, the priority of transferring of write request queue is set to lowly, or the priority of transferring of read request queue is set to lowly, and the priority of transferring of write request queue is set to height; Also can determine and transfer priority by the difference of the request number of read request queue and write request queue, while being greater than the number of write request as the number of read request, the priority of transferring that read request queue is set is set to lowly, and the priority of transferring of write request queue is set to high.Determining the transferring after priority of read request queue and write request queue, transfer current transfer in the queue that priority is high in front request, send to the server of storage user data the request of transferring by the communication interface of physical machine.
The reading/writing method of user data under the virtualized environment that the embodiment of the present invention provides, in the time detecting that virtual machine exists user data read-write requests, the user data read-write requests of each virtual machine will be collected, read request is joined in preset read request queue, write request is joined in preset write request queue, and read request queue and/or write request queue are adjusted, by current transfer in the queue that priority is high front request send to storage user data server, realized the read-write of user data under virtualized environment, compared to existing technology, the reading/writing method of user data under the virtualized environment that the embodiment of the present invention provides, the user data read-write requests of virtual machine does not directly send to the server of storage user data by communication interface, but after the read-write requests of user data is intercepted and captured, for virtual machine carries out the agency of the read-write requests of user data, pass through read request queue, write request queue, the adjustment of read request queue and/or write request queue, and transfer in the queue that priority is high in front request, server to storage user data is sent in front request, make the user data read-write requests that is adjusted to communication interface become orderly, between virtual machine, the read-write of user data will be realized by agency, and no longer carry out the competition of the communication interface of physical machine, significantly reduce the read-write pressure of the communication interface of physical machine and the server of storage user data, improve the read-write efficiency of user data.
Above described in, step S12 can consider the adjustment of read request queue and the adjustment of write request queue simultaneously, Fig. 3 shows the reading/writing method of corresponding user data, another process flow diagram of the reading/writing method of user data under the virtualized environment that Fig. 3 provides for the embodiment of the present invention, the method is applied to simulation to be had in the physical machine of many virtual machines, with reference to Fig. 3, the method can comprise step:
Step S100, detect each virtual machine and whether have user data read-write requests;
Step S110, in the time there is user data read-write requests in virtual machine, collect the user data read-write requests of each virtual machine, read request is joined in read request queue, write request is joined in write request queue;
Step S120, when read data address that the read request just having added is asked, with the read data address of asking in front read request to response, while meeting default first condition, according to the preset read request queue method of adjustment corresponding with default first condition, read request queue is adjusted;
Whether the embodiment of the present invention is provided with default first condition, and whether default first condition is mainly used in weighing the read data address that the read request that just added is asked, relevant to the read data address of asking in front read request, i.e. direct correlation or indirect association.
Corresponding, the embodiment of the present invention is also provided with the read request queue method of adjustment corresponding with default first condition, the read data address of asking in the read request just having added, with the read data address of asking in front read request to response, while meeting default first condition, by the read request queue method of adjustment according to corresponding with default first condition, read request queue is adjusted; Optionally, for the situation of multiple read datas address direct correlation, the plurality of read data address can be merged, for the situation of multiple read datas address indirect association, read request queue can be reset, make the sequence of the read data address that has indirect association mutually continuous, change for the visual concrete applicable cases of concrete method of adjustment of read request queue, above-mentioned optional mode should not become its restriction.
Step S130, write data address when what the write request just having added was asked, with ask in front write request write data address to response, while meeting default second condition, according to the preset write request queue regulation method corresponding with default second condition, to write request, queue is adjusted;
Whether the embodiment of the present invention is provided with default second condition, and whether default second condition is mainly used in weighing the read data address that the read request that just added is asked, relevant to the read data address of asking in front read request, i.e. direct correlation or indirect association.
Corresponding, the embodiment of the present invention is also provided with the write request queue regulation method corresponding with default second condition, the read data address of asking in the write request just having added, with ask in front write request write data address to response, while meeting default second condition, by the write request queue regulation method according to corresponding with default second condition, to write request, queue is adjusted; Optionally, for multiple situations of writing data address direct correlation, the plurality of data address of writing can be merged, for multiple situations of writing data address indirect association, write request queue can be reset, make to exist the sequence of writing data address of indirect association mutually continuous, change for the visual concrete applicable cases of concrete method of adjustment of write request queue, above-mentioned optional mode should not become its restriction.
It should be noted that step S120 and step S130 in the embodiment of the present invention are respectively the processing of doing for read request queue and write request queue, do not exist the sequencing of step between step S120 and step S130.
Step S140, detect read request queue transfer priority, and write request queue transfer priority, read request queue transfer priority be greater than write request queue transfer priority time, transfer in read request queue in front read request, to storage user data server send the read request of transferring; Read request queue transfer priority be less than write request queue transfer priority time, transfer in write request queue in front write request, to storage user data server send the write request of transferring.
Already described above, in the embodiment of the present invention, between read data address, can there is direct association, or indirectly associated; For direct correlation, be chosen as the read data address of asking between read data address identical, or mutually continuous; For indirect association, be chosen as the read data address of asking between read data address and belong to a file address; The adjustment of carrying out for read request queue for ease of understanding the embodiment of the present invention, below will be identical with read data address, or consecutive direct correlation, and the indirect association that read data address belongs to a file address is that example is described; It should be noted that following example is only the optional mode of the address direct correlation of embodiment of the present invention read data and indirect association, it should not become the restriction of the embodiment of the present invention.
Optionally, default first condition can be, the read data address that the read request just having added is asked is identical with the read data address of asking in front read request.The process flow diagram that Fig. 4 adjusts for the read request queue that the embodiment of the present invention provides, with reference to Fig. 4, this flow process can comprise:
The read data address that the read request that step S1201, judgement have just added is asked, whether identical with the read data address of asking in front read request in read request queue, if so, perform step S1202;
Step S1202, the read request just having added is merged to described in front read request;
The read request just having added will merge in front request, form the same request with identical read data address, can be regarded as herein and cancel the read request just having added, and be retained in front read request, and Fig. 5 is the schematic diagram that read request merges, together reference.
To merge for multiple read requests of same read data address, can significantly reduce the number of read request, reduce read request number of times, the read-write pressure of the server of communication interface and storage user data is significantly reduced.
Optionally, default first condition can be, the read data address that the read request just having added is asked is mutually continuous with the read data address of asking in front read request.Another process flow diagram that Fig. 6 adjusts for the read request queue that the embodiment of the present invention provides, with reference to Fig. 6, this flow process can comprise:
The read data address that the read request that step S1211, judgement have just added is asked, whether continuous with the read data address of asking in front read request in read request queue, if so, perform step S1212;
Step S1212, the read data address that the read request just having added is asked and described read data address of asking in front read request, superpose according to the consecutive order of address, by the read request just having added with describedly merge in front read request.
The read request just having added will merge to described in front request, and the request after institute merges is the request with the address that superposes, and Fig. 7 is another schematic diagram of read request merging, together reference.
Multiple read requests continuous read data address are merged, can significantly reduce the number of read request, reduce read request number of times, the read-write pressure of the server of communication interface and storage user data is significantly reduced.
Optionally, default first condition can be that the read data address that the read request just having added is asked, belongs to a file address with the read data address of asking in front read request.The another process flow diagram that Fig. 8 adjusts for the read request queue that the embodiment of the present invention provides, with reference to Fig. 8, this flow process can comprise:
Whether the read data address that the read request that step S1221, judgement have just added is asked, with the read data address of asking in front read request, belong to a file address, if so, performs step S1222;
Step S1222, read request queue is reset, the sequence of the read request just having added is adjusted to described after front read request, make the sequence of the read request that belongs to a file address in described read request queue continuous.
The embodiment of the present invention is by the adjustment of read request queue, by making the sequence for the read request of identical file continuous, Fig. 9 is the schematic diagram that read request queue is reset, together reference.
The multiple read requests that belong to a file are sorted continuously, can make the access meeting of same file carry out continuously, thereby the read-write pressure of the server of storing user data is significantly reduced.
Already described above, in the embodiment of the present invention, write directly association of existence between data address, or indirectly associated; For direct correlation, be chosen as write between data address, ask to write data address identical, or mutually continuous; For indirect association, be chosen as and write the data address of writing of asking between data address and belong to a file address; For ease of understanding the embodiment of the present invention adjustment that queue is carried out for write request, below will be identical to write data address, or consecutive direct correlation, writing the indirect association that data address belongs to a file address is that example is described; It should be noted that following example only writes the optional mode of data address direct correlation and indirect association for the embodiment of the present invention, it should not become the restriction of the embodiment of the present invention.
Optionally, default second condition can be, what the write request just having added was asked writes data address, with ask in front write request to write data address identical.In the case, the implementation of write request regulator can be: what the write request that just added of judgement was asked writes data address, with ask in front write request whether write data address identical; If so, described in the write request just having added being merged to, in front write request, form and there is the identical same request of writing data address.Read request shown in the write request union operation that the embodiment of the present invention is carried out and Fig. 5 merges similar, and both can cross-reference.
Optionally, default second condition can be, what the write request just having added was asked writes data address, with ask in front write request to write data address mutually continuous, in the case, the implementation of write request regulator can be: what the write request that just added of judgement was asked writes data address, with ask in front write request whether write data address mutually continuous; If, the write request just having added is asked write data address and described ask in front write request write data address, consecutive order according to address superposes, and described in the write request just having added is merged to, in front write request, is merged into the request with stack address.Read request shown in the write request union operation that the embodiment of the present invention is carried out and Fig. 7 merges similar, and both can cross-reference.
Merge writing the identical or continuous multiple write requests of data address, can significantly reduce the number of read request, reduce read request number of times, the read-write pressure of the server of communication interface and storage user data is significantly reduced.
Optionally, default second condition can be that what the write request just having added was asked writes data address, belongs to a file address with the data address of writing of asking in front write request; In the case, the implementation of write request regulator can be: what the write request that judgement has just added was asked writes data address, and whether the data address of writing with asking in front write request, belong to a file address; If so, to write request, queue is reset, and described in the sequence of the write request just having added is adjusted to, after front write request, makes the sequence of the write request that belongs to a file address in described write request queue continuous.It is similar with the rearrangement of read request shown in Fig. 9 that the write request that the embodiment of the present invention is carried out is reset operation, and both can cross-reference.
The multiple write requests that belong to a file are sorted continuously, can make the access meeting of same file carry out continuously, thereby the read-write pressure of the server of storing user data is significantly reduced.
Optionally, also buffer memory in advance of the embodiment of the present invention, and/or, transfer in advance the user data in the server of storing user data, thereby ask in collected read request the data of reading, when corresponding with buffer memory in advance and/or the user data transferred in advance, the user data of directly transferring buffer memory in advance and/or transferring in advance, the read operation of completing user data.Concrete, can detect collected read request and ask the data of reading, whether corresponding with buffer memory in advance and/or the user data transferred in advance; Ask in collected read request the user data of reading, when corresponding with buffer memory in advance and/or the user data transferred in advance, return to read request to corresponding virtual machine and complete response, transfer buffer memory in advance and/or the corresponding data transferred in advance to corresponding virtual machine.
Wherein, can pass through user data read request in the past, analyze user data and read data the most frequently, user data is transferred to the user data that number of times reaches default number and carry out buffer memory in advance, optionally, user data can be buffered in to NVM(Nonvolatile memory, nonvolatile memory in advance) in; For transferring in advance of user data, can be by analyzing data read request in the past, analyze and followingly most possibly transferred and the current user data of not transferring, this part data is carried out to transferring in advance, the data of transferring in advance also can be stored in NVM.
Already described above, determine the priority of transferring of read request queue, and the mode of transferring priority of write request queue has multiple, for the embodiment of the present invention, can preferentially transfer read request, postpone to transfer write request, as can be first carried out transferring of read request, until read request has all been transferred, read request all sends to after the server of storage user data, then transfers write request.But in order to have taken into account write request, the implementation that the embodiment of the present invention provides a kind of read-write requests to transfer, the method flow diagram that Figure 10 transfers for the read-write requests that the embodiment of the present invention provides, with reference to Figure 10, the method can comprise:
The read request number of step S141, detection read request queue, and the write request number of write request queue;
Step S142, be greater than write request number when read request number, and when difference is not more than preset first threshold value, determine the priority of transferring that priority is greater than write request queue of transferring of read request queue, transfer in read request queue in front read request, to storage user data server send the read request of transferring;
The visual practical application request of preset first threshold value is set.
Step S143, in the time that read request number is less than write request number, determine the priority of transferring that priority is greater than write request queue of transferring of read request queue, transfer in read request queue in front read request, to storage user data server send the read request of transferring;
Step S144, be greater than write request number when read request number, and when difference is greater than preset first threshold value, determine the priority of transferring that priority is less than write request queue of transferring of read request queue, transfer in write request queue in front write request, to storage user data server send the write request of transferring.
Owing to postponing to transfer the pressure that write request can reduce communication interface and store the server of user data, therefore the embodiment of the present invention is also followed and is preferentially transferred read request for transferring of read-write requests, postpone to transfer the principle of write request, but the embodiment of the present invention is also provided with first threshold, make to be less than read request number in write request number, and while differing larger, carry out transferring of write request, in order to avoid the write request number of never call is too much.
Because the write request in the read-write requests of collected each virtual machine had both comprised data to be written, comprise again the data address of writing of data to be written, therefore in the time that the read-write requests of collected virtual machine is write request, the embodiment of the present invention, by data to be written corresponding buffer memory write request, joins in write request queue comprising the write request of writing data address corresponding to data to be written; Corresponding, transfer write request, while sending to the server of storage user data the write request of transferring, will transfer the data to be written of institute's buffer memory simultaneously, server to storage user data sends, and comprises described data to be written and the write request of writing data address corresponding to described data to be written.Optionally, data buffer storage to be written can be entered in NVM.
The embodiment of the present invention, data to be written corresponding write request are being carried out to buffer memory, after the write request of writing data address is joined to write request queue, can complete and reply to virtual machine transmission write request corresponding to this write request, write link thereby make this virtual machine can enter fast next user data.
Optionally, for the response that completes of read request, the embodiment of the present invention can arrange time limit read request response time (deadline), in the time that the read request number in read request queue is greater than default Second Threshold, be that read request number is when too much,, according to preset time limit read request response time, the read request of postponing the read request of default number in read request queue completes response, reads link so that virtual machine postpones to enter next user data; The visual practical situations of Second Threshold is set.
Optionally, after having collected the user data read-write requests of virtual machine, read request is joined to read request queue, before being joined to write request queue, write request also can comprise step: the access rights of the read-write requests to collected user data are verified, stop for the read-write requests of having no right the server of storage user data to conduct interviews, will proceed follow-up operation for the read-write requests of having the right the server of storage user data to conduct interviews, concrete, access rights that can the each virtual machine of buffer memory, if the user data read-write requests that the virtual machine collecting sends, not correspondingly with the access rights of each virtual machine of buffer memory (comprise and in buffer memory, do not have this virtual machine list, though or have this virtual machine list, but access qualification is not corresponding with current request), judge that current virtual machine sends the authority of user data read-write requests without the server of access storage user data, can stop read-write requests, end operation, also can be to the server request access rights of storage user data, and the buffer memory of the authority that conducts interviews in the physical machine of carrying virtual machine, if the user data read-write requests that the virtual machine collecting sends is corresponding with the access rights of each virtual machine of buffer memory, carry out follow-up operation.
The another process flow diagram of the reading/writing method of user data under the virtualized environment that Figure 11 provides for the embodiment of the present invention, Figure 11 shows the flow process of the reading/writing method of the user data of refinement, be only the optional implementation of corresponding step in flow process shown in Fig. 3 for some refinement modes wherein, with reference to Figure 11, the method can comprise:
Step S200, detect each virtual machine and whether have user data read-write requests;
Step S210, in the time there is user data read-write requests in virtual machine, collect the user data read-write requests of each virtual machine, judge in the access rights of institute's buffer memory, whether corresponding with the access rights of the user data read-write requests of collected each virtual machine, if not, execution step S220 or step S230, if so, perform step S240
Herein, access rights are the servers for storage user data, as the access rights of each virtual machine to network file system(NFS).
Step S220, process ends;
Step S230, to storage user data server request access rights, and in the machine cache access authority, return to step S210;
Step S240, judge the type of user data read-write requests, if read request performs step S250, if write request, execution step S310;
Step S250, whether in advance to judge in NVM buffer memory and/or transfer in advance the user data corresponding with read request, if so, performing step S260, if not, execution step S270;
Step S260, return to user data to corresponding virtual machine, complete read request;
Step S270, read request is joined in read request queue;
Step S280, when the read data address that the read request just having added is asked, when identical with the read data address of asking in front read request, the read request just having added is merged to described in front read request;
Step S290, when read data address that the read request just having added is asked, with the read data address consecutive hours of asking in front read request, the read data address that the read request just having added is asked and described read data address of asking in front read request are superimposed, the read request just having added are merged to described in front read request;
Step S300, when read data address that the read request just having added is asked, while belonging to a file address with the read data address of asking in front read request, read request queue is reset, described in being adjusted to, the sequence of the read request just having added after front read request, make the sequence of the read request that belongs to a file address in described read request queue continuous;
Step S310, data buffer storage to be written corresponding write request is entered in NVM, join in write request queue comprising the write request of writing data address corresponding to data to be written;
Step S320, write data address when what the write request just having added was asked, with ask in front write request write data address when identical, the write request just having added is merged to described in front write request;
Step S330, write data address when what the write request just having added was asked, with ask in front write request write data address consecutive hours, the write request just having added is asked write data address and described ask in front write request write data address, consecutive order according to address superposes, and the write request just having added is merged to described in front write request;
Step S340, write data address when what the write request just having added was asked, with ask in front write request write data address and belong to a file address time, to write request, queue is reset, described in being adjusted to, the sequence of the write request just having added after front write request, make the sequence of the write request that belongs to a file address in described write request queue continuous;
Step S350, detect read request queue transfer priority, and write request queue transfer priority;
Step S360, read request queue transfer priority be greater than write request queue transfer priority time, transfer in read request queue in front read request, to storage user data server send the read request of transferring;
Step S370, read request queue transfer priority be less than write request queue transfer priority time, transfer in write request queue in front write request, transfer the data to be written of institute's buffer memory simultaneously, server to storage user data sends, and comprises described data to be written and the write request of writing data address corresponding to described data to be written.
Method shown in Figure 11 is the reading/writing method of the user data under preferred virtualized environment, and it can significantly reduce the user data read-write pressure of the server of communication interface and storage user data.
Under the virtualized environment below embodiment of the present invention being provided, the read-write system of user data is described, and system described below is corresponding with above-described method, and both can cross-reference.
The structured flowchart of the read-write system of user data under the virtualized environment that Figure 12 provides for the embodiment of the present invention, this system is arranged in the physical machine of loading virtual machine, and with reference to Figure 12, this system can comprise:
Whether request detection module 100, there is user data read-write requests for detection of each virtual machine;
Can be on each virtual machine the driving of installation and measuring user data read-write requests, this driving can be thought the request detection module 100 that the embodiment of the present invention provides, in each virtual machine of the embodiment of the present invention, be provided with request detection module 100, optionally, it can realize the semantic compatible Virtual File System of a POSIX, catch the user data read-write requests of intercepting and capturing each virtual machine, mutual with request collection module 200 by intra-node communication mode.
Request collection module 200, when there is user data read-write requests at virtual machine, collects the user data read-write requests of each virtual machine;
The user data read-write requests of the each virtual machine collecting can be mounted in request detection module 100 on each virtual machine and intercept and capture after user data read-write requests, is forwarded to request collection module 200.
Module 300 is lined up in request, for the read request of user data read-write requests is joined in read request queue, write request is joined in write request queue;
The embodiment of the present invention is provided with read request queue and two queues of write request queue.
Request queue adjusting module 400, be used in read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted;
Wherein, the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, the second request address be the request that just added at request address corresponding to front request.
Module 500 is transferred in request, for detection of the priority of transferring of read request queue, and write request queue transfer priority, transfer in the request queue that priority is relatively high in front request, send to the server of storage user data the request of transferring.
Request is transferred module 500 and is communicated with communication interface, and module 500 is transferred in request can, by communication interface to the server of storing user data, as network file system(NFS), send the request of transferring.
Optionally, except request detection module 100 can be arranged on virtual machine, request collection module 200, module 300 is lined up in request, request queue adjusting module 400, request is transferred module 500 and can be arranged on virtual machine monitor, and concrete set-up mode can be as shown in figure 13.
Figure 14 shows the structure of request queue adjusting module, and request queue adjusting module 400 can comprise:
Read request queue adjustment unit 410, for the read data address of asking in the read request just having added, with the read data address of asking in front read request to response, while meeting default first condition, according to the preset read request queue method of adjustment corresponding with default first condition, read request queue is adjusted;
Write request regulator unit 420, for the data address of writing of asking in the write request just having added, with ask in front write request write data address to response, while meeting default second condition, according to the preset write request queue regulation method corresponding with default second condition, to write request, queue is adjusted;
Obviously, request queue adjusting module 400 also can comprise read request queue adjusting module 410, or write request regulator module 420.
Figure 15 shows the structure of the read request queue adjustment unit that the embodiment of the present invention provides, and with reference to Figure 15, read request queue adjustment unit 410 can comprise:
Default first condition judgment sub-unit 411, for the read data address that judges that the read request that just added is asked, whether identical with the read data address of asking in front read request, or no mutually continuous, or noly belonging to a file address, file corresponding to described file address carries multiple data;
The first read request merges subelement 412, for the read data address that judges that in default first condition judgment sub-unit 411 read request that just added is asked, when identical with the read data address of asking in front read request, described in being merged to, the read request just having added in front read request, forms the same request with identical read data address;
The second read request merges subelement 413, for the read data address that judges that in default first condition judgment sub-unit 411 read request that just added is asked, with the read data address consecutive hours of asking in front read request, the read data address that the read request just having added is asked and described read data address of asking in front read request, consecutive order according to address superposes, by the read request just having added and described front read request be merged into have stack address request;
Read request is reset subelement 414, for the read data address that judges that in default first condition judgment sub-unit 411 read request that just added is asked, while belonging to a file address with the read data address of asking in front read request, read request queue is reset, described in being adjusted to, the sequence of the read request just having added after front read request, make the sequence of the read request that belongs to a file address in described read request queue continuous.
Obviously, read request queue adjustment unit 410 also can only arrange the first read request and merge subelement 412, the second read requests merging subelements 413, and read request is reset at least one in subelement 414, corresponding, the Rule of judgment of default first condition judgment sub-unit 411 is adjusted accordingly.
The structured flowchart of the write request regulator unit that Figure 16 provides for the embodiment of the present invention, with reference to Figure 16, write request regulator unit 420 can comprise:
Default second condition judgment sub-unit 421, for the data address of writing that judges that the write request that just added asks, with ask in front write request whether write data address identical, or no mutually continuous, or noly belonging to a file address, file corresponding to described file address carries multiple data;
The first write request merges subelement 422, for the data address of writing that judges that in default second condition judgment sub-unit 421 write request that just added asks, with ask in front write request write data address when identical, described in the write request just having added is merged to, in front write request, form and there is the identical same request of writing data address;
The second write request merges subelement 423, for the data address of writing that judges that in default second condition judgment sub-unit 421 write request that just added asks, with ask in front write request write data address consecutive hours, the write request just having added is asked write data address and described ask in front write request write data address, consecutive order according to address superposes, by the write request just having added and described front write request be merged into have stack address request;
Write request is reset subelement 424, for the data address of writing that judges that in default second condition judgment sub-unit 421 write request that just added asks, with ask in front write request write data address and belong to a file address time, to write request, queue is reset, described in being adjusted to, the sequence of the write request just having added after front write request, make the sequence of the write request that belongs to a file address in described write request queue continuous.
Obviously, write request regulator module 420 also can only arrange the first write request and merge subelement 422, the second write requests merging subelements 423, and write request is reset at least one in subelement 424, corresponding, the Rule of judgment of default second condition judgment sub-unit 421 is adjusted accordingly.
Figure 17 shows the structure of asking to line up module, and with reference to Figure 17, request is lined up module 300 and can be comprised:
Data buffer storage unit 301 to be written, for data to be written corresponding to buffer memory write request;
Data to be written can be buffered in NVM.
Write request adds unit 302, for joining write request queue by comprising the write request of writing data address corresponding to data to be written.
Corresponding, lining up on the basis of module in request shown in Figure 17, Figure 18 shows the structure of asking to transfer module, and with reference to Figure 18, request is transferred module 500 and can be comprised:
Data to be written are transferred unit 501, the data to be written of buffer memory for transferring;
Write request transmitting element 502, for sending to the server of storage user data, comprises described data to be written and the write request of writing data address corresponding to described data to be written.
Corresponding, line up module in request shown in Figure 17, request shown in Figure 18 is transferred on the basis of module, and under the virtualized environment that the embodiment of the present invention provides, the read-write system of user data can also comprise:
Write request completes respond module (not shown), be used in data to be written corresponding to data buffer storage unit 301 buffer memory write requests to be written, write request adds unit 302 by comprising after the write request of writing data address corresponding to data to be written join write request queue, returns to write request complete response to virtual machine corresponding to write request.
Figure 19 shows another structure of asking to transfer module, and with reference to Figure 19, request is transferred module 500 and can be comprised:
Request number detecting unit 511, for detection of the read request number of read request queue, and the write request number of write request queue;
First transfers determining unit 512, for being greater than write request number when read request number, and when difference is not more than preset first threshold value, or read request number is while being less than write request number, determines the priority of transferring that priority is greater than write request queue of transferring of read request queue;
First transfers unit 513, for first transfer determining unit 512 determine read request queue transfer priority be greater than write request queue transfer priority time, transfer in read request queue in front read request, to storage user data server send the read request of transferring;
Second transfers determining unit 514, and for being greater than write request number when read request number, and difference is while being greater than preset first threshold value, determines the priority of transferring that priority is less than write request queue of transferring of read request queue;
Second transfers unit 515, for second transfer determining unit 514 determine read request queue transfer priority be less than write request queue transfer priority time, transfer in write request queue in front write request, to storage user data server send the write request of transferring.
Another structured flowchart of the read-write system of user data under the virtualized environment that Figure 20 provides for the embodiment of the present invention, shown in Figure 12 and Figure 20, system shown in Figure 20 also comprises:
Whether the pre-slow detection module 600 that fetches data, for after collecting the user data read-write requests of each virtual machine, detects the read request of collecting and asks the data of reading, corresponding with buffer memory in advance and/or the user data transferred in advance;
Buffer memory and/or the user data transferred in advance can be stored in NVM in advance.
User data is transferred module 700, ask for detecting collected read request at the pre-slow detection module 600 that fetches data the data of reading, when corresponding with buffer memory in advance and/or the user data transferred in advance, return to read request to corresponding virtual machine and complete response, transfer buffer memory in advance and/or the corresponding data transferred in advance to corresponding virtual machine;
Read request number detection module 800, for detection of the read request number in read request queue;
Module 900 is postponed in read request response, and while presetting Second Threshold for being greater than in read request number, according to preset time limit read request response time, the read request that postponement is returned to the read request of default number in read request queue to virtual machine completes response.
Optionally, under the virtualized environment that the embodiment of the present invention provides, the read-write system of user data can also comprise:
Configuration module (not shown), be used to the parameter of each modular unit in the read-write system of user data under virtualized environment to be configured, as generated Agent ID and access key for each virtual machine, carry request detection module on virtual machine, configuration module can provide a set of software UI interface or WebUI interface.
The read-write system of user data under the virtualized environment that the embodiment of the present invention provides, the user data read-write requests of virtual machine does not directly send to the server of storage user data by communication interface, but after the read-write requests of user data is intercepted and captured, for virtual machine carries out the agency of the read-write requests of user data, pass through read request queue, write request queue, the adjustment of read request queue and write request queue, and transfer in the queue that priority is high in front request, server to storage user data is sent in front request, make the user data read-write requests that is adjusted to communication interface become orderly, between virtual machine, the read-write of user data will be realized by agency, and no longer carry out the competition of the communication interface of physical machine, significantly reduce the read-write pressure of the communication interface of physical machine and the server of storage user data, improve the read-write efficiency of user data.
The structured flowchart of the physical machine that Figure 21 provides for the embodiment of the present invention, with reference to Figure 21, this physical machine can comprise: processor 1, communication interface 2, storer 3 and communication bus 4;
Wherein processor 1, communication interface 2, storer 3 complete mutual communication by communication bus 4;
Communication interface 2, the user data read-write requests of transferring for obtaining processor 1, sends this read-write requests to the server of storage user data;
Optionally, communication interface 2 can be network interface card interface;
Processor 1, for executive routine;
Storer 3, for depositing program;
Program can comprise program code, and described program code comprises computer-managed instruction.
Processor 1 may be a central processor CPU, or specific integrated circuit ASIC(Application Specific Integrated Circuit), or be configured to implement one or more integrated circuit of the embodiment of the present invention.
Storer 3 may comprise high-speed RAM storer, also may also comprise nonvolatile memory (non-volatile memory), for example at least one magnetic disk memory.
Wherein, program can be specifically for:
Detect each virtual machine and whether have user data read-write requests;
In the time there is user data read-write requests in virtual machine, collect the user data read-write requests of each virtual machine, read request is joined in read request queue, write request is joined in write request queue;
Work as read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted, described the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, described the second request address be the request that just added at request address corresponding to front request;
That detects read request queue transfers priority, and write request queue transfer priority, transfer in the request queue that priority is relatively high in front request, send to the server of storage user data the request of transferring.
Optionally, program can comprise the functional module shown in Figure 12 to Figure 20.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment, between each embodiment identical similar part mutually referring to.For the disclosed device of embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part illustrates referring to method part.
Professional can also further recognize, unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein, can realize with electronic hardware, computer software or the combination of the two, for the interchangeability of hardware and software is clearly described, composition and the step of each example described according to function in the above description in general manner.These functions are carried out with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel can realize described function with distinct methods to each specifically should being used for, but this realization should not thought and exceeds scope of the present invention.
The software module that the method for describing in conjunction with embodiment disclosed herein or the step of algorithm can directly use hardware, processor to carry out, or the combination of the two is implemented.Software module can be placed in the storage medium of any other form known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
To the above-mentioned explanation of the disclosed embodiments, make professional and technical personnel in the field can realize or use the present invention.To be apparent for those skilled in the art to the multiple modification of these embodiment, General Principle as defined herein can, in the situation that not departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (19)

1. a reading/writing method for user data under virtualized environment, is characterized in that, comprising:
Detect each virtual machine and whether have user data read-write requests;
In the time there is user data read-write requests in virtual machine, collect the user data read-write requests of each virtual machine, read request is joined in read request queue, write request is joined in write request queue;
Work as read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted, described the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, described the second request address be the request that just added at request address corresponding to front request;
That detects read request queue transfers priority, and write request queue transfer priority, transfer in the request queue that priority is high in front request, send to the server of storage user data the request of transferring.
2. method according to claim 1, it is characterized in that, described read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, request queue adjust corresponding to the first request address comprises:
The read data address that the read request just having added in read request queue is asked, with the read data address of asking in front read request to response, while meeting default first condition, according to the preset read request queue method of adjustment corresponding with default first condition, read request queue is adjusted; And/or,
What the write request just having added in write request queue was asked writes data address, with ask in front write request write data address to response, while meeting default second condition, according to the preset write request queue regulation method corresponding with default second condition, to write request, queue is adjusted.
3. method according to claim 2, is characterized in that, the read data address that the described read request just having added is asked, with the read data address of asking in front read request to response, meet default first condition and comprise:
The read data address that the read request just having added is asked, identical with the read data address of asking in front read request, or mutually continuous, or belonging to a file address, file corresponding to described file address carries multiple data;
Described according to the preset read request queue method of adjustment corresponding with default first condition, read request queue is adjusted specifically and comprised:
When the read data address that the read request just having added is asked, when identical with the read data address of asking in front read request, described in being merged to, the read request just having added in front read request, forms the same request with identical read data address; Or,
When the read data address that the read request just having added is asked, with the read data address consecutive hours of asking in front read request, the read data address that the read request just having added is asked and described read data address of asking in front read request, consecutive order according to address superposes, by the read request just having added and described front read request be merged into have stack address request; Or,
When the read data address that the read request just having added is asked, while belonging to a file address with the read data address of asking in front read request, read request queue is reset, described in being adjusted to, the sequence of the read request just having added after front read request, make the sequence of the read request that belongs to a file address in described read request queue continuous.
4. method according to claim 2, is characterized in that, what the described write request just having added was asked writes data address, with ask in front write request write data address to response, meet default second condition and comprise:
What the write request just having added was asked writes data address, with ask in front write request to write data address identical, or mutually continuous, or belong to a file address, file corresponding to described file address carries multiple data;
Described according to the preset write request queue regulation method corresponding with default second condition, to write request, queue is adjusted specifically and is comprised:
Write data address when what the write request just having added was asked, with ask in front write request write data address when identical, the write request just having added is merged to described in front write request, form and there is the identical same request of writing data address; Or,
Write data address when what the write request just having added was asked, with ask in front write request write data address consecutive hours, the write request just having added is asked write data address and described ask in front write request write data address, consecutive order according to address superposes, by the write request just having added and described front write request be merged into have stack address request; Or,
Write data address when what the write request just having added was asked, with ask in front write request write data address and belong to a file address time, to write request, queue is reset, described in being adjusted to, the sequence of the write request just having added after front write request, make the sequence of the write request that belongs to a file address in described write request queue continuous.
5. according to the method described in claim 1 to 4 any one, it is characterized in that, describedly write request is joined to write request queue comprise:
The data to be written that buffer memory write request is corresponding, join in write request queue comprising the write request of writing data address corresponding to data to be written;
The described server to storage user data sends the write request of transferring and specifically comprises:
Transfer the data to be written of institute's buffer memory, send to the server of storage user data, comprise described data to be written and the write request of writing data address corresponding to described data to be written.
6. method according to claim 5, is characterized in that, described method also comprises:
In data to be written corresponding to buffer memory write request, by comprising after the write request of writing data address corresponding to data to be written join write request queue, return to write request to virtual machine corresponding to write request and complete response.
7. according to the method described in claim 1 to 4 any one, it is characterized in that, after collecting the user data read-write requests of each virtual machine, also comprise:
Detect the read request collected and ask the data of reading, whether corresponding with buffer memory in advance and/or the user data transferred in advance;
Ask in collected read request the user data of reading, when corresponding with buffer memory in advance and/or the user data transferred in advance, return to read request to corresponding virtual machine and complete response, transfer buffer memory in advance and/or the corresponding data transferred in advance to corresponding virtual machine.
8. method according to claim 1, is characterized in that, described detection read request queue transfer priority, and the priority of transferring of write request queue comprises:
Detect the read request number of read request queue, and the write request number of write request queue;
When read request number is greater than write request number, and difference is while being not more than preset first threshold value, or read request number is while being less than write request number, determines the priority of transferring that priority is greater than write request queue of transferring of read request queue;
When read request number is greater than write request number, and difference is while being greater than preset first threshold value, determines the priority of transferring that priority is less than write request queue of transferring of read request queue;
Described transfer in the request queue that priority is relatively high in front request, send the request of transferring and comprise to the server of storage user data:
Read request queue transfer priority be greater than write request queue transfer priority time, transfer in read request queue in front read request, to storage user data server send the read request of transferring;
Read request queue transfer priority be less than write request queue transfer priority time, transfer in write request queue in front write request, to storage user data server send the write request of transferring.
9. according to the method described in claim 1,2,3,4,6 or 8, it is characterized in that, also comprise:
Detect the read request number in read request queue;
If read request number is greater than default Second Threshold, according to preset time limit read request response time, the read request that postponement is returned to the read request of default number in read request queue to virtual machine completes response.
10. a read-write system for user data under virtualized environment, is characterized in that, comprising:
Whether request detection module, there is user data read-write requests for detection of each virtual machine;
Request collection module, when there is user data read-write requests at virtual machine, collects the user data read-write requests of each virtual machine;
Module is lined up in request, for the read request of user data read-write requests is joined in read request queue, write request is joined in write request queue;
Request queue adjusting module, be used in read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted, described the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, described the second request address be the request that just added at request address corresponding to front request;
Module is transferred in request, for detection of the priority of transferring of read request queue, and write request queue transfer priority, transfer in the request queue that priority is relatively high in front request, send to the server of storage user data the request of transferring.
11. systems according to claim 10, is characterized in that, described request regulator module comprises:
Read request queue adjustment unit, for the read data address of asking in the read request just having added, with the read data address of asking in front read request to response, while meeting default first condition, according to the preset read request queue method of adjustment corresponding with default first condition, read request queue is adjusted; And/or,
Write request regulator unit, for the data address of writing of asking in the write request just having added, with ask in front write request write data address to response, while meeting default second condition, according to the preset write request queue regulation method corresponding with default second condition, to write request, queue is adjusted.
12. systems according to claim 11, is characterized in that, described read request queue adjustment unit comprises:
Default first condition judgment sub-unit, for the read data address that judges that the read request that just added is asked, whether identical with the read data address of asking in front read request, or no mutually continuous, or noly belonging to a file address, file corresponding to described file address carries multiple data;
The first read request merges subelement, for judge the read data address that the read request that just added is asked in described default first condition judgment sub-unit, when identical with the read data address of asking in front read request, described in being merged to, the read request just having added in front read request, forms the same request with identical read data address; Or,
The second read request merges subelement, for judge the read data address that the read request that just added is asked in described default first condition judgment sub-unit, with the read data address consecutive hours of asking in front read request, the read data address that the read request just having added is asked and described read data address of asking in front read request, consecutive order according to address superposes, by the read request just having added and described front read request be merged into have stack address request; Or,
Read request is reset subelement, for judge the read data address that the read request that just added is asked in described default first condition judgment sub-unit, while belonging to a file address with the read data address of asking in front read request, read request queue is reset, described in being adjusted to, the sequence of the read request just having added after front read request, make the sequence of the read request that belongs to a file address in described read request queue continuous.
13. systems according to claim 11, is characterized in that, described write request regulator unit comprises:
Default second condition judgment sub-unit, for the data address of writing that judges that the write request that just added asks, with ask in front write request whether write data address identical, or no mutually continuous, or noly belonging to a file address, file corresponding to described file address carries multiple data;
The first write request merges subelement, for the data address of writing that judges that in described default second condition judgment sub-unit the write request that just added asks, with ask in front write request write data address when identical, described in the write request just having added is merged to, in front write request, form and there is the identical same request of writing data address;
The second write request merges subelement, for the data address of writing that judges that in described default second condition judgment sub-unit the write request that just added asks, with ask in front write request write data address consecutive hours, the write request just having added is asked write data address and described ask in front write request write data address, consecutive order according to address superposes, by the write request just having added and described front write request be merged into have stack address request;
Write request is reset subelement, for the data address of writing that judges that in described default second condition judgment sub-unit the write request that just added asks, with ask in front write request write data address and belong to a file address time, to write request, queue is reset, described in being adjusted to, the sequence of the write request just having added after front write request, make the sequence of the write request that belongs to a file address in described write request queue continuous.
14. according to claim 10 to the system described in 13 any one, it is characterized in that, described request is lined up module and comprised:
Data buffer storage unit to be written, for data to be written corresponding to buffer memory write request;
Write request adds unit, for joining write request queue by comprising the write request of writing data address corresponding to data to be written;
Described request is transferred module and is comprised:
Data to be written are transferred unit, for write request queue transfer priority be greater than read request queue transfer priority time, transfer the data to be written of institute's buffer memory;
Write request transmitting element, for sending to the server of storage user data, comprises described data to be written and the write request of writing data address corresponding to described data to be written.
15. systems according to claim 14, is characterized in that, also comprise:
Write request completes respond module, be used in data to be written corresponding to described data buffer storage unit buffer memory write request to be written, described write request adds unit by comprising after the write request of writing data address corresponding to data to be written join write request queue, returns to write request complete response to virtual machine corresponding to write request.
16. according to claim 10 to the system described in 13, it is characterized in that, also comprises:
Whether the pre-slow detection module that fetches data, for after collecting the user data read-write requests of each virtual machine, detects the read request of collecting and asks the data of reading, corresponding with buffer memory in advance and/or the user data transferred in advance;
User data is transferred module, ask for detecting at the described pre-slow detection module that fetches data the read request of collecting the data of reading, when corresponding with buffer memory in advance and/or the user data transferred in advance, return to read request to corresponding virtual machine and complete response, transfer buffer memory in advance and/or the corresponding data transferred in advance to corresponding virtual machine.
17. systems according to claim 10, is characterized in that, described request is transferred module and comprised:
Request number detecting unit, for detection of the read request number of read request queue, and the write request number of write request queue;
First transfers determining unit, and for being greater than write request number when read request number, and difference is while being not more than preset first threshold value, or read request number is while being less than write request number, determines the priority of transferring that priority is greater than write request queue of transferring of read request queue;
First transfers unit, for described first transfer determining unit determine read request queue transfer priority be greater than write request queue transfer priority time, transfer in read request queue in front read request, to storage user data server send the read request of transferring;
Second transfers determining unit, and for being greater than write request number when read request number, and difference is while being greater than preset first threshold value, determines the priority of transferring that priority is less than write request queue of transferring of read request queue;
Second transfers unit, for described second transfer determining unit determine read request queue transfer priority be less than write request queue transfer priority time, transfer in write request queue in front write request, to storage user data server send the write request of transferring.
18. according to the system described in claim 10,11,12,13,15 or 17, it is characterized in that, also comprises:
Read request number detection module, for detection of the read request number in read request queue;
Module is postponed in read request response, and while presetting Second Threshold for being greater than in read request number, according to preset time limit read request response time, the read request that postponement is returned to the read request of default number in read request queue to virtual machine completes response.
19. 1 kinds of physical machine, is characterized in that, comprising: processor, communication interface, storer and communication bus;
Wherein said processor, described communication interface, described storer complete mutual communication by described communication bus;
Described communication interface, the user data read-write requests of transferring for obtaining described processor, sends this read-write requests to the server of storage user data;
Described processor, for executive routine;
Described storer, for depositing program;
Its Program is used for:
Detect each virtual machine and whether have user data read-write requests;
In the time there is user data read-write requests in virtual machine, collect the user data read-write requests of each virtual machine, read request is joined in read request queue, write request is joined in write request queue;
Work as read request queue, and/or the first request address in write request queue and the second request address response is met when pre-conditioned, according to pre-conditioned corresponding request queue method of adjustment, the request queue that the first request address is corresponding is adjusted, described the first request address is for just adding read request queue, and/or the request address of the request correspondence of write request queue, described the second request address be the request that just added at request address corresponding to front request;
That detects read request queue transfers priority, and write request queue transfer priority, transfer in the request queue that priority is relatively high in front request, send to the server of storage user data the request of transferring.
CN201210572237.8A 2012-12-25 2012-12-25 The reading/writing method of user data, system and physical machine under a kind of virtualized environment Expired - Fee Related CN103902348B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210572237.8A CN103902348B (en) 2012-12-25 2012-12-25 The reading/writing method of user data, system and physical machine under a kind of virtualized environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210572237.8A CN103902348B (en) 2012-12-25 2012-12-25 The reading/writing method of user data, system and physical machine under a kind of virtualized environment

Publications (2)

Publication Number Publication Date
CN103902348A true CN103902348A (en) 2014-07-02
CN103902348B CN103902348B (en) 2017-07-14

Family

ID=50993687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210572237.8A Expired - Fee Related CN103902348B (en) 2012-12-25 2012-12-25 The reading/writing method of user data, system and physical machine under a kind of virtualized environment

Country Status (1)

Country Link
CN (1) CN103902348B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812321A (en) * 2014-12-30 2016-07-27 沈阳高精数控智能技术股份有限公司 Network file system based on user information management file resource and processing method
CN106527989A (en) * 2016-10-28 2017-03-22 郑州云海信息技术有限公司 SCSI (Small Computer System Interface) command control method and system for storage system
CN106941461A (en) * 2017-02-23 2017-07-11 江苏徐工信息技术股份有限公司 A kind of method that utilization message queue optimizes server processing requests
CN107888687A (en) * 2017-11-15 2018-04-06 长沙证通云计算有限公司 A kind of agent client storage accelerated method and system based on distributed memory system
CN107908368A (en) * 2017-11-16 2018-04-13 郑州云海信息技术有限公司 A kind of single input storage organization and method with priority
WO2018171357A1 (en) * 2017-03-22 2018-09-27 华为技术有限公司 Resource management method and device
CN108780387A (en) * 2016-03-21 2018-11-09 高通股份有限公司 Storage resource management in virtualized environment
CN109684236A (en) * 2018-12-25 2019-04-26 广东浪潮大数据研究有限公司 A kind of data write buffer control method, device, electronic equipment and storage medium
CN110489353A (en) * 2019-07-19 2019-11-22 苏州浪潮智能科技有限公司 A kind of raising solid state hard disk bandwidth reading performance method and device
CN110597451A (en) * 2018-06-12 2019-12-20 华为技术有限公司 Method for realizing virtualized cache and physical machine
CN110865769A (en) * 2018-08-28 2020-03-06 阿里巴巴集团控股有限公司 Method for processing read/write request, network storage system and electronic equipment
CN111600943A (en) * 2020-05-09 2020-08-28 上海云轴信息科技有限公司 Method and equipment for acquiring target data
CN111752486A (en) * 2020-06-18 2020-10-09 杭州雾联科技有限公司 Method for reducing read delay of write-back data of diskless workstation based on IO (input/output) scheduling strategy
CN115348222A (en) * 2022-08-17 2022-11-15 北京蔚领时代科技有限公司 Message distribution method, device, server and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667161A (en) * 2008-09-02 2010-03-10 联想(北京)有限公司 Method and device for protecting data of storage device and computer system
CN102467408B (en) * 2010-11-12 2014-03-19 阿里巴巴集团控股有限公司 Method and device for accessing data of virtual machine
CN102521016A (en) * 2011-12-08 2012-06-27 中兴通讯股份有限公司 Method and system for operating multiple virtual machines
CN102693162A (en) * 2011-12-29 2012-09-26 中国科学技术大学苏州研究院 Method for process communication among multiple virtual machines on multi-core platform based on shared memory and intercore interruption

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812321A (en) * 2014-12-30 2016-07-27 沈阳高精数控智能技术股份有限公司 Network file system based on user information management file resource and processing method
CN105812321B (en) * 2014-12-30 2019-03-19 沈阳高精数控智能技术股份有限公司 A kind of Network File System and processing method based on subscriber information management file resource
CN108780387A (en) * 2016-03-21 2018-11-09 高通股份有限公司 Storage resource management in virtualized environment
CN106527989A (en) * 2016-10-28 2017-03-22 郑州云海信息技术有限公司 SCSI (Small Computer System Interface) command control method and system for storage system
CN106941461A (en) * 2017-02-23 2017-07-11 江苏徐工信息技术股份有限公司 A kind of method that utilization message queue optimizes server processing requests
WO2018171357A1 (en) * 2017-03-22 2018-09-27 华为技术有限公司 Resource management method and device
CN108628775A (en) * 2017-03-22 2018-10-09 华为技术有限公司 A kind of method and apparatus of resource management
CN107888687A (en) * 2017-11-15 2018-04-06 长沙证通云计算有限公司 A kind of agent client storage accelerated method and system based on distributed memory system
CN107888687B (en) * 2017-11-15 2020-06-16 长沙证通云计算有限公司 Proxy client storage acceleration method and system based on distributed storage system
CN107908368A (en) * 2017-11-16 2018-04-13 郑州云海信息技术有限公司 A kind of single input storage organization and method with priority
CN110597451A (en) * 2018-06-12 2019-12-20 华为技术有限公司 Method for realizing virtualized cache and physical machine
CN110597451B (en) * 2018-06-12 2021-02-23 华为技术有限公司 Method for realizing virtualized cache and physical machine
US11397690B2 (en) 2018-06-12 2022-07-26 Huawei Technologies Co., Ltd. Virtualized cache implementation method and physical machine
CN110865769A (en) * 2018-08-28 2020-03-06 阿里巴巴集团控股有限公司 Method for processing read/write request, network storage system and electronic equipment
CN110865769B (en) * 2018-08-28 2023-06-20 阿里巴巴集团控股有限公司 Method for processing read/write request, network storage system and electronic equipment
CN109684236A (en) * 2018-12-25 2019-04-26 广东浪潮大数据研究有限公司 A kind of data write buffer control method, device, electronic equipment and storage medium
CN110489353A (en) * 2019-07-19 2019-11-22 苏州浪潮智能科技有限公司 A kind of raising solid state hard disk bandwidth reading performance method and device
CN111600943A (en) * 2020-05-09 2020-08-28 上海云轴信息科技有限公司 Method and equipment for acquiring target data
CN111752486A (en) * 2020-06-18 2020-10-09 杭州雾联科技有限公司 Method for reducing read delay of write-back data of diskless workstation based on IO (input/output) scheduling strategy
CN111752486B (en) * 2020-06-18 2023-05-05 杭州雾联科技有限公司 Method for reducing read delay of write-back data of diskless workstation based on IO scheduling strategy
CN115348222A (en) * 2022-08-17 2022-11-15 北京蔚领时代科技有限公司 Message distribution method, device, server and storage medium
CN115348222B (en) * 2022-08-17 2023-11-17 北京蔚领时代科技有限公司 Message distribution method, device, server side and storage medium

Also Published As

Publication number Publication date
CN103902348B (en) 2017-07-14

Similar Documents

Publication Publication Date Title
CN103902348A (en) Method and system for reading and writing user data under virtual environment and physical machine
US5884077A (en) Information processing system and method in which computer with high load borrows processor of computer with low load to execute process
CN105630955B (en) A kind of data acquisition system member management method of high-efficiency dynamic
CN104391737B (en) The optimization method of load balance in cloud platform
US8732576B2 (en) Operating system providing multi-touch support for applications in a mobile device
JP5664098B2 (en) Composite event distribution apparatus, composite event distribution method, and composite event distribution program
CN110928661B (en) Thread migration method, device, equipment and readable storage medium
CN106326002B (en) Resource scheduling method, device and equipment
US10972555B2 (en) Function based dynamic traffic management for network services
US9792231B1 (en) Computer system for managing I/O metric information by identifying one or more outliers and comparing set of aggregated I/O metrics
CN101957863A (en) Data parallel processing method, device and system
CN104462432A (en) Self-adaptive distributed computing method
CN109614276A (en) Fault handling method, device, distributed memory system and storage medium
CN109656895A (en) Distributed memory system, method for writing data, device and storage medium
CN104407926A (en) Scheduling method of cloud computing resources
WO2024119763A1 (en) Computing power scheduling method for container cluster, and related apparatus
CN106257456A (en) The method of data base's stability, Apparatus and system is improved under high concurrent request
US20190332328A1 (en) Storage Controller and IO Request Processing Method
CN102193856A (en) Trace data priority selection
US9146952B1 (en) System and method for distributed back-off in a database-oriented environment
CN109669822A (en) The creation method and computer readable storage medium of electronic device, spare memory pool
CN115543938A (en) Data processing method and device, electronic equipment and storage medium
JP2007018407A (en) Data replication system
CN113836184A (en) Service persistence method and device
CN110674008B (en) Problem disk log information collection method, device, equipment and medium of SSD

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170714

Termination date: 20201225

CF01 Termination of patent right due to non-payment of annual fee