Memory access methods, devices, computer equipment, and readable storage media

CN119475396BActive Publication Date: 2026-08-14CHINA TELECOM CLOUD TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]传统技术通常是通过重复发送所有内存访问请求的方式,来确保内存访问请求和响应的完整性;但是,通过该方式进行内存访问需要耗费较多的处理时间,导致内存访问的效率较低

Benefits of technology

[0046]上述内存访问方法、装置、计算机设备、计算机可读存储介质和计算机程序产品,发送第一内存访问请求至响应端;所述第一内存访问请求携带有请求序列号;接收所述响应端基于所述第一内存访问请求返回的与所述请求序列号对应的第一内存访问响应;所述第一内存访问响应携带有响应序列号;根据所述请求序列号和所述响应序列号,确定所述第一内存访问请求的缺失序列号;发送携带有所述缺失序列号的第二内存访问请求至所述响应端;所述第二内存访问请求用于指示所述响应端返回与所述缺失序列号对应的第二内存访问响应。该方案通过在接收到第一内存访问响应时,根据其携带的响应序列号与请求序列号来确定缺失序列号,并立即发送携带该缺失序列号的第二内存访问请求,有利于在检测到响应丢包时快速进行选择性重传,而不需要等待超时后再重传所有请求,从而有利于减少不必要的数据包重传,节省网络带宽并提高内存访问的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119475396B_ABST
    Figure CN119475396B_ABST
Patent Text Reader

Abstract

This application relates to a memory access method, apparatus, computer device, computer-readable storage medium, and computer program product, which can be used in the field of computer technology. The method includes: sending a first memory access request to a responding end; the first memory access request carrying a request sequence number; receiving a first memory access response corresponding to the request sequence number returned by the responding end based on the first memory access request; the first memory access response carrying a response sequence number; determining a missing sequence number of the first memory access request based on the request sequence number and the response sequence number; sending a second memory access request carrying the missing sequence number to the responding end; the second memory access request instructing the responding end to return a second memory access response corresponding to the missing sequence number. This method can improve the efficiency of memory access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a memory access method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] With the development of computer technology, memory access technology plays an increasingly important role in data processing. How to perform efficient memory access has become an important research direction.

[0003] Traditional techniques typically ensure the integrity of memory access requests and responses by repeatedly sending all memory access requests; however, this method requires a significant amount of processing time, resulting in low efficiency in memory access. Summary of the Invention

[0004] Therefore, it is necessary to provide a memory access method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the efficiency of memory access in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a memory access method. The method includes:

[0006] Send a first memory access request to the responding end; the first memory access request carries a request sequence number;

[0007] The system receives a first memory access response corresponding to the request sequence number returned by the response end based on the first memory access request; the first memory access response carries a response sequence number.

[0008] Based on the request sequence number and the response sequence number, determine the missing sequence number of the first memory access request;

[0009] Send a second memory access request carrying the missing sequence number to the response end; the second memory access request is used to instruct the response end to return a second memory access response corresponding to the missing sequence number.

[0010] In one embodiment, determining the missing sequence number of the first memory access request based on the request sequence number and the response sequence number includes:

[0011] Based on the response sequence number, the status of the request sequence number is updated to obtain the updated status of the request sequence number;

[0012] Based on the updated status, select the serial number that is in an unconfirmed state from the requested serial numbers and use it as the missing serial number.

[0013] In one embodiment, selecting a sequence number in an unconfirmed state from the request sequence numbers as the missing sequence number based on the updated state includes:

[0014] Based on the updated status, select a first unconfirmed sequence number from the request sequence numbers that is smaller than the response sequence number and is in the unconfirmed state;

[0015] The first unconfirmed serial number is identified as the missing serial number.

[0016] In one embodiment, selecting a sequence number in an unconfirmed state from the request sequence numbers as the missing sequence number based on the updated state includes:

[0017] Obtain the current time and determine the time difference between the current time and the sending time of the first memory access request;

[0018] If the time difference is greater than a preset time threshold, a second unconfirmed sequence number in the unconfirmed state is selected from the request sequence numbers according to the updated state.

[0019] The second unconfirmed serial number is identified as the missing serial number.

[0020] In one embodiment, after sending a second memory access request carrying the missing sequence number to the responding end, the method further includes:

