CN104205780A - Data storage method and device - Google Patents

Data storage method and device Download PDF

Info

Publication number
CN104205780A
CN104205780A CN201480000338.5A CN201480000338A CN104205780A CN 104205780 A CN104205780 A CN 104205780A CN 201480000338 A CN201480000338 A CN 201480000338A CN 104205780 A CN104205780 A CN 104205780A
Authority
CN
China
Prior art keywords
server
data
memory space
residual
servers
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
CN201480000338.5A
Other languages
Chinese (zh)
Other versions
CN104205780B (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 Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN104205780A publication Critical patent/CN104205780A/en
Application granted granted Critical
Publication of CN104205780B publication Critical patent/CN104205780B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems

Abstract

The invention discloses a data storage method and a device, relating to the technology field. The invention is used for reducing the time delay of reading data so as to improve the system performance.The method provided by the invention is applied in the storage system. The distribution mode storage system comprises a first server and the other servers. The method comprises steps of determining the first data generated by the first server, determining the size relation between the residual storage space of the first server and the storage space occupied by the first data,and storing the first data in the residual storage space of the first server if the residual storage space of the first server is bigger or eaqual to the storage space occupied by the first data and the storage space used by the first server is bigger than the minimum used storage space.

Description

A kind of method and apparatus of storing data
Technical field
The present invention relates to technical field of memory, relate in particular to a kind of method and apparatus of storing data.
Background technology
Distributed memory system is high with reliability, availability strong, be easy to the features such as expansion becomes the focus of research.Distributed memory system is made up of multiple servers, on each server, one or more virtual machine can be installed, a part of memory space on the corresponding RAID of each server (Redundant Arrays of Independent Disks, disk array).
At present, in distributed memory system, be generally the data allocations amount of physical memory that the application of installing on server/virtual machine generates according to the principle of " load balancing ", be, the data allocations amount of physical memory that the application of installing on server/virtual machine generates according to the principle of " memory space of the use equilibrium of the each server in HDFS "; Wherein, amount of physical memory is the memory space of the disk array that a certain server is corresponding and/or the memory space of this server itself.Concrete, taking distributed memory system as HDFS, (Hadoop Distributed File System, distributed file system) describes for example:
In HDFS, minimum memory unit is piece (block), and the maximum of each is 64M.In the time that the shared memory space of data of the application of installing on server/virtual machine generation is greater than 64M, first this server carries out piecemeal to these data, usually, have at the most 1 shared memory space of piece to be less than 64M, the shared memory space of all the other pieces is equal to 64M; Secondly according to the principle of " memory space of the use equilibrium of the each server in HDFS ", by each memory space that is mapped to one or more server in HDFS.In the time that the shared memory space of data of the application of installing on server/virtual machine generation is equal to or less than 64M, according to the principle of " memory space of the use equilibrium of the each server in HDFS ", by this data-mapping in HDFS, use on the memory space of server of memory space minimum.
Owing to being the data allocations physical location that the application of installing on server/virtual machine generates according to the principle of " load balancing " in such scheme, therefore, the part/total data in these data may be stored on the memory space of other servers in distributed memory system.Like this, this server often need to read this data from the memory space of other servers, thereby causes the problem that reading out data time delay is large, and then causes systematic function poor.
Summary of the invention
The embodiment of the present invention provides a kind of method and apparatus of storing data, the time delay when reducing reading out data, thus improve systematic function.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, provides a kind of method of storing data, is applied to distributed memory system, and described distributed memory system comprises first server and other servers, and described method comprises:
Determine the first data that described first server generates;
Judge the magnitude relationship of the shared memory space of the residual memory space of described first server and described the first data;
If the residual memory space of described first server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described first server has been used memory space, described the first data are stored in the residual memory space of described first server.
In conjunction with first aspect, in the possible implementation of the first, described first server comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server; Described method also comprises:
If the residual memory space of described first server is less than the shared memory space of described the first data, send to described second server the first Indication message that comprises described the first data; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
In the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
In conjunction with first aspect, in the possible implementation of the second, described other servers comprise second server; Described method also comprises:
If the residual memory space of described first server is less than the shared memory space of described the first data, send to described second server the first Indication message that comprises described the first data; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Upgrade the residual memory space of described first server;
When residual memory space after described first server is upgraded is greater than or equal to the shared memory space of described the first data, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described first server;
Receive described the first data that described second server sends;
Described the first data are stored in the residual memory space after described first server is upgraded.
In conjunction with the possible implementation of the first of first aspect, first aspect or the possible implementation of the second any, in the third possible implementation, described other servers also comprise the 3rd server, described method also comprises:
The 3rd Indication message that sends the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
Second aspect, provides a kind of method of storing data, is applied to distributed memory system, and described distributed memory system comprises first server and other servers, and described method comprises:
Determine the first data that described first server generates; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system;
Judge the magnitude relationship of the shared memory space of the residual memory space of described first server and described the first data;
If the residual memory space of described first server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described first server has been used memory space, described the first data are stored in the residual memory space of described first server.
The third aspect, provides a kind of server, is applied to distributed memory system, and described distributed memory system also comprises other servers, and described server comprises:
Determination module, for the first data of determining that described server generates;
Judge module, for judging the magnitude relationship of the shared memory space of the residual memory space of described server and described the first data;
Memory module, for determining that at described judge module the residual memory space of described server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described server has been used memory space, described the first data are stored in the residual memory space of described server.
In conjunction with the third aspect, in the possible implementation of the first, described server comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server, and described server also comprises:
Sending module, when determining that at described judge module the residual memory space of described server is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Transferring module, for in the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
In conjunction with the third aspect, in the possible implementation of the second, described other servers comprise second server, and described server also comprises:
Sending module, when determining that at described judge module the residual memory space of described server is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Update module, for upgrading the residual memory space of described server;
Described sending module also for, in the time that the residual memory space after described server update is greater than or equal to the shared memory space of described the first data, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described server;
Receiver module, described the first data that send for receiving described second server;
Described memory module also for, described the first data are stored in the residual memory space after described server update.
In conjunction with the possible implementation of the second of the possible implementation of the first of the third aspect, the third aspect or the third aspect any, in the third possible implementation, described other servers also comprise the 3rd server;
Described sending module also for, the 3rd Indication message that sends the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
Fourth aspect, provides a kind of server, is applied to distributed memory system, and described distributed memory system also comprises other servers, and described server comprises:
Processor, for the first data of determining that described server generates; And judge the magnitude relationship of the residual memory space of described server and the shared memory space of described the first data;
Memory, for determining that at described processor the residual memory space of described server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described server has been used memory space, under the control of described processor, described the first data are stored in the residual memory space of described server.
In conjunction with fourth aspect, in the possible implementation of the first, described server comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server, and described server also comprises:
Transmitter, when determining that at described processor the residual memory space of described server is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Described processor also for, in the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
In conjunction with fourth aspect, in the possible implementation of the second, described other servers comprise second server;
Described processor also for, upgrade the residual memory space of described server;
Described transmitter also for, in the time that the residual memory space after described server update is greater than or equal to the shared memory space of described the first data, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described server;
Described server also comprises: receiver, described the first data that send for receiving described second server;
Described memory also for, under the control of described processor, described the first data are stored in the residual memory space after described server update.
In conjunction with the possible implementation of the second of the possible implementation of the first of fourth aspect, fourth aspect or fourth aspect any, in the third possible implementation, described other servers also comprise the 3rd server;
Described transmitter also for, the 3rd Indication message that sends the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
The 5th aspect, provides a kind of server, is applied to distributed memory system, and described distributed memory system also comprises other servers, and described server comprises:
Determination module, for the first data of determining that described server generates; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system;
Judge module, for judging the magnitude relationship of the shared memory space of the residual memory space of described server and described the first data;
Memory module, for determining that at described judge module the residual memory space of described server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described server has been used memory space, described the first data are stored in the residual memory space of described server.
The 6th aspect, provides a kind of server, is applied to distributed memory system, and described distributed memory system also comprises other servers, and described server comprises:
Processor, for the first data of determining that described server generates; And judge the magnitude relationship of the residual memory space of described server and the shared memory space of described the first data; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system;
Memory, for determining that at described processor the residual memory space of described server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described server has been used memory space, under the control of described processor, described the first data are stored in the residual memory space of described server.
Technique scheme, is applied to distributed memory system, in the time that a server determines that its residual memory space is greater than or equal to the shared memory space of data of its generation, preferentially these data is stored in the residual memory space of this server.Like this, this server can directly read this data from this locality, and need to not read this data by other servers from network, thereby reaches the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers by network cause time extend, the poor problem of systematic function.
Brief description of the drawings
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 skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The flow chart of a kind of method of storing data that Fig. 1 provides for the embodiment of the present invention one;
The flow chart of a kind of method of storing data that Fig. 2 provides for the embodiment of the present invention two;
The flow chart of a kind of method of storing data that Fig. 3 provides for the embodiment of the present invention 1;
The flow chart of a kind of method of storing data that Fig. 4 provides for the embodiment of the present invention 2;
The structural representation of a kind of server that Fig. 5 provides for the embodiment of the present invention three;
The structural representation of the another kind of server that Fig. 6 provides for the embodiment of the present invention three;
The structural representation of a kind of server that Fig. 7 provides for the embodiment of the present invention four;
The structural representation of the another kind of server that Fig. 8 provides for the embodiment of the present invention four;
The structural representation of a kind of server that Fig. 9 provides for the embodiment of the present invention five;
The structural representation of a kind of server that Figure 10 provides for the embodiment of the present invention six.
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, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Term " system " and " network " are often used interchangeably in this article herein.Term "and/or" herein, is only a kind of incidence relation of describing affiliated partner, and expression can exist three kinds of relations, and for example, A and/or B, can represent: individualism A exists A and B, these three kinds of situations of individualism B simultaneously.Character "/" herein, generally represents that forward-backward correlation is to liking a kind of relation of "or".
Embodiment mono-
As shown in Figure 1, for a kind of method of storing data that the present embodiment provides, be applied to distributed memory system, described distributed memory system comprises first server and other servers, and described method comprises:
101: determine the first data that described first server generates.
Wherein, " first server " can be the arbitrary server in distributed memory system; " other servers " refers to the Servers-all in this distributed memory system, except first server." the first data " can be arbitrary data of first server generation.The executive agent of the present embodiment can be " first server ".
Server in distributed memory system can be installed one or more virtual machine, and virtual machine also can be installed.In the time virtual machine being installed on server, this server shares with the virtual machine of installing on it disk array that this server is corresponding.In addition, in the time that one or more virtual machine is installed on server, the first data that this server generates can be: the data that the upper application of installing of this server (physical machine) generates; The data that also can generate for a virtual machine of installing on this server.
Further, when data be on server, install one application generate data time, this server can record the corresponding relation between these data and this server; When data be on server, install one virtual machine generate data time, this server can record the corresponding relation between these data and this virtual machine.Specifically can record this corresponding relation by generated data routing table.Usually, the each server in distributed memory system all can be shared this data routing table.In this article, when the server at the application/virtual machine place that generates data, is thought and realized the localization to these data while being same server with the corresponding server of memory space of these data of storage.
102: the magnitude relationship that judges the shared memory space of the residual memory space of described first server and described the first data.
Wherein, " residual memory space of server " refer in the memory space of disk array that this server is corresponding and/or this server itself, do not store data, free memory.The size of residual memory space can be 0, also can comprise one or more memory cell.The size etc. that the residual memory space of each server may be because deleting the data of having stored, increase data to be stored, change the disk array that this server is corresponding is upgraded.Server can include but not limited to obtain its residual memory space according to following several modes: periodically obtain its residual memory space, regularly obtain its residual memory space, obtain its residual memory space etc. while generating data.
The present embodiment does not limit the size of " memory space that the first data are shared ".
Before step 102, the method can also comprise: obtain the shared memory space of described the first data, and the residual memory space of described first server.
103: if the residual memory space of described first server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described first server has been used memory space, described the first data are stored in the residual memory space of described first server.
Wherein, step 103 specifically can comprise: described first server is greater than or equal to the shared memory space of described the first data at definite its residual memory space, and when the minimum that uses memory space to be greater than described other servers of described first server has been used memory space, for described the first data allocations memory address, and described the first data are stored in memory cell corresponding to described memory address; Described memory address is memory address corresponding to one or more memory cell in the residual memory space of described first server.
Exemplary, by a concrete example, " minimum of other servers has been used memory space " described: suppose that other servers are made up of server 1, server 2, server 3, the size that uses memory space of these 3 servers is respectively: A, B, C, and A > B > C; So, the minimum of other servers has been used memory space for C.
Further, in order to contrast in detail with prior art scheme, from the angle of the peaked magnitude relationship of the minimum memory unit of the shared memory space of the first data and distributed memory system, step 103 is described below.Concrete, in the case of comprising feature " residual memory space of first server is greater than or equal to the shared memory space of the first data ", step 103 can comprise following scene 1 and scene 2:
1: the first shared memory space of data of scene is greater than the maximum of the minimum memory unit of distributed memory system, and the minimum that uses memory space to be greater than other servers of first server has been used memory space.
2: the first shared memory spaces of data of scene are less than or equal to the maximum of the minimum memory unit of distributed memory system, and the minimum that uses memory space to be greater than other servers of first server has been used memory space.
Wherein, for scene 1, in prior art scheme, first server need to be carried out piecemeal to the first data, and according to the principle of " load balancing ", respectively by the residual memory space of the each multiple servers that are stored in distributed memory system.For scene 2, in prior art scheme, first server need to be stored in the first data in the maximum residual memory space in other servers.
It should be noted that, when actual realization, also may occur following scenario A and scenario B:
Scenario A: the shared memory space of the first data is greater than the maximum of the minimum memory unit of distributed memory system, and the minimum that uses memory space to be less than or equal to other servers of first server has been used memory space.
Scenario B: the shared memory space of the first data is less than or equal to the maximum of the minimum memory unit of distributed memory system, and the minimum that uses memory space to be less than or equal to other servers of first server has been used memory space.
Wherein, provide the implementation method for scenario A herein, in following embodiment bis-, had corresponding description.For scenario B, identical with the implementation method of prior art scheme, concrete, first server is stored in the first data in its residual memory space.
Summary, from above-mentioned scene 1, scene 2, scenario A and scenario B, when actual realization, the method of the storage data that the embodiment of the present invention provides does not need to limit the size of the shared memory space of the first data, does not need to limit the magnitude relationship that uses memory space that uses memory space and other servers of first server yet.Specific implementation includes but not limited to the method shown in following embodiment 1 and embodiment 2.
In one embodiment of the invention, described first server comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server; Described method also comprises the steps A1-A2:
Steps A 1: if the residual memory space of described first server is less than the shared memory space of described the first data, send to described second server the first Indication message that comprises described the first data; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server.
Steps A 2: in the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
Wherein, " second server " can be arbitrary server in this distributed memory system, except first server, that meet " residual memory space is greater than or equal to the shared memory space of other data except the first data that described virtual machine is corresponding " condition.
Steps A 1 can comprise: A11) if described first server is less than the shared memory space of described the first data at definite its residual memory space, determine the size of the shared memory space of other data except described first data corresponding with described virtual machine; A12) server that residual memory space is greater than or equal to this memory space is as second server; A13) send to described second server the first Indication message that comprises described the first data.
Exemplary, the specific implementation of " by described virtual machine and other Data Migrations corresponding to described virtual machine to described second server ", as prior art, is no longer described herein.
It should be noted that, when actual realization, steps A 2 can be carried out immediately after steps A 1; Also can in the time that need to reading the first data, carry out described virtual machine.Wherein, the former can be described as: in the time that the first data are write to second server, realize the localization of the first data; The latter can be described as: in the time that described virtual machine need to read described the first data, realize the localization of the first data.
In this embodiment, in " first server by described virtual machine (vm) migration to second server ", afterwards, described virtual machine becomes the virtual machine being arranged on second server, no longer has described virtual machine in first server.In " first server will with described other Data Migrations to second server ", afterwards, described other data be all stored in the memory space of second server.In addition, this optional embodiment can be called to the localization that realizes the first data by the mode of virtual machine (vm) migration.
In another embodiment of the present invention, described other servers comprise second server; Described method also comprises the steps B1-B4:
Step B1: if the residual memory space of described first server is less than the shared memory space of described the first data, send to described second server the first Indication message that comprises described the first data; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server.
Step B2: the residual memory space that upgrades described first server.
Step B3: when the residual memory space after described first server is upgraded is greater than or equal to the shared memory space of described the first data, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described first server.
Step B4: receive described the first data that described second server sends; Described the first data are stored in the residual memory space after described first server is upgraded.
Wherein, in this embodiment, second server is after sending the first data to first server, and second server can be deleted the first data of this locality storage, also can not delete.In the former implementation, the present embodiment can be called to the localization that realizes the first data by the mode of the first Data Migration; In the latter's implementation, can think that the copy of first data of storing in distributed memory system has become n+1 copy by n copy, wherein, the method for the copy of storage the first data relevant embodiment that can vide infra.It should be noted that, for corresponding with above-mentioned optional embodiment, hereinafter this optional embodiment is called to the localization that realizes the first data by the mode of the first Data Migration.
In another embodiment of the present invention: described first server comprises a virtual machine, described the first data are data that described virtual machine generates, and described other servers also comprise the 3rd server, the further comprising the steps of C of described method:
Step C: described first server sends the 3rd Indication message of the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
Wherein, " the 3rd server " can be for storing the copy of the first data, can comprise one or more the 3rd server in distributed memory system.When actual realization, the each server in distributed memory system all can be known the residual memory space of Servers-all in this distributed memory system.In this embodiment, first server can be according to the principle of " load balancing ", and one or more server in selection distributed memory system is as the 3rd server.
This embodiment, by the copy of storage the first data, can reach the beneficial effect of the performance that strengthens distributed memory system.Concrete: in the time of the first corrupted data or loss, can distributed memory system normally be moved by calling the copy of the first data, thereby strengthen the stability of system.
The method of the storage data that the embodiment of the present invention provides, be applied in the distributed memory system that comprises first server and other servers, determine that in first server its residual memory space is greater than or equal to the shared memory space of data of its generation, and when the minimum that uses memory space to be greater than other servers of first server has been used memory space, preferentially these data are stored in the residual memory space of this server.Like this, first server can directly read this data from this locality, and need to not read this data by other servers from network, thereby reaches the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers in network cause time extend, the poor problem of systematic function.
Embodiment bis-
The method of the storage data that the present embodiment provides, is applied to distributed memory system, and described distributed memory system comprises first server and other servers.What the present embodiment was described is the method for storing data under the scenario A in above-described embodiment one.
As shown in Figure 2, comprising:
201: determine the first data that described first server generates; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system.
202: the magnitude relationship that judges the shared memory space of the residual memory space of described first server and described the first data.
203: if the residual memory space of described first server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described first server has been used memory space, described the first data are stored in the residual memory space of described first server.
Further, for the scene (being scenario A) of the present embodiment, in prior art scheme, first server need to be carried out piecemeal to the first data, and according to the principle of " load balancing ", respectively by the residual memory space of the each multiple servers that are stored in distributed memory system.
Optionally, in one embodiment of the invention, described method can also comprise: the steps A 1-A2 in above-described embodiment one, or step B1-B4 in above-described embodiment one; In addition, can also comprise the step C in above-described embodiment one.
It should be noted that, the relevant explanation in the present embodiment can be with reference to the relevant portion of above-described embodiment one.
The method of the storage data that the embodiment of the present invention provides, be applied in the distributed memory system that comprises first server and other servers, determine that in first server its residual memory space is greater than or equal to the shared memory space of data of its generation, and when the minimum that uses memory space to be less than or equal to other servers of first server has been used memory space, preferentially these data are stored in the residual memory space of this server; Wherein, the shared memory space of these data is greater than the maximum of the minimum memory unit of distributed memory system.Like this, first server can directly read this data from this locality, and need to not read this data by other servers from network, thereby reaches the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers in network cause time extend, the poor problem of systematic function.
The method of the storage data that above-described embodiment one and embodiment bis-provided below by several specific embodiments is carried out exemplary illustration:
Embodiment 1
In the present embodiment, in first server, do not comprise virtual machine." this locality " in the present embodiment refers to the server at the application place of generated data.
As shown in Figure 3, be a kind of method of storing data that the present embodiment provides, comprising:
301: the upper application of installing of first server (physical machine) generates data.
Exemplary, " application " here can be any application of the prior art, for example, text processing application, audio frequency are processed application, video pictures is processed application, computer control application, computer-aided design application, scientific simulations application etc.
Suppose to carry out this step 301 4 times, the upper application symbiosis of installing of first server (physical machine) becomes 4 data, is respectively D1, D2, D3, D4.
302: first server is obtained residual memory space and the shared memory space of these data of first server.
Particularly, step 302 can be implemented as: the distributed storage program in first server is obtained residual memory space and the shared memory space of these data of first server
Exemplary, according to the example in step 301,4 execution steps 302, the residual memory space of the first server of obtaining is respectively: X1, X2, X3, X4; The size in the shared space of data D1, D2, D3, D4 is respectively: M1, M2, M3, M4.
303: first server judges whether its residual memory space is greater than or equal to the shared memory space of these data.
If so, perform step 304; If not, perform step 305.
Particularly, step 303 can be implemented as: the distributed storage program in first server judges whether the residual memory space of first server is greater than or equal to the shared memory space of these data.
Exemplary, according to the example in step 302, suppose: X1 > M1, X2 > M2, X3=M3, X4 ﹤ M4.
304: first server is stored in these data in the residual memory space of first server.Specifically comprise: the distributed storage program in first server is this data allocations memory address, and these data are stored in memory module corresponding to this memory address; This memory address is memory address corresponding to one or more memory module in the residual memory space of first server.
After execution step 304, finish.
Exemplary, according to the example in step 303, D1, D2, D3 store respectively in (residue) memory space of first server.Suppose that first server is that the memory address that D1, D2, D3 distribute is respectively: S1/D1/offset1, S1/D2/offset2, S1/D2/offset3.Wherein, S1 represents first server, and S1/D1/offset1 represents: the memory address of data D1 is positioned at the offset1 place of the memory space of first server S1, and other memory address is explained no longer one by one.
After the 3rd execution step 301-306, the data routing table recording in distributed memory system is as shown in table 1:
Table 1
Data Local Residual memory space Address data memory
D1 S1 X1 S1/D1/offset1
D2 S1 X2 S1/D2/offset2
D3 S1 X3 S1/D3/offset3
305: first server sends the first Indication message that comprises these data to second server; The first Indication message is used to indicate second server these data is stored in the residual memory space of second server.
After execution step 305, execution step 306.
306: second server is stored in these data in the residual memory space of second server according to the first Indication message.Specifically comprise: the distributed storage program on second server is this data allocations memory address, and these data are stored in memory module corresponding to this memory address; This memory address is memory address corresponding to one or more memory module in the residual memory space of second server.
Exemplary, according to the example in step 303, D4 is stored in (residue) memory space of second server.Suppose that second server is that the memory address that D4 distributes is respectively: S2/D4/offset4.Wherein, S2 represents second server, and S2/D4/offset4 represents that the memory address of data D4 is positioned at the offset4 place of the memory space of second server S2.
After the 4th execution step 301-306, the data routing table recording in distributed memory system is as shown in table 2:
Table 2
Data Local Residual memory space Address data memory
D1 S1 X1 S1/D1/offset1
D2 S1 X2 S1/D2/offset2
D3 S1 X3 S1/D3/offset3
D4 S1 X4 S2/D4/offset4
As shown in Table 2, obtain the server of data D4 and the server of storage data D4 for being same server.
307: first server is upgraded the residual memory space of first server, and periodically detect the residual memory space after first server is upgraded.
Particularly, step 307 can be implemented as: the residual memory space of the distributed storage program updates first server in first server, and periodically detect the residual memory space after first server is upgraded.
Exemplary, according to the example in step 306, after the 4th is performed step to 301-306, performing step at 307 o'clock, the residual memory space after the first server of acquisition is upgraded is expressed as X4 '.Suppose X4 ' > M4.
308: first server judges whether the residual memory space after its renewal is greater than or equal to the shared memory space of these data.
If not, return to step 307; If so, perform step 309.
Particularly, step 308 can be implemented as: the distributed storage program in first server judges whether the residual memory space after first server is upgraded is greater than or equal to the shared memory space of these data.
Exemplary, according to the example in step 307, step 308 is specially: first server judges whether X4 ' is greater than or equal to M4.
309: first server sends the second Indication message to second server; The second Indication message is used to indicate second server these data is sent to first server.
310: second server sends this data according to the second Indication message to first server.
311: first server is stored in these data in the residual memory space after first server is upgraded.
After execution step 311, finish.
Particularly, step 311 can be implemented as: the distributed storage program in first server is stored in these data in the residual memory space after first server is upgraded.
Exemplary, according to the example in step 307, after execution step 311, the data routing table recording in distributed memory system is as shown in table 3:
Table 3
Data Local Residual memory space Address data memory
D1 S1 X1 S1/D1/offset1
D2 S1 X2 S1/D2/offset2
D3 S1 X3 S1/D3/offset3
D4 S1 X4′ S1/D4/offset4
As shown in Table 3, the server that obtains data D4 is same server with the server of storage data D4.Wherein, S1/D4/offset4 represents that the memory address of data D4 is positioned at the offset4 place of first server S1.
Optionally, after step 301, the method can also comprise the following steps A and step B:
Steps A: first server sends the 3rd Indication message of the copy that comprises these data to the 3rd server, the 3rd Indication message is used to indicate the 3rd server the copy of these data is stored in the residual memory space of the 3rd server.
Exemplary, according to the example in embodiment 1, the copy of D1, D2, D3, D4 is expressed as: D1 ', D2 ', D3 ', D4 '.
Step B: the 3rd server is stored in the copy of these data in the residual memory space of the 3rd server according to the 3rd Indication message.
Particularly, step B can be implemented as: the distributed storage program on the 3rd server is stored in the copy of these data in the residual memory space of the 3rd server according to the 3rd Indication message.
Exemplary, according to the example in embodiment 1, suppose that the 3rd server is that the memory address that D1, D2, D3, D4 distribute is respectively: S3/D1 '/offset1, S3/D2 '/offset2, S3/D3 '/offset3, S3/D4 '/offset4, wherein, S3 represents the 3rd server, and S3/D1 '/offset1 represents.Copy D1 ' memory address of data D1 is positioned at the offset1 place of the memory space of the 3rd server S 3, and other memory address is explained no longer one by one.
After the 3rd execution step 301-306 and steps A, step B, the data routing table recording in distributed memory system is as shown in table 4:
Table 4
Data Local Residual memory space Address data memory Copy Copy memory address
D1 S1 X1 S1/D1/offset1 D1′ S3/D1′/offset1
D2 S1 X2 S1/D2/offset2 D2′ S3/D2′/offset2
D3 S1 X3 S1/D3/offset3 D3′ S3/D3′/offset3
After the 4th execution step 301-306 and steps A, step B, the data routing table recording in distributed memory system is as shown in table 5:
Table 5
Data Local Residual memory space Address data memory Copy Copy memory address
D1 S1 X1 S1/D1/offset1 D1′ S3/D1′/offset1
D2 S1 X2 S1/D2/offset2 D2′ S3/D2′/offset2
D3 S1 X3 S1/D3/offset3 D3′ S3/D3′/offset3
D4 S1 X4 S2/D4/offset4 D4′ S3/D4′/offset3
Further, this steps A and step B are for strengthening the stability of system, concrete, if this loss of data of storing in the memory space of second server or while damaging, first server can send the Indication message that the copy of these data is sent to first server to the 3rd server; Make the 3rd server according to the copy that sends these data according to this Indication message to first server; First server is stored in the copy of these data in the residual memory space after first server is upgraded.
The method of the storage data that the embodiment of the present invention provides, in the time that first server determines that its residual memory space is greater than or equal to the shared memory space of data that an application of its installation generates, preferentially these data are stored in the residual memory space of this server; In the time that first server determines that its residual memory space is less than the shared memory space of these data, these data are stored in the residual memory space of second server, and in the time determining that residual memory space after first server is upgraded is greater than or equal to the shared memory space of these data, these data are stored in the residual memory space after first server is upgraded.Like this, the application of installing in first server can directly be read this data from local (memory space of first server), need to not read this data by other servers from network, thereby reach the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers in network cause time extend, the poor problem of systematic function.
Embodiment 2
In the present embodiment, in first server, comprise virtual machine." this locality " in the present embodiment refers to the server at the virtual machine place of generated data.
As shown in Figure 4, be a kind of method of storing data that the present embodiment provides, comprising:
401: the virtual machine of installing in first server generates data.
Exemplary, suppose, in first server, 4 virtual machines (VM1, VM2, VM3, VM4) are installed, 4 carry out this step 401, are specially: VM1, VM2, VM3, VM4 obtain respectively data D1, D2, D3, D4.
402: first server is obtained residual memory space and the shared memory space of these data of first server.
403: first server judges whether its residual memory space is greater than or equal to the shared memory space of these data.
If so, perform step 404; If not, perform step 405.
404: first server is stored in these data in the residual memory space of first server.
After execution step 404, finish.
It should be noted that, the example of step 402-step 404 can, with reference to the step 302-304 in above-described embodiment 1, repeat no more herein.
405: the size of the shared memory space of first server is determined and virtual machine in step 401 is corresponding other data except described the first data, is labeled as W.
406: the server that first server is determined in distributed memory system, residual memory space is greater than or equal to W, as second server.
407: first server sends the first Indication message that comprises these data to second server; The first Indication message is used to indicate second server these data is stored in the residual memory space of second server.
408: second server is stored in these data in the residual memory space of second server according to the first Indication message.
It should be noted that, the concrete example in step 407-408 can be identical with reference to the step 305-306 in above-described embodiment 1, repeats no more herein.In addition, the table 1 in embodiment 1 and table 2 also go in the corresponding step of this enforcement.
Further, in order to know comparative example 1 and embodiment 2, in the present embodiment, above-mentioned table 1 and table 2 can be expressed as following table 1 ' and table 2 ':
Table 1 '
Virtual machine Data Local Residual memory space Address data memory
VM1 D1 S1 X1 S1/D1/offset1
VM2 D2 S1 X2 S1/D2/offset2
VM3 D3 S1 X3 S1/D3/offset3
Table 2 '
Virtual machine Data Local Residual memory space Address data memory
VM1 D1 S1 X1 S1/D1/offset1
VM2 D2 S1 X2 S1/D2/offset2
VM3 D3 S1 X3 S1/D3/offset3
VM4 D4 S1 X4 S2/D4/offset4
From table 2 ', the server S 1 of obtaining the virtual machine VM4 place of D4 is not same server with the server S 2 of storage D4.
409: other Data Migrations that first server generates this virtual machine and this virtual machine are to second server.
After execution step 409, finish.
Exemplary, in tentation data routing table, record, exist all data of corresponding relation to be with this virtual machine: D1, D2, D3, D4, step 409 is specially: first server moves to this virtual machine and D1, D2, D3 on second server.
Exemplary, according to the example in step 408, after execution step 409, the data routing table recording in distributed memory system as table 3 ' as shown in:
Table 3 '
Virtual machine Data Local Residual memory space Address data memory
VM1 D1 S1 X1 S1/D1/offset1
VM2 D2 S1 X2 S1/D2/offset2
VM3 D3 S1 X3 S1/D3/offset3
VM4 D4 S2 X4 S2/D4/offset4
From table 3 ', the server S 2 of obtaining the virtual machine VM4 place of D4 is same server with the server S 2 of storage D4.
Optionally, the method can also comprise steps A and the step B in above-described embodiment 1.
In order to know comparative example 1 and embodiment 2, in the present embodiment, above-mentioned table 4 and table 5 can be expressed as following table 4 ' and table 5 ':
Table 4 '
Virtual machine Data Local Residual memory space Address data memory Copy Copy memory address
VM1 D1 S1 X1 S1/D1/offset1 D1′ S3/D1′/offset1
VM2 D2 S1 X2 S1/D2/offset2 D2′ S3/D2′/offset2
VM3 D3 S1 X3 S1/D3/offset3 D3′ S3/D3′/offset3
Table 5 '
Virtual machine Data Local Residual memory space Address data memory Copy Copy memory address
VM1 D1 S1 X1 S1/D1/offset1 D1′ S3/D1′/offset1
VM2 D2 S1 X2 S1/D2/offset2 D2′ S3/D2′/offset2
VM3 D3 S1 X3 S1/D3/offset3 D3′ S3/D3′/offset3
VM4 D4 S1 X4 S2/D4/offset4 D4′ S3/D4′/offset3
The method of the storage data that the embodiment of the present invention provides, in the time that first server determines that its residual memory space is greater than or equal to the shared memory space of data that the virtual machine on it generates, preferentially these data are stored in the residual memory space of this server; In the time that first server determines that its residual memory space is less than the shared memory space of these data, these data are stored in the memory space of second server, and by this virtual machine (vm) migration to second server.Like this, virtual machine can be directly from local (memory space of second server) reading out data, need to other servers from network on reading out data, thereby reach the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers in network cause time extend, the poor problem of systematic function.
Embodiment tri-
As shown in Figure 5, for a kind of server 1 that the present embodiment provides, be applied to distributed memory system, described distributed memory system also comprises other servers, and described server 1 is in order to the method for the storage data shown in execution graph 1, and described server 1 comprises:
Determination module 51, for the first data of determining that described server 1 generates;
Judge module 52, for judging the magnitude relationship of the shared memory space of the residual memory space of described server 1 and described the first data;
Memory module 53, for determining that at described judge module 52 residual memory space of described server 1 is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described server 1 has been used memory space, described the first data are stored in the residual memory space of described server 1.
Optionally, described server 1 comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server; As shown in Figure 6, described server 1 also comprises:
Sending module 54, when determining that at described judge module 52 residual memory space of described servers 1 is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Transferring module 55, for in the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
Optionally, described other servers comprise second server, and as shown in Figure 6, described server 1 also comprises:
Sending module 54, when determining that at described judge module 52 residual memory space of described servers 1 is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Update module 56, for upgrading the residual memory space of described server 1;
When described sending module 54 is also greater than or equal to the shared memory space of described the first data for, the residual memory space after described server 1 upgrades, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described server 1;
Receiver module 57, described the first data that send for receiving described second server;
Described memory module 53 also for, described the first data are stored in the residual memory space after described server 1 upgrades.
Optionally, described other servers also comprise the 3rd server;
Described sending module 54 also for, the 3rd Indication message that sends the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
Exemplary, the server 1 in the present embodiment is specifically as follows " first server " in above-described embodiment one, described, and " second server " in the present embodiment can be " second server " described in above-described embodiment one.
The server 1 that the embodiment of the present invention provides, be applied in the distributed memory system that also comprises other servers, determine that at server 1 its residual memory space is greater than or equal to the shared memory space of data of its generation, and when the minimum that uses memory space to be greater than other servers of server 1 has been used memory space, preferentially these data are stored in the residual memory space of this server.Like this, server 1 can directly read this data from this locality, and need to not read this data by other servers from network, thereby reaches the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers in network cause time extend, the poor problem of systematic function.
Embodiment tetra-
For embodiment tri-, on hardware is realized, sending module wherein can be transmitter, and receiver module can be receiver, and this transmitter and receiver can integrate formation transceiver; Memory module can be memory, determination module, judge module, transferring module etc. can be embedded in or be independent of in the processor of server 1 with example, in hardware, also can be stored in the memory of server 1 with software form, carry out operation corresponding to above modules so that processor calls, this processor can be CPU (CPU), microprocessor, single-chip microcomputer etc.
As shown in Figure 7, a kind of server 1 providing for the embodiment of the present invention, be applied to distributed memory system, described distributed memory system also comprises other servers, described server 1 is in order to the method for the storage data shown in execution graph 1, and described server 1 comprises: bus system 71, memory 72, processor 73.
Wherein, between memory 72 and processor 73, be coupled by bus system 71, wherein bus system 71, except comprising data/address bus, can also comprise power bus, control bus and status signal bus in addition etc.But for the purpose of clearly demonstrating, in the drawings various buses are all designated as to bus system 71.
Memory 72, for storing one group of code;
In memory 72, the code of storage determines for control processor 73 the first data that described server 1 generates; And judge the magnitude relationship of the residual memory space of described server 1 and the shared memory space of described the first data;
Memory 72, also for determining that at described processor 73 residual memory space of described server 1 is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described server 1 has been used memory space, under the control of described processor, described the first data are stored in the residual memory space of described server 1.
Optionally, described server 1 comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server; As shown in Figure 8, described server 1 also comprises:
Transmitter 74, when determining that at described processor 73 residual memory space of described servers 1 is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Described processor 73 also for, in the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
Optionally, described other servers comprise second server;
Described processor 73 also for, upgrade the residual memory space of described server 1;
When described transmitter 74 is also greater than or equal to the shared memory space of described the first data for, the residual memory space after described server 1 upgrades, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described server 1;
As shown in Figure 8, described server 1 also comprises: receiver 75, described the first data that send for receiving described second server;
Described memory 72 also for, under the control of described processor 73, described the first data are stored in the residual memory space after described server 1 upgrades.
Optionally, described other servers also comprise the 3rd server;
Described transmitter 74 also for, the 3rd Indication message that sends the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
Exemplary, the server 1 in the present embodiment is specifically as follows " first server " in above-described embodiment one, described, and " second server " in the present embodiment can be " second server " described in above-described embodiment one.
The server 1 that the embodiment of the present invention provides, be applied in the distributed memory system that also comprises other servers, determine that at server 1 its residual memory space is greater than or equal to the shared memory space of data of its generation, and when the minimum that uses memory space to be greater than other servers of server 1 has been used memory space, preferentially these data are stored in the residual memory space of this server.Like this, server 1 can directly read this data from this locality, and need to not read this data by other servers from network, thereby reaches the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers in network cause time extend, the poor problem of systematic function.
Embodiment five
As shown in Figure 9, for a kind of server 2 that the present embodiment provides, be applied to distributed memory system, described distributed memory system also comprises other servers, and described server 2 is in order to the method for the storage data shown in execution graph 2, and described server 2 comprises:
Determination module 91, for the first data of determining that described server 2 generates; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system;
Judge module 92, for judging the magnitude relationship of the shared memory space of the residual memory space of described server 2 and described the first data;
Memory module 93, for determining that at described judge module 92 residual memory space of described server 2 is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described server 2 has been used memory space, described the first data are stored in the residual memory space of described server 2.
Exemplary, the server 2 in the present embodiment is specifically as follows " first server " in above-described embodiment one, described,
The server 2 that the embodiment of the present invention provides, be applied in the distributed memory system that also comprises other servers, determine that at server 2 its residual memory space is greater than or equal to the shared memory space of data of its generation, and when the minimum that uses memory space to be less than or equal to other servers of server 2 has been used memory space, preferentially these data are stored in the residual memory space of this server; Wherein, the shared memory space of these data is greater than the maximum of the minimum memory unit of distributed memory system.Like this, server 2 can directly read this data from this locality, and need to not read this data by other servers from network, thereby reaches the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers in network cause time extend, the poor problem of systematic function.
Embodiment six
For embodiment five, on hardware is realized, memory module wherein can be memory, determination module, judge module can be embedded in or be independent of in the processor of server 2 with example, in hardware, also can be stored in the memory of server 2 with software form, carry out operation corresponding to above modules so that processor calls, this processor can be CPU (CPU), microprocessor, single-chip microcomputer etc.
As shown in figure 10, a kind of server 2 providing for the embodiment of the present invention, be applied to distributed memory system, described distributed memory system also comprises other servers, described server 2 is in order to the method for the storage data shown in execution graph 2, and described server 1 comprises: bus system 10A, memory 10B, processor 10C.
Wherein, between memory 10B and processor 10C, be coupled by bus system 10A, wherein bus system 10A, except comprising data/address bus, can also comprise power bus, control bus and status signal bus in addition etc.But for the purpose of clearly demonstrating, in the drawings various buses are all designated as to bus system 10A.
Memory 10B, for storing one group of code;
The code of storing in memory 10B determines for control processor 10C the first data that described server 2 generates; And judge the magnitude relationship of the residual memory space of described server 2 and the shared memory space of described the first data; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system;
Memory 10B, also for determining that at described processor 10C the residual memory space of described server 2 is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described server 2 has been used memory space, under the control of described processor 10C, described the first data are stored in the residual memory space of described server 2.
Exemplary, the server 2 in the present embodiment is specifically as follows " first server " in above-described embodiment one, described,
The server 2 that the embodiment of the present invention provides, be applied in the distributed memory system that also comprises other servers, determine that at server 2 its residual memory space is greater than or equal to the shared memory space of data of its generation, and when the minimum that uses memory space to be less than or equal to other servers of server 2 has been used memory space, preferentially these data are stored in the residual memory space of this server; Wherein, the shared memory space of these data is greater than the maximum of the minimum memory unit of distributed memory system.Like this, server 2 can directly read this data from this locality, and need to not read this data by other servers from network, thereby reaches the beneficial effect that shortens time delay, improves systematic function.Solved in prior art, because of reading out data on other servers in network cause time extend, the poor problem of systematic function.
Those skilled in the art can be well understood to, for convenience and simplicity of description, the system of foregoing description, the specific works process of device and module, can, with reference to the corresponding process in preceding method embodiment, not repeat them here.
In the several embodiment that provide in the application, should be understood that, disclosed system, apparatus and method, can realize by another way.For example, device embodiment described above is only schematic, for example, the division of described module, be only that a kind of logic function is divided, when actual realization, can have other dividing mode, for example multiple modules or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or module can be electrically, machinery or other form.
The described module as separating component explanation can or can not be also physically to separate, and the parts that show as module can be or can not be also physical modules, can be positioned at a place, or also can be distributed on multiple mixed-media network modules mixed-medias.Can select according to the actual needs some or all of module wherein to realize the object of the present embodiment scheme.
In addition, the each functional module in each embodiment of the present invention can be integrated in a processing module, can be also that the independent physics of modules comprises, also can two or more module integrations in a module.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form that also can adopt hardware to add software function module realizes.
The integrated module that the above-mentioned form with software function module realizes, can be stored in a computer read/write memory medium.Above-mentioned software function module is stored in a storage medium, comprise that some instructions (can be personal computers in order to make a computer equipment, server, or the network equipment etc.) carry out the part steps of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, ROM (Read-Only Memory, read-only memory), the various media that can be program code stored such as RAM (Random Access Memory, random access memory), magnetic disc or CD.
Finally it should be noted that: above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to previous embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or part technical characterictic is wherein equal to replacement; And these amendments or replacement do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (15)

