A distributed system shared memory consistency synchronization method and device
By using memory mapping cards and cables to connect each host node in a distributed system, combined with memory block management and data synchronization modules, the problem of inconsistent memory data between different nodes is solved, efficient memory data synchronization and consistency are achieved, and system efficiency and correctness are improved.
Patent Information
- Application Number
- CN202211037637.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-08-26
AI Technical Summary
In existing shared memory consistency methods for distributed systems, update writeback events and read events are not prioritized, resulting in a cumbersome data synchronization update process and affecting system efficiency.
A memory mapping card and cables are used to connect each host node. Memory address mapping and data synchronization are achieved through the address translation module, memory mapping interface module and memory data transmission module of the memory mapping card. Combined with the memory block mapping management module, memory operation interception module and memory data synchronization module, read and write requests are distinguished and status management is performed to ensure data consistency.
It improves the efficiency of the shared memory mechanism of the distributed system, avoids deadlock, ensures the consistency of memory data between different nodes, and improves the correctness of parallel computing.
Smart Images

Figure CN115391060B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distributed system shared memory and memory consistency, and in particular relates to a distributed system shared memory consistency synchronization method and device in a collaborative task system. Background Art
[0002] The shared memory mechanism is a low-latency, high-throughput information exchange method between nodes in a distributed computer system, and has been applied to a certain extent in distributed information computing systems. Cross-node shared memory technology uses a computer network to connect multiple computers to form a loosely coupled distributed system. When multiple host node processors access shared memory data at the same time, they may access the same data, including loading and modifying it. Maintaining the consistency of shared data access between nodes in a distributed system is a problem that must be solved by a shared memory system. In existing methods for shared memory consistency in distributed systems, update writeback events and read events are regarded as the same type of events, and there is no distinction between read events and write events. The main disadvantage of the existing technology is that each request for a modification event to the shared memory must use a complex protocol to update the data to the corresponding memory on other nodes. The cumbersome data synchronization update process and the large number of data transmissions and volumes between nodes may affect the overall efficiency of the distributed system. Summary of the Invention
[0003] The purpose of the present invention is to provide a method and device for synchronizing the consistency of shared memory in a distributed system, which is intended to solve the inconsistency problem that may occur in shared memory data between different nodes in a distributed computing system, ensure that the same shared memory data is accessed on processors of different nodes, and avoid inconsistent memory data affecting the correctness of distributed parallel computing applications.
[0004] To achieve the purpose of the present invention, the present invention provides a distributed system shared memory consistency synchronization device, characterized in that it includes a distributed computing system composed of multiple host nodes, each host node is connected by a memory mapping card and a cable; according to the configured memory data sharing parameter items, memory address mapping and data synchronization update can be achieved between the host node memories;
[0005] The internal hardware configuration of the host node includes a storage unit, a processor unit, a communication interface, a host baseboard, and a memory mapping card; the memory mapping card integrates an address translation module, a memory mapping interface module, and a memory data transmission module; the memory mapping card is connected to the host node via a PCIe expansion interface and can directly use the memory access function to read and write memory; the address translation module is used to map and convert the addresses of shared memories between different host nodes; the memory mapping interface module is used to connect to the memory mapping interface module of a memory mapping switching device or other host nodes via a cable; the memory data transmission module is used to perform protocol encapsulation, integrity verification, and decapsulation on the data in the shared memory area and send it to the memory data transmission modules of other nodes;
[0006] Memory mapping driver software is deployed on the host node, and the memory mapping driver software integrates a memory block mapping management module, a memory operation interception module, and a memory data synchronization module; the memory block mapping management module is used to maintain the block identification, block number, and block status of the shared memory in the distributed system, and supports the synchronization of memory data blocks on different host nodes; the memory operation interception module is used to intercept the host node's read and write requests for data in the shared memory area; the memory data synchronization module is used to synchronize the updates of local shared memory data by a host node in the distributed system to the host node through the memory data transmission module.
[0007] Furthermore, each host node is connected to the memory mapping switch device through a memory mapping card interface to realize a shared memory data channel connection between the host nodes; the memory mapping switch device has multiple ports connected to the memory mapping card interface, which is used to connect multiple host nodes to the distributed shared memory system and supports cascading.
[0008] In order to achieve the purpose of the present invention, the present invention also discloses a method for synchronizing the shared memory consistency of a distributed system, comprising the following steps:
[0009] Step 1: The memory block mapping management module of each host node in the system initializes the shared memory blocks, sets the status of all allocated memory blocks to "available", and creates a memory address mapping table through the address translation module to establish the mapping relationship between the shared memory blocks of each host node;
[0010] Step 2: When a host node X in the distributed system makes a read / write request to a shared memory block, the memory operation interception module of the host node X intercepts the request;
[0011] Step 3: If the memory operation interception module of host node X intercepts the request as a read request, it reads the corresponding memory data and returns the memory data, and then goes to step 2;
[0012] Step 4: If the memory operation interception module request of host node X is a write request, the memory operation interception module passes the intercepted shared memory block write request to the memory block mapping management module of host node X. The memory block mapping management module of host node X sets the shared memory block status of host node X to "writable";
[0013] Step 5: Relying on the memory mapping interface, the memory mapping switch device, and the cables between them, the memory block mapping management module of host node X sets the shared memory blocks of other host nodes in the distributed system to an unavailable state through the memory data transmission module;
[0014] Step 6: The memory block mapping management module of host node X passes the shared memory block write request to the memory data synchronization module; the memory address mapping table in the address translation module of host node X is searched, and the memory data synchronization module of host node X updates the shared memory block data corresponding to other nodes in the distributed system and restores the shared memory blocks of other nodes to a usable state;
[0015] Step 7: Host node X intercepts the write request according to the memory operation interception module and updates the corresponding memory data, then restores the shared memory block status to "available" and returns, and then goes to step 2.
[0016] Furthermore, in step one, "initializing shared memory blocks" means that the memory block mapping management module establishes a mapping relationship between shared memory blocks of host nodes in a distributed system, and divides and identifies the shared memory space according to the size of the shared memory space, and allocates space for storing block identifiers and status.
[0017] Furthermore, in step 2, "intercepting the request" means that the memory operation interception module obtains a request event for accessing the shared memory area by accessing the memory bus; the memory operation interception module does not obtain a request event for the non-shared memory area.
[0018] Furthermore, in step three, "reading corresponding memory data" means that if the status of the memory block is "available", the corresponding memory data is read and returned; if the status of the memory block is "unavailable", the corresponding memory data is read when the waiting status is set to "available".
[0019] Furthermore, in step five, "setting the memory block to an unavailable state" means that if the original state of the memory block is "available", it is set to "unavailable"; if the original state of the memory block is "writable", wait until it becomes "available" and then set the memory block state to "unavailable".
[0020] Furthermore, in step six, “data update” refers to the memory data synchronization module updating the memory block data corresponding to other host nodes in the distributed system through the memory data transmission module.
[0021] Furthermore, in step six, “restoring the available state” means that the updated memory block state is restored to “available” through the memory block mapping management module.
[0022] Compared with the existing technology, the significant improvements of the present invention are: 1) a memory data synchronization method can ensure the consistency of shared memory data between host nodes in a distributed system; 2) the method of first identifying the status and then updating can avoid deadlock in updating memory; 3) the memory synchronization method that distinguishes between read and write requests is adopted to improve the efficiency of the shared memory mechanism of the distributed system.
[0023] In order to more clearly illustrate the functional characteristics and structural parameters of the present invention, further description is given below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0025] Figure 1 This is a block diagram of a host node in a distributed system shared memory consistency synchronization device provided by an embodiment of the present invention;
[0026] Figure 2 This is a block diagram of the composition of a first distributed system shared memory consistency synchronization device provided by an embodiment of the present invention;
[0027] Figure 3 This is a block diagram of the composition of a second distributed system shared memory consistency synchronization device provided by an embodiment of the present invention;
[0028] Figure 4 This is a diagram of the software module composition of a host node in a distributed system shared memory consistency synchronization device provided by an embodiment of the present invention;
[0029] Figure 5 This is a module composition diagram of a memory mapping card in a distributed system shared memory consistency synchronization device provided by an embodiment of the present invention;
[0030] Figure 6 This is a flow chart of a method for synchronizing shared memory consistency in a distributed system provided by an embodiment of the present invention.
[0031] The accompanying drawings in the figure are marked as follows: host node 1, communication interface 2, processor unit 3, storage unit 4, memory mapping card 5, host baseboard 6, memory mapping switching device 7, address translation module 8, memory data transmission module 9, memory mapping interface module 10, memory mapping driver software 11, memory block mapping management module 12, memory operation interception module 13, and memory data synchronization module 14. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0033] like Figure 6 As shown, a method for synchronizing shared memory consistency in a distributed system includes the following steps:
[0034] Step 1: The memory block mapping management module of each host node in the system initializes the shared memory blocks, sets the status of all allocated memory blocks to "available", and creates a memory address mapping table through the address translation module to establish the mapping relationship between the shared memory blocks of each host node;
[0035] Step 2: When a host node X in the distributed system makes a read / write request to a shared memory block, the memory operation interception module of the host node X intercepts the request;
[0036] Step 3: If the memory operation interception module of host node X intercepts the request as a read request, it reads the corresponding memory data and returns the memory data, and then goes to step 2;
[0037] Step 4: If the memory operation interception module request of host node X is a write request, the memory operation interception module passes the intercepted shared memory block write request to the memory block mapping management module of host node X. The memory block mapping management module of host node X sets the shared memory block status of host node X to "writable";
[0038] Step 5: Relying on the memory mapping interface, the memory mapping switch device, and the cables between them, the memory block mapping management module of host node X sets the shared memory blocks of other host nodes in the distributed system to an unavailable state through the memory data transmission module;
[0039] Step 6: The memory block mapping management module of host node X passes the shared memory block write request to the memory data synchronization module; the memory address mapping table in the address translation module of host node X is searched, and the memory data synchronization module of host node X updates the shared memory block data corresponding to other nodes in the distributed system and restores the shared memory blocks of other nodes to a usable state;
[0040] Step 7: Host node X intercepts the write request according to the memory operation interception module and updates the corresponding memory data, then restores the shared memory block status to "available" and returns, and then goes to step 2.
[0041] Example
[0042] like Figure 1 As shown, in this embodiment, host node 1 includes a communication interface 2, a processor unit 3, a storage unit 4, a memory mapping card 5, and a host backplane 6. Processor unit 3 can be a general-purpose CPU or an embedded CPU. In a shared memory-based distributed system, host nodes can be of the same type with the same configuration or of different configurations.
[0043] like Figure 2 As shown, in this embodiment, the system includes three members, host node A, host node B, and host node C. The three host nodes are interconnected through a memory mapping switching device 7, wherein the cable connecting the memory mapping card 5 and the memory mapping switching device 7 can be a copper cable or an optical cable.
[0044] like Figure 3 As shown, in this embodiment, the system includes a host node A and a host node B, a total of two host nodes, and the two host nodes are directly connected through the interface of the memory mapping card 5.
[0045] like Figure 4 As shown, in this embodiment, the memory mapping card 5 on each host node 1 integrates an address translation module 8, a memory data transmission module 9, and a memory mapping interface module 10. The memory mapping card 5 is connected to the computer via a PCIe expansion interface and can directly read and write memory using the direct memory access function. The address translation module 8 is used to map and translate the addresses of the shared memory between different host nodes 1; the memory mapping interface module 10 is used to connect to the memory mapping switch device or the memory mapping interface module of other host nodes via a cable; the memory data transmission module 9 is used to perform protocol encapsulation, integrity verification, and decapsulation of data within the shared memory area, and send it to the memory data transmission modules of other nodes.
[0046] like Figure 5As shown, in this embodiment, memory mapping driver software 11 is deployed on each host node 1. The memory mapping driver software 11 integrates a memory block mapping management module 12, a memory operation interception module 13, and a memory data synchronization module 14. The memory block mapping management module 12 is used to maintain the block identification, block number, and block status of the shared memory in the distributed system, and supports the synchronization of memory data blocks on different host nodes 1; the memory operation interception module 13 is used to intercept host node 1's read and write requests for data within the shared memory area; and the memory data synchronization module 14 is used to synchronize updates to local shared memory data by a host node 1 in the distributed system to the host node 1 via the memory data transmission module 9.
[0047] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0048] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A distributed system shared memory consistency synchronization device, characterized in that: A distributed computing system consisting of several host nodes, each of which is connected via memory mapping cards and cables. Based on the configured memory data sharing parameters, memory address mapping and data synchronization can be achieved between the host node memories. The internal hardware configuration of the host node includes a storage unit, a processor unit, a communication interface, a host baseboard, and a memory mapping card; the memory mapping card integrates an address translation module, a memory mapping interface module, and a memory data transmission module; The memory mapping card is connected to the host node via the PCIe expansion interface and can directly use the memory access function to read and write memory; the address translation module is used to map and convert the addresses of shared memories between different host nodes; the memory mapping interface module is used to connect to the memory mapping switching device or the memory mapping interface module of other host nodes via a cable; the memory data transmission module is used to perform protocol encapsulation, integrity verification, and decapsulation on the data in the shared memory area and send it to the memory data transmission modules of other nodes; Memory mapping driver software is deployed on the host node. The memory mapping driver software integrates a memory block mapping management module, a memory operation interception module, and a memory data synchronization module. The memory block mapping management module is used to maintain the block identification, block number, and block status of the shared memory in the distributed system, and supports the synchronization of memory data blocks on different host nodes. The memory operation interception module is used to intercept the host node's read and write requests for data in the shared memory area; The memory data synchronization module is used to synchronize the updates of local shared memory data by a host node in the distributed system to the host node through the memory data transmission module; The memory block mapping management module of each host node in the system initializes the shared memory blocks, sets the status of all allocated memory blocks to "available", and creates a memory address mapping table through the address translation module to establish the mapping relationship between the shared memory blocks of each host node; When a host node X in the distributed system makes a read / write request to a shared memory block, the memory operation interception module of host node X intercepts the request; If the memory operation interception module of host node X intercepts a read request, it reads the corresponding memory data and returns the memory data. Then, go to "When a host node X in a distributed system makes a read or write request to a shared memory block, the memory operation interception module of host node X intercepts the request." If the memory operation interception module request of host node X is a write request, the memory operation interception module will pass the intercepted shared memory block write request to the memory block mapping management module of host node X, and the memory block mapping management module of host node X will set the shared memory block status of host node X to "writable"; Relying on the memory mapping interface, memory mapping switch device, and the cables between them, the memory block mapping management module of host node X sets the shared memory blocks of other host nodes in the distributed system to an unavailable state through the memory data transmission module; The memory block mapping management module of host node X passes the shared memory block write request to the memory data synchronization module; The memory address mapping table in the address translation module of host node X is searched. The memory data synchronization module of host node X updates the shared memory block data corresponding to other nodes in the distributed system and restores the shared memory blocks of other nodes to a usable state. Host node X intercepts the write request using the memory operation interception module, updates the corresponding memory data, and then restores the shared memory block status to "available" and returns. The process then proceeds to "When a host node X in the distributed system makes a read or write request for a shared memory block, the memory operation interception module of host node X intercepts the request." "Data update" means that the memory data synchronization module updates the memory block data corresponding to other host nodes in the distributed system through the memory data transmission module; "Restoring to an available state" means that the updated memory block state is restored to "available" through the memory block mapping management module.
2. A distributed system shared memory consistency synchronization device according to claim 1, characterized in that: Each host node is connected to the memory mapping switch device through a memory mapping card interface to realize the shared memory data channel connection between the host nodes; the memory mapping switch device has multiple ports connected to the memory mapping card interface, which is used to connect multiple host nodes to the distributed shared memory system and supports cascading.
3. A method for synchronizing a shared memory consistency in a distributed system, the method being based on a device for synchronizing a shared memory consistency in a distributed system according to any one of claims 1 to 2, characterized in that: The following steps are involved: Step 1: The memory block mapping management module of each host node in the system initializes the shared memory blocks, sets the status of all allocated memory blocks to "available", and creates a memory address mapping table through the address translation module to establish the mapping relationship between the shared memory blocks of each host node; Step 2: When a host node X in the distributed system makes a read / write request to a shared memory block, the memory operation interception module of the host node X intercepts the request; Step 3: If the memory operation interception module of host node X intercepts the request as a read request, it reads the corresponding memory data and returns the memory data, and then goes to step 2; Step 4: If the memory operation interception module request of host node X is a write request, the memory operation interception module passes the intercepted shared memory block write request to the memory block mapping management module of host node X. The memory block mapping management module of host node X sets the shared memory block status of host node X to "writable"; Step 5: Relying on the memory mapping interface, the memory mapping switch device, and the cables between them, the memory block mapping management module of host node X sets the shared memory blocks of other host nodes in the distributed system to an unavailable state through the memory data transmission module; Step 6: The memory block mapping management module of host node X passes the shared memory block write request to the memory data synchronization module; The memory address mapping table in the address translation module of host node X is searched. The memory data synchronization module of host node X updates the shared memory block data corresponding to other nodes in the distributed system and restores the shared memory blocks of other nodes to a usable state. Step 7: Host node X intercepts the write request according to the memory operation interception module and updates the corresponding memory data, then restores the shared memory block status to "available" and returns, and then goes to step 2.
4. A method for synchronizing shared memory consistency in a distributed system according to claim 3, characterized in that: In step 1, "initializing shared memory blocks" means that the memory block mapping management module establishes a mapping relationship between shared memory blocks of host nodes in the distributed system, divides and identifies the shared memory space according to the size of the shared memory space, and allocates space for storing block identifiers and status.
5. A method for synchronizing shared memory consistency in a distributed system according to claim 3, characterized in that: In step 2, "intercepting the request" means that the memory operation interception module obtains a request event for accessing the shared memory area by accessing the memory bus; the memory operation interception module does not obtain a request event for the non-shared memory area.
6. A method for synchronizing shared memory consistency in a distributed system according to claim 3, characterized in that: In step 3, "reading the corresponding memory data" means that if the status of the memory block is "available", the corresponding memory data is read and returned; if the status of the memory block is "unavailable", the corresponding memory data is read when the status is set to "available".
7. A method for synchronizing shared memory consistency in a distributed system according to claim 3, characterized in that: In step 5, "setting the memory block to unavailable state" means that if the original state of the memory block is "available", it is set to "unavailable". If the original state of the memory block is "writable", the memory block state is set to "unavailable" after it becomes "available".
Citation Information
Patent Citations
Distributed file data block read-write method and system based on RDMA and nonvolatile memory
CN111125049A
Data processing method and device based on distributed shared memory system
CN113590364A
Method for sharing memory among cluster system nodes on demand based on RDMA (Remote Direct Memory Access)
CN114756388A