[0021] The receiver receives the second memory access response returned by the response end based on the second memory access request; the second memory access response carries a secondary response sequence number;

[0022] The response result of the first memory access request is determined based on the missing sequence number and the secondary response sequence number.

[0023] In one embodiment, before sending the first memory access request to the responding end, the method further includes:

[0024] Generate the request sequence number;

[0025] The request sequence number is added to the initial memory access request to obtain the first memory access request carrying the request sequence number.

[0026] Secondly, this application also provides a memory access device. The device includes:

[0027] The first sending module is used to send a first memory access request to the responding end; the first memory access request carries a request sequence number;

[0028] A response receiving module is configured to receive a first memory access response corresponding to the request sequence number returned by the response end based on the first memory access request; the first memory access response carries a response sequence number.

[0029] A sequence determination module is used to determine the missing sequence number of the first memory access request based on the request sequence number and the response sequence number;

[0030] The second sending module is used to send a second memory access request carrying the missing sequence number to the response end; the second memory access request is used to instruct the response end to return a second memory access response corresponding to the missing sequence number.

[0031] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0032] Send a first memory access request to the responding end; the first memory access request carries a request sequence number;

[0033] The system receives a first memory access response corresponding to the request sequence number returned by the response end based on the first memory access request; the first memory access response carries a response sequence number.

[0034] Based on the request sequence number and the response sequence number, determine the missing sequence number of the first memory access request;

[0035] Send a second memory access request carrying the missing sequence number to the response end; the second memory access request is used to instruct the response end to return a second memory access response corresponding to the missing sequence number.

[0036] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0037] Send a first memory access request to the responding end; the first memory access request carries a request sequence number;

[0038] The system receives a first memory access response corresponding to the request sequence number returned by the response end based on the first memory access request; the first memory access response carries a response sequence number.

[0039] Based on the request sequence number and the response sequence number, determine the missing sequence number of the first memory access request;

[0040] Send a second memory access request carrying the missing sequence number to the response end; the second memory access request is used to instruct the response end to return a second memory access response corresponding to the missing sequence number.

[0041] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0042] Send a first memory access request to the responding end; the first memory access request carries a request sequence number;

[0043] The system receives a first memory access response corresponding to the request sequence number returned by the response end based on the first memory access request; the first memory access response carries a response sequence number.

[0044] Based on the request sequence number and the response sequence number, determine the missing sequence number of the first memory access request;

[0045] Send a second memory access request carrying the missing sequence number to the response end; the second memory access request is used to instruct the response end to return a second memory access response corresponding to the missing sequence number.

[0046] The aforementioned memory access method, apparatus, computer device, computer-readable storage medium, and computer program product send a first memory access request to a responding end; the first memory access request carries a request sequence number; receive a first memory access response corresponding to the request sequence number returned by the responding end based on the first memory access request; the first memory access response carries a response sequence number; determine a missing sequence number of the first memory access request based on the request sequence number and the response sequence number; send a second memory access request carrying the missing sequence number to the responding end; the second memory access request is used to instruct the responding end to return a second memory access response corresponding to the missing sequence number. This scheme, by determining the missing sequence number based on the response sequence number and request sequence number carried by the first memory access response upon receipt, and immediately sending a second memory access request carrying the missing sequence number, facilitates rapid selective retransmission when response packet loss is detected, without needing to wait for a timeout before retransmitting all requests. This helps reduce unnecessary data packet retransmissions, saves network bandwidth, and improves memory access efficiency. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a flowchart illustrating a memory access method in one embodiment;

[0049] Figure 2 This is a schematic diagram of communication between the sending end and the receiving end in one embodiment;

[0050] Figure 3 This is another communication diagram between the sending end and the receiving end in one embodiment;

[0051] Figure 4 This is a structural block diagram of a memory access device in one embodiment;

[0052] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0054] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0055] In one exemplary embodiment, such as Figure 1 As shown, a memory access method is provided. This embodiment illustrates the application of this method to a sending end (which can also be an access end or a terminal). It is understood that this method can also be applied to a server, and to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc.; the server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. In this embodiment, the method includes the following steps:

[0056] Step S101: Send a first memory access request to the responding end; the first memory access request carries a request sequence number.