1. a method of storing data, is characterized in that, is applied to distributed memory system, and described distributed memory system comprises first server and other servers, and described method comprises:
Determine the first data that described first server generates;
Judge the magnitude relationship of the shared memory space of the residual memory space of described first server and described the first data;
If the residual memory space of described first server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described first server has been used memory space, described the first data are stored in the residual memory space of described first server.
2. method according to claim 1, is characterized in that, described first server comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server; Described method also comprises:
If the residual memory space of described first server is less than the shared memory space of described the first data, send to described second server the first Indication message that comprises described the first data; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
In the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
3. method according to claim 1, is characterized in that, described other servers comprise second server; Described method also comprises:
If the residual memory space of described first server is less than the shared memory space of described the first data, send to described second server the first Indication message that comprises described the first data; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Upgrade the residual memory space of described first server;
When residual memory space after described first server is upgraded is greater than or equal to the shared memory space of described the first data, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described first server;
Receive described the first data that described second server sends;
Described the first data are stored in the residual memory space after described first server is upgraded.
4. according to the method described in claim 1-3 any one, it is characterized in that, described other servers also comprise the 3rd server, and described method also comprises:
The 3rd Indication message that sends the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
5. a method of storing data, is characterized in that, is applied to distributed memory system, and described distributed memory system comprises first server and other servers, and described method comprises:
Determine the first data that described first server generates; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system;
Judge the magnitude relationship of the shared memory space of the residual memory space of described first server and described the first data;
If the residual memory space of described first server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described first server has been used memory space, described the first data are stored in the residual memory space of described first server.
6. a server, is characterized in that, is applied to distributed memory system, and described distributed memory system also comprises other servers, and described server comprises:
Determination module, for the first data of determining that described server generates;
Judge module, for judging the magnitude relationship of the shared memory space of the residual memory space of described server and described the first data;
Memory module, for determining that at described judge module the residual memory space of described server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described server has been used memory space, described the first data are stored in the residual memory space of described server.
7. server according to claim 6, is characterized in that, described server comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server, and described server also comprises:
Sending module, when determining that at described judge module the residual memory space of described server is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Transferring module, for in the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
8. server according to claim 6, is characterized in that, described other servers comprise second server, and described server also comprises:
Sending module, when determining that at described judge module the residual memory space of described server is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Update module, for upgrading the residual memory space of described server;
Described sending module also for, in the time that the residual memory space after described server update is greater than or equal to the shared memory space of described the first data, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described server;
Receiver module, described the first data that send for receiving described second server;
Described memory module also for, described the first data are stored in the residual memory space after described server update.
9. according to the server described in claim 6-8 any one, it is characterized in that, described other servers also comprise the 3rd server;
Described sending module also for, the 3rd Indication message that sends the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
10. a server, is characterized in that, is applied to distributed memory system, and described distributed memory system also comprises other servers, and described server comprises:
Processor, for the first data of determining that described server generates; And judge the magnitude relationship of the residual memory space of described server and the shared memory space of described the first data;
Memory, for determining that at described processor the residual memory space of described server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be greater than described other servers of described server has been used memory space, under the control of described processor, described the first data are stored in the residual memory space of described server.
11. servers according to claim 10, is characterized in that, described server comprises a virtual machine, and described the first data are data that described virtual machine generates; Described other servers comprise second server, and described server also comprises:
Transmitter, when determining that at described processor the residual memory space of described server is less than the shared memory space of described the first data, sends the first Indication message that comprises described the first data to described second server; Described the first Indication message is used to indicate described second server described the first data is stored in the residual memory space of described second server;
Described processor also for, in the time that the shared memory space of other data except described the first data corresponding to described virtual machine is less than or equal to the residual memory space of described second server, by described virtual machine and described other Data Migrations to described second server.
12. servers according to claim 10, is characterized in that, described other servers comprise second server;
Described processor also for, upgrade the residual memory space of described server;
Described transmitter also for, in the time that the residual memory space after described server update is greater than or equal to the shared memory space of described the first data, send the second Indication message to described second server; Described the second Indication message is used to indicate described second server described the first Data Migration is arrived to described server;
Described server also comprises: receiver, described the first data that send for receiving described second server;
Described memory also for, under the control of described processor, described the first data are stored in the residual memory space after described server update.
13. according to the server described in claim 10-12 any one, it is characterized in that, described other servers also comprise the 3rd server;
Described transmitter also for, the 3rd Indication message that sends the copy that comprises described the first data to described the 3rd server, described the 3rd Indication message is used to indicate described the 3rd server the copy of described the first data is stored in the residual memory space of described the 3rd server.
14. 1 kinds of servers, is characterized in that, are applied to distributed memory system, and described distributed memory system also comprises other servers, and described server comprises:
Determination module, for the first data of determining that described server generates; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system;
Judge module, for judging the magnitude relationship of the shared memory space of the residual memory space of described server and described the first data;
Memory module, for determining that at described judge module the residual memory space of described server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described server has been used memory space, described the first data are stored in the residual memory space of described server.
15. 1 kinds of servers, is characterized in that, are applied to distributed memory system, and described distributed memory system also comprises other servers, and described server comprises:
Processor, for the first data of determining that described server generates; And judge the magnitude relationship of the residual memory space of described server and the shared memory space of described the first data; The shared memory space of described the first data is greater than the maximum of the minimum memory unit of described distributed memory system;
Memory, for determining that at described processor the residual memory space of described server is greater than or equal to the shared memory space of described the first data, and when the minimum that uses memory space to be less than or equal to described other servers of described server has been used memory space, under the control of described processor, described the first data are stored in the residual memory space of described server.
CN201480000338.5A 2014-01-23 2014-01-23 A kind of method and apparatus of data storage Active CN104205780B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/071224 WO2015109483A1 (en) 2014-01-23 2014-01-23 Data storage method and device

