The present invention relates to the computer field, and in particular, to a memory access method, device, and system.
Cloud computing is a new Internet computing mode developed and converged from conventional computer technologies and network technologies. The cloud computing aims to form, by integrating data center resources, a system that exhibits a powerful computing capability, and use the system to provide services for users. As an important aspect in resource management, memory resources are directly associated with running efficiency of the system, therefore, the memory resources need to be properly allocated, so that the memory resources can be allocated in a balanced manner, and waste of the memory resources is reduced.
Currently, a distributed shared memory (DSM) technology provides a memory resource management and access method, and the technology logically implements a shared memory based on physically distributed memories, as shown in
In a process of implementing the foregoing DSM, it is found that at least the following problem exists in the prior art: the DSM is generally implemented by an OS or a user programming library at a software layer, or may be implemented depending on a special network adapter or hardware that maintains Cache consistency; as a result, operation overheads and implementation costs of the DSM are relatively high. In addition, the DSM performs unified addressing on memory, and provides a single image for programmers. The DSM further needs to maintain data consistency, and a granularity of shared data is relatively small. These features result in that the DSM cannot favorably support flexible resource scheduling when an application load changes dynamically at a data center.
Embodiments of the present invention provide a memory access method, device, and system, which reduce operation and maintenance overheads of a system, and implement flexible scheduling of memory resources.
To achieve the foregoing objectives, the following technical solutions are adopted in the embodiments of the present invention:
According to a first aspect, an embodiment of the present invention provides a memory access method, applied to a cloud control device on the side of a requesting node on a cloud computing network, where the method includes:
receiving, by the cloud control device, a request packet that is sent by the requesting node and is for accessing to-be-accessed data stored in a memory resource provided by a contributing node to the requesting node for use, where the request packet includes identification information of the requesting node and a first physical address of the to-be-accessed data, and the first physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the requesting node;
querying, by the cloud control device, a preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire identification information of the contributing node, where the first mapping relationship includes a mapping relationship between the identification information of the contributing node and a physical address that is of the memory resource provided by the contributing node and is on the requesting node; and
sending, by the cloud control device, an access request message for accessing the to-be-accessed data to a cloud control device on the side of the contributing node according to the identification information of the contributing node, so that the cloud control device on the side of the contributing node queries a second mapping relationship according to the identification information of the requesting node in the access request message to acquire a second physical address of the to-be-accessed data, and transmits the second physical address of the to-be-accessed data and the access request message to the contributing node, so that the contributing node completes an access operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the access request message, where the access request message includes the identification information of the requesting node, the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of the memory resource provided by the contributing node and is on the contributing node, and the second physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the contributing node.
According to a first possible implementation manner, with reference to the first aspect, the cloud control device receives the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a read access request packet; and
accordingly, the sending, by the cloud control device, an access request message for accessing the to-be-accessed data to a cloud control device on the side of the contributing node according to the identification information of the contributing node, so that the cloud control device on the side of the contributing node queries a second mapping relationship according to the identification information of the requesting node in the access request message to acquire a second physical address of the to-be-accessed data, and transmits the second physical address of the to-be-accessed data and the access request message to the contributing node, so that the contributing node completes an access operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the access request message, includes:
sending, by the cloud control device, a read access request message of the to-be-accessed data to the cloud control device on the side of the contributing node according to the identification information of the contributing node, so that the cloud control device on the side of the contributing node queries the second mapping relationship according to the identification information of the requesting node in the read access request to acquire the second physical address of the to-be-accessed data, and transmits the second physical address of the to-be-accessed data and the access request message to the contributing node, so that the contributing node completes a read operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the access request message, and transmits a feedback message to the cloud control device of the contributing node, so that the cloud control device on the side of the contributing node sends the feedback message to the cloud control device on the side of the requesting node, where the feedback message includes the identification information of the contributing node and the to-be-accessed data read by the contributing node.
According to a second possible implementation manner, with reference to the first possible implementation manner, the method further includes:
receiving, by the cloud control device, the feedback message sent by the cloud control device on the side of the contributing node;
querying, by the cloud control device, the first mapping relationship according to the identification information of the contributing node to acquire the first physical address of the to-be-accessed data; and
sending, by the cloud control device, the to-be-accessed data read by the contributing node and the first physical address of the to-be-accessed data to the requesting node, so that the requesting node completes reading the to-be-accessed data.
According to a third possible implementation manner, with reference to the first aspect, the cloud control device receives the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a write access request packet and to-be-written data, and the write access request packet includes the identification information of the requesting node and a first physical address of the to-be-written data; and
accordingly, the querying, by the cloud control device, a preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire identification information of the contributing node; and
the sending, by the cloud control device, an access request message for accessing the to-be-accessed data to a cloud control device on the side of the contributing node according to the identification information of the contributing node, so that the cloud control device on the side of the contributing node queries a second mapping relationship according to the identification information of the requesting node in the access request message to acquire a second physical address of the to-be-accessed data, and transmits the second physical address of the to-be-accessed data and the access request message to the contributing node, so that the contributing node completes an access operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the access request message, includes:
querying, by the cloud control device, the preset first mapping relationship according to the first physical address of the to-be-written data to acquire the identification information of the contributing node; and
sending, by the cloud control device, the write access request message to the cloud control device on the side of the contributing node according to the identification information of the contributing node, where the write access request message includes the write access request packet and the to-be-written data, so that the cloud control device on the side of the contributing node queries the second mapping relationship according to the identification information of the requesting node in the write access request message to acquire a second physical address of the to-be-written data, and transmits the second physical address of the to-be-written data and the to-be-written data to the contributing node, so that the contributing node writes the to-be-written data to the second physical address of the to-be-written data.
According to a second aspect, an embodiment of the present invention provides a memory access method on a cloud computing network, applied to a cloud control device on the side of a contributing node on the cloud computing network, where the method includes:
receiving, by the cloud control device, an access request message that is of to-be-accessed data and sent by a cloud control device on the side of a requesting node, where the access request message includes identification information of the requesting node;
querying, by the cloud control device, a preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-accessed data, where the second physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the contributing node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of a memory resource provided by the contributing node and is on the contributing node; and
transmitting, by the cloud control device, the second physical address of the to-be-accessed data and the access request message to the contributing node, so that the contributing node completes an access operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the access request message.
According to a first possible implementation manner, with reference to the second aspect, the cloud control device receives the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a read access request message; and
accordingly, the transmitting, by the cloud control device, the second physical address of the to-be-accessed data and the access request message to the contributing node, so that the contributing node completes an access operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the access request message, includes:
transmitting, by the cloud control device, the second physical address of the to-be-accessed data and the read access request message to the contributing node, so that the contributing node completes a read operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the read access request message, and transmits a feedback message to the cloud control device, where the feedback message includes identification information of the contributing node and the to-be-accessed data read by the contributing node.
According to a second possible implementation manner, with reference to the first possible implementation manner, the method further includes:
receiving, by the cloud control device, the feedback message transmitted by the contributing node, and querying the second mapping relationship according to the second physical address of the to-be-accessed data to obtain the identification information of the requesting node; and
sending, by the cloud control device, the feedback message to the cloud control device on the side of the requesting node according to the identification information of the requesting node, where the feedback message includes the identification information of the contributing node and the to-be-accessed data read by the contributing node.
According to a third possible implementation manner, with reference to the second aspect, the cloud control device receives the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a write access request packet and to-be-written data; and
accordingly, the querying, by the cloud control device, a second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-accessed data; and
the transmitting, by the cloud control device, the second physical address of the to-be-accessed data and the access request message to the contributing node, so that the contributing node completes an access operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the access request message, includes:
querying, by the cloud control device, the preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-written data; and
transmitting, by the cloud control device, the second physical address of the to-be-written data and the to-be-written data to the contributing node, so that the contributing node writes the to-be-written data to the second physical address of the to-be-written data.
According to a third aspect, an embodiment of the present invention provides a memory access method on a cloud computing network, including:
receiving, by a global resource manager, a resource request message sent by a requesting node, where the resource request message includes identification information of the requesting node, a size of a memory resource required by the requesting node, and a physical address of the memory resource on the requesting node;
querying, by the global resource manager, a global resource status table according to the size of the memory resource required by the requesting node and the identification information of the requesting node, and acquiring, according to a location of each node in the global resource status table and a shortest path principle, a contributing node whose memory resource remaining status in the global resource status table can meet the memory resource required by the requesting node, where the global resource status table includes identification information, the location, and a memory resource remaining status that are of each node; and
setting, by the global resource manager, a first mapping relationship applied to a cloud control device on the side of the requesting node, and setting a second mapping relationship applied to a cloud control device on the side of the contributing node, where the first mapping relationship includes a mapping relationship between identification information of the contributing node and a physical address that is of a memory resource provided by the contributing node and is on the requesting node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of the memory resource provided by the contributing node and is on the contributing node.
According to a first possible implementation manner, with reference to the third aspect, the method further includes:
receiving, by the global resource manager, an application message that is sent by the requesting node after the requesting node uses up the memory resource provided by the contributing node, where the application message includes the identification information of the requesting node and the physical address that is of the memory resource provided by the contributing node and is on the requesting node;
querying, by the global resource manager, the first mapping relationship according to the physical address that is of the memory resource provided by the contributing node and is on the requesting node, to obtain an identifier of the contributing node, setting the second mapping relationship that is on the contributing node and is corresponding to an identifier of the requesting node to be invalid, releasing the memory resource provided by the contributing node, and setting the memory resource as a remaining memory resource of the contributing node; and
setting, by the global resource manager, the first mapping relationship on the side of the requesting node to be invalid.
According to a fourth aspect, an embodiment of the present invention provides a cloud control device, applied to the side of a requesting node on a cloud computing network, where the cloud control device includes:
a first communication unit, configured to receive a request packet that is sent by the requesting node and is for accessing to-be-accessed data stored in a memory resource provided by a contributing node to the requesting node for use, where the request packet includes identification information of the requesting node and a first physical address of the to-be-accessed data, and the first physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the requesting node;
a memory cloud controller, configured to query a preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire identification information of the contributing node, where the first mapping relationship includes a mapping relationship between the identification information of the contributing node and a physical address that is of the memory resource provided by the contributing node and is on the requesting node; and
a second communication unit, configured to send an access request message for accessing the to-be-accessed data to a cloud control device on the side of the contributing node according to the identification information of the contributing node.
According to a first possible implementation manner, with reference to the fourth aspect, the first communication unit is configured to receive the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a read access request packet; and
accordingly, the memory cloud controller further includes:
a remote memory management unit RMMU, configured to query the preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire the identification information of the contributing node; and
an external packet generation unit, configured to: generate a read access request message of the to-be-accessed data, and transmit the read access request for accessing the to-be-accessed data to the second communication unit; where
the second communication unit is configured to send the read access request message of the to-be-accessed data to the cloud control device on the side of the contributing node according to the identification information of the contributing node.
According to a second possible implementation manner, with reference to the first possible implementation manner, the second communication unit is further configured to receive the feedback message sent by the cloud control device on the side of the contributing node, where the feedback message includes the identification information of the contributing node and the to-be-accessed data read by the contributing node;
the memory cloud controller further includes a packet parsing unit and an internal packet generation unit;
the packet parsing unit is configured to parse the feedback message;
the RMMU is further configured to query the first mapping relationship according to the identification information of the contributing node in the parsed feedback message to acquire the first physical address of the to-be-accessed data;
the internal packet generation unit is configured to: generate the to-be-accessed data that is in the parsed feedback message and read by the contributing node, and the first physical address of the to-be-accessed data, into a packet format that can be used to communicate with the requesting node, and transmit the packet to the first communication unit; and
the first communication unit is further configured to send the to-be-accessed data that is in the feedback message and read by the contributing node, and the first physical address of the to-be-accessed data to the requesting node, so that the requesting node completes reading the to-be-accessed data.
According to a third possible implementation manner, with reference to the fourth aspect, the first communication unit is configured to receive the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a write access request packet and to-be-written data, and the write access request packet includes the identification information of the requesting node and a first physical address of the to-be-written data;
accordingly, an RMMU in the memory cloud controller is configured to query the preset first mapping relationship according to the first physical address of the to-be-written data to acquire the identification information of the contributing node;
an external packet generation unit packs the write access request packet and the to-be-written data into a write access request message for communication between nodes, and transmits the write access request message to the second communication unit; and
the second communication unit is configured to send the write access request message to the cloud control device on the side of the contributing node according to the identification information of the contributing node, where the write access request message includes the write access request packet and the to-be-written data.
According to a fifth aspect, an embodiment of the present invention provides a cloud control device, applied to the side of a contributing node on a cloud computing network, where the cloud control device includes:
a second communication unit, configured to receive an access request message that is of to-be-accessed data and sent by a cloud control device on the side of a requesting node, where the access request message includes identification information of the requesting node;
a memory cloud controller, configured to query a preset second mapping relationship according to the identification info/Elation of the requesting node to acquire a second physical address of the to-be-accessed data, where the second physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the contributing node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of a memory resource provided by the contributing node and is on the contributing node; and
a first communication unit, configured to send the second physical address of the to-be-accessed data and the access request message to the contributing node.
According to a first possible implementation manner, with reference to the fifth aspect, the second communication unit is configured to receive the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a read access request message; and
accordingly, the memory cloud controller includes:
a packet parsing unit, configured to: parse the read access request message, and transmit the parsed read access request message to a remote memory management unit RMMU;
the RMMU, configured to obtain the second physical address of the to-be-accessed data by querying the second mapping relationship; and
an internal packet generation unit, configured to transmit the second physical address of the to-be-accessed data and the read access request message to the first communication unit; where
the first communication unit is configured to transmit the second physical address of the to-be-accessed data and the read access request message to the contributing node.
According to a second possible implementation manner, with reference to the first possible implementation manner,
the first communication unit is further configured to receive the feedback message transmitted by the contributing node, where the feedback message includes identification information of the contributing node and the to-be-accessed data read by the contributing node;
the RMMU in the memory cloud controller is further configured to query the second mapping relationship according to the second physical address of the to-be-accessed data to obtain the identification information of the requesting node;
the memory cloud controller further includes an external packet generation unit, configured to: pack the feedback message in a format by using which communication can be performed between nodes, and transmit the packed feedback message to the second communication unit; and
the second communication unit is further configured to send the feedback message to the cloud control device on the side of the requesting node according to the identification information of the requesting node.
According to a third possible implementation manner, with reference to the fifth aspect, the second communication unit is configured to receive the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a write access request packet and to-be-written data;
accordingly, a packet parsing unit in the memory cloud controller is configured to: parse the access request message, and transmit information obtained by parsing to the RMMU;
the RMMU is configured to query the preset second mapping relationship according to the identification information of the requesting node to acquire the second physical address of the to-be-written data;
the internal packet generation unit is configured to: generate the second physical address of the to-be-written data and the parsed access request message into a packet format that can be used to communicate with the contributing node, and transmit the packet to the first communication unit; and
the first communication unit is configured to send the second physical address of the to-be-written data and the to-be-written data to the contributing node, so that the contributing node writes the to-be-written data to the second physical address of the to-be-written data.
According to a sixth aspect, an embodiment of the present invention provides a global resource manager, including:
a receiver, configured to receive a resource request message sent by a requesting node, where the resource request message includes identification information of the requesting node, a size of a memory resource required by the requesting node, and a physical address of the memory resource on the requesting node;
an allocator, configured to: query a global resource status table according to the size of the memory resource required by the requesting node and the identification information of the requesting node, and acquire, according to a location of each node in the global resource status table and a shortest path principle, a contributing node whose memory resource remaining status in the global resource status table can meet the memory resource required by the requesting node, where the global resource status table includes identification information, the location, and a memory resource remaining status that are of each node; and
a setter, configured to: set a first mapping relationship applied to a cloud control device on the side of the requesting node, and set a second mapping relationship applied to a cloud control device on the side of the contributing node, where the first mapping relationship includes a mapping relationship between identification information of the contributing node and a physical address that is of a memory resource provided by the contributing node and is on the requesting node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of the memory resource provided by the contributing node and is on the contributing node.
According to a first possible implementation manner, with reference to the sixth aspect, the receiver is further configured to receive an application message that is sent by the requesting node after the requesting node uses up the memory resource provided by the contributing node, where the application message includes the identification information of the requesting node and the physical address that is of the memory resource provided by the contributing node and is on the requesting node; and
the setter is further configured to: query the first mapping relationship according to the physical address that is of the memory resource provided by the contributing node and is on the requesting node, to obtain an identifier of the contributing node, set the second mapping relationship that is on the cloud control device on the side of the contributing node and is corresponding to an identifier of the requesting node to be invalid, release the memory resource provided by the contributing node, and set the memory resource as a remaining memory resource of the contributing node; and
set the first mapping relationship on the cloud control device on the side of the requesting node to be invalid.
According to a seventh aspect, an embodiment of the present invention provides a cloud control device, applied to the side of a requesting node on a cloud computing network, where the cloud control device includes:
a receiving unit, configured to receive a request packet that is sent by the requesting node and is for accessing to-be-accessed data stored in a memory resource provided by a contributing node to the requesting node for use, where the request packet includes identification information of the requesting node and a first physical address of the to-be-accessed data, and the first physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the requesting node;
an acquiring unit, configured to query a preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire identification information of the contributing node, where the first mapping relationship includes a mapping relationship between the identification information of the contributing node and a physical address that is of the memory resource provided by the contributing node and is on the requesting node; and
a sending unit, configured to send an access request message for accessing the to-be-accessed data to a cloud control device on the side of the contributing node according to the identification information of the contributing node.
According to a first possible implementation manner, with reference to the seventh aspect,
the receiving unit is configured to receive the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a read access request packet; and
accordingly, the sending unit is configured to send a read access request message of the to-be-accessed data to the cloud control device on the side of the contributing node according to the identification information of the contributing node.
According to a second possible implementation manner, with reference to the first possible implementation manner,
the receiving unit is further configured to receive the feedback message sent by the cloud control device on the side of the contributing node, where the feedback message includes the identification information of the contributing node and the to-be-accessed data read by the contributing node;
the acquiring unit is further configured to query the first mapping relationship according to the identification information of the contributing node to acquire the first physical address of the to-be-accessed data; and
the sending unit is further configured to send the to-be-accessed data read by the contributing node and the first physical address of the to-be-accessed data to the requesting node, so that the requesting node completes reading the to-be-accessed data.
According to a third possible implementation manner, with reference to the seventh aspect, the receiving unit is configured to receive the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a write access request packet and to-be-written data, and the write access request packet includes the identification information of the requesting node and a first physical address of the to-be-written data;
accordingly, the acquiring unit is configured to query the preset first mapping relationship according to the first physical address of the to-be-written data to acquire the identification information of the contributing node; and
the sending unit is configured to send the write access request message to the cloud control device on the side of the contributing node according to the identification information of the contributing node, where the write access request message includes the write access request packet and the to-be-written data.
According to an eighth aspect, an embodiment of the present invention provides a cloud control device, applied to the side of a contributing node on a cloud computing network, where the cloud control device includes:
a receiving unit, configured to receive an access request message that is of to-be-accessed data and sent by a cloud control device on the side of a requesting node, where the access request message includes identification information of the requesting node;
an acquiring unit, configured to query a preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-accessed data, where the second physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the contributing node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of a memory resource provided by the contributing node and is on the contributing node; and
a sending unit, configured to send the second physical address of the to-be-accessed data and the access request message to the contributing node.
According to a first possible implementation manner, with reference to the eighth aspect, the receiving unit is configured to receive the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a read access request message; and
accordingly, the sending unit is configured to transmit the second physical address of the to-be-accessed data and the read access request message to the contributing node.
According to a second possible implementation manner, with reference to the first possible implementation manner, the receiving unit is further configured to receive the feedback message transmitted by the contributing node, where the feedback message includes identification information of the contributing node and the to-be-accessed data read by the contributing node;
the acquiring unit is further configured to query the second mapping relationship according to the second physical address of the to-be-accessed data to obtain the identification information of the requesting node; and
the sending unit is further configured to send the feedback message to the cloud control device on the side of the requesting node according to the identification information of the requesting node.
According to a third possible implementation manner, with reference to the eighth aspect, the receiving unit is configured to receive the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a write access request packet and to-be-written data;
accordingly, the acquiring unit is configured to query the preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-written data; and
the sending unit is configured to send the second physical address of the to-be-written data and the to-be-written data to the contributing node, so that the contributing node writes the to-be-written data to the second physical address of the to-be-written data.
According to a ninth aspect, an embodiment of the present invention provides a global resource manager, including:
a receiving unit, configured to receive a resource request message sent by a requesting node, where the resource request message includes identification information of the requesting node, a size of a memory resource required by the requesting node, and a physical address of the memory resource on the requesting node;
an acquiring unit, configured to: query a global resource status table according to the size of the memory resource required by the requesting node and the identification information of the requesting node, and acquire, according to a location of each node in the global resource status table and a shortest path principle, a contributing node whose memory resource remaining status in the global resource status table can meet the memory resource required by the requesting node, where the global resource status table includes identification information, the location, and a memory resource remaining status that are of each node; and
a setting unit, configured to: set a first mapping relationship applied to a cloud control device on the side of the requesting node, and set a second mapping relationship applied to a cloud control device on the side of the contributing node, where the first mapping relationship includes a mapping relationship between identification information of the contributing node and a physical address that is of a memory resource provided by the contributing node and is on the requesting node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of the memory resource provided by the contributing node and is on the contributing node.
According to a tenth aspect, an embodiment of the present invention provides a memory access system, applied to a cloud computing network, where the memory access system includes the cloud control device on the side of a requesting node according to either the fourth aspect or the seventh aspect, the cloud control device on the side of a contributing node according to either the fifth aspect or the eighth aspect, and the global resource manager according to either the sixth aspect or the ninth aspect.
According to the memory access method, device, and system provided in the embodiments of the present invention, a global resource manager allocates a memory resource of a contributing node to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node is requested by the requesting node according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
To describe the technical solutions in the embodiments of the present invention or in the prior art more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments or the prior art. Apparently, the accompanying drawings in the following description show merely some embodiments of the present invention, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
The following clearly and describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are merely some but not all of the embodiments of the present invention. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
Referring to
201. A requesting node sends a resource request message to a global resource manager.
Exemplarily, a scenario applied in this embodiment is shown in a node topology diagram of a cloud computing network shown in
Exemplarily, the resource request message includes identification information of the requesting node, a size of a memory resource required by the requesting node, and a physical address of the memory resource on the requesting node. Specifically, in this embodiment of the present invention, to clearly describe the technical solutions provided in this embodiment, it is assumed that node 6 is the requesting node, a size of a memory resource requested by node 6 is 3 GB, and a physical address of the memory resource on node 6 is 0Xffff000000.
202. The global resource manager queries a global resource status table according to a size of a memory resource required by the requesting node and identification information of the requesting node, and acquires, according to a location of each node in the global resource status table and a shortest path principle, a contributing node whose memory resource remaining status in the global resource status table can meet the memory resource required by the requesting node.
Exemplarily, the global resource manager may obtain the global resource status table in advance, where the global resource status table includes identification information, the location, and a memory resource remaining status of each node, and the memory resource remaining status of each node may include a size of a currently idle memory resource (denoted as “idle” in
In this embodiment, because node 6 needs to request a memory resource of 3 GB, the global resource manager may learn, by using a location of node 6 and according to the shortest path principle, that node 2, node 5, node 7, and node 10 are nearest to node 6, and node 2, node 5, node 7, and node 10 each may provide a memory resource of 3G according to memory resource remaining statuses. In this case, the global resource manager may further select, by comparing health statuses of nodes, a contributing node that provides a memory resource of 3G. It is assumed, in this embodiment, that node 2 is selected as the contributing node, and it is learned that a physical address that is of a memory resource provided by node 2 and on node 2 is 0X1040000000. Subsequently, the global resource manager may further update a memory resource remaining status of node 2 in the global resource status table to 1G, and update a use status of node 2 in the global resource status table to 7G, as shown in
203. The global resource manager sets a first mapping relationship applied to a cloud control device on the side of the requesting node, and sets a second mapping relationship applied to a cloud control device on the side of the contributing node.
Exemplarily, the first mapping relationship includes a mapping relationship between identification information of the contributing node and a physical address that is of a memory resource provided by the contributing node and is on the requesting node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of the memory resource provided by the contributing node and is on the contributing node.
Specifically, in this embodiment, the first mapping relationship may be described in a form of a mapping table shown in Table 1, where the physical address that is of the memory resource provided by the contributing node and is on the requesting node, an identifier of the contributing node, a validity status of the memory resource (“1” indicates valid, and “0” indicates invalid), and a size of the memory resource may be included.
Accordingly, the second mapping relationship may also be described by using a mapping relationship shown in Table 2, where an identifier of the requesting node, the physical address that is of the memory resource provided by the contributing node and is on the contributing node, the validity status of the memory resource (“1” indicates valid, and “0” indicates invalid), and the size of the memory resource may be included.
It may be understood that on the one hand, for one requesting node, there may be more than one contributing node that provides a memory resource, and on the other hand, for one contributing node, the contributing node may also provide memory resources for more than one requesting node. Therefore, there may be more than one first mapping relationship on a requesting node, and there may also be more than one second mapping relationship on a contributing node.
In step 201 to step 203, with the global resource manager, the memory resource of the contributing node is allocated to the requesting node for exclusive use, and after the allocation is completed, the requesting node can access the memory resource provided by the contributing node. For clear description, in this embodiment of the present invention, the cloud control device on the side of the requesting node may be referred to as a first cloud control device, and the cloud control device on the side of the contributing node may be referred to as a second cloud control device. A specific access process is implemented, as described in step 204 to step 209.
204. A first cloud control device receives a request packet that is sent by the requesting node and is for accessing to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use.
Exemplarily, the first cloud control device is applied to the side of the requesting node, and may be connected to the requesting node by using a bus, or may be directly used as an apparatus that is on the requesting node and is included in the requesting node, which is not limited in this embodiment of the present invention.
Exemplarily, the request packet includes the identification information of the requesting node and a first physical address of the to-be-accessed data, and the first physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the requesting node.
205. The first cloud control device queries the preset first mapping relationship according to a first physical address of the to-be-accessed data to acquire identification information of the contributing node.
Exemplarily, the first mapping relationship includes the mapping relationship between the identification information of the contributing node and the physical address that is of the memory resource provided by the contributing node and is on the requesting node.
206. The first cloud control device sends an access request message for accessing the to-be-accessed data to a second cloud control device on the side of the contributing node according to the identification information of the contributing node.
Exemplarily, the access request message may include the identification information of the requesting node.
207. The second cloud control device receives the access request message sent by the first cloud control device.
Exemplarily, the second cloud control device is applied to the side of the contributing node, and may be connected to the contributing node by using a bus, or may be directly used as an apparatus that is on the contributing node and is included in the contributing node, which is not limited in this embodiment of the present invention.
208. The second cloud control device queries the preset second mapping relationship according to the identification info nation of the requesting node to acquire a second physical address of the to-be-accessed data.
Exemplarily, the second physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the contributing node, and the second mapping relationship includes the mapping relationship between the identification information of the requesting node and the physical address that is of the memory resource provided by the contributing node and is on the contributing node.
209. The second cloud control device transmits the second physical address of the to-be-accessed data and the access request message to the contributing node, so that the contributing node completes an access operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the access request message.
Exemplarily, after the requesting node uses up the memory resource provided by the contributing node, the method may further include the following steps:
210. The requesting node sends an application message to the global manager.
Exemplarily, the application message includes the identification information of the requesting node and the physical address that is of the memory resource provided by the contributing node and is on the requesting node.
211. The global resource manager queries the first mapping relationship according to a physical address that is of the memory resource provided by the contributing node and is on the requesting node, to obtain an identifier of the contributing node, sets the second mapping relationship that is on the contributing node and is corresponding to an identifier of the requesting node to be invalid, releases the memory resource provided by the contributing node, and sets the memory resource as a remaining memory resource of the contributing node.
Exemplarily, in this embodiment, the global resource manager acquires, by querying the first mapping relationship shown in Table 1 on the requesting node (node 6) for a physical address that is of the memory resource provided by the contributing node and on node 6, the identifier (node 2) of the contributing node that provides the memory resource. In addition, the global resource manager queries the second mapping relationship shown in Table 2 on node 2 for the identification information (node 6) of the requesting node, to obtain the physical address 0X1040000000 of the memory resource provided by node 2 to node 6.
Then, the global resource manager sets the second mapping relationship that is on node 2 and related to node 6 to be invalid, releases, according to the physical address 0X1040000000 of the memory resource provided by node 2 to node 6, the memory resource provided by node 2 to node 6, and sets the memory resource as a remaining memory resource of node 2.
212. The global resource manager sets the first mapping relationship on the side of the requesting node to be invalid.
Exemplarily, in this embodiment, the global resource manager may further set the first mapping relationship that is on node 6 and related to node 2 to be invalid.
According to the memory access method provided in this embodiment of the present invention, a global resource manager allocates a memory resource of a contributing node to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node is requested by the requesting node according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
Based on the embodiment in
501. The first cloud control device receives a request packet that is sent by the requesting node and is for accessing to-be-accessed data stored in a memory resource provided by the contributing node to the requesting node for use.
Exemplarily, the request packet may include a read access request packet, where the read request packet may include identification information of the requesting node and a first physical address of the to-be-accessed data.
Specifically, in this embodiment of the present invention, the read request packet may include identification information of node 6 and the first physical address of the to-be-accessed data, that is, a physical address of the to-be-accessed data on node 6. For clear description, it is supposed that the to-be-accessed data is 512 MB, and the first physical address is 0Xffff000000.
502. The first cloud control device queries a preset first mapping relationship according to a first physical address of the to-be-accessed data to acquire identification information of the contributing node.
Exemplarily, the first mapping relationship may be shown in Table 1. In this embodiment, after the first mapping relationship is queried by using the first physical address, it may be obtained that the identification information of the contributing node that provides the memory resource is node 2.
503. The first cloud control device sends a read access request message of the to-be-accessed data to the second cloud control device according to the identification information of the contributing node.
Exemplarily, in this embodiment, the first cloud control device may generate the read access request message, where the read access request message may include the identification information, that is, node 6, of the requesting node. Subsequently, the first cloud control device may send the read access request message to the second cloud control device of the corresponding contributing node (node 2) according to the identification information of the contributing node obtained in step 502.
504. The second cloud control device queries the preset second mapping relationship according to the identification information of the requesting node in the received read access request message to acquire a second physical address of the to-be-accessed data.
Exemplarily, the second physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the contributing node, and the second mapping relationship includes the mapping relationship between the identification information of the requesting node and the physical address that is of the memory resource provided by the contributing node and is on the contributing node.
Specifically, in this embodiment, the second mapping relationship is shown in Table 2. After querying the second mapping relationship in Table 2, the second cloud control device may obtain that second physical address information of the to-be-accessed data is 0X1040000000.
505. The second cloud control device transmits the second physical address of the to-be-accessed data and the read access request message to the contributing node, so that the contributing node completes a read operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the read access request message, and transmits a feedback message to the second cloud control device.
Exemplarily, in this embodiment, the contributing node (node 2) may read the to-be-accessed data of 512 MB at the second physical address, generate a feedback message by including the to-be-accessed data of 512 MB and the identification information of the contributing node, and transmit the feedback message to the second cloud control device.
506. The second cloud control device receives the feedback message transmitted by the contributing node, and queries the second mapping relationship according to the second physical address of the to-be-accessed data to obtain the identification information of the requesting node.
Exemplarily, in this embodiment, the second cloud control device may query, according to the second physical address, the second mapping relationship shown in Table 2 to obtain the identification information (node 6) of the requesting node that expects to read the to-be-accessed data.
507. The second cloud control device sends the feedback message to the first cloud control device according to the identification information of the requesting node.
508. The first cloud control device queries the first mapping relationship according to the identification information of the contributing node in the feedback message to obtain the first physical address of the to-be-accessed data.
Exemplarily, in this embodiment, after receiving the feedback message sent by the second cloud control device, the first cloud control device queries the first mapping relationship shown in Table 1, and may obtain that the first physical address of the to-be-accessed data of 512 MB on the requesting node is 0Xffff000000.
509. The first cloud control device sends the read to-be-accessed data and the first physical address of the to-be-accessed data to the requesting node, so that the requesting node completes reading the to-be-accessed data.
Exemplarily, the first cloud control device may transmit the to-be-accessed data of 512 MB and the first physical address 0Xffff000000 of the to-be-accessed data to the requesting node (node 6), so that node 6 completes reading the to-be-accessed data.
Exemplarily, after using up the memory resource provided by the contributing node, the requesting node may send an application to the global resource manager, so as to release the memory resource provided by the contributing node, set the memory resource to an available state, and set the first mapping relationship on the first cloud control device and the second mapping relationship on the second cloud control device to be invalid. For a specific process, refer to step 210 to step 212, and details are not described herein again.
According to the memory access method provided in this embodiment of the present invention, a global resource manager allocates a memory resource of a contributing node to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node is requested by the requesting node according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
Based on the embodiment in
601. The first cloud control device receives a request packet that is sent by the requesting node and is for accessing to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use.
Exemplarily, the request packet includes a write access request packet and to-be-written data, where the write access request packet includes identification information of the requesting node and a first physical address of to-be-written data.
602. The first cloud control device queries a preset first mapping relationship according to a first physical address of to-be-written data to acquire identification information of the contributing node.
603. The first cloud control device sends a write access request message to the second cloud control device according to the identification information of the contributing node.
Exemplarily, the write access request message includes the write access request packet and the to-be-written data.
604. The second cloud control device queries a preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-written data.
Exemplarily, the identification information of the requesting node is included in the write access request message.
605. The second cloud control device transmits the second physical address of the to-be-written data and the to-be-written data to the contributing node, so that the contributing node writes the to-be-written data to the second physical address of the to-be-written data.
Exemplarily, similar to the foregoing embodiment, after using up the memory resource provided by the contributing node, the requesting node may send an application to the global resource manager, so as to release the memory resource provided by the contributing node, set the memory resource to an available state, and set the first mapping relationship on the first cloud control device and the second mapping relationship on the second cloud control device to be invalid. For a specific process, refer to step 210 to step 212, and details are not described herein again.
According to the memory access method provided in this embodiment of the present invention, a global resource manager allocates a memory resource of a contributing node to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node is requested by the requesting node according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
Referring to
the communications bus 704 may be an Industry Standard Architecture (ISA) Bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like.
The bus 704 may be an address bus, a data bus, a control bus, or the like by category. For ease of denotation, the bus 704 is indicated by using only one bold line in
The first communication unit 701 may be an I/O interface, such as a Peripheral Component Interconnect Express (PCIe) bus interface or a customized system interconnection interface, which is not limited in this embodiment of the present invention.
The second communication unit 703 may be a proprietarily designed communications interface, communicate with another node by using a customized protocol, and efficiently connect to various server resources, thereby reducing a network communication delay, which is not limited in this embodiment of the present invention.
As shown in
The first communication unit 701 is configured to receive a request packet that is sent by the requesting node and is for accessing to-be-accessed data stored in a memory resource provided by a contributing node to the requesting node for use, where the request packet includes identification information of the requesting node and a first physical address of the to-be-accessed data, and the first physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the requesting node.
Exemplarily, a scenario to which this embodiment is applied is shown in
The memory cloud controller 702 is configured to query a preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire identification information of the contributing node, where the first mapping relationship includes a mapping relationship between the identification information of the contributing node and a physical address that is of the memory resource provided by the contributing node and is on the requesting node.
The second communication unit 703 is configured to send an access request message for accessing the to-be-accessed data to a cloud control device on the side of the contributing node according to the identification information of the contributing node.
Exemplarily, specific access request types may include a read access request and a write access request. It may be understood that for access requests of different types, the cloud control device 70 applied to the requesting node also has corresponding processing processes.
First Aspect
The first communication unit 701 is configured to: receive the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, and transmit the request packet to the memory cloud controller 702, where the request packet includes a read access request packet, and the read request packet may include the identification information of the requesting node and the first physical address of the to-be-accessed data.
Specifically, in this embodiment of the present invention, the read request packet may include identification information of node 6 and the first physical address of the to-be-accessed data, that is, a physical address of the to-be-accessed data on node 6. For clear description, it is supposed that the to-be-accessed data is 512 MB, and the first physical address is 0Xffff000000.
The memory cloud controller 702 is configured to query the preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire the identification information of the contributing node, where the first mapping relationship includes the mapping relationship between the identification information of the contributing node and the physical address that is of the memory resource provided by the contributing node and is on the requesting node.
Exemplarily, in this embodiment, the first mapping relationship may be stored in the RMMU 7021, and specifically, may be stored in a form shown in Table 1, which is not limited in the present invention. The RMMU 7021 queries the preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire the identification information of the contributing node, where the identification information of the contributing node is node 2 in this embodiment. The external packet generation unit 7023 may generate a read access request message, pack the read access request message in a format for communication between nodes, and transmit the packed read access request message to the second communication unit 703 by using the buffer 7025.
Accordingly, the second communication unit 703 is configured to send the read access request message of the to-be-accessed data to the cloud control device on the side of the contributing node according to the identification information of the contributing node.
Exemplarily, in this embodiment, the second communication unit 703 may send the packed read access request message to node 2.
Exemplarily, by using step 504 to step 507, the cloud control device on the side of the contributing node may complete the read access request and send a feedback message to the cloud control device 70, where the feedback message includes the identification information of the contributing node and the to-be-accessed data of 512 MB read by the contributing node.
The second communication unit 703 is further configured to: receive the feedback message sent by the cloud control device on the side of the contributing node, and transmit the feedback message to the memory cloud controller 702.
Exemplarily, in this embodiment, the second communication unit 703 may transmit the feedback message to the buffer 7025 in the memory cloud controller 702.
The memory cloud controller 702 is further configured to query the first mapping relationship according to the identification information of the contributing node to acquire the first physical address of the to-be-accessed data.
Exemplarily, in this embodiment, after receiving the feedback message, the memory cloud controller 702 performs parsing on the feedback message in the buffer 7025 by using the packet parsing unit 7024, and transmits the parsed feedback message to the RMMU 7021.
The RMMU 7021 may obtain, by querying the first mapping relationship shown in Table 1, that the first physical address of the to-be-accessed data of 512 MB on the requesting node (node 6) is 0Xffff000000. Subsequently, the RMMU 7021 transmits the to-be-accessed data of 512 MB and the first physical address 0Xffff000000 of the to-be-accessed data to the internal packet generation unit 7022.
The internal packet generation unit 7022 generates the to-be-accessed data of 512 MB and the first physical address 0Xffff000000 of the to-be-accessed data into a packet format that is used to communicate with the requesting node (node 6), and transmits the packet to the first communication unit 701.
The first communication unit 701 is further configured to send the to-be-accessed data read by the contributing node and the first physical address of the to-be-accessed data to the requesting node, so that the requesting node completes reading the to-be-accessed data.
Second Aspect
The first communication unit 701 is configured to receive the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a write access request packet and to-be-written data, and the write access request packet includes the identification information of the requesting node and a first physical address of the to-be-written data.
Exemplarily, in this embodiment, after receiving the request packet, the first communication unit may transmit the request packet to the memory cloud controller 702 by using a network on chip.
Accordingly, the memory cloud controller 702 is configured to query the preset first mapping relationship according to the first physical address of the to-be-written data to acquire the identification information of the contributing node.
Exemplarily, similar to the foregoing first aspect, the first mapping relationship may be saved in the RMMU 7021, and specifically, may be saved in a form shown in Table 1, which is not limited in the present invention. The RMMU 7021 queries the preset first mapping relationship according to the first physical address of the to-be-written data to acquire the identification information of the contributing node, where the identification information of the contributing node is node 2 in this embodiment. The external packet generation unit 7023 may pack the write access request packet and the to-be-written data into a packet for communication between nodes, and transmit the packet obtained by packing to the second communication unit 703 by using the buffer 7025.
The second communication unit 703 is configured to send a write access request message to the cloud control device on the side of the contributing node according to the identification information of the contributing node, where the write access request message includes the write access request packet and the to-be-written data.
This embodiment of the present invention provides the cloud control device 70 for memory access. A global resource manager allocates a memory resource of a contributing node to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node is requested by the requesting node 70 according to a size of a memory resource required by the requesting node 70; therefore, flexible scheduling of memory resources is also implemented.
Referring to
the communications bus 904 may be an Industry Standard Architecture (ISA) Bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like.
The bus 904 may be an address bus, a data bus, a control bus, or the like by category. For ease of denotation, the bus 904 is indicated by using only one bold line in
The first communication unit 901 may be an I/O interface, such as a Peripheral Component Interconnect Express (PCIe) bus interface or a customized system interconnection interface, which is not limited in this embodiment of the present invention.
The second communication unit 903 may be a proprietarily designed communications interface, communicate with another node by using a customized protocol, and efficiently connect to various server resources, thereby reducing a network communication delay, which is not limited in this embodiment of the present invention.
As shown in
It should be noted that each node on an actual cloud computing network may be a requesting node, or may be a contributing node; therefore, a cloud control device on each node may include the apparatuses shown in
The second communication unit 903 is configured to receive an access request message that is of to-be-accessed data and sent by a cloud control device on the side of a requesting node, where the access request message includes identification information of the requesting node.
Exemplarily, a scenario applied in this embodiment is shown in
The memory cloud controller 902 is configured to query a preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-accessed data, where the second physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the contributing node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of a memory resource provided by the contributing node and is on the contributing node.
The first communication unit 901 is configured to send the second physical address of the to-be-accessed data and the access request message to the contributing node.
Exemplarily, a specific type of an access request may include a read access request and a write access request. It may be understood that for access requests of different types, the cloud control device 90 applied to the requesting node also has corresponding processing processes.
First Aspect
The second communication unit 903 is configured to receive the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a read access request message.
Exemplarily, after receiving the read access request message, the second communication unit 903 transmits the read access request message to the buffer 9025 in the memory cloud controller 902.
Accordingly, the memory cloud controller 902 queries the preset second mapping relationship according to the identification information of the requesting node in the received read access request message to acquire the second physical address of the to-be-accessed data.
Exemplarily, in this embodiment, the packet parsing unit 9024 in the memory cloud controller 902 performs parsing on the read access request message in the buffer 9025, and transmits the identification information, parsed from the read access request message, of the requesting node to the RMMU 9021, and the RMMU 9021 queries the second mapping relationship shown in Table 2, to obtain the second physical address 0X1040000000 of the to-be-accessed data.
At the same time, the packet parsing unit 9024 discovers that the read access request message is a read operation on a large volume of data, and therefore, the packet parsing unit 9024 transmits a DMA parameter to a direct memory access (DMA) module 9026 that is further included in the memory cloud controller 902, as shown in
The internal packet generation unit 9022 generates the second physical address of the to-be-accessed data, the DMA start message, and the read access request message into a packet format that is used to communicate with the contributing node (node 2), and transmits the packet to the first communication unit 901.
The first communication unit 901 is configured to transmit the second physical address of the to-be-accessed data and the read access request message to the contributing node.
Exemplarily, in this embodiment, the first communication unit 901 sends, to the contributing node (node 2), the packet that is generated by the internal packet generation unit 9022 and includes the second physical address of the to-be-accessed data, the DMA start message, and the read access request message, so that the contributing node completes a DMA read operation on the to-be-accessed data at the second physical address of the to-be-accessed data according to the read access request message and the DMA start message by using the DMA engine, and transmits a feedback message to the first communication unit 901, where the feedback message includes identification information of the contributing node (node 2) and the to-be-accessed data read by the contributing node (node 2).
The first communication unit 901 is further configured to: receive the feedback message transmitted by the contributing node, and transmit the feedback message to the memory cloud controller 902.
The memory cloud controller 902 is further configured to query the second mapping relationship according to the second physical address of the to-be-accessed data to obtain the identification information of the requesting node.
Exemplarily, in this embodiment, the RMMU 9021 queries, according to the second physical address of the to-be-accessed data, the second mapping relationship shown in Table 2, and may obtain the identification information (node 6) of the requesting node that expects to read the to-be-accessed data.
The external packet generation unit 9023 packs the feedback message in a format for communication between nodes, and transmits the packed feedback message to the second communication unit 903 by using the buffer 9025.
The second communication unit 903 is further configured to send the feedback message to the cloud control device on the side of the requesting node according to the identification information of the requesting node.
Exemplarily, the second communication unit 903 may send, to the cloud control device on the side of the requesting node according to the identification information (node 6) of the requesting node, the feedback message packed by the external packet generation unit 9023.
Second Aspect
The second communication unit 903 is configured to receive a access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a write access request packet and to-be-written data.
Exemplarily, after receiving the access request message, the second communication unit 903 transmits the access request message to the buffer 9025 in the memory cloud controller 902.
Accordingly, the memory cloud controller 902 is configured to query the preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-written data.
Exemplarily, the packet parsing unit 9024 in the memory cloud controller 902 performs parsing on the access request message in the buffer 9025, and transmits the second physical address that is of the to-be-written data and obtained by parsing to the RMMU 9021, and the RMMU 9021 queries the second mapping relationship shown in Table 2, to obtain the second physical address of the to-be-written data.
The internal packet generation unit 9022 generates the second physical address of the to-be-written data and the parsed write access request message into a packet format that is used to communicate with the contributing node (node 2), and transmits the packet to the first communication unit 901.
The first communication unit 901 is configured to send the second physical address of the to-be-written data and the to-be-written data to the contributing node, so that the contributing node writes the to-be-written data to the second physical address of the to-be-written data.
This embodiment of the present invention provides the cloud control device 90 for memory access. A global resource manager allocates a memory resource of a contributing node 90 to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node 90 is requested by the requesting node according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
Referring to
The receiver 1101 is configured to receive a resource request message sent by a requesting node, where the resource request message includes identification information of the requesting node, a size of a memory resource required by the requesting node, and a physical address of the memory resource on the requesting node.
Exemplarily, a scenario applied in this embodiment is shown in a node topology diagram of a cloud computing network shown in
Specifically, in this embodiment of the present invention, to clearly describe the technical solutions provided in this embodiment, it is assumed that node 6 is the requesting node, a size of a memory resource requested by node 6 is 3G, and a physical address of the memory resource on node 6 is 0Xffff000000.
The allocator 1102 is configured to: query a global resource status table according to the size of the memory resource required by the requesting node and the identification information of the requesting node, and acquire, according to a location of each node in the global resource status table and a shortest path principle, a contributing node whose memory resource remaining status in the global resource status table can meet the memory resource required by the requesting node, where the global resource status table includes identification information, the location, and a memory resource remaining status that are of each node.
Exemplarily, the global resource manager 110 may obtain the global resource status table in advance, where the global resource status table includes the identification information, the location, and the memory resource remaining status of each node, and the memory resource remaining status of each node may include a size of a currently idle memory resource (denoted as “idle” in
In this embodiment, because node 6 needs to request a memory resource of 3G, the allocator 1102 may learn, by using a location of node 5 and according to the shortest path principle, that node 2, node 5, node 7, and node 10 are nearest to node 6, and memory remaining statuses of node 2, node 5, node 7, and node 10 each may provide a memory resource of 3 GB. In this case, the allocator 1102 may further perform comparison by including health statuses of nodes, so as to select a contributing node that provides a memory resource of 3G. It is assumed, in this embodiment, that node 2 is selected as the contributing node, and it is learned that a physical address that is of a memory resource provided by node 2 and on node 2 is 0X1040000000. Subsequently, the allocator 1102 may further update a memory resource remaining status of node 2 in the global resource status table to 1G, and update a use status of node 2 in the global resource status table to 7G, as shown in
The setter 1103 is configured to: set a first mapping relationship applied to a cloud control device on the side of the requesting node, and set a second mapping relationship applied to a cloud control device on the side of the contributing node, where the first mapping relationship includes a mapping relationship between identification information of the contributing node and a physical address that is of a memory resource provided by the contributing node and is on the requesting node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of the memory resource provided by the contributing node and is on the contributing node.
Exemplarily, the first mapping relationship and the second mapping relationship may be described respectively by using the mapping relationships shown in Table 1 and Table 2. It may be understood that on the one hand, for one requesting node, there may be more than one contributing node that provides a memory resource, and on the other hand, for one contributing node, the contributing node may also provide memory resources for more than one requesting node. Therefore, there may be more than one first mapping relationship on a requesting node, and there may also be more than one second mapping relationship on a contributing node.
Exemplarily, the receiver 1101 is further configured to receive an application message that is sent by the requesting node after the requesting node uses up the memory resource provided by the contributing node, where the application message includes the identification information of the requesting node and the physical address that is of the memory resource provided by the contributing node and is on the requesting node.
The setter 1102 is further configured to: query the first mapping relationship according to the physical address that is of the memory resource provided by the contributing node and is on the requesting node, to obtain an identifier of the contributing node; set the second mapping relationship that is on the cloud control device on the side of the contributing node and is corresponding to an identifier of the requesting node to be invalid; release the memory resource provided by the contributing node; and set the memory resource as a remaining memory resource of the contributing node; and
set the first mapping relationship on the cloud control device on the side of the requesting node to be invalid.
Exemplarily, in this embodiment, the setter 1102 acquires, by querying the first mapping relationship shown in Table 1 on the requesting node (node 6) for the physical address that is of the memory resource provided by the contributing node and on node 6, the identifier (node 2) of the contributing node that provides the memory resource. In addition, the setter 1102 queries the identification information (node 6) of the requesting node in the second mapping relationship shown in Table 2 on node 2, to obtain the physical address 0X1040000000 of the memory resource provided by node 2 to node 6.
Then, the setter 1102 sets the second mapping relationship that is on node 2 and related to node 6 to be invalid, releases, according to the physical address 0X1040000000 of the memory resource provided by node 2 to node 6, the memory resource provided by node 2 to node 6, and sets the memory resource as a remaining memory resource of node 2; and
sets the first mapping relationship that is on node 6 and related to node 2 to be invalid.
This embodiment of the present invention provides the global resource manager 110 for memory access. The global resource manager 110 allocates a memory resource of a contributing node to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node is requested by the requesting node according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
Referring to
a receiving unit 1201, configured to receive a request packet that is sent by the requesting node and is for accessing to-be-accessed data stored in a memory resource provided by a contributing node to the requesting node for use, where the request packet includes identification information of the requesting node and a first physical address of the to-be-accessed data, and the first physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the requesting node;
an acquiring unit 1202, configured to query a preset first mapping relationship according to the first physical address of the to-be-accessed data to acquire identification information of the contributing node, where the first mapping relationship includes a mapping relationship between the identification information of the contributing node and a physical address that is of the memory resource provided by the contributing node and is on the requesting node; and
a sending unit 1203, configured to send an access request message for accessing the to-be-accessed data to a cloud control device on the side of the contributing node according to the identification information of the contributing node.
Exemplarily, the receiving unit 1201 is configured to receive the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a read access request packet.
Accordingly, the sending unit 1203 is configured to send a read access request message of the to-be-accessed data to the cloud control device on the side of the contributing node according to the identification information of the contributing node.
Further, the receiving unit 1201 is further configured to receive a feedback message sent by the cloud control device on the side of the contributing node, where the feedback message includes the identification information of the contributing node and the to-be-accessed data read by the contributing node.
The acquiring unit 1202 is further configured to query the first mapping relationship according to the identification information of the contributing node to acquire the first physical address of the to-be-accessed data.
The sending unit 1203 is further configured to send the to-be-accessed data read by the contributing node and the first physical address of the to-be-accessed data to the requesting node, so that the requesting node completes reading the to-be-accessed data.
Exemplarily, the receiving unit 1201 is configured to receive the request packet that is sent by the requesting node and is for accessing the to-be-accessed data stored in the memory resource provided by the contributing node to the requesting node for use, where the request packet includes a write access request packet and to-be-written data, and the write access request packet includes the identification information of the requesting node and a first physical address of the to-be-written data.
Accordingly, the acquiring unit 1202 is configured to query the preset first mapping relationship according to the first physical address of the to-be-written data to acquire the identification information of the contributing node.
The sending unit 1203 is configured to send a write access request message to the cloud control device on the side of the contributing node according to the identification information of the contributing node, where the write access request message includes the write access request packet and the to-be-written data.
This embodiment of the present invention provides the cloud control device 70 for memory access. A global resource manager allocates a memory resource of a contributing node to a requesting node 70, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node is requested by the requesting node 70 according to a size of a memory resource required by the requesting node 70; therefore, flexible scheduling of memory resources is also implemented.
Referring to
a receiving unit 1301, configured to receive an access request message that is of to-be-accessed data and sent by a cloud control device on the side of a requesting node, where the access request message includes identification information of the requesting node;
an acquiring unit 1302, configured to query a preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-accessed data, where the second physical address of the to-be-accessed data is a physical address of the to-be-accessed data, on the contributing node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of a memory resource provided by the contributing node and is on the contributing node; and
a sending unit 1303, configured to send the second physical address of the to-be-accessed data and the access request message to the contributing node.
It should be noted that each node on an actual cloud computing network may be a requesting node, or may be a contributing node; therefore, a cloud control device on each node may include the apparatuses shown in
Exemplarily, the receiving unit 1301 is configured to receive the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a read access request message.
Accordingly, the sending unit 1303 is configured to transmit the second physical address of the to-be-accessed data and the read access request message to the contributing node.
According to a second possible implementation manner, with reference to a first possible implementation manner, the receiving unit 1301 is further configured to receive a feedback message transmitted by the contributing node, where the feedback message includes identification information of the contributing node and the to-be-accessed data read by the contributing node.
The acquiring unit 1302 is further configured to query the second mapping relationship according to the second physical address of the to-be-accessed data to obtain the identification information of the requesting node.
The sending unit 1303 is further configured to send the feedback message to the cloud control device on the side of the requesting node according to the identification information of the requesting node.
According to a third possible implementation manner, with reference to an eighth aspect, the receiving unit 1301 is configured to receive the access request message that is of the to-be-accessed data and sent by the cloud control device on the side of the requesting node, where the access request message includes a write access request packet and to-be-written data.
Accordingly, the acquiring unit 1302 is configured to query the preset second mapping relationship according to the identification information of the requesting node to acquire a second physical address of the to-be-written data.
The sending unit 1303 is configured to send the second physical address of the to-be-written data and the to-be-written data to the contributing node, so that the contributing node writes the to-be-written data to the second physical address of the to-be-written data.
This embodiment of the present invention provides the cloud control device 90 for memory access. A global resource manager allocates a memory resource of a contributing node 90 to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node 90 is requested by the requesting node according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
Referring to
a receiving unit 1401, configured to receive a resource request message sent by a requesting node, where the resource request message includes identification information of the requesting node, a size of a memory resource required by the requesting node, and a physical address of the memory resource on the requesting node;
an acquiring unit 1402, configured to: query a global resource status table according to the size of the memory resource required by the requesting node and the identification information of the requesting node, and acquire, according to a location of each node in the global resource status table and a shortest path principle, a contributing node whose memory resource remaining status in the global resource status table can meet the memory resource required by the requesting node, where the global resource status table includes identification information, the location, and a memory resource remaining status that are of each node; and
a setting unit 1403, configured to: set a first mapping relationship applied to a cloud control device on the side of the requesting node, and set a second mapping relationship applied to a cloud control device on the side of the contributing node, where the first mapping relationship includes a mapping relationship between identification information of the contributing node and a physical address that is of a memory resource provided by the contributing node and is on the requesting node, and the second mapping relationship includes a mapping relationship between the identification information of the requesting node and a physical address that is of the memory resource provided by the contributing node and is on the contributing node.
Exemplarily, the receiving unit 1401 is further configured to receive an application message that is sent by the requesting node after the requesting node uses up the memory resource provided by the contributing node, where the application message includes the identification information of the requesting node and the physical address that is of the memory resource provided by the contributing node and is on the requesting node.
The setting unit 1403 is further configured to: query the first mapping relationship according to the physical address that is of the memory resource provided by the contributing node and is on the requesting node, to obtain an identifier of the contributing node; set the second mapping relationship that is on the cloud control device on the side of the contributing node and is corresponding to an identifier of the requesting node to be invalid; release the memory resource provided by the contributing node; and set the memory resource as a remaining memory resource of the contributing node; and
set the first mapping relationship on the cloud control device on the side of the requesting node to be invalid.
This embodiment of the present invention provides the global resource manager 110 for memory access. The global resource manager 110 allocates a memory resource of a contributing node to a requesting node, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node is requested by the requesting node according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
Referring to
This embodiment of the present invention provides the memory access system 150. A global resource manager 110 allocates a memory resource of a contributing node 90 to a requesting node 70, which avoids a case in which multiple nodes frequently use a same memory resource, and reduces operation and maintenance overheads of a system. In addition, the memory resource of the contributing node 90 is requested by the requesting node 70 according to a size of a memory resource required by the requesting node; therefore, flexible scheduling of memory resources is also implemented.
It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, reference may be made to a corresponding process in the foregoing method embodiments, and details are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely exemplary. For example, the unit division is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, maybe located in one position, or maybe distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of hardware in addition to a software functional unit.
A person of ordinary skill in the art may understand that all or some of the steps of the method embodiments may be implemented by a program instructing relevant hardware. The program may be stored in a computer-readable storage medium. When the program runs, the steps of the method embodiments are performed. The foregoing storage medium includes: any medium that can store program code, such as a ROM, a RAM, a magnetic disk, or an optical disc.
The foregoing descriptions are merely specific implementation manners of the present invention, but are not intended to limit the protection scope of the present invention. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the present invention shall fall within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Number | Date | Country | Kind |
---|---|---|---|
201310492067.7 | Oct 2013 | CN | national |
This application is a continuation of International Application No. PCT/CN2014/088618, filed on Oct. 15, 2014, which claims priority to Chinese Patent Application No. 201310492067.7, filed on Oct. 18, 2013, both of which are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2014/088618 | Oct 2014 | US |
Child | 15131449 | US |