[0057] Step S102: The receiving end returns a first memory access response corresponding to the request sequence number based on the first memory access request; the first memory access response carries a response sequence number.

[0058] Step S103: Determine the missing sequence number of the first memory access request based on the request sequence number and the response sequence number.

[0059] Step S104: Send a second memory access request carrying the missing sequence number to the responding end; the second memory access request is used to instruct the responding end to return a second memory access response corresponding to the missing sequence number.

[0060] Among them, a memory access request can be a request to access the memory of another computer. For example, a memory access request can be an RDMA READ REQUEST. RDMA (Remote Direct Memory Access) is a type of RDMA access that allows one computer to directly read and access the memory of another computer.

[0061] The responding end can be a computer that receives and processes memory access requests. For example, the responding end can be a computer that receives an RDMA READ REQUEST and returns an RDMA READ RESPONSE.

[0062] The request sequence number can be a number used to identify the order of data packets, such as a PSN (Packet Sequence Number).

[0063] The memory access response can be the response data returned by the responding end after processing the memory access request. For example, the memory access response can be RDMA READ RESPONSE.

[0064] The response sequence number can be a number carried in the memory access response to identify the order of the response data. For example, the response sequence number can be a PSN (Packet Sequence Number).

[0065] The missing sequence number can be a sequence number that has not been acknowledged in the received memory access response. For example, the missing sequence number can be an unacknowledged PSN range that is smaller than the received response sequence number and adjacent to it.

[0066] Optionally, the sending end sends a first memory access request to the responding end. This first memory access request is an RDMA READ REQUEST, which carries a PSN (Packet Sequence Number) as the request sequence number. The sending end receives a first memory access response from the responding end. This first memory access response is an RDMA READ RESPONSE, which carries a corresponding PSN as the response sequence number. The sending end compares the request sequence number and the response sequence number to determine whether there exists an unacknowledged PSN range adjacent to the received response sequence number. This PSN range is the missing sequence number. The sending end then sends a second memory access request carrying the missing sequence number to the responding end. This second memory access request is an RDMA READ REQUEST containing the missing sequence number, used to instruct the responding end to return a second memory access response corresponding to the missing sequence number.

[0067] For example, the sender first sends an RDMA READ REQUEST containing PSNs 0-5 to the responder. When the sender receives an RDMA READ RESPONSE with a PSN of 3 from the responder, it discovers an adjacent unacknowledged PSN range (i.e., the range with PSNs 0-2) with a PSN less than 3. This indicates that the RDMA READ RESPONSE with PSNs 0-2 has been lost. At this point, the sender immediately sends an RDMA READ REQUEST containing PSNs 0-2 to the responder, without waiting for a timeout to retransmit all RDMA READ REQUESTs. This achieves selective and fast retransmission, improving communication performance and saving network bandwidth.

[0068] In the above memory access method, a first memory access request is sent to the responding end; the first memory access request carries a request sequence number; the responding end receives a first memory access response corresponding to the request sequence number based on the first memory access request; the first memory access response carries a response sequence number; based on the request sequence number and the response sequence number, the missing sequence number of the first memory access request is determined; a second memory access request carrying the missing sequence number is sent to the responding end; the second memory access request is used to instruct the responding end to return a second memory access response corresponding to the missing sequence number. This scheme, by determining the missing sequence number based on the response sequence number and request sequence number carried by the first memory access response upon receipt, and immediately sending a second memory access request carrying the missing sequence number, facilitates rapid selective retransmission when response packet loss is detected, without needing to wait for a timeout before retransmitting all requests. This reduces unnecessary data packet retransmissions, saves network bandwidth, and improves memory access efficiency.

[0069] In an exemplary embodiment, determining the missing sequence number of the first memory access request based on the request sequence number and the response sequence number specifically includes the following: updating the status of the request sequence number based on the response sequence number to obtain the updated status of the request sequence number; and selecting the sequence number in the unconfirmed state from the request sequence numbers based on the updated status as the missing sequence number.

[0070] The status can be an identifier used to determine whether the serial number has been confirmed, such as a confirmed status or an unconfirmed status.