Publications (2)

Publication Number Publication Date
CN104205780A true CN104205780A (en) 2014-12-10
CN104205780B CN104205780B (en) 2017-06-27

Family

ID=52088184

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201480000338.5A Active CN104205780B (en) 2014-01-23 2014-01-23 A kind of method and apparatus of data storage

Country Status (2)

Country Link
CN (1) CN104205780B (en)
WO (1) WO2015109483A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202350A (en) * 2016-07-05 2016-12-07 浪潮(北京)电子信息产业有限公司 A kind of distributed file system simplifies the method and system of configuration automatically
CN106909321A (en) * 2017-02-24 2017-06-30 郑州云海信息技术有限公司 A kind of control method and device based on storage system
CN107092443A (en) * 2017-04-28 2017-08-25 杭州宏杉科技股份有限公司 Data migration method and device
CN107172222A (en) * 2017-07-27 2017-09-15 郑州云海信息技术有限公司 A kind of date storage method and device based on distributed memory system
CN109783576A (en) * 2019-01-02 2019-05-21 佛山市顺德区美的洗涤电器制造有限公司 Household appliance and its date storage method, device
CN110109622A (en) * 2019-04-28 2019-08-09 平安科技(深圳)有限公司 A kind of data processing method and relevant apparatus based on middleware
CN110134332A (en) * 2019-04-28 2019-08-16 平安科技(深圳)有限公司 A kind of date storage method and relevant apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6958881B1 (en) * 2003-11-26 2005-10-25 Western Digital Technologies, Inc. Disk drive control system having a servo processing accelerator circuit
CN101771715A (en) * 2008-12-26 2010-07-07 华为技术有限公司 Method, device and system for establishing distribution type network
CN103064639A (en) * 2012-12-28 2013-04-24 华为技术有限公司 Method and device for storing data
CN103092927A (en) * 2012-12-29 2013-05-08 华中科技大学 File quick reading and writing method under distributed environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7406505B2 (en) * 2004-04-29 2008-07-29 International Business Machines Corporation Managing on-demand email storage
CN102508736A (en) * 2011-10-11 2012-06-20 宇龙计算机通信科技(深圳)有限公司 Backup method of application program in communication terminal and communication terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6958881B1 (en) * 2003-11-26 2005-10-25 Western Digital Technologies, Inc. Disk drive control system having a servo processing accelerator circuit
CN101771715A (en) * 2008-12-26 2010-07-07 华为技术有限公司 Method, device and system for establishing distribution type network
CN103064639A (en) * 2012-12-28 2013-04-24 华为技术有限公司 Method and device for storing data
CN103092927A (en) * 2012-12-29 2013-05-08 华中科技大学 File quick reading and writing method under distributed environment

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202350A (en) * 2016-07-05 2016-12-07 浪潮(北京)电子信息产业有限公司 A kind of distributed file system simplifies the method and system of configuration automatically
CN106909321A (en) * 2017-02-24 2017-06-30 郑州云海信息技术有限公司 A kind of control method and device based on storage system
CN107092443A (en) * 2017-04-28 2017-08-25 杭州宏杉科技股份有限公司 Data migration method and device
CN107092443B (en) * 2017-04-28 2020-04-07 杭州宏杉科技股份有限公司 Data migration method and device
CN107172222A (en) * 2017-07-27 2017-09-15 郑州云海信息技术有限公司 A kind of date storage method and device based on distributed memory system
CN109783576A (en) * 2019-01-02 2019-05-21 佛山市顺德区美的洗涤电器制造有限公司 Household appliance and its date storage method, device
CN110109622A (en) * 2019-04-28 2019-08-09 平安科技(深圳)有限公司 A kind of data processing method and relevant apparatus based on middleware
CN110134332A (en) * 2019-04-28 2019-08-16 平安科技(深圳)有限公司 A kind of date storage method and relevant apparatus
WO2020220535A1 (en) * 2019-04-28 2020-11-05 平安科技(深圳)有限公司 Data storage method, and related device
CN110134332B (en) * 2019-04-28 2022-03-08 平安科技(深圳)有限公司 Data storage method and related device

