Cache consistency maintenance method and device, equipment, medium and program product
After receiving an invalid write operation request in a multi-core processor system, the master node first returns a response message and updates the directory entry to avoid invalid data transmission. This solves the problem of increased bus load in traditional cache coherence protocols and improves the efficiency of write-after-read operations and system performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-04-21
AI Technical Summary
In shared memory systems such as multi-core processors and multi-way servers, traditional cache coherence protocols require a mutual exclusion read request before a non-exclusive cache line can perform a write operation, resulting in invalid data transmission, increased bus load and communication latency, and reduced write operation efficiency, especially in large-scale multi-node concurrent write scenarios.
After receiving an invalid cache consistency write operation request, the master node first returns a response message, without waiting for data to be retrieved, and initiates a data request query to the other nodes and updates the directory entries. Data is only distributed to nodes that have data requests to avoid invalid transmission.
It effectively reduces bus load and operation latency, simplifies the write-after-read operation process, and improves the write-after-read operation efficiency and overall performance of multi-node systems.
Smart Images

Figure CN121901296A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, medium, and program product for maintaining cache consistency. Background Technology
[0002] In shared memory systems such as multi-core processors and multi-processor servers, each core or node is typically equipped with an independent cache. Concurrent access to shared data can easily lead to data inconsistency, necessitating cache coherence protocols to manage cache line states and ensure data validity. In traditional protocols, a non-exclusive cache line must initiate a mutual exclusion read request to convert to an exclusive state before performing a write operation. However, the data read can be overwritten by subsequent write operations, resulting in invalid data transmission and directly increasing bus load and communication latency. This is especially pronounced in large-scale, multi-node concurrent write scenarios, where bus congestion and latency issues are exacerbated, significantly reducing write operation efficiency and limiting overall system performance and concurrent processing capabilities. Summary of the Invention
[0003] This invention provides a cache consistency maintenance method, apparatus, device, medium, and program product, which can effectively reduce bus load and operation latency, and significantly improve the execution efficiency of write-after-read operations in multi-node systems while ensuring cache consistency.
[0004] This invention provides a cache consistency maintenance method applied to a master node, comprising: After receiving the cache consistency write operation request initiated by the first requesting node, a response message is returned to the first requesting node; the initial state of the target cache line corresponding to the first requesting node is invalid. Initiate invalidation listener requests carrying the target cache line data request query to the other requesting nodes; After receiving the listening response from other requesting nodes, which carries their own target cache line data requirement information, update the current data requirement information of the other requesting nodes to the corresponding directory entries; After the first requesting node receives the response message and sends the target cache line data to be written, it sends a completion response to the first requesting node. Based on the updated directory entries, the received target cache line data is distributed to the requesting nodes that require data.
[0005] The present invention also provides a cache consistency maintenance device, applied to a master node, comprising: The response message sending module is used to receive the cache consistency write operation request initiated by the first requesting node and return a response message to the first requesting node; the initial state of the target cache line corresponding to the first requesting node is invalid. The listening request sending module is used to send invalidation listening requests carrying queries for the target cache line data to other request nodes; The information update module is used to receive the listening response returned by other requesting nodes, which carries their own target cache line data requirement information, and then update the current data requirement information of the other requesting nodes to the corresponding directory entries. The completion response sending module is used to send a completion response to the first request node after the first request node receives the response message and sends the target cache line data to be written; The data distribution module is used to distribute the received target cache line data to the requesting nodes that need the data, based on the updated directory entries.
[0006] The present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described cache coherence maintenance methods when executing the computer program.
[0007] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described cache coherence maintenance methods.
[0008] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described cache coherence maintenance methods.
[0009] The cache consistency maintenance method provided by this invention, after receiving a cache consistency write operation request from the first requesting node whose initial state is invalid, the master node first returns a response message without waiting for data acquisition; then it initiates invalidation listening requests carrying queries about the target cache line data requirements to the other requesting nodes, and receives listening responses from each node carrying its own data requirement information. Based on the returned data requirement information, the master node updates the directory entries, accurately perceives and records the actual data requirements of each node, thereby avoiding the problem of increased bus load caused by mutual exclusion read operations reading useless data in traditional cache consistency protocols; after receiving the target cache line data to be written sent by the first requesting node, the master node promptly sends a completion response to ensure the smooth progress of the write operation process, and based on the updated directory entries, distributes the target cache line data only to nodes with data requirements, without waiting for the data requirement nodes to re-initiate the read data operation. This effectively reduces bus communication overhead, simplifies the write-after-read operation process in multi-core systems, reduces operation latency, and significantly improves the execution efficiency of write-after-read operations in shared memory systems while ensuring cache data consistency among multiple nodes. It can be applied to multi-core processor, multi-way server, or large-scale multi-server node multi-computing node systems.
[0010] In addition, the present invention also provides corresponding cache consistency maintenance devices, electronic devices, computer-readable storage media and program products for cache consistency maintenance methods, which have the same or corresponding technical features as the cache consistency maintenance methods mentioned above, and have the same effects. Attached Figure Description
[0011] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart of a cache consistency maintenance method provided in an embodiment of the present invention; Figure 2 This is one of the signaling interaction diagrams of the cache consistency maintenance method provided in the embodiments of the present invention; Figure 3 This is the second schematic diagram of the signaling interaction of the cache consistency maintenance method provided in the embodiments of the present invention; Figure 4 This is a schematic diagram of the cache consistency maintenance device provided in an embodiment of the present invention. Detailed Implementation
[0013] In multi-core processor and multi-processor server systems, cache consistency is a key technology, ensuring the consistency of cached data accessed by multiple processor cores or physical processors in a shared memory system. Taking multi-core processors as an example, each core typically has an independent cache to reduce latency when accessing main memory. However, when multiple cores concurrently access shared data, the lack of effective cache consistency control can lead to data inconsistency. To address this, systems typically employ cache consistency protocols to manage the state of target cache lines, ensuring that all cores read and write the latest version of the data. In write requests to shared addresses, typically only a target cache line in an exclusive state has the authority to initiate write operations to lower-level caches or memory. If a non-exclusive target cache line wants to initiate a write operation to a lower-level cache or memory, it must first initiate a mutual exclusion read request to convert its target cache line state to an exclusive state. However, the data read through this mutual exclusion read is actually useless and will be overwritten by subsequent write operations, increasing the bus load due to data transfer. This invention provides a cache consistency maintenance method that effectively solves the above problems.
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0015] It should be noted that, in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0016] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0017] The specific application environment architecture or specific hardware architecture on which the execution of the cache consistency maintenance method depends is described here.
[0018] The embodiments of the present invention provide a cache consistency maintenance method, and the method is described in detail in conjunction with the execution flow of the cache consistency maintenance method. Figure 1 A flowchart of the cache consistency maintenance method provided in the embodiments of the present invention is shown below. Figure 1 As shown, this method is applied to the master node and includes: S101. After receiving the cache consistency write operation request initiated by the first requesting node, return a response message to the first requesting node; the initial state of the target cache line corresponding to the first requesting node is invalid.
[0019] It's important to note that the Home Node is the node that processes cache consistency transactions. Request Nodes (RNs) are the initiators of cache consistency transactions. A cache consistency write operation request is a write operation request initiated by the first requesting node to the Home Node to modify data in shared memory, used to maintain cache data consistency across multiple nodes. A response message is a feedback message returned by the Home Node to the first requesting node after receiving the cache consistency write operation request, informing them that the request has been accepted and subsequent operations can continue. The target cache line is the specific data block stored in the cache, line by line, that this write operation targets. An invalid state is a cache line's state indicating that the data stored in that cache line is invalid and unavailable, and the node cannot directly perform read or write operations based on that data.
[0020] When executing step S101, after receiving the cache consistency write operation request initiated by the first requesting node whose initial state is invalid, the master node immediately returns a response message to the requesting node. On the one hand, this limits the initiator of the write operation to the first requesting node whose cache line is invalid, corresponding to the applicable scenario of the optimized protocol, and lays the foundation for skipping traditional mutual exclusion reads and avoiding invalid data transmission. On the other hand, the design of the master node returning the response message first eliminates the need to wait for feedback or data retrieval from other nodes, shortening the waiting time of the requesting nodes and providing a premise for simplifying the process of write-after-read operations in multi-core systems and reducing operation latency.
[0021] S102, Initiate invalidation listening requests to other requesting nodes, carrying queries for the target cache line data.
[0022] It should be noted that the target cache line data request is a query instruction issued by the master node to other requesting nodes to inquire whether they need the target cache line data. The invalidate listener request (also known as the "make invalid listener request") is a control instruction issued by the master node to other requesting nodes, requiring them to mark the corresponding target cache line as invalid.
[0023] When executing step S102, the master node combines the data request query and invalidation listener into a single request. While completing the invalidation of the cache line, the master node accurately collects the actual data requests of each node for the target cache line. This provides a basis for distributing data only to nodes with requests and avoiding invalid transmissions. This simplifies the interaction process, reduces the number of bus interactions, and lays the foundation for reducing communication overhead and improving the efficiency of write-after-read operations.
[0024] S103. After receiving the listening response from the other requesting nodes, which carries their own target cache line data requirement information, update the current data requirement information of the other requesting nodes to the corresponding directory entries.
[0025] It should be noted that the target cache line data requirement information is a status message returned by other requesting nodes, indicating whether the node needs the target cache line data. Directory entries are storage items in the master node used to record the correspondence between each requesting node and the target cache line, as well as their data requirement status.
[0026] During step S103, after receiving the listening responses from the other requesting nodes, which carry their respective data request information, the master node updates this real-time request information to the corresponding directory entries. This step achieves accurate recording and dynamic maintenance of the data requests of each node, providing a direct basis for subsequent on-demand data distribution based on directory entries. It fundamentally avoids the invalid transmission caused by broadcasting data to all nodes in traditional protocols, effectively reducing bus load, while ensuring the real-time nature and accuracy of directory information, providing data support for the efficient execution of the entire cache-consistent write operation.
[0027] S104. After receiving the response message and sending the target cache line data to be written, the first request node sends a completion response to the first request node.
[0028] When executing step S104, the master node only sends a completion response to the first requesting node after confirming that the first requesting node has received the previous response message and successfully received the target cache line data to be written. This ensures the integrity of the write operation data transmission and guarantees the orderliness of the interaction process, avoiding operation anomalies caused by data not being delivered or state mismatch. At the same time, it provides a reliable timing node for subsequent data distribution to nodes in need based on directory entries and for completing the overall cache consistency synchronization, further improving the stability and controllability of the write-after-read operation process.
[0029] S105. Based on the updated directory entries, distribute the received target cache line data to the requesting nodes that require data.
[0030] During step S105, the master node accurately identifies requesting nodes with data needs based on the updated directory entries from step S103. It then distributes the target cache line data received in step S104 only to these requesting nodes, rather than broadcasting it to all nodes. This directly solves the problem of invalid data transmission in traditional protocols. By distributing data on demand, it significantly reduces bus communication volume, effectively lowers bus load and operational latency, and significantly improves the efficiency of read-after-write operations in shared memory systems while ensuring cache data consistency across multiple nodes.
[0031] In the cache consistency maintenance method provided in this embodiment of the invention, after receiving a cache consistency write operation request from the first requesting node whose initial state is invalid, the master node first returns a response message without waiting for data retrieval; then, it initiates invalidation listening requests carrying queries about the target cache line data requirements to the other requesting nodes, and receives listening responses from each node carrying their own data requirement information. Based on the returned data requirement information, it updates the directory entries, accurately perceiving and recording the actual data requirements of each node, thereby avoiding the increased bus load caused by mutual exclusion read operations reading useless data in traditional cache consistency protocols; the master node, upon receiving... Upon receiving the target cache line data to be written from the first requesting node, a completion response is promptly sent to ensure the smooth progress of the write operation. Based on the updated directory entries, the target cache line data is distributed only to nodes that require data, eliminating the need to wait for the data-requiring nodes to re-initiate the read data operation. This effectively reduces bus communication overhead, simplifies the write-after-read operation process in multi-core systems, and reduces operation latency. While ensuring cache data consistency among multiple nodes, it significantly improves the execution efficiency of write-after-read operations in shared memory systems. It can be applied to multi-core processor, multi-way server, or large-scale multi-server node multi-computing node systems.
[0032] Furthermore, in specific implementations, the cache consistency maintenance method provided in the embodiments of the present invention may further include: receiving a completion confirmation response returned by a requesting node with data requirements; and initiating a write request to a node that proxies lower-level cache or memory data, so that the node that proxies lower-level cache or memory data performs a write data operation.
[0033] In implementation, a node that proxies lower-level cache or memory data refers to a node in the cache hierarchy architecture responsible for managing and accessing lower-level cache or main memory data, and acting as an intermediary for data interaction between upper-level nodes and lower-level storage. After the master node distributes the target cache line data to the requesting nodes that have data needs on demand, it receives completion confirmation responses from these requesting nodes to ensure successful data distribution. Subsequently, it initiates write requests to the node responsible for proxies lower-level cache or memory data, triggering it to execute write data operations and synchronize the latest data to the lower-level cache or main memory. This not only ensures the consistency of cached data among multiple nodes, but also achieves persistent synchronization of data from the upper-level cache to the lower-level storage, forming a complete closed loop for cache consistency maintenance. This ensures that shared data at all levels in the system is the latest valid version, and improves the reliability of write-after-read operations and system stability through step-by-step confirmation and orderly execution.
[0034] Furthermore, in specific implementation, in the above steps, a write request is initiated to the node that proxies the lower-level cache or memory data, so that the node that proxies the lower-level cache or memory data performs a write data operation. Specifically, this may include: initiating write requests to the node that proxies the lower-level cache or memory data in parallel, so that the node that proxies the lower-level cache or memory data performs a write data operation on the target cache line, wherein the data interaction between the master node and the node that proxies the lower-level cache or memory data is performed in parallel; and the data interaction between the master node and each requesting node is performed in parallel.
[0035] In implementation, this invention achieves a significant improvement in operational efficiency through parallel execution of data interactions between the master node and nodes that proxy lower-level cache or memory data, as well as between the master node and each requesting node. Specifically, while the master node initiates write requests to nodes that proxy lower-level cache or memory data to complete the persistence of the target cache line data, it can simultaneously process data distribution, confirmation, and other interactive processes with each requesting node, without waiting for the lower-level storage write operation to complete or for a single node to respond. This parallel design effectively avoids the overall process blockage caused by lower-level cache / memory write latency or inter-node interaction waiting in traditional serial processing, significantly shortening the total write operation time and reducing system response latency. While ensuring eventual data consistency and persistence reliability, it further improves the concurrent processing capability and overall operating efficiency of multi-core processors, multi-way servers, and other multi-node shared memory systems. It is particularly suitable for large-scale node concurrent write operation scenarios and can effectively alleviate bus contention and system bottleneck problems.
[0036] Furthermore, in a specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, after receiving the cache consistency write operation request initiated by the first requesting node, step S101 returns a response message to the first requesting node, which may specifically include: receiving the cache consistency write operation request initiated by the first requesting node and confirming whether the cache consistency write operation request is valid; when the cache consistency write operation request is confirmed to be valid, allocating a data buffer identifier for the first requesting node and generating a response message carrying the data buffer identifier; and returning the response message to the first requesting node to notify the first requesting node to prepare for the sending operation of the data to be written.
[0037] In implementation, the aforementioned response message can be a DBIDResp (Data Buffer ID Response) message. Upon receiving a cache-consistent write operation request from the first requesting node, the master node first verifies its validity, ensuring the request is legitimate and the target cache line status meets the operation conditions. This guarantees the stability of system interaction and data security. After verification, the master node assigns a corresponding data buffer ID to the first requesting node and includes it in the response message, informing the first requesting node that it can begin preparing and sending the data to be written. This avoids invalid requests consuming system resources. Simultaneously, the data buffer ID enables precise differentiation and management of different write operation requests, effectively preventing data confusion and transmission conflicts. This provides a reliable guarantee for the subsequent orderly reception and processing of data to be written, significantly improving the standardization and reliability of the cache-consistent write operation process.
[0038] Furthermore, in specific implementation, the above steps, receiving the cache-consistent write operation request initiated by the first requesting node and confirming whether the cache-consistent write operation request is valid, may specifically include: receiving the write exclusive operation request initiated by the first requesting node and confirming whether the write exclusive operation request is valid. Then, when the write exclusive operation request is confirmed to be valid, a data buffer identifier is allocated to the first requesting node, and a response message carrying the data buffer identifier is generated.
[0039] It should be noted that a write exclusive operation request is an operation request initiated by the first requesting node to the master node for a target cache line, used to obtain exclusive write permission to perform data modification and maintain cache consistency. This typically corresponds to write scenarios where the cache line is initially in an invalid or shared state. This invention does not impose restrictions on specific cache consistency write operations; that is, write operations initiated by an RN with an initial state of 'I' are applicable.
[0040] In practical applications, the Advanced Coherency Extensions (ACE) protocol and the Coherent Hub Interface (CHI) protocol in the Advanced Microcontroller Bus Architecture (ARM AMBA) interconnect protocol add WriteUnique. Write operation. WriteUnique While write operations support direct writing to invalid cache lines, they first invalidate cache copies on other nodes, resulting in the directory losing its original state and all node caches becoming invalid. To restore the original system state, each core needs to re-initiate read requests, and the master node, to ensure consistency, can only process these sequentially, significantly increasing read latency. Furthermore, the master node can only passively wait for read requests and cannot actively restore the original cache state. This invention, however, receives the write exclusive operation request from the first requesting node and performs validity verification, filtering invalid requests to avoid resource waste. After successful verification, a data buffer identifier is allocated and a response message is generated, achieving precise distinction and orderly management of requests. Subsequently, invalidation listening requests carrying data request queries are sent to other nodes. Upon receiving responses, directory entries are updated to accurately record the data requests of each node. After the first requesting node sends the data to be written, a completion response is sent, and data is distributed to nodes with requests based on directory entries. This approach, through pre-verification, on-demand invalidation, accurate recording of requests, and targeted distribution, avoids the problems associated with WriteUnique. This addresses the issues of directory loss and passive waiting for read requests after an operation, while eliminating the need to serially process a large number of read requests during state recovery. This reduces core operation interruptions and data reading time. At the same time, it reduces bus load through ordered interaction and precise distribution, improving the efficiency of post-write read operations and the speed of system state recovery, thus ensuring the concurrent performance and stability of multi-node shared memory systems.
[0041] Furthermore, in a specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, when the remaining request nodes include a second request node and a third request node, and the second request node needs target cache line data while the third request node does not need target cache line data, after receiving the listening response returned by the remaining request nodes carrying their own target cache line data requirement information, step S103 updates the current data requirement information of the remaining request nodes to the corresponding directory entries. Specifically, this may include: after receiving the listening response returned by the second request node carrying that it needs target cache line data, updating the information that the second request node needs target cache line data to the corresponding directory entries; and after receiving the listening response returned by the third request node carrying that it does not need target cache line data, updating the information that the third request node does not need target cache line data to the corresponding directory entries.
[0042] Correspondingly, step S105 distributes the received target cache line data to the request nodes that have data requirements according to the updated directory entries. Specifically, it may include: distributing the received target cache line data only to the second request node according to the updated directory entries, without distributing the received target cache line data to the third request node.
[0043] Figure 2This is one of the signaling interaction diagrams for the cache consistency maintenance method provided in this embodiment of the invention. In implementation, as... Figure 2 As shown, assuming there are three requesting nodes (RN0, RN1, and RN2) in the system, their initial cache line states differ significantly: the first requesting node (RN0) has an initial cache line state of Invalid (I), the second requesting node (RN1) has an initial cache line state of Shared Dirty (SD), and the third requesting node (RN2) has an initial cache line state of Shared Clean (SC). The first requesting node (RN0) initiates a cache-consistent write operation request (e.g., a write exclusive operation request) to the master node (HN), fully demonstrating the master node's (HN) ability to fine-tune cache consistency. Upon receiving the cache-consistent write operation request, the master node (HN) returns a response message (e.g., a DBIDResp message) to the first requesting node (RN0) and initiates invalidation listening requests carrying queries for the target cache line data to the second requesting node (RN1) and the third requesting node (RN2). After receiving the listening response from the second requesting node (RN1) indicating that it needs the target cache line data, the master node (HN) updates the target cache line data requirement information of the second requesting node (RN1) to the corresponding directory entry. Upon receiving the listening response from the third requesting node (RN2) indicating that it does not need the target cache line data, the master node (HN) updates the target cache line data requirement information of the third requesting node (RN2) to the corresponding directory entry and synchronously records its data requirement status for the target cache line. Specifically, upon receiving the invalidation listening request, the second requesting node (RN1) and the third requesting node (RN2) first set their own cache line status to invalid (I), and then return the execution result and data requirement information through the listening response. The second requesting node (RN1) marks "still needs target cache line data" in its response, while the third requesting node (RN2) marks "does not need target cache line data". After receiving these responses, the master node (HN) synchronously updates the cache status bit of the directory entry with the invalidation execution result, and simultaneously writes the data requirement information to a preset flag bit to ensure that the directory reflects the latest status of each node in real time and accurately. Based on the updated directory entries, the master node (HN) only distributes the target cache line data to the second requesting node (RN1) that has data needs, and does not distribute it to the third requesting node (RN2) that does not need it. This effectively avoids the waste of bus bandwidth and invalid transmission caused by sending data to nodes that do not need it, significantly reduces bus load and operation latency, and at the same time ensures the efficient execution of write-after-read operations in the cache, thereby improving the overall operating efficiency of the multi-node shared memory system.
[0044] Furthermore, in a specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, when the remaining request nodes include a second request node and a third request node, and both the second request node and the third request node require target cache line data, after receiving the listening response returned by the remaining request nodes carrying their own target cache line data requirement information, step S103 updates the current data requirement information of the remaining request nodes to the corresponding directory entries. Specifically, this may include: after receiving the listening responses returned by the second request node and the third request node carrying their respective required target cache line data, updating the information of the second request node and the third request node requiring target cache line data to the corresponding directory entries respectively.
[0045] Correspondingly, step S105 distributes the received target cache line data to the request nodes that have data requirements according to the updated directory entries. Specifically, it may include: distributing the received target cache line data to the second request node and the third request node respectively according to the updated directory entries.
[0046] Figure 3 This is the second schematic diagram of the signaling interaction for the cache consistency maintenance method provided in this embodiment of the invention. In implementation, as... Figure 3As shown, assuming there are three request nodes (RN0, RN1, and RN2) in the system, their initial cache line states differ significantly: the first request node (RN0) has an initial cache line state of Invalid (I), the second request node (RN1) has an initial cache line state of Shared Dirty (SD), and the third request node (RN2) has an initial cache line state of Shared Clean (SC). The first request node (RN0) initiates a cache-consistent write operation request (e.g., a write exclusive operation request) to the master node (HN), fully demonstrating the master node's (HN) ability to fine-tune cache consistency. Upon receiving the cache-consistent write operation request, the master node (HN) returns a response message (e.g., a DBIDResp message) to the first request node (RN0) and initiates invalidation listening requests carrying queries for the target cache line data to the second request node (RN1) and the third request node (RN2). After receiving the listening responses from the second requesting node (RN1) and the third requesting node (RN2) containing their required target cache line data, the master node (HN) updates the target cache line data required by both nodes in the corresponding directory entries and synchronously records their data requirement status for the target cache line. Specifically, upon receiving the invalidation listening request, the second and third requesting nodes (RN1 and RN2) first set their own cache line status to invalid (I), and then return the execution result and data requirement information through the listening response. Both the second and third requesting nodes (RN1 and RN2) mark "still need target cache line data" in their responses. After receiving these responses, the master node (HN) synchronously updates the cache status bit of the directory entry with the invalidation execution result, and simultaneously writes the data requirement information to a preset flag bit, ensuring that the directory accurately reflects the latest status of each node in real time. Based on the updated directory entries, the master node (HN) distributes the target cache line data to the second requesting node (RN1) and the third requesting node (RN2) that have data requirements, ensuring the consistency and real-time performance of the cached data of each requesting node. At the same time, the precise distribution avoids the waste of bus bandwidth caused by broadcast transmission, effectively reducing bus load and improving the overall efficiency of write-after-read operations and data synchronization in a multi-node shared memory system.
[0047] Furthermore, in a specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, step S102, which initiates an invalidation listening request carrying a query for the target cache line data requirement to the other request nodes, may specifically include: querying local directory entries to obtain a list of other request nodes currently holding a copy of the target cache line; initiating an invalidation listening request to each of the other request nodes in the list of other request nodes; and synchronously carrying relevant information about the query for the target cache line data requirement in the invalidation listening request.
[0048] In implementation, this invention achieves precise cache consistency control by first querying local directory entries to obtain a list of nodes holding copies of the target cache line, and then initiating a targeted invalidation listening request. The request synchronously carries data request queries, collecting data requests from each node at once while invalidating the cache line, thus avoiding the bus overhead caused by multiple interactions.
[0049] Furthermore, in specific implementation, the above steps may include, while obtaining the list of other request nodes currently holding a copy of the target cache line, obtaining the current status information of the target cache line corresponding to each of the other request nodes in the list of other request nodes.
[0050] Accordingly, invalidation listening requests are initiated to each of the remaining request nodes in the remaining request node list. Specifically, this may include: based on the obtained current state information, initiating invalidation listening requests to each of the remaining request nodes in the remaining request node list whose target cache line status is not invalid.
[0051] In implementation, the master node of this invention can query directory entries to simultaneously obtain the current state of each node's cache line while retrieving the list of nodes holding a copy of the target cache line. It only initiates invalidation listening requests to nodes whose state is not invalid, achieving fine-grained and targeted cache consistency control. This avoids repeatedly initiating requests to nodes already in an invalid state, reducing unnecessary bus interactions and processing overhead, and improving the efficiency of invalidation operations.
[0052] Furthermore, in a specific implementation, in the above-mentioned cache consistency maintenance method provided in the embodiments of the present invention, before initiating invalidation listening requests to each of the remaining request nodes in the remaining request node list in step S102, it may further include: adding a first field segment of a set size to the invalidation listening request; the first field segment is used to inquire whether each of the remaining request nodes still needs information on the target cache line data.
[0053] In implementation, this invention can add a first field of a set size (e.g., 1 bit) to the invalidation listening request to synchronously query each node for its data requirements of the target cache line, thus merging the invalidation operation and the requirement query. This effectively reduces the number of bus interactions and lowers communication latency and bandwidth usage.
[0054] Furthermore, in a specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, step S103, receiving the listening response returned by the other requesting nodes carrying their own target cache line data requirement information, may specifically include: receiving the listening response returned by each of the other requesting nodes; the listening response synchronously carrying the execution result that the corresponding requesting node has set the target cache line status to invalid, and relevant information on whether it still needs the target cache line data recorded in a second field of a set size; after receiving the listening responses returned by each of the other requesting nodes, storing the information of the listening response.
[0055] In implementation, the master node of this invention can synchronously obtain the execution result of invalidating the target cache line and the node data requirement information by receiving the listening responses returned by other requesting nodes, and store this key information uniformly, realizing the integrated collection and management of operation feedback and requirement data. The listening response can include a second field segment of a set size (e.g., 1 bit) to indicate whether the requesting node still needs the cache line data, providing a basis for the master node to perform data distribution.
[0056] Furthermore, in specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, step S103, receiving the listening response returned by other request nodes carrying their own target cache line data requirement information, may specifically include: receiving the listening response returned by each of the other request nodes in the list of other request nodes whose target cache line status is not invalid; the listening response synchronously carries the execution result that the corresponding request node has set the target cache line status to invalid, and the relevant information on whether it still needs the target cache line data recorded in a second field of a set size; after receiving the listening responses returned by each of the other request nodes in the list of other request nodes whose target cache line status is not invalid, storing the information of the listening response.
[0057] In implementation, this invention can receive listening responses only for nodes that were previously in a non-invalid state. The responses simultaneously carry invalidation execution results and data requirement information, ensuring that the master node obtains the operation status and subsequent distribution basis in one go. After receiving the responses, the response information is stored uniformly, providing reliable data support for subsequent accurate distribution according to directory entries and avoiding invalid transmission. This reduces unnecessary interaction processing and improves the overall efficiency and reliability of write-after-read operations in the cache.
[0058] Furthermore, in a specific implementation, in the above-mentioned cache consistency maintenance method provided in the embodiments of the present invention, while updating the current data demand information of the remaining request nodes to the corresponding directory entries in step S103, it may also include: updating the information that the target cache line of the remaining request nodes has been set to invalid state to the cache status bit corresponding to the directory entry.
[0059] In practice, this invention updates the data requirement information of each other request node to the directory entry while simultaneously updating the status of the target cache line that has been set to invalid to the corresponding cache status bit. This achieves integrated maintenance of data requirements and cache status, ensuring that the directory entry reflects the latest status of each node in real time and accurately. This provides a reliable basis for subsequent accurate data distribution and clearly marks that the cache of each node is invalid, avoiding inconsistencies in status and further improving the efficiency of directory management and the reliability of cache consistency control.
[0060] Furthermore, in a specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, step S103 updates the current data demand information of the remaining request nodes to the corresponding directory entries, which may specifically include: updating the current data demand information of the remaining request nodes to the preset flag bit of the directory entries; wherein, the current data demand information is the relevant information recorded in the second field segment regarding whether it still needs the target cache line data; the flag bit is used to identify whether the target cache line data is still needed.
[0061] In implementation, this invention can update the node data demand information recorded in the second domain segment of the monitoring response to the preset identifier bit of the directory entry, realizing the structured and bit-level storage of demand information. This allows the master node to quickly determine whether each node needs the target cache line data through the identifier bit, providing an efficient query basis for subsequent targeted distribution, simplifying the directory management logic, and improving the speed and accuracy of data demand judgment.
[0062] Furthermore, in a specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, after the first requesting node receives the response message and sends the target cache line data to be written, step S104 sends a completion response to the first requesting node. Specifically, it may include: after the first requesting node receives the response message and sends the target cache line data to be written to the master node based on the response message, receiving the target cache line data; and sending a completion response to the first requesting node to notify the first requesting node that the cache consistency write operation is complete.
[0063] In implementation, after the master node receives the target cache line data to be written sent by the first requesting node based on the response message, the present invention sends a completion response to notify that the operation is over. This clarifies the completion node of the write data transmission, ensures that the first requesting node is aware of the operation status, avoids repeated sending or waiting for timeout, and provides a timing reference for subsequent data distribution and writing to lower-level storage.
[0064] Furthermore, in a specific implementation, in the cache consistency maintenance method provided in the embodiments of the present invention, step S105, which distributes the received target cache line data to the request nodes that have data requirements according to the updated directory entries, may specifically include: filtering out the request nodes that still need the target cache line data based on the locally updated directory entry information and designating them as request nodes with data requirements; distributing the received target cache line data to the request nodes with data requirements, so that the request nodes with data requirements can return a completion confirmation response to the master node after obtaining the target cache line data.
[0065] In implementation, this invention allows the master node to precisely filter out requesting nodes that still require target cache line data based on locally updated directory entry information, achieving fine-grained positioning of data distribution objects. Based on the filtering results, the master node only distributes the received target cache line data to these nodes with demand, rather than broadcasting it to all nodes. This effectively avoids wasted bus bandwidth and invalid transmission caused by nodes without demand receiving data, significantly reducing bus load and operational latency. After data distribution is complete, nodes with data demand, upon successfully acquiring and loading the target cache line data, will return a completion confirmation response to the master node, ensuring the reliability and accuracy of data synchronization and guaranteeing the orderliness and stability of data synchronization in a multi-node shared memory system.
[0066] From the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0067] Embodiments of the present invention also provide a cache consistency maintenance apparatus. Figure 4 This is a schematic diagram of the cache consistency maintenance device provided in an embodiment of the present invention. This embodiment is based on functional modules, such as… Figure 4 As shown, this device is applied to the master node and includes: The response message sending module 10 is used to receive the cache consistency write operation request initiated by the first requesting node and return a response message to the first requesting node; the initial state of the target cache line corresponding to the first requesting node is invalid. The listening request sending module 11 is used to send invalidation listening requests carrying the target cache line data requirement query to other request nodes; Information update module 12 is used to receive the listening response returned by other request nodes carrying their own target cache line data requirement information, and then update the current data requirement information of the other request nodes to the corresponding directory entries. The completion response sending module 13 is used to send a completion response to the first request node after the first request node receives the response message and sends the target cache line data to be written; The data distribution module 14 is used to distribute the received target cache line data to the requesting nodes that have data needs, based on the updated directory entries.
[0068] In the cache consistency maintenance device provided in this embodiment of the invention, the interaction of the five modules enables the master node to return a response message immediately after receiving a cache consistency write operation request from the first requesting node whose initial state is invalid, without waiting for data retrieval. Subsequently, it initiates invalidation listening requests carrying queries about the target cache line data requirements to the remaining requesting nodes, and receives listening responses from each node carrying their own data requirement information. Based on the returned data requirement information, it updates the directory entries, accurately sensing and recording the actual data requirements of each node. This avoids the increased bus load caused by mutual exclusion read operations reading useless data in traditional cache consistency protocols. The master node, upon receiving the target cache line data to be written from the first requesting node, promptly sends a completion response to ensure the smooth progress of the write operation. Based on the updated directory entries, it distributes the target cache line data only to nodes that require data, eliminating the need to wait for the data-requiring node to re-initiate the read operation. This effectively reduces bus communication overhead, simplifies the write-after-read operation process in multi-core systems, reduces operation latency, and significantly improves the execution efficiency of write-after-read operations in shared memory systems while ensuring cache data consistency among multiple nodes. It can be applied to multi-core processor, multi-way server, or large-scale multi-server node multi-computing node systems.
[0069] Since the embodiments of the cache consistency maintenance device and the cache consistency maintenance method correspond to each other, the descriptions of the features in the embodiments corresponding to the cache consistency maintenance device can be found in the relevant descriptions of the embodiments corresponding to the cache consistency maintenance method, and will not be repeated here. Furthermore, it has the same beneficial effects as the cache consistency maintenance method mentioned above.
[0070] Furthermore, in specific implementations, the cache consistency maintenance apparatus provided in the embodiments of the present invention may further include: a write request initiation module, used to receive a completion confirmation response returned by a requesting node with data requirements; and to initiate write requests to nodes that proxy lower-level cache or memory data, so that the nodes that proxy lower-level cache or memory data perform write data operations. The write request initiation module can initiate write requests to nodes that proxy lower-level cache or memory data in parallel, so that the nodes that proxy lower-level cache or memory data perform write data operations on the target cache line. Data interaction between the master node and the nodes that proxy lower-level cache or memory data is performed in parallel; data interaction between the master node and each requesting node is performed in parallel.
[0071] Furthermore, in a specific implementation, in the cache consistency maintenance device provided in this embodiment of the invention, the response message sending module 10 can be specifically used to receive a cache consistency write operation request initiated by a first requesting node, and confirm whether the cache consistency write operation request is valid; when the cache consistency write operation request is confirmed to be valid, a data buffer identifier is allocated to the first requesting node, and a response message carrying the data buffer identifier is generated; the response message is returned to the first requesting node to notify the first requesting node to prepare for the sending operation of the data to be written. Specifically, it can receive a write exclusive operation request initiated by the first requesting node and confirm whether the write exclusive operation request is valid. Then, when the write exclusive operation request is confirmed to be valid, a data buffer identifier is allocated to the first requesting node, and a response message carrying the data buffer identifier is generated.
[0072] Furthermore, in a specific implementation, in the cache consistency maintenance device provided in the embodiments of the present invention, the listening request sending module 11 can be specifically used to query local directory entries to obtain a list of other request nodes currently holding a copy of the target cache line; to initiate invalidation listening requests to each of the other request nodes in the list of other request nodes; the invalidation listening requests synchronously carry relevant information regarding the target cache line data requirement query. While obtaining the list of other request nodes currently holding a copy of the target cache line, it may also include: obtaining the current status information of the target cache line corresponding to each of the other request nodes in the list of other request nodes. Based on the obtained current status information, invalidation listening requests are initiated to each of the other request nodes in the list of other request nodes whose target cache line status is not invalid. Before initiating invalidation listening requests to each of the other request nodes in the list of other request nodes, it may also include: adding a first field of a set size to the invalidation listening request; the first field is used to query whether each of the other request nodes still needs the target cache line data.
[0073] Furthermore, in specific implementation, in the cache consistency maintenance device provided in the embodiments of the present invention, the information update module 12 can be specifically used to receive the listening responses returned by each of the other request nodes; the listening responses synchronously carry the execution result that the corresponding request node has set the target cache line status to invalid, and the relevant information on whether it still needs the target cache line data recorded in a second field of a set size; after receiving the listening responses returned by each of the other request nodes, the information of the listening responses is stored. The information update module 12 can also be specifically used to receive the listening responses returned by each of the other request nodes in the list of other request nodes whose target cache line status is not invalid; the listening responses synchronously carry the execution result that the corresponding request node has set the target cache line status to invalid, and the relevant information on whether it still needs the target cache line data recorded in a second field of a set size; after receiving the listening responses returned by each of the other request nodes in the list of other request nodes whose target cache line status is not invalid, the information of the listening responses is stored. While updating the current data demand information of the remaining request nodes to the corresponding directory entries, it may also include updating the information that the target cache line of the remaining request nodes has been set to invalid to the cache status bit of the corresponding directory entry.
[0074] In addition, the information update module 12 can also be used to update the current data demand information of the other request nodes to the preset flag bit of the directory entry; wherein, the current data demand information is the relevant information recorded in the second field segment regarding whether it still needs the target cache line data; the flag bit is used to indicate whether the target cache line data is still needed.
[0075] Furthermore, in a specific implementation, in the cache consistency maintenance device provided in the embodiments of the present invention, the response sending module 13 can be used to receive the target cache line data after the first requesting node receives the response message and sends the target cache line data to be written to the master node based on the response message; and send a completion response to the first requesting node to notify the first requesting node that the cache consistency write operation is complete.
[0076] Furthermore, in a specific implementation, in the cache consistency maintenance device provided in the embodiments of the present invention, the data distribution module 14 can be specifically used to filter out the request nodes that still need the target cache line data based on the locally updated directory entry information and to designate them as request nodes with data requirements; distribute the received target cache line data to the request nodes with data requirements, so that the request nodes with data requirements can return a completion confirmation response to the master node after obtaining the target cache line data.
[0077] Furthermore, in a specific implementation, in the cache consistency maintenance device provided in this embodiment of the invention, when the remaining requesting nodes include a second requesting node and a third requesting node, and the second requesting node needs target cache line data while the third requesting node does not, the information update module 12 can be specifically used to update the information that the second requesting node needs target cache line data to the corresponding directory entry after receiving the listening response returned by the second requesting node carrying that it needs target cache line data; and to update the information that the third requesting node does not need target cache line data to the corresponding directory entry after receiving the listening response returned by the third requesting node carrying that it does not need target cache line data. The data distribution module 14 can be specifically used to distribute the received target cache line data only to the second requesting node according to the updated directory entry, without distributing the received target cache line data to the third requesting node.
[0078] Furthermore, in a specific implementation, in the cache consistency maintenance device provided in this embodiment of the invention, when the remaining requesting nodes include a second requesting node and a third requesting node, and both the second and third requesting nodes require target cache line data, the information update module 12 can be specifically used to receive the listening responses returned by the second and third requesting nodes carrying their respective requirements for target cache line data, and then update the information of the second and third requesting nodes requiring target cache line data to the corresponding directory entries. The data distribution module 14 can be specifically used to distribute the received target cache line data to the second and third requesting nodes respectively according to the updated directory entries.
[0079] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the cache coherence maintenance method.
[0080] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the cache consistency maintenance method at runtime.
[0081] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0082] Embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the cache coherence maintenance method.
[0083] Embodiments of the present invention also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described cache coherence maintenance method embodiments.
[0084] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0085] The foregoing has provided a detailed description of the cache consistency maintenance method, apparatus, device, medium, and program product provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of this invention.
Claims
1. A cache consistency maintenance method, characterized in that, Applied to the master node, including: After receiving the cache consistency write operation request initiated by the first requesting node, a response message is returned to the first requesting node; the initial state of the target cache line corresponding to the first requesting node is invalid. Initiate invalidation listener requests carrying the target cache line data request query to the other requesting nodes; After receiving the listening response from other requesting nodes, which carries their own target cache line data requirement information, update the current data requirement information of the other requesting nodes to the corresponding directory entries; After the first requesting node receives the response message and sends the target cache line data to be written, it sends a completion response to the first requesting node. Based on the updated directory entries, the received target cache line data is distributed to the requesting nodes that require data.
2. The cache consistency maintenance method according to claim 1, characterized in that, Also includes: Receive a completion confirmation response from the requesting node that has data requirements; A write request is sent to the node that proxies the lower-level cache or memory data, so that the node that proxies the lower-level cache or memory data performs a write data operation.
3. The cache consistency maintenance method according to claim 2, characterized in that, Sending a write request to a node that proxies lower-level cache or memory data, so that the node proxies lower-level cache or memory data performs a write data operation, including: Write requests are initiated in parallel to nodes that proxy lower-level cache or memory data, so that the nodes that proxy lower-level cache or memory data can perform write data operations on the target cache line. The data interaction between the master node and the nodes that proxy lower-level cache or memory data is performed in parallel; the data interaction between the master node and each requesting node is performed in parallel.
4. The cache consistency maintenance method according to claim 1, characterized in that, Initiate invalidation listener requests carrying queries for the target cache line data to other requesting nodes, including: Query the local directory entries to obtain a list of the remaining request nodes that currently hold a copy of the target cache line; Initiate invalidation listening requests to each of the remaining request nodes in the remaining request node list; the invalidation listening requests synchronously carry relevant information about the target cache line data requirement query.
5. The cache consistency maintenance method according to claim 4, characterized in that, In addition to retrieving the list of remaining request nodes that currently hold a copy of the target cache line, this also includes: Obtain the current status information of the target cache line corresponding to each of the remaining request nodes in the list of remaining request nodes; Initiate invalidation listening requests to each of the remaining request nodes in the remaining request node list, including: Based on the obtained current status information, invalidation listening requests are initiated to each of the remaining request nodes in the list of remaining request nodes whose target cache line status is not invalid.
6. The cache consistency maintenance method according to claim 4, characterized in that, Before initiating invalidation listening requests to each of the remaining request nodes in the remaining request node list, the process also includes: Add a first field of a set size to the invalidation listener request; the first field is used to query each of the other request nodes whether they still need the target cache line data.
7. The cache consistency maintenance method according to claim 1, characterized in that, Receive listening responses from other requesting nodes, which carry information about their target cache line data requirements, including: Receive listening responses returned by each of the other requesting nodes; the listening responses synchronously carry the execution result that the corresponding requesting node has set the target cache line status to invalid, as well as relevant information recorded in a second field of a set size on whether it still needs the target cache line data; After receiving the listening responses from all the other requesting nodes, the information in the listening responses is stored.
8. The cache consistency maintenance method according to claim 5, characterized in that, Receive listening responses from other requesting nodes, which carry information about their target cache line data requirements, including: Receive listening responses from each of the remaining request nodes in the list of remaining request nodes whose target cache line status is not invalid; the listening responses synchronously carry the execution result that the corresponding request node has set the target cache line status to invalid, as well as relevant information recorded in a second field of a set size regarding whether it still needs the target cache line data; After receiving the listening responses from all the other request nodes in the list of other request nodes whose target cache line status is not invalid, the information of the listening responses is stored.
9. The cache consistency maintenance method according to claim 1, characterized in that, While updating the current data requirement information of the remaining requesting nodes to the corresponding directory entries, it also includes: Update the cache status bit of the directory entry with the information that the target cache line of the remaining request nodes has been set to invalid.
10. The cache consistency maintenance method according to claim 7, characterized in that, Update the current data requirement information of the remaining requesting nodes to the corresponding directory entries, including: Update the current data requirement information of the remaining request nodes to the preset flag bit of the directory entry; wherein, the current data requirement information is the relevant information recorded in the second field segment regarding whether it still needs the target cache line data; the flag bit is used to identify whether the target cache line data is still needed.
11. The cache consistency maintenance method according to claim 1, characterized in that, After the first requesting node receives the response message and sends the target cache line data to be written, it sends a completion response to the first requesting node, including: After the first requesting node receives the response message and sends the target cache line data to be written to the master node based on the response message, the target cache line data is received. Send a completion response to the first requesting node to notify the first requesting node that the cache-consistent write operation is complete.
12. The cache consistency maintenance method according to claim 1, characterized in that, Based on the updated directory entries, the received target cache line data is distributed to requesting nodes that require data, including: Based on the locally updated directory entry information, select the request nodes that still need the target cache line data and treat them as request nodes with data requirements; The received target cache line data is distributed to the requesting nodes that need the data, so that the requesting nodes that need the data can obtain the target cache line data and then return a completion confirmation response to the master node.
13. The cache consistency maintenance method according to claim 1, characterized in that, After receiving the cache consistency write operation request initiated by the first requesting node, a response message is returned to the first requesting node, including: Receive a cache consistency write operation request initiated by the first request node, and confirm whether the cache consistency write operation request is valid; When the cache-consistent write operation request is confirmed to be valid, a data buffer identifier is allocated to the first requesting node, and a response message carrying the data buffer identifier is generated. The response message is returned to the first requesting node to notify the first requesting node to prepare for the sending operation of the data to be written.
14. The cache consistency maintenance method according to claim 13, characterized in that, Receiving a cache-consistent write operation request initiated by the first requesting node, and confirming whether the cache-consistent write operation request is valid, including: Receive a write exclusive operation request initiated by the first requesting node, and confirm whether the write exclusive operation request is valid; When the cache-consistent write operation request is confirmed to be valid, a data buffer identifier is allocated to the first requesting node, and a response message carrying the data buffer identifier is generated, including: When the write exclusive operation request is confirmed to be valid, a data buffer identifier is allocated to the first requesting node, and a response message carrying the data buffer identifier is generated.
15. The cache consistency maintenance method according to claim 1, characterized in that, When the remaining requesting nodes include a second requesting node and a third requesting node, and the second requesting node needs the target cache line data while the third requesting node does not, after receiving the listening response from the remaining requesting nodes carrying their own target cache line data requirement information, the current data requirement information of the remaining requesting nodes is updated to the corresponding directory entries, including: After receiving the listening response from the second requesting node carrying the target cache line data it needs, update the information of the target cache line data required by the second requesting node to the corresponding directory entry; after receiving the listening response from the third requesting node carrying the target cache line data it does not need, update the information of the target cache line data not needed by the third requesting node to the corresponding directory entry. Based on the updated directory entries, the received target cache line data is distributed to requesting nodes that require data, including: Based on the updated directory entries, the received target cache line data is distributed only to the second request node, and not to the third request node.
16. The cache consistency maintenance method according to claim 1, characterized in that, When the remaining requesting nodes include a second requesting node and a third requesting node, and both the second and third requesting nodes require target cache line data, after receiving the listening response from the remaining requesting nodes carrying their own target cache line data requirement information, the current data requirement information of the remaining requesting nodes is updated to the corresponding directory entries, including: After receiving the listening responses from the second request node and the third request node, which carry the target cache line data they each need, update the target cache line data information of the second request node and the third request node to the corresponding directory entries respectively; Based on the updated directory entries, the received target cache line data is distributed to requesting nodes that require data, including: Based on the updated directory entries, the received target cache line data is distributed to the second request node and the third request node, respectively.
17. A cache consistency maintenance device, characterized in that, Applied to the master node, including: The response message sending module is used to receive the cache consistency write operation request initiated by the first requesting node and return a response message to the first requesting node; the initial state of the target cache line corresponding to the first requesting node is invalid. The listening request sending module is used to send invalidation listening requests carrying queries for the target cache line data to other request nodes; The information update module is used to receive the listening response returned by other requesting nodes, which carries their own target cache line data requirement information, and then update the current data requirement information of the other requesting nodes to the corresponding directory entries. The completion response sending module is used to send a completion response to the first request node after the first request node receives the response message and sends the target cache line data to be written; The data distribution module is used to distribute the received target cache line data to the requesting nodes that need the data, based on the updated directory entries.
18. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the cache coherency maintenance method as described in any one of claims 1 to 16 when executing the computer program.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the cache coherency maintenance method as described in any one of claims 1 to 16.
20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the cache coherency maintenance method as described in any one of claims 1 to 16.
Citation Information
Patent Citations
Adjustable and reliable consistency maintenance method in structured P2P network
CN107612980A
A data access method and device based on a multi-core processor
CN109684237A
Software package updating method, device and system, electronic equipment and readable storage medium
CN116301952A
Cache processing method and device, storage medium and electronic equipment
CN118250333A
Multi-node cache consistency maintenance method, device, equipment, medium and product
CN118394773A