[0071] The updated status can be the status after updating the confirmation status of the request sequence number based on the received response sequence number. For example, the updated status can be that the PSN (Packet Sequence Number) that has received RDMA READ RESPONSE is marked as confirmed, while the PSN that has not received RDMA READ RESPONSE is marked as unconfirmed.

[0072] The unacknowledged status can indicate that a corresponding response has not yet been received. For example, the unacknowledged status can indicate that the corresponding RDMA READ RESPONSE PSN has not yet been received.

[0073] Optionally, upon receiving an RDMA READ RESPONSE, the sending end updates the acknowledgment status of the PSN (Packet Sequence Number) in the previously sent RDMA READ REQUEST based on the response sequence number carried in the RDMA READ RESPONSE. Specifically, the sending end marks the PSN of the received RDMA READ RESPONSE as acknowledged, and then checks whether there is an unacknowledged PSN interval that is smaller than the acknowledged PSN and adjacent to it. If such an unacknowledged PSN interval exists, it is treated as a missing sequence number.

[0074] For example, when the sender sends an RDMA READ REQUEST containing PSNs 0-5, if it receives an RDMA READ RESPONSE with a PSN of 3, the sender will update the request sequence number with PSN 3 to an acknowledged status. Subsequently, the sender checks and finds that the range with PSNs 0-2 is in an unacknowledged state, and this range is smaller than and adjacent to the acknowledged PSN of 3. Therefore, the sender determines the range with PSNs 0-2 as a missing sequence number and immediately initiates a retransmission request for the missing sequence number, without waiting for a timeout to retransmit all sequence numbers.

[0075] The technical solution provided in this embodiment updates the status of the request sequence number based on the received response sequence number and selects the sequence number in the unacknowledged state as the missing sequence number. This helps to accurately identify which response data packets of which sequence numbers have been lost, thereby enabling targeted selective retransmission and avoiding unnecessary retransmission of successfully transmitted data packets, thus improving the efficiency of RDMA communication.

[0076] In an exemplary embodiment, based on the updated status, a sequence number in an unconfirmed state is selected from the request sequence number as a missing sequence number. Specifically, this includes: based on the updated status, selecting a first unconfirmed sequence number that is smaller than the response sequence number and is in an unconfirmed state from the request sequence number; and determining the first unconfirmed sequence number as a missing sequence number.

[0077] The first unacknowledged sequence number can be a sequence number in the request sequence number that is less than the response sequence number and is in an unacknowledged state. For example, the first unacknowledged sequence number can be a PSN (Packet Sequence Number) in the sent RDMA READ REQUEST that is less than the PSN of the received RDMA READRESPONSE and for which the corresponding response has not yet been received.

[0078] Optionally, after receiving an RDMA READ RESPONSE, the sender checks all request sequence numbers with a lower PSN (Packet Sequence Number) than the one carried in the currently received RDMA READ RESPONSE, based on the updated request sequence number status. The sender then filters out unacknowledged sequence numbers from these and checks whether they are adjacent to any received response sequence numbers. If they are adjacent, these unacknowledged sequence numbers are identified as missing sequence numbers.

[0079] For example, when the sender sends an RDMA READ REQUEST with PSNs 0-5, and receives an RDMA READ RESPONSE with a PSN of 3, the sender checks the status of all request sequence numbers with PSNs less than 3. The sender finds that sequence numbers with PSNs 0-2 are unacknowledged, and these sequence numbers are adjacent to the acknowledged PSNs of 3. Therefore, the sender identifies sequence numbers with PSNs 0-2 as missing sequence numbers. This method allows the sender to accurately locate lost response packets, enabling targeted selective retransmission.

[0080] The technical solution provided in this embodiment selects a sequence number that is smaller than the current response sequence number and is in an unacknowledged state from the request sequence number as the missing sequence number. This helps to accurately locate the position of the lost data packet adjacent to the received response, thereby enabling fast and accurate selective retransmission. It avoids full retransmission of all sequence numbers and improves the efficiency of RDMA communication.

[0081] In an exemplary embodiment, based on the updated status, a sequence number in an unconfirmed state is selected from the request sequence numbers as a missing sequence number. Specifically, this includes: obtaining the current time and determining the time difference between the current time and the sending time of the first memory access request; if the time difference is greater than a preset time threshold, selecting a second unconfirmed sequence number in an unconfirmed state from the request sequence numbers based on the updated status; and determining the second unconfirmed sequence number as a missing sequence number.