Also Published As

Publication number Publication date
CN104205780B (en) 2017-06-27
WO2015109483A1 (en) 2015-07-30

Similar Documents

Publication Publication Date Title
CN104205780A (en) Data storage method and device
CN102707990B (en) Container based processing method and device
KR102137761B1 (en) Heterogeneous unified memory section and method for manaing extended unified memory space thereof
US9471239B2 (en) Memory power management and data consolidation
CN101901149B (en) Apparatus, method and program for processing information
US9703488B2 (en) Autonomous dynamic optimization of platform resources
US9916215B2 (en) System and method for selectively utilizing memory available in a redundant host in a cluster for virtual machines
CN104699423A (en) Method and device for binding disk drive in Linux system
CN105677257A (en) Data storage method and electronic equipment
US10664392B2 (en) Method and device for managing storage system
CN104932933A (en) Spin lock acquisition method and apparatus
CN105335309A (en) Data transmission method and computer
CN102419753B (en) Information processing equipment, information processing method and information processing system
CN104517067A (en) Method, device and system for data access
US20120179885A1 (en) Write control system
CN104063234A (en) Compatible method and device
US20150278299A1 (en) External merge sort method and device, and distributed processing device for external merge sort
CN111414422B (en) Data distribution method, device, equipment and storage medium
CN104050189A (en) Page sharing processing method and device
CN102521155B (en) Method and device for realizing table item dynamic allocation on physical storage
CN102419693A (en) Method for managing disk space of memory cell and electronic equipment
CN104023056A (en) Method of updating data and associated equipment
CN104750547A (en) Input-output (IO) request processing method and device of virtual machines
US20160156525A1 (en) Dynamic conversion of hardware resources of a server system
CN101510146A (en) Virtual space establishing method, apparatus and system based on independent redundant magnetic disc array

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
TR01 Transfer of patent right

Effective date of registration: 20220216

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right