[0082] The current time can be the time at the current moment.

[0083] The sending time can be the time when the sender sends the RDMA READ REQUEST. For example, the sending time can be the time when the sender first sends an RDMA READ REQUEST containing a specific PSN (Packet Sequence Number).

[0084] The time difference can be a time interval used to determine whether a timeout has occurred.

[0085] The preset time threshold can be a time standard used to determine timeout. For example, the preset time threshold can be the timeout retransmission time set in RDMA communication.

[0086] The second unconfirmed sequence number can be a sequence number selected from the request sequence number that is in an unconfirmed state in the event of a timeout. For example, the second unconfirmed sequence number can be a PSN for which the corresponding RDMA READRESPONSE has not been received after a timeout.

[0087] Optionally, the sender records the transmission time when sending the RDMA READ REQUEST and obtains the current system time during subsequent processing to calculate the time difference from sending the RDMA READ REQUEST to the current time. When the sender detects that the time difference exceeds a preset timeout threshold, the sender checks the status of all request sequence numbers, filters out the PSNs (Packet Sequence Numbers) that are still in an unacknowledged state, and identifies these unacknowledged PSNs (second unacknowledged sequence numbers) as missing sequence numbers that need to be retransmitted.

[0088] For example, when the sender sends an RDMA READ REQUEST containing PSNs 0-5, if after a preset timeout (e.g., 100 milliseconds) the sender finds that sequence numbers with PSNs 2-4 are still unacknowledged, the sender will classify these sequence numbers as missing sequence numbers. This timeout-based selective retransmission mechanism allows the sender to retransmit only those requests that have not received a response, rather than retransmitting all sequence numbers as in traditional mechanisms, in cases of network congestion or severe packet loss, thereby improving the efficiency of RDMA communication.

[0089] The technical solution provided in this embodiment calculates the time difference between the current time and the time the memory access request was sent, and selects the sequence number in the unacknowledged state as the missing sequence number when the time exceeds a preset time threshold. This helps to promptly identify the problematic sequence number when network congestion or transmission anomalies cause a long period of no response, thereby facilitating selective retransmission based on the timeout mechanism, avoiding full retransmission of all sequence numbers, and improving the efficiency of RDMA communication.

[0090] In an exemplary embodiment, after sending a second memory access request carrying a missing sequence number to the responding end, the method further includes: receiving a second memory access response returned by the responding end based on the second memory access request; the second memory access response carrying a secondary response sequence number; and determining the response result of the first memory access request based on the missing sequence number and the secondary response sequence number.

[0091] The second memory access request can be an RDMA READREQUEST (RDMA read request) that the sender retransmits for the missing sequence number. For example, the second memory access request can be a retransmission request that includes the previously lost PSN (Packet Sequence Number).

[0092] The second memory access response can be an RDMA READ RESPONSE returned by the receiving end (i.e., the responding end) in response to the second memory access request. For example, the second memory access response can be a response data packet from the receiving end to the retransmission request.

[0093] The secondary response sequence number can be the PSN carried in the second memory access response, for example, the secondary response sequence number can be the packet sequence number contained in the retransmission response packet.

[0094] The response result can be a confirmation of the integrity of the first memory access request. For example, the response result can be a result of comparing the missing sequence number and the secondary response sequence number to determine whether all requests have been responded to.

[0095] Optionally, after sending an RDMA READ REQUEST containing the missing sequence number, the sending end waits for the receiving end to return the corresponding RDMA READ RESPONSE. Upon receiving the RDMA READ RESPONSE, the sending end extracts the PSN (Packet Sequence Number) carried in the response packet as a secondary response sequence number. This secondary response sequence number is then compared with the previously recorded missing sequence number. The comparison result determines whether the retransmission request received a correct response, thereby confirming the integrity status of the first memory access request.

[0096] For example, when the sender sends a retransmission RDMA READ REQUEST containing PSNs 2-4, the receiver will sequentially return RDMA READ RESPONSE packets carrying the corresponding PSNs. Upon receiving these response packets, the sender checks if the PSNs in the response packets completely match the previously recorded missing sequence numbers 2-4. If the sender confirms that all missing sequence numbers have received corresponding responses, it indicates that the first memory access request has been successfully completed; if some missing sequence numbers still have not received corresponding responses, a new round of selective retransmission is required.

[0097] The technical solution provided in this embodiment, by receiving the second memory access response returned by the response end and comparing the secondary response sequence number carried by it with the missing sequence number, is conducive to accurately determining whether the retransmission request has received a complete response. This is beneficial to timely confirm the integrity status of RDMA communication, avoid unnecessary repeated retransmissions, and improve the efficiency of RDMA communication.

[0098] In an exemplary embodiment, before sending the first memory access request to the responding end, the method further includes: generating a request sequence number; adding the request sequence number to the initial memory access request to obtain a first memory access request carrying the request sequence number.

[0099] The initial memory access request can be a raw RDMA READ REQUEST that has not yet been assigned a PSN (Packet Sequence Number). For example, the initial memory access request can be an RDMA read request data packet that the sender is preparing to send but has not yet been assigned a sequence number.

[0100] The process of generating a request sequence number can be a process of creating a PSN for identifying the order of data packets for an RDMA READ REQUEST. For example, generating a request sequence number can be a process of assigning a unique sequence number to each request packet according to a continuous number sequence such as 0-5.

[0101] Adding a request sequence number can be a process of writing the generated PSN into the header of the initial memory access request. For example, adding a request sequence number can be done by writing sequence numbers such as 0-5 into the header fields of the corresponding RDMA READ REQUEST.

[0102] Optionally, before sending an RDMA READ REQUEST, the sender first generates a set of consecutive PSNs (Packet Sequence Numbers) as request sequence numbers. Then, the sender adds the generated request sequence numbers sequentially to the header field of the initial memory access request, thereby constructing a complete first memory access request.

[0103] The technical solution provided in this embodiment, by generating a request sequence number before sending a memory access request and adding it to the initial memory access request, facilitates the allocation of a unique identifier for each RDMA READ REQUEST, thereby providing support for selective retransmission.

[0104] The following application example illustrates the memory access method provided in this application. This application example demonstrates how the method is applied to the sending end (which can also be the access end or terminal).

[0105] Among them, RDMA (Remote Direct Memory Access) is a technology that allows direct memory access between computer systems. RDMA READ is an access mode of RDMA that allows one computer system to directly read memory data from another computer system. Go-Back-N is a packet retransmission mechanism used by RDMA; when a packet loss is detected, all packets prior to the earliest point of loss are retransmitted. PSN (Packet Sequence Number) is a number used to identify the order in which data packets are transmitted.

[0106] RDMA technology is widely used in high-performance storage, big data processing, artificial intelligence, and other fields. Among them, RDMAREAD is an important function that enables direct memory access between computer systems without processor intervention, which is one of the core characteristics of RDMA.

[0107] RDMA technology was initially applied in lossless network environments. In lossless networks, the link layer guarantees ordered data transmission, and packet loss is extremely rare. Therefore, RDMA employs a simplified packet loss retransmission mechanism: when packet loss occurs, all data packets preceding the earliest point of loss need to be retransmitted, i.e., a Go-Back-N mechanism. Specifically, after the sender issues an RDMAREAD REQUEST, it needs to confirm the PSN contained in the previously sent request by receiving RDMAREAD RESPONSEs in order. When an RDMAREAD RESPONSE packet is lost, the sender ignores all response packets received from the point of loss onwards and retransmits all RDMAREAD REQUESTs after a timeout, while the receiver also needs to retransmit all RDMAREAD RESPONSEs. In lossy network environments (such as Ethernet), this mechanism not only wastes bandwidth but also reduces communication efficiency and may even exacerbate network congestion. Figure 2 The diagram illustrates the communication process between the sender and receiver. The specific communication flow is as follows: First, the sender sends read requests (0-5), and the receiver returns read responses 0 and 1 sequentially. A data packet loss, indicated by the symbol 'x', occurs during the transmission of read response 2. Although the receiver continues to send read responses 3, 4, and 5, these responses are not processed by the sender. A timeout occurs, and the sender resends read requests (2-5), after which the receiver returns read responses 2, 3, 4, and 5 sequentially. The entire communication process is represented by arrows indicating the communication relationship between the sender and receiver.

[0108] This application example mainly includes:

[0109] First, when the sending end receives an RDMA READ RESPONSE, it acknowledges the corresponding PSN. If it finds an adjacent unacknowledged PSN range that is smaller than the PSN, it can immediately retransmit the RDMA READ REQUEST corresponding to that PSN range.

[0110] Second, after a timeout, the sending end only retransmits the RDMA READ REQUEST corresponding to the unacknowledged PSN.

[0111] This application example, while maintaining compatibility with existing protocols, implements selective and fast retransmission functions for RDMA READ RESPONSE packet loss, which improves both network bandwidth utilization and communication performance.

[0112] This application example includes the following steps:

[0113] Step 1: The sender first sends an RDMA READ REQUEST, in which the initial PSN status is unacknowledged.

[0114] Step 2: After receiving the RDMA READ REQUEST, the receiving end returns an RDMA READ RESPONSE carrying the corresponding PSN in the order of the PSNs in the request.

[0115] Step 3: When the sending end receives RDMA READ RESPONSE, it confirms its PSN. If it finds an unconfirmed PSN range that is smaller than the PSN and adjacent to it, it means that the response packet corresponding to the range has been lost. At this time, the request packet for the range is immediately retransmitted.

[0116] Step 4: After receiving the retransmission request, the receiving end processes it in the same way as in Step 2.

[0117] Step 5: If there are still unacknowledged PSNs after the sender times out, the retransmission will only include the READREQUEST of the unacknowledged PSNs.

[0118] refer to Figure 3 The diagram illustrates the communication process between the sender and receiver. The specific communication flow is as follows: First, the sender sends read requests (0-5), and the receiver sequentially returns read responses 0 and 1. During transmission, an 'x' symbol indicates data packet loss. The receiver then sends read responses 2 and 3. At this point, the sender sends read request 2, and the receiver subsequently returns read responses 4 and 5. Finally, the receiver returns read response 2. The entire communication process is represented by arrows indicating the communication relationship between the sender and receiver.

[0119] The technical solution provided in this application example determines the missing sequence number based on the response sequence number and request sequence number carried by the first memory access response upon receipt, and immediately sends a second memory access request carrying the missing sequence number. This facilitates rapid selective retransmission when response packet loss is detected, without having to wait for a timeout before retransmitting all requests. This helps reduce unnecessary packet retransmissions, saves network bandwidth, and improves memory access efficiency.

[0120] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0121] Based on the same inventive concept, this application also provides a memory access apparatus for implementing the memory access method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more memory access apparatus embodiments provided below can be found in the limitations of the memory access method described above, and will not be repeated here.

[0122] In one exemplary embodiment, such as Figure 4 As shown, a memory access device 400 is provided, which may include:

[0123] The first sending module 401 is used to send a first memory access request to the responding end; the first memory access request carries a request sequence number.

[0124] The response receiving module 402 is used to receive the first memory access response corresponding to the request sequence number returned by the response end based on the first memory access request; the first memory access response carries a response sequence number.

[0125] The sequence determination module 403 is used to determine the missing sequence number of the first memory access request based on the request sequence number and the response sequence number;

[0126] The second sending module 404 is used to send a second memory access request carrying a missing sequence number to the response end; the second memory access request is used to instruct the response end to return a second memory access response corresponding to the missing sequence number.

[0127] In an exemplary embodiment, the sequence determination module 403 is further configured to update the status of the request sequence number according to the response sequence number to obtain the updated status of the request sequence number; and select the sequence number in the unconfirmed status from the request sequence numbers as the missing sequence number according to the updated status.

[0128] In an exemplary embodiment, the sequence determination module 403 is further configured to select a first unconfirmed sequence number that is smaller than the response sequence number and is in an unconfirmed state from the request sequence number according to the updated state; and determine the first unconfirmed sequence number as a missing sequence number.

[0129] In an exemplary embodiment, the sequence determination module 403 is further configured to obtain the current time, determine the time difference between the current time and the sending time of the first memory access request; if the time difference is greater than a preset time threshold, select a second unconfirmed sequence number in an unconfirmed state from the request sequence numbers according to the updated state; and determine the second unconfirmed sequence number as a missing sequence number.

[0130] In an exemplary embodiment, the device 400 further includes: a result determination module, configured to receive a second memory access response returned by the response end based on the second memory access request; the second memory access response carries a secondary response sequence number; and determine the response result of the first memory access request based on the missing sequence number and the secondary response sequence number.

[0131] In an exemplary embodiment, the device 400 further includes: a sequence generation module for generating a request sequence number; adding the request sequence number to an initial memory access request to obtain a first memory access request carrying the request sequence number.

[0132] Each module in the aforementioned memory access device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.

[0133] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a memory access method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0134] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0135] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0136] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.

[0137] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0138] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0139] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0140] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A memory access method, characterized in that, The method includes: Send a first memory access request to the responding end; the first memory access request carries a request sequence number; The system receives a first memory access response corresponding to the request sequence number returned by the response end based on the first memory access request; the first memory access response carries a response sequence number. Based on the response sequence number, the status of the request sequence number is updated to obtain the updated status of the request sequence number; the status is an identifier used to indicate whether the sequence number has been confirmed. Based on the updated status, select the sequence number in the unconfirmed state from the request sequence number as the missing sequence number of the first memory access request; the unconfirmed state indicates that the corresponding RDMA read response PSN has not yet been received; the missing sequence number includes the range of unconfirmed request sequence numbers that are smaller than the response sequence number and adjacent to the response sequence number. Send a second memory access request carrying the missing sequence number to the response end; the second memory access request is used to instruct the response end to return a second memory access response corresponding to the missing sequence number.

2. The method according to claim 1, characterized in that, The step of selecting the sequence number in the unconfirmed state from the request sequence numbers based on the updated state as the missing sequence number of the first memory access request includes: Based on the updated status, select a first unconfirmed sequence number from the request sequence numbers that is smaller than the response sequence number and is in the unconfirmed state; The first unconfirmed serial number is identified as the missing serial number.

3. The method according to claim 1, characterized in that, The step of selecting the sequence number in the unconfirmed state from the request sequence numbers based on the updated state as the missing sequence number of the first memory access request includes: Obtain the current time and determine the time difference between the current time and the sending time of the first memory access request; If the time difference is greater than a preset time threshold, a second unconfirmed sequence number in the unconfirmed state is selected from the request sequence numbers according to the updated state. The second unconfirmed serial number is identified as the missing serial number.

4. The method according to claim 1, characterized in that, After sending a second memory access request carrying the missing sequence number to the responding end, the process further includes: The receiver receives the second memory access response returned by the response end based on the second memory access request; the second memory access response carries a secondary response sequence number; The response result of the first memory access request is determined based on the missing sequence number and the secondary response sequence number.

5. The method according to any one of claims 1 to 4, characterized in that, Before sending the first memory access request to the responding end, it also includes: Generate the request sequence number; The request sequence number is added to the initial memory access request to obtain the first memory access request carrying the request sequence number.

6. A memory access device, characterized in that, The device includes: The first sending module is used to send a first memory access request to the responding end; the first memory access request carries a request sequence number; A response receiving module is configured to receive a first memory access response corresponding to the request sequence number returned by the response end based on the first memory access request; the first memory access response carries a response sequence number. The sequence determination module is used to update the status of the request sequence number according to the response sequence number to obtain the updated status of the request sequence number; the status is an identifier used to indicate whether the sequence number has been confirmed; according to the updated status, the sequence number in the unconfirmed state is selected from the request sequence numbers as the missing sequence number of the first memory access request; the unconfirmed state indicates that the corresponding RDMA read response PSN has not yet been received; the missing sequence number includes an unconfirmed request sequence number range that is smaller than the response sequence number and adjacent to the response sequence number; The second sending module is used to send a second memory access request carrying the missing sequence number to the response end; the second memory access request is used to instruct the response end to return a second memory access response corresponding to the missing sequence number.

7. The apparatus according to claim 6, characterized in that, The device further includes a result determination module, which is used to receive the second memory access response returned by the response end based on the second memory access request; the second memory access response carries a secondary response sequence number. The response result of the first memory access request is determined based on the missing sequence number and the secondary response sequence number.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data transmission acceleration method, device and system

    CN109327288A