Memory refreshing method, device, computer device, and storage medium

By implementing data volume-driven pre-refresh and delay refresh mechanisms in high-bandwidth memory, the problem of low read and write efficiency in traditional refresh solutions is solved, and the efficiency of data reading and writing is significantly improved.

CN114333940BActive Publication Date: 2025-06-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111389605.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-22
Publication Date
2025-06-13
Estimated Expiration
2041-11-22

AI Technical Summary

Technical Problem

Traditional high-bandwidth memory (HBM) refresh schemes frequently interrupt data read and write tasks, resulting in a significant reduction in read and write efficiency.

Method used

When acquiring the data read and write request, the data amount of the data to be read and written and the data storage area in the memory is determined, and if the data amount is greater than the first threshold, pre-refreshing is performed. In the pre-refreshed data storage area, read and write processing is performed in batches, and refreshed when the preset refresh time is reached. If the remaining data amount within the current refresh cycle is less than or equal to the second threshold, the refresh is delayed until the read and write processing is completed before refreshing.

Benefits of technology

It effectively avoids interruptions to read and write operations during refreshing, and improves the efficiency of data reading and writing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114333940B_ABST
    Figure CN114333940B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, computer device, and storage medium for refreshing a memory. The method can be applied to application scenarios of cloud technology and vehicle-mounted terminals, and includes: determining the data volume of data to be read and written and the data storage area in the memory for storing the data to be read and written; if the data volume of the data to be read and written is greater than a first threshold, pre-refreshing the data storage area; in the pre-refreshed data storage area, performing read and write processing on the data to be read and written in batches; during the read and write processing, when a preset refresh time is reached, refreshing the data storage area; the preset refresh time includes at least one refresh cycle; if the remaining quantity after performing read and write processing on the data to be read and written within the current refresh cycle is less than or equal to a second threshold, continuing to perform read and write processing on the remaining quantity of the data to be read and written; after completing the read and write processing, refreshing the data storage area. Using this method can effectively improve the read and write efficiency of the memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and particularly to a method and apparatus for refreshing a memory, a computer device, and a storage medium. Background Art

[0002] High Bandwidth Memory (HBM) is a new type of memory with high speed and high bandwidth, mainly applied in the field of artificial intelligence chips. Since HBM is a memory implemented based on DRAM, it needs to be refreshed periodically during use to ensure that the stored data in HBM will not be lost or damaged.

[0003] In traditional refresh schemes, the entire HBM is usually refreshed periodically according to tREFI (i.e., the average refresh time interval), and data read / write tasks will be frequently interrupted, resulting in a significant reduction in data read / write efficiency. Summary of the Invention

[0004] Based on this, it is necessary to provide a method and apparatus for refreshing a memory, a computer device, and a storage medium that can effectively improve the read / write efficiency of the memory for the above technical problems.

[0005] A method for refreshing a memory, the method comprising:

[0006] When a data read / write request is obtained, determining the data volume of the data to be read / written and the data storage area in the memory for storing the data to be read / written;

[0007] If the data volume of the data to be read / written is greater than a first threshold, pre-refreshing the data storage area;

[0008] In the pre-refreshed data storage area, performing read / write processing on the data to be read / written in batches;

[0009] During the read / write processing, when a preset refresh time is reached, refreshing the data storage area; the preset refresh time includes at least one refresh cycle;

[0010] If the remaining quantity after performing read / write processing on the data to be read / written within the current refresh cycle is less than or equal to a second threshold, continuing to perform read / write processing on the remaining quantity of the data to be read / written;

[0011] After completing the read / write processing, refreshing the data storage area.

[0012] A device for refreshing a memory, the device comprising:

[0013] A determination module, configured to determine the amount of data to be read and written and a data storage area in a memory for storing the data to be read and written when a data read / write request is obtained;

[0014] A first refresh module, configured to perform a pre-refresh on the data storage area if the amount of the data to be read and written is greater than a first threshold;

[0015] A first processing module, configured to perform read / write processing on the data to be read and written in batches in the pre-refreshed data storage area;

[0016] A second refresh module, configured to perform a refresh on the data storage area when a preset refresh time is reached during the read / write processing; the preset refresh time includes at least one refresh period;

[0017] A second processing module, configured to continue performing read / write processing on the remaining amount of the data to be read and written if the remaining amount after the read / write processing on the data to be read and written in the current refresh period is less than or equal to a second threshold;

[0018] A third refresh module, configured to perform a refresh on the data storage area after the read / write processing is completed.

[0019] In one embodiment, the first refresh module is further configured to determine the number of pre-refresh instructions according to the first threshold if the amount of the data to be read and written is greater than the first threshold; generate pre-refresh instructions with the number of the pre-refresh instructions; and perform a pre-refresh on the data storage area based on the pre-refresh instructions.

[0020] In one embodiment, the determination module is further configured to determine a preset refresh time based on the number of instructions of the pre-refresh instructions; and determine a second threshold according to the first threshold, the preset refresh time, and a read / write rate during the read / write processing.

[0021] In one embodiment, the number of the pre-refresh instructions is at least two; the first refresh module is further configured to sequentially send at least two pre-refresh instructions to at least two memory row blocks of the data storage area to perform a pre-refresh on at least two memory row blocks;

[0022] The first processing module is further configured to read the data to be read and written in batches from at least two pre-refreshed memory row blocks; or write the data to be read and written in batches into at least two pre-refreshed memory row blocks.

[0023] In one embodiment, the apparatus further includes:

[0024] A sending module, configured to send read / write activation instructions to at least two pre-refreshed memory row blocks to activate the read / write functions of at least two memory row blocks;

[0025] The first processing module is further configured to read the data to be read and written in batches from at least two of the activated memory row blocks; or write the data to be read and written in batches into at least two of the activated memory row blocks.

[0026] In one embodiment, the third refresh module is further configured to refresh at least two of the memory row blocks; or refresh the remaining memory row blocks in the data storage area;

[0027] The sending module is further configured to send a closing instruction to at least two of the memory row blocks after the read and write processing is completed, so as to close the read and write functions of the at least two memory row blocks.

[0028] In one embodiment, when the storage capacity of at least two of the memory row blocks is less than the data volume of the data to be read and written, the second processing module is further configured to continue to read the remaining amount of data to be read and written from the remaining memory row blocks in the data storage area; or write the remaining amount of data to be read and written into the remaining memory row blocks in the data storage area;

[0029] The third refresh module is further configured to refresh the remaining memory row blocks in the data storage area after the read and write processing is completed.

[0030] In one embodiment, the first processing module is further configured to, if the data volume of the data to be read and written is less than or equal to the first threshold and greater than the second threshold, perform read and write processing on the data to be read and written in batches in the data storage area; and refresh the data storage area when the read and write processing of the data to be read and written is completed.

[0031] In one embodiment, the first processing module is further configured to, if the data volume of the data to be read and written is less than or equal to the first threshold and greater than the second threshold, perform pre-refreshing on the data storage area; and perform read and write processing on the data to be read and written in batches in the pre-refreshed data storage area until the read and write processing of the data to be read and written is completed before the preset refresh time arrives.

[0032] In one embodiment, the third refresh module is further configured to refresh the data storage area if the remaining amount after the read and write processing of the data to be read and written in the current refresh cycle is greater than the second threshold;

[0033] The second processing module is further configured to perform read and write processing on the remaining amount of data to be read and written in batches in the refreshed data storage area until the read and write processing of the remaining amount of data to be read and written is completed.

[0034] A computer device includes a memory and a controller. The memory stores a computer program. When the controller executes the computer program, the following steps are implemented:

[0035] When a data read / write request is obtained, determine the data volume of the data to be read / written and the data storage area in the memory for storing the data to be read / written;

[0036] If the data volume of the data to be read / written is greater than a first threshold, pre-refresh the data storage area;

[0037] In the pre-refreshed data storage area, perform read / write processing on the data to be read / written in batches;

[0038] During the read / write processing, when a preset refresh time is reached, refresh the data storage area; the preset refresh time includes at least one refresh cycle;

[0039] If the remaining quantity after read / write processing of the data to be read / written in the current refresh cycle is less than or equal to a second threshold, continue to perform read / write processing on the remaining quantity of the data to be read / written;

[0040] After the read / write processing is completed, refresh the data storage area.

[0041] A computer-readable storage medium stores a computer program. When the computer program is executed by a controller, the following steps are implemented:

[0042] When a data read / write request is obtained, determine the data volume of the data to be read / written and the data storage area in the memory for storing the data to be read / written;

[0043] If the data volume of the data to be read / written is greater than a first threshold, pre-refresh the data storage area;

[0044] In the pre-refreshed data storage area, perform read / write processing on the data to be read / written in batches;

[0045] During the read / write processing, when a preset refresh time is reached, refresh the data storage area; the preset refresh time includes at least one refresh cycle;

[0046] If the remaining quantity after read / write processing of the data to be read / written in the current refresh cycle is less than or equal to a second threshold, continue to perform read / write processing on the remaining quantity of the data to be read / written;

[0047] After the read / write processing is completed, refresh the data storage area.

[0048] A computer program product includes a computer program which, when executed by a controller, performs the following steps:

[0049] When a data read / write request is obtained, determine the amount of data to be read / written and the data storage area in the memory for storing the data to be read / written;

[0050] If the amount of data to be read / written is greater than a first threshold, pre-refresh the data storage area;

[0051] In the pre-refreshed data storage area, perform read / write processing on the data to be read / written in batches;

[0052] During the read / write processing, when a preset refresh time is reached, refresh the data storage area; the preset refresh time includes at least one refresh cycle;

[0053] If the remaining quantity after read / write processing of the data to be read / written within the current refresh cycle is less than or equal to a second threshold, continue to perform read / write processing on the remaining quantity of the data to be read / written;

[0054] After the read / write processing is completed, refresh the data storage area.

[0055] In the above memory refresh method, device, computer device and storage medium, during the process of performing read / write operations, first determine the amount of data to be read / written and the data storage area. When the amount of data is greater than the first threshold, specifically pre-refresh the data storage area, so that the data to be read / written can be concentrated and processed in batches in the data storage area after pre-refreshing, which can avoid interrupting the read / write processing of the data to be read / written due to refreshing. In addition, during the read / write processing, when the preset refresh time is reached, refresh the data storage area, and then continue the read / write processing. If the remaining quantity after read / write processing of the data to be read / written within the current refresh cycle is less than or equal to the second threshold, the refresh will be delayed, that is, continue to perform read / write processing on the remaining quantity of the data to be read / written, and only after the read / write processing is completed, refresh the data storage area, thus effectively ensuring that the read / write operation of the data is no longer interrupted due to refreshing, greatly reducing the interruption of the read / write processing process due to refreshing, and effectively improving the data read / write efficiency. Description of the Drawings

[0056] Figure 1 It is an application environment diagram of the memory refresh method in an embodiment;

[0057] Figure 2 It is a flow schematic diagram of the memory refresh method in an embodiment;

[0058] Figure 3Schematic diagram of the HBM controller in the server in one embodiment;

[0059] Figure 4 Schematic diagram of the timing of pre-refresh in one embodiment;

[0060] Figure 5 Schematic diagram of the timing of delayed refresh in one embodiment;

[0061] Figure 6 Schematic diagram of the process of adopting the pre-refresh or delayed refresh scheme in one embodiment;

[0062] Figure 7 Block diagram of the structure of the refresh device of the memory in another embodiment;

[0063] Figure 8 Block diagram of the structure of the refresh device of the memory in one embodiment;

[0064] Figure 9 Internal structure diagram of a computer device in one embodiment. Detailed implementation manners

[0065] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0066] Artificial Intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, a theory, method, technology and application system that perceives the environment, acquires knowledge and uses the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence is also to study the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning and decision-making.

[0067] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in multiple fields. For example, common artificial intelligence chips (Artificial Intelligence, AI), smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless, autonomous driving, drones, robots, smart healthcare, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0068] The refresh method of the memory provided by the present application can be applied to such as Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The refresh method of this memory can be executed by the terminal 102 or the server 104, or jointly executed by the terminal 102 and the server 104. If the memory refresh method is executed by the terminal 102, when the terminal 102 obtains a data read / write request, it determines the data volume of the data to be read / written and the data storage area in the memory for storing the data to be read / written; if the data volume of the data to be read / written is greater than the first threshold, it pre-refreshes the data storage area; in the pre-refreshed data storage area, it processes the data to be read / written in batches; during the process of the read / write processing, when the preset refresh time is reached, it refreshes the data storage area; the preset refresh time includes at least one refresh cycle; if the remaining quantity after processing the data to be read / written within the current refresh cycle is less than or equal to the second threshold, it continues to process the remaining quantity of the data to be read / written; after completing the read / write processing, it refreshes the data storage area, and at the same time, it can also send the data to be read / written to the server 104 so that the server 104 can perform corresponding processing based on the data to be read / written. For example, assuming that the data to be read / written is a face image to be recognized, the server 104 can perform a face recognition operation on the face image. Another example, assuming that the data to be read / written is a photo of scenery and food taken by a user during a trip, after completing the read / write processing of the photo, the photo can be sent to the social server 104 so that the server 104 can share the photo with friends, thus achieving the purpose of trip sharing.

[0069] If the memory refresh method is executed by the server 104, when the server 104 obtains a data read / write request initiated by the terminal 102, the data read / write request can be a Remote Procedure Call (RPC) request. When obtaining the data read / write request, it determines the data volume of the data to be read / written and the data storage area in the memory for storing the data to be read / written; if the data volume of the data to be read / written is greater than the first threshold, it pre-refreshes the data storage area; in the pre-refreshed data storage area, it processes the data to be read / written in batches; during the process of the read / write processing, when the preset refresh time is reached, it refreshes the data storage area; the preset refresh time includes at least one refresh cycle; if the remaining quantity after processing the data to be read / written within the current refresh cycle is less than or equal to the second threshold, it continues to process the remaining quantity of the data to be read / written; after completing the read / write processing, it refreshes the data storage area, and at the same time, it can also return the data to be read / written to the terminal 102.

[0070] Among them, the terminal 102 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle terminal, etc. integrated with an AI chip, but not limited thereto. The AI chip can be a chip combining an AI processor and a memory (such as a high-bandwidth memory). The memory can include a data storage area and a controller, or the controller can exist independently and control the memory.

[0071] The server 104 can be an independent physical server integrated with an AI chip, or a service node in a blockchain system. The service nodes in the blockchain system form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP).

[0072] In addition, the server 104 can also be a server cluster composed of multiple physical servers integrated with AI chips, and can be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.

[0073] The terminal 102 and the server 104 can be connected through communication connection methods such as Bluetooth, USB (Universal Serial Bus), or network. This application does not limit this here.

[0074] In one embodiment, as Figure 2 shown, a method for refreshing a memory is provided. This method can be executed by the terminal 102 or the server 104 in Figure 1 , or jointly executed by the terminal 102 and the server 104. In this embodiment, taking this method being executed by the server 104 in Figure 1 as an example for illustration, it includes the following steps:

[0075] S202, when a data read / write request is obtained, determine the amount of data to be read / written and the data storage area in the memory for storing the data to be read / written.

[0076] Among them, the data read / write request can include a data read request or a data write request. Correspondingly, the data to be read / written can refer to the data that needs to be written into the data storage area of the memory, or the data that needs to be read from the data storage area of the memory, including text data, audio data, image data, or video data, etc.

[0077] The memory can refer to High Bandwidth Memory (HBM), which needs to be refreshed periodically during use to ensure that the data stored in the HBM will not be lost or damaged. The memory can include multiple data storage areas (banks), and each data storage area can be divided into multiple rows, and each row can be called a storage row block. For example, data storage area a has 10 rows; in addition, each row in the data storage area can have multiple columns.

[0078] For example, assume that each bank can be divided into 65536 rows, each row has 1024 columns, and the storage capacity of each storage unit is 16 bit (bits). Then each row can store 1024×16 bit = 2028 bit = 2 KB (kilobytes), so the storage capacity of each bank is 65536×2 KB = 128 MB (megabytes).

[0079] In one embodiment, the server receives a data read / write request sent by the terminal, determines the data to be read / written based on the data identifier carried in the data read / write request, and determines the data storage area in the memory for storing the data to be read / written.

[0080] For example, the terminal displays a message sharing page of a social application. When the user triggers the user message displayed on the message sharing page (the user message contains a compressed user image), a remote procedure call request for reading the user image in standard size is generated and sent to the server; the server determines the user image to be obtained based on the image identifier in the remote procedure call request, and then determines the data storage area in the memory that stores the user image, so as to read the user image in standard size from the data storage area.

[0081] S204, if the data volume of the data to be read / written is greater than the first threshold, pre-refresh the data storage area.

[0082] Among them, the first threshold can be a data volume threshold set according to the read / write rate of the memory (that is, the communication of the memory) and the preset refresh time. The preset refresh time can refer to the time for refreshing the data storage area of the memory, and can be set according to the number of instructions of the pre-refresh instruction and the refresh period. The refresh period can be the refresh period tREFI of the HBM. For example, the first threshold can be set to the data volume that can be read from the HBM within 9 normal refresh cycles. If the read / write rate of the HBM is 38400 MB / s, then the data volume a that can be read in 9 refresh cycles = 38400 MB / s×9×3.9 us≈1.3 MB.

[0083] Pre-refresh can refer to refreshing the data storage area in advance before the preset refresh time arrives.

[0084] In one embodiment, if the amount of data to be read and written is greater than a first threshold, the controller of the server (such as an HBM controller) generates a pre-refresh instruction or reads a pre-refresh instruction from an instruction pool, and then sends the pre-refresh instruction to the memory, so that the memory pre-refreshes the data storage area based on the received pre-refresh instruction. Wherein, the number of instructions of the pre-refresh instruction is less than or equal to the configured number of instructions. For example, if the maximum number of instructions configured for the server is 8, the number of instructions of the generated or read pre-refresh instruction should be less than or equal to 8.

[0085] Specifically, the controller of the server generates multiple pre-refresh instructions (such as greater than or equal to two pre-refresh instructions) according to the amount of data to be read and written, or reads multiple pre-refresh instructions from an instruction pool, and then sequentially sends the pre-refresh instructions to the data storage area of the memory at a preset sending interval to pre-refresh the memory row blocks in the data storage area.

[0086] For example, as Figure 3 shown, Figure 3 is a schematic structural diagram of the HBM controller in the server. The operation management unit determines the bank in the memory for reading and writing the data to be read and written according to the data read and write request. In addition, the refresh management unit generates multiple pre-refresh instructions, and then sequentially sends the pre-refresh instructions to the instruction arbitration and decoding unit at a preset sending interval, first decodes the pre-refresh instructions, and then sequentially sends them to the bank to pre-refresh the bank.

[0087] For the pre-refresh process, it is described in conjunction with Figure 4 Assume that a data read and write request is received at time t5. At this time, 8 pre-refresh instructions can be obtained, and these 8 pre-refresh instructions are sent to the data storage area (i.e., the bank) of the HBM to pre-refresh 8 memory row blocks in the bank. After the pre-refresh is completed, at least one normal refresh can be performed, and then after waiting for 9 refresh cycles (i.e., 9tREFI), a normal refresh or a delayed refresh can be performed again. Among them, during the process of waiting for 9 refresh cycles, S206 can be executed, that is, the data to be read and written is read and written in the bank.

[0088] S206, in the pre-refreshed data storage area, the data to be read and written is read and written in batches.

[0089] In one embodiment, the server sends a data read and write instruction to the pre-refreshed data storage area through the controller to read and write the data to be read and written in batches from the data storage area. For example, the data to be read and written is read in batches from the data storage area, or the data to be read and written is written to the data storage area in batches.

[0090] In one embodiment, before sending a data read / write instruction, the server may also send a read / write activation instruction to the data storage area after pre-refresh through a controller to activate the read / write function of the data storage area, and then send a data read / write instruction.

[0091] S208. During the read / write process, when the preset refresh time is reached, the data storage area is refreshed.

[0092] Among them, the preset refresh time includes at least one refresh cycle. It should be noted that this refresh is a normal refresh. Among them, the refresh methods include pre-refresh, normal refresh, and delayed refresh. Pre-refresh may refer to sending a pre-refresh instruction to the data storage area for refreshing before a single refresh cycle arrives. Normal refresh may refer to sending a refresh instruction (i.e., a normal refresh instruction) to the data storage area for refreshing when a single refresh cycle arrives. Delayed refresh may refer to pausing to send a refresh instruction to the data storage area when a single refresh cycle arrives, and when the data read / write process is completed and the delayed waiting duration is reached, sending a delayed refresh instruction to the data storage area and refreshing when the delayed refresh instruction is received.

[0093] Specifically, when the preset refresh time is reached, the server sends a refresh instruction (i.e., a normal refresh instruction) to the data storage area through the controller to refresh the data storage area.

[0094] S210. If the remaining quantity after reading and writing the data to be read / written in the current refresh cycle is less than or equal to the second threshold, continue to read and write the remaining quantity of the data to be read / written.

[0095] It should be noted that if the remaining quantity after reading and writing the data to be read / written in the current refresh cycle is less than or equal to the second threshold, the refresh of the data storage area is delayed, that is, continue to read and write the remaining quantity of the data to be read / written, and then execute S212.

[0096] Among them, the second threshold may be a data volume threshold set according to the number of instructions of the pre-refresh instruction, the preset refresh time, and the read / write rate. The read / write rate may be the communication bandwidth of the memory. For example, the communication bandwidth of a single-channel (channel) HBM2 is 38400 MB / s. The preset refresh time may refer to the time for refreshing the data storage area of the memory, and can be set according to the number of instructions of the pre-refresh instruction and the refresh cycle.

[0097] For example, assume that the maximum waiting duration is 9tREFI. When the number of instructions n of the pre-refresh instruction is 1, the preset refresh time is the time of n + 1 refresh cycles after the pre-refresh is completed, that is, the time of 2tREFI; the second threshold y2 = y1 - 2tREFI×v, where y1 = 9tREFI×v, and v is the read / write rate. Therefore, y2 = 7tREFI×v, that is, the amount of data that can be read and written within 7 refresh cycles.

[0098] Assume that the maximum waiting duration is 9tREFI. When the number of instructions n of the pre-refresh instruction is 2, the preset refresh time is the time of n + 1 refresh cycles after the pre-refresh is completed, that is, the time of 3tREFI; the second threshold y2 = y1 - 3tREFI×v = 6tREFI×v, that is, the amount of data that can be read and written within 6 refresh cycles.

[0099] In one embodiment, the controller of the server generates a delayed refresh instruction or reads a delayed refresh instruction from the instruction pool, and then delays sending the delayed refresh instruction to the data storage area after pre-refresh (that is, pauses sending the delayed refresh instruction to the data storage area after pre-refresh), so that the server can continue to perform read and write processing on the remaining amount of data to be read and written. Among them, the number of instructions of the generated or read delayed refresh instruction is related to the number of refresh cycles of the delayed waiting. For example, if the delayed waiting duration is a (if a = 2) tREFI, then the number of instructions n = a - 1 = 1.

[0100] S212. After completing the read and write processing, refresh the data storage area.

[0101] Among them, this refresh refers to a delayed refresh, that is, when the preset refresh time is reached, the refresh operation is paused, and after the read and write processing of the data to be read and written is completed, the data storage area is refreshed.

[0102] In one embodiment, after the server completes the read and write processing and reaches the delayed waiting duration, it sends a delayed refresh instruction to the data storage area through the controller, thereby completing the refresh of the data storage area.

[0103] Specifically, when the controller of the server obtains at least one delayed refresh instruction, it sequentially sends at least one delayed refresh instruction to the data storage area of the memory according to a preset sending interval to refresh the memory row blocks in the data storage area.

[0104] For example, as Figure 3 shown, Figure 3It is a schematic structural diagram of an HBM controller in a server. The refresh management unit generates at least one delayed refresh instruction. After completing the read / write processing of the data to be read / written and reaching the delayed waiting duration, the delayed refresh instructions are sequentially sent to the instruction arbitration and decoding unit at a preset sending interval. Then, the instruction arbitration and decoding unit first decodes the pre-refresh instructions and then sequentially sends them to the bank for reading and writing the data to be read / written to perform a pre-refresh on the bank.

[0105] Regarding the process of delayed refresh, it is described in conjunction with Figure 5 as follows. Assume that a regular refresh is completed at time t1 and the read / write processing of the data to be read / written is not completed during the current refresh cycle from t1 to t2. At this time, the read / write processing of the remaining amount of data to be read / written will continue until the read / write processing of the data to be read / written is completed. At this time, a delayed refresh instruction can be sent to the bank; in addition, a regular refresh instruction can also be sent to the bank until time ti, when a delayed refresh instruction is sent to the bank.

[0106] In one embodiment, if the remaining amount after the read / write processing of the data to be read / written during the current refresh cycle is greater than the second threshold, the data storage area is refreshed; in the refreshed data storage area, the remaining amount of data to be read / written is processed in batches for reading and writing until the read / write processing of the remaining amount of data to be read / written is completed. It should be noted that the above refresh belongs to a regular refresh.

[0107] Among them, when the remaining amount is greater than the second threshold, it means that during the delayed waiting duration of performing the delayed refresh, the remaining amount of data to be read / written cannot be completed. Therefore, the data storage area can be continuously refreshed regularly and then the read / write processing process can be carried out.

[0108] To more clearly understand the solution of the above embodiment, the following specific example is used for illustration. The specific content is as follows:

[0109] Example: Assume that when the pre-refresh instruction is 1, the data volume of the data to be read and written is q = 9.1tREFI×v, and the first threshold y1 = 9tREFI×v. During the data read and write process, since the data volume of the data to be read and written is greater than the first threshold, the bank of the HBM is pre-refreshed once first. Then, before the preset refresh time 2tREFI arrives, the read and write processing of the data volume 2tREFI×v is completed. At this time, there is a remaining quantity p1 = 7.1tREFI×v, so a normal refresh is required; when the next preset refresh time (i.e., the refresh cycle of the normal refresh) is reached, there is still a remaining quantity p2 = 6.1tREFI×v, and this remaining quantity p2 is less than the second threshold y2. Then, the data to be read and written with the remaining quantity p2 = 6.1tREFI×v can be read and written, and a refresh (i.e., delayed refresh) is performed after the read and write processing is completed. For different values of the data volume of the data to be read and written, corresponding refresh methods can be adopted, and specific details can be referred to Table 1.

[0110] Table 1

[0111]

[0112]

[0113] In the above embodiments, during the process of executing the read and write service, first, the data volume of the data to be read and written and the data storage area are determined. When the data volume is greater than the first threshold, the data storage area is pre-refreshed accordingly, so that the data to be read and written can be read and written in batches in the data storage area after the pre-refresh, and the interruption of the read and write processing of the data to be read and written due to the refresh can be avoided. In addition, during the read and write processing, when the preset refresh time is reached, the data storage area is refreshed, and then the read and write processing continues. If the remaining quantity after the read and write processing of the data to be read and written within the current refresh cycle is less than or equal to the second threshold, the refresh will be delayed, that is, the read and write processing of the remaining quantity of the data to be read and written will continue, and the data storage area will only be refreshed after the read and write processing is completed. Thus, it is effectively ensured that the read and write operation of the data is no longer interrupted due to the refresh, thereby greatly reducing the interruption of the read and write processing due to the refresh and effectively improving the data read and write efficiency.

[0114] In one embodiment, after the controller of the server determines the data storage area for storing the data to be read and written, it can also first determine the first threshold, which specifically includes the following steps: determining the maximum number of refresh operations that the memory allows to be executed centrally, and determining the maximum time interval between two adjacent refresh instructions based on this number of operations. Then, according to the read and write bandwidth of the memory, the refresh cycle (tREFI) of the memory, and the maximum time interval between two adjacent refresh instructions, the first threshold is determined. The first threshold can be determined using the following formula:

[0115] y 1 = v × (n max + 1) × tREFI

[0116] where y 1 is the first threshold, v is the read / write bandwidth of the memory, n max is the maximum number of refresh operations that the memory allows to be executed centrally, and tREFI is the refresh period of the memory. (n max + 1) × tREFI is the maximum time interval between two adjacent refresh instructions.

[0117] Taking HBM as an example, if the maximum number of refresh operations that HBM allows to be executed centrally is 8 (or more than 8, this embodiment takes 8 as an example), that is, the maximum number of operations is 8, the maximum time interval between any two adjacent refresh instructions is 9 refresh periods (tREFI). Therefore, in the embodiment of the present application, the first threshold can be set to the amount of data that can be read from HBM within 9 normal refresh cycles. If the read / write bandwidth of HBM is 38400 MB / s and the refresh period tREFI = 3.9 us, the first threshold y 1 for the amount of data that can be read in 9 refresh cycles is a = 38400 MB / s × 9 × 3.9 us ≈ 1.3 MB.

[0118] In the above embodiment, the first threshold is determined by the maximum number of refresh operations that the memory allows to be executed centrally, so that during the process of executing read / write services, an appropriate memory refresh mechanism can be determined based on the first threshold, avoiding excessive refresh operations from interrupting data reading and writing during the execution of read / write services, and effectively improving the data reading and writing efficiency.

[0119] In one embodiment, the controller of the server, when executing the process of pre-refreshing the data storage area if the amount of data to be read / written is greater than the first threshold, includes the following steps: if the amount of data to be read / written is greater than the first threshold, determining the number of pre-refresh instructions according to the first threshold; generating pre-refresh instructions for the number of pre-refresh instructions; and pre-refreshing the data storage area based on the pre-refresh instructions.

[0120] Among them, the first threshold can be a data volume threshold set according to the read / write bandwidth of the memory and the refresh period (tREFI) of the memory.

[0121] Specifically, after the controller of the server determines that the data volume of the data to be read and written is greater than the first threshold, it can also determine the maximum number of refresh operations that the memory allows to be executed centrally according to the first threshold, configure the number of pre-refresh instructions according to the determined maximum number of operations, generate pre-refresh instructions according to the configured number of pre-refresh instructions, and then centrally send the generated pre-refresh instructions to the memory. The memory centrally refreshes the data storage area based on the received pre-refresh instructions.

[0122] Among them, the configured number of pre-refresh instructions is not greater than the maximum number of operations. For example, if the maximum number of operations is 8, the preset refresh instruction data can be any integer from 1 to 8.

[0123] It should be noted that the refresh instructions are all row instructions, that is, each refresh instruction is used to refresh a row of the storage area. The time required to refresh a row is called the row refresh cycle time tRFC. Centrally sending pre-refresh instructions means continuously sending pre-refresh instructions within a short period of time. Assuming the number of refresh instructions is 8, it means centrally refreshing 8 rows of the storage area. The time required for the centralized refresh of 8 rows is 8×tRFC.

[0124] In the above embodiment, if the data volume of the data to be read and written is greater than the first threshold, the number of pre-refresh instructions is determined according to the first threshold, pre-refresh instructions with the number of pre-refresh instructions are generated, and the data storage area is pre-refreshed based on the pre-refresh instructions, so that flexible refreshing of the memory can be realized, the number of refreshes during the execution of read and write operations can be reduced, and the data read and write efficiency is effectively improved.

[0125] In one embodiment, after the controller of the server pre-refreshes the data storage area, it can further determine a second threshold, which specifically includes the following steps: determining a preset refresh time based on the number of instructions of the pre-refresh instructions; determining the second threshold according to the first threshold, the preset refresh time, and the read and write rate during read and write processing.

[0126] Among them, the second threshold is used to determine whether it is necessary to refresh the data storage area during data read and write. The preset refresh time refers to the time interval between the time when the pre-refresh is completed and the next refresh, that is, the time to wait for the next refresh after the pre-refresh. During this pre-refresh time, read and write operations can be performed on the data storage area. The preset refresh time includes at least one refresh cycle. The read and write rate during read and write processing can be the communication bandwidth of the memory.

[0127] Specifically, after the controller of the server determines the number of instructions of the pre-refresh instructions, it can also obtain the refresh cycle of the memory and determine the preset refresh time according to the number of instructions and the refresh cycle. Among them, the number of instructions is the number of refresh cycles included in the preset refresh time, that is, the preset refresh time can be determined by the following formula:

[0128] T = n × tREFI

[0129] Wherein, T is the preset refresh time, n is the number of instructions, and tREFI is the refresh period.

[0130] After the controller of the server determines the preset refresh time, the preset refresh time and the read / write rate during the read / write process are used to determine the amount of data that can be read / written within the preset refresh time, and the second threshold is determined according to the first threshold and the amount of data that can be read / written within the preset refresh time.

[0131] It can be understood that the first threshold is the maximum amount of data that can be read / written within the maximum time interval between two adjacent refresh instructions, that is, the amount of data that can be read / written within the time interval between any two refresh instructions should be less than the first threshold. Therefore, in the embodiments of the present application, the sum of the second threshold and the amount of data that can be read / written within the preset refresh time is equal to the first threshold. The second threshold can be specifically determined by the following formula:

[0132] y 2 = y 1 - v × T

[0133] Wherein, y 2 is the second threshold, v is the read / write bandwidth of the memory, T is the preset refresh time, and v × T is the amount of data that can be read / written within the preset refresh time.

[0134] In the above embodiments, the preset refresh time is determined based on the number of pre-refresh instructions; the second threshold is determined according to the first threshold, the preset refresh time, and the read / write rate during the read / write process. Thus, during the execution of the read / write service, an appropriate memory refresh mechanism during the read / write process can be determined based on the second threshold, avoiding excessive refresh operations during the execution of the read / write service from interrupting the read / write of data, and effectively improving the data read / write efficiency.

[0135] In one embodiment, the number of pre-refresh instructions is at least two. The process by which the controller of the server pre-refreshes the data storage area based on the pre-refresh instructions includes the following steps: sequentially sending at least two pre-refresh instructions to at least two storage row blocks of the data storage area to perform pre-refresh on the at least two storage row blocks.

[0136] Wherein, the storage row block is the storage unit of the memory. The essence of the storage unit is a capacitor. Executing a refresh command means charging each capacitor on the storage row block.

[0137] Specifically, after the controller of the server generates pre-refresh instructions with a pre-determined number of pre-refresh instructions, it centrally sends the generated pre-refresh instructions to the corresponding memory row blocks of the memory. The memory row block that first receives the pre-refresh instruction performs a refresh operation based on the received pre-refresh instruction. After the refresh of this row is completed, it directly starts the refresh operation of the memory row block until all the memory row blocks that have received the pre-refresh instruction complete the pre-refresh.

[0138] The execution process of the refresh operation can be specifically as follows: 1) In the initial state, all bit line levels are pre-charged to VDD / 2; 2) The row address decoder selects this row and raises the word line level, and the transistors of all memory cells in this row are turned on, connecting the capacitor and the bit line; 3) According to whether the capacitor level is high or low, charge flows from the capacitor to the bit line or from the bit line into the capacitor, thereby causing a slight level change of VDD / 2 ± △ on the bit line, and the change direction is recognized by the sense amplifier; 4) The local sense amplifier charges or discharges the bit line according to the change direction, pulling its level to VDD or 0. During this process, since the bit line is connected to the capacitor, the capacitor is also recharged to VDD or discharged to 0, that is, the refresh operation is performed.

[0139] In the above embodiment, by sequentially sending at least two pre-refresh instructions to at least two memory row blocks in the data storage area to perform pre-refresh on at least two memory row blocks, flexible refresh of the memory can be achieved, and the number of refreshes during the execution of read and write operations can be reduced, effectively improving the data read and write efficiency.

[0140] In one embodiment, the process of batch reading and writing the data to be read and written in the pre-refreshed data storage area by the controller of the server includes the following steps: batch reading the data to be read and written from at least two memory row blocks after pre-refresh; or batch writing the data to be read and written into at least two memory row blocks after pre-refresh.

[0141] It should be noted that in the embodiments of the present application, when the data storage area is in a non-refresh operation state, the data storage area can be accessed, that is, data can be read from the data storage area or written into the data storage area. The pre-refreshed data storage area is in a non-refresh operation state within a preset refresh time. That is, within the preset refresh time after the data storage area is pre-refreshed, data can be read from the data storage area or written into the data storage area, specifically including reading the data to be read and written from at least two memory row blocks after pre-refresh; or writing the data to be read and written into at least two memory row blocks after pre-refresh.

[0142] Specifically, when it is necessary to read data from or write data to the data storage area, the controller of the server can preset the amount of batch data that can be read from the data storage area each time, or the amount of batch data written to the data storage area each time, and read data from or write data to the data storage area according to the preset amount of batch data. Specifically, it can read the data to be read and written in batches from at least two stored row blocks after pre-refreshing, or write the data to be read and written in batches into at least two stored row blocks after pre-refreshing according to the preset amount of batch data.

[0143] For example, the amount of batch data can be set to the amount of data that can be read and written in one refresh period (tREFI). Assuming the communication bandwidth is v, the amount of batch data is v×tREFI.

[0144] For example, as Figure 3 shown, Figure 3 FIG. is a schematic structural diagram of the HBM controller in the server. The operation management unit determines the bank in the memory for reading and writing the data to be read and written according to the data read and write request. In addition, the read and write control unit generates multiple read and write instructions, and then sequentially sends the read and write instructions to the instruction arbitration and decoding unit according to the preset sending interval. The instruction arbitration and decoding unit arbitrates the received read and write instructions and other instructions. When the arbitration result is to send the read and write instructions, it first decodes the read and write instructions, and then sequentially sends the read and write instructions to the bank to read and write the data in the stored row block of the bank.

[0145] In the above embodiment, by reading the data to be read and written in batches from at least two stored row blocks after pre-refreshing; or writing the data to be read and written in batches into at least two stored row blocks after pre-refreshing, it is possible to avoid excessive refresh operations during the execution of the read and write service from interrupting the read and write of data, effectively improving the data read and write efficiency.

[0146] In one embodiment, the process of the controller of the server accessing at least two stored row blocks after pre-refreshing includes the following steps: sending a read and write activation instruction to at least two stored row blocks after pre-refreshing to activate the read and write function of at least two stored row blocks; reading the data to be read and written in batches from the at least two activated stored row blocks; or writing the data to be read and written in batches into the at least two activated stored row blocks.

[0147] Specifically, the data read / write requests obtained by the controller of the server are parsed to obtain a parsing result, and based on the parsing result, a data read / write instruction and an activation instruction are generated, and the activation instruction and the data read / write instruction are sent to at least two memory row blocks after pre-refreshing. One of the memory row blocks activates the capacitor based on the received activation instruction, and after activation, performs a read / write operation from this memory row block based on the data read / write instruction. At the same time, the next memory row block activates the capacitor based on the activation instruction for subsequent read / write operations on this memory row block. Among them, performing a read / write operation means batch-reading the data to be read / written from at least two activated memory row blocks; or batch-writing the data to be read / written into at least two activated memory row blocks.

[0148] For example, as Figure 3 shown, Figure 3 is a schematic structural diagram of the HBM controller in the server. The operation management unit determines the bank in the memory for reading and writing the data to be read / written based on the data read / write request, generates an activation instruction through the bank instruction parsing module, and then sequentially sends the activation instruction to the instruction arbitration and decoding unit according to a preset sending interval through the bank instruction unit. The instruction arbitration and decoding unit arbitrates the received activation instruction and other instructions. When the arbitration result is to send the activation instruction, it first decodes the activation instruction and then sequentially sends the activation instruction to this bank to activate the memory row blocks in this bank.

[0149] In the above embodiment, by sending read / write activation instructions to at least two memory row blocks after pre-refreshing, the read / write functions of at least two memory row blocks are activated; thus, access to at least two memory row blocks can be realized.

[0150] In one embodiment, the process of the controller of the server accessing at least two memory row blocks after pre-refreshing further includes: after completing the read / write processing, sending a close instruction to at least two memory row blocks to close the read / write functions of at least two memory row blocks. Among them, the close instruction can also be called a precharge instruction (precharge instruction).

[0151] Specifically, for any one memory row block, it performs a read / write operation from this memory row block based on the data read / write instruction, and after completing the read / write operation of this memory row block, the controller of the server sends a close instruction to this memory row block. After receiving the close instruction, the memory row block closes the read / write functions of at least two memory row blocks based on this close instruction; similarly, after the next memory row block completes the read / write operation of this memory row block, the controller of the server sends a close instruction to this memory row block. After receiving the close instruction, the memory row block closes the read / write functions of at least two memory row blocks based on this close instruction.

[0152] For example, asFigure 3 As shown, Figure 3 The schematic diagram of the structure of the HBM controller in the server is as follows: the operation management unit determines the bank in the memory used for reading and writing data to be read and written according to the data read and write request, and generates a close instruction through the bank instruction parsing module, and then sends the close instruction to the instruction arbitration and decoding unit in sequence according to the preset sending interval through the bank instruction unit. The instruction arbitration and decoding unit arbitrates the received close instruction and other instructions. When the arbitration result is to send a close instruction, the close instruction is first decoded, and then the close instruction is sent to the bank in sequence to close the storage row block in the bank.

[0153] In one embodiment, the process of refreshing the data storage area by the controller of the server specifically includes: refreshing at least two storage row blocks; or refreshing the remaining storage row blocks in the data storage area.

[0154] Specifically, the data storage area includes multiple storage row blocks. If the refresh of each storage row block in the data storage area has been completed before the read and write processing is completed, then after the read and write processing is completed, the controller of the server directly refreshes at least two storage row blocks in the data storage area; if only the refresh of some storage row blocks in the logarithmic storage area has been completed before the read and write processing is completed, then after the read and write processing is completed, the remaining storage row blocks in the data storage area are refreshed.

[0155] For example, the data storage area contains 9 storage row blocks. When the storage area is pre-refreshed, the 1st to 8th storage row blocks are refreshed, and when the preset refresh time is reached, the 9th storage row block is refreshed. At this point, the refresh of all storage row blocks in the data storage area is completed. After completing the read and write processing, the server controller can refresh the 1st storage row block again.

[0156] For another example, the data storage area contains 12 storage row blocks. When the storage area is pre-refreshed, the 1st to 8th storage row blocks are refreshed, and when the preset refresh time is reached, the 9th storage row block is refreshed. After completing the read and write processing, the server controller can then refresh the 10th storage row block.

[0157] In the above embodiment, by refreshing at least two storage row blocks, or refreshing the remaining storage row blocks in the data storage area, after completing the read and write processing, a close instruction is sent to at least two storage row blocks to close the read and write functions of at least two storage row blocks, thereby avoiding excessive refresh operations that interrupt data reading and writing during the execution of read and write services, thereby effectively improving data reading and writing efficiency.

[0158] In one embodiment, when the storage capacities of at least two storage row blocks are less than the data volume of the data to be read and written, the process by which the controller of the server continues to perform read and write processing on the remaining amount of data to be read and written includes: continuously reading the remaining amount of data to be read and written from the remaining storage row blocks in the data storage area; or writing the remaining amount of data to be read and written into the remaining storage row blocks in the data storage area.

[0159] It should be noted that in the embodiments of the present application, when the data storage area is in a non-refresh operation state, the data storage area can be accessed, that is, data can be read from the data storage area or written into the data storage area. If the remaining amount after performing read and write processing on the data to be read and written within the current refresh cycle is less than or equal to the second threshold, the refresh of the data storage area is delayed, that is, the read and write processing on the remaining amount of data to be read and written continues.

[0160] Delaying the refresh of the data storage area means that the data storage area is in a non-refresh operation state within the preset refresh time, so that data can be read from the data storage area or written into the data storage area. If the read and write operations on at least two storage row blocks have been completed before, but the amount of data read and written is less than the data volume of the data to be read and written, that is, the storage capacities of at least two storage row blocks are less than the data volume of the data to be read and written, the controller of the server then continues to perform read and write operations on other storage row blocks outside the at least two storage row blocks of the memory, specifically including reading the data to be read and written from other storage row blocks; or writing the data to be read and written into other storage row blocks.

[0161] In one embodiment, the process by which the controller of the server refreshes the data storage area after completing the read and write processing includes: refreshing the remaining storage row blocks in the data storage area after completing the read and write processing.

[0162] Specifically, the data storage area includes multiple storage row blocks. If the refresh of each storage row block in the data storage area has been completed before completing the read and write processing, then after completing the read and write processing, the controller of the server directly refreshes at least two storage row blocks of the data storage area; if only the refresh of some storage row blocks in the data storage area has been completed before completing the read and write processing, then after completing the read and write processing, the remaining storage row blocks in the data storage area are refreshed.

[0163] For example, the data storage area contains 12 storage line blocks. When the storage area is pre-refreshed, the first to eighth storage line blocks are refreshed. When the preset refresh time is reached, the ninth storage line block is refreshed. If the amount of data read and written by the controller of the server in the first nine storage line blocks does not reach the amount of data to be read and written, the server controller can perform data read and write processing in at least one of the remaining three storage line blocks. After the read and write processing is completed, the controller of the server can then refresh the tenth to twelfth storage line blocks.

[0164] In the above embodiment, when the storage capacities of at least two of the storage line blocks are smaller than the amount of data to be read and written, by accessing the remaining storage line blocks in the data storage area, the reading and writing of the data to be read and written can be completed.

[0165] In Figure 6 the embodiment, it mainly describes that when the amount of data to be read and written is greater than the first threshold, pre-refreshing, normal refreshing, and delayed refreshing are performed on the data storage area. When the amount of data to be read and written is less than or equal to the first threshold and greater than the second threshold, only pre-refreshing or delayed refreshing can be performed on the data storage area and the read and write processing can be completed. The specific refreshing steps are as follows:

[0166] S602. When a data read and write request is obtained, determine the amount of data to be read and written and the data storage area in the memory for storing the data to be read and written.

[0167] S604a. If the amount of data to be read and written is less than or equal to the first threshold and greater than the second threshold, in the data storage area, perform read and write processing on the data to be read and written in batches.

[0168] In one embodiment, the server sends a data read and write instruction to the data storage area through the controller to perform read and write processing on the data to be read and written in batches from the data storage area. For example, read the data to be read and written in batches from the data storage area, or write the data to be read and written in batches to the data storage area.

[0169] In one embodiment, before sending the data read and write instruction, the server can also send a read and write activation instruction to the data storage area through the controller to activate the read and write function of the data storage area, and then send the data read and write instruction.

[0170] S606a. When the read and write processing of the data to be read and written is completed, refresh the data storage area.

[0171] In one embodiment, when the read and write processing of the data to be read and written is completed and the preset refresh time is reached, the server refreshes the data storage area. The preset refresh time includes at least one refresh cycle.

[0172] Specifically, when the read / write processing of the data to be read / written is completed and the preset refresh time is reached, the server sends a refresh instruction (i.e., a conventional refresh instruction) to the data storage area through the controller to refresh the data storage area.

[0173] It should be noted that the solutions of S604a to S606a are delayed refresh solutions.

[0174] S604b, if the amount of data to be read / written is less than or equal to the first threshold and greater than the second threshold, pre-refresh the data storage area.

[0175] S606b, in the pre-refreshed data storage area, perform read / write processing on the data to be read / written in batches until the read / write processing of the data to be read / written is completed before the preset refresh time arrives.

[0176] It should be noted that the solutions of S604b to S606b are pre-refresh solutions. For the specific refresh process and read / write processing process, reference can be made to S604a to S606a. In the actual application process, it can be determined whether to adopt the delayed refresh solution or the pre-refresh solution according to the pre-configured requirements.

[0177] In addition, for the specific steps of the above S604a to S606a and S604b to S606b, reference can be made to Figure 2 S202 to S212 in the embodiments, as well as the above other embodiments.

[0178] In the above embodiments, during the execution of the read / write service, first determine the amount of data to be read / written and the data storage area. If the amount of data is less than or equal to the first threshold and greater than the second threshold, the pre-refresh solution can be adopted for refreshing, that is, first perform the refresh and then perform the read / write processing on the data to be read / written, so that the process of read / write processing does not need to be interrupted, effectively improving the data read / write efficiency. In addition, if the amount of data is less than or equal to the first threshold and greater than the second threshold, the delayed refresh solution can also be adopted for refreshing, that is, first perform the read / write processing on the data to be read / written and then perform the refresh, so that the process of read / write processing does not need to be interrupted, effectively improving the data read / write efficiency.

[0179] It should be understood that although Figure 2 、 6 the steps in the flowchart are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figure 2 、 6At least a part of the steps therein may include multiple steps or multiple stages. These steps or stages are not necessarily executed and completed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0180] In one embodiment, as Figure 7 shown, a memory refreshing device is provided. This device can be a software module, a hardware module, or a combination of both to become a part of a computer device. Specifically, the device includes: a determination module 702, a first refreshing module 704, a first processing module 706, a second refreshing module 708, a second processing module 710, and a third refreshing module 712, where:

[0181] The determination module 702 is configured to determine the data volume of the data to be read and written and the data storage area in the memory for storing the data to be read and written when a data read / write request is obtained;

[0182] The first refreshing module 704 is configured to perform a pre-refresh on the data storage area if the data volume of the data to be read and written is greater than a first threshold;

[0183] The first processing module 706 is configured to perform read / write processing on the data to be read and written in batches in the pre-refreshed data storage area;

[0184] The second refreshing module 708 is configured to perform a refresh on the data storage area when a preset refresh time is reached during the read / write processing; the preset refresh time includes at least one refresh period;

[0185] The second processing module 710 is configured to continue performing read / write processing on the remaining amount of the data to be read and written if the remaining amount after performing read / write processing on the data to be read and written within the current refresh period is less than or equal to a second threshold;

[0186] The third refreshing module 712 is configured to perform a refresh on the data storage area after the read / write processing is completed.

[0187] In one of the embodiments, the third refreshing module 712 is further configured to perform a refresh on the data storage area if the remaining amount after performing read / write processing on the data to be read and written within the current refresh period is greater than the second threshold;

[0188] The second processing module 710 is further configured to perform read / write processing on the remaining amount of the data to be read and written in batches in the refreshed data storage area until the read / write processing of the remaining amount of the data to be read and written is completed.

[0189] In the above embodiments, during the process of performing read / write operations, first, the data volume of the data to be read / written and the data storage area are determined. When the data volume is greater than the first threshold, the data storage area is specifically pre-refreshed, so that after the pre-refresh, the data to be read / written can be batch-processed centrally in the data storage area, and the read / write processing of the data to be read / written can be avoided from being interrupted due to refreshing. In addition, during the read / write processing, when the preset refresh time is reached, the data storage area is refreshed, and then the read / write processing continues. If the remaining quantity after the read / write processing of the data to be read / written within the current refresh cycle is less than or equal to the second threshold, the refresh will be delayed, that is, the read / write processing of the remaining quantity of the data to be read / written will continue, and the data storage area will be refreshed only after the read / write processing is completed, thus effectively ensuring that the read / write operation of the data is no longer interrupted due to refreshing, greatly reducing the interruption of the read / write processing due to refreshing, and effectively improving the data read / write efficiency.

[0190] In one of the embodiments, the first refresh module 704 is further configured to, if the data volume of the data to be read / written is greater than the first threshold, determine the number of pre-refresh instructions according to the first threshold; generate pre-refresh instructions with the number of pre-refresh instructions; and perform pre-refresh on the data storage area based on the pre-refresh instructions.

[0191] In the above embodiments, if the data volume of the data to be read / written is greater than the first threshold, determine the number of pre-refresh instructions according to the first threshold, generate pre-refresh instructions with the number of pre-refresh instructions, and perform pre-refresh on the data storage area based on the pre-refresh instructions, so that flexible refreshing of the memory can be realized, the number of refreshes during the execution of read / write operations can be reduced, and the data read / write efficiency is effectively improved.

[0192] In one of the embodiments, the determination module 702 is further configured to determine the preset refresh time based on the number of instructions of the pre-refresh instructions; and determine the second threshold according to the first threshold, the preset refresh time, and the read / write rate during read / write processing.

[0193] In the above embodiments, determine the preset refresh time based on the number of instructions of the pre-refresh instructions; determine the second threshold according to the first threshold, the preset refresh time, and the read / write rate during read / write processing, so that during the process of performing read / write operations, an appropriate memory refresh mechanism during read / write can be determined based on the second threshold, avoiding excessive refresh operations during the execution of read / write operations from interrupting the read / write of data, and effectively improving the data read / write efficiency.

[0194] In one of the embodiments, the number of pre-refresh instructions is at least two; the first refresh module 704 is further configured to sequentially send at least two pre-refresh instructions to at least two memory row blocks of the data storage area to perform pre-refresh on the at least two memory row blocks;

[0195] The first processing module 706 is further configured to batch-read data to be read / written from at least two stored row blocks after pre-refreshing; or batch-write the data to be read / written into at least two stored row blocks after pre-refreshing.

[0196] In the above embodiments, by sequentially sending at least two pre-refresh instructions to at least two stored row blocks of the data storage area to perform pre-refreshing on at least two stored row blocks, flexible refreshing of the memory can be achieved, the number of refreshes during the execution of read / write operations can be reduced, and the data read / write efficiency is effectively improved.

[0197] In one of the embodiments, as Figure 8 shown, the apparatus further includes:

[0198] A sending module 714, configured to send read / write activation instructions to at least two stored row blocks after pre-refreshing to activate the read / write functions of at least two stored row blocks;

[0199] The first processing module 706 is further configured to batch-read data to be read / written from at least two activated stored row blocks; or batch-write the data to be read / written into at least two activated stored row blocks.

[0200] In the above embodiments, by batch-reading data to be read / written from at least two stored row blocks after pre-refreshing; or batch-writing the data to be read / written into at least two stored row blocks after pre-refreshing, excessive refresh operations during the execution of read / write operations can be avoided from interrupting data read / write, and the data read / write efficiency is effectively improved.

[0201] In one of the embodiments, the third refresh module 712 is further configured to refresh at least two stored row blocks; or refresh the remaining stored row blocks in the data storage area;

[0202] The sending module 714 is further configured to send a closing instruction to at least two stored row blocks after completing read / write processing to close the read / write functions of at least two stored row blocks.

[0203] In the above embodiments, by sending read / write activation instructions to at least two stored row blocks after pre-refreshing to activate the read / write functions of at least two stored row blocks; access to the at least two stored row blocks can be achieved.

[0204] In one of the embodiments, when the storage capacity of at least two stored row blocks is less than the data volume of the data to be read / written, the second processing module 710 is further configured to continue reading the remaining quantity of data to be read / written from the remaining stored row blocks in the data storage area; or write the remaining quantity of data to be read / written into the remaining stored row blocks in the data storage area;

[0205] The third refresh module 712 is further configured to, after completing the read / write processing, refresh the remaining storage row blocks in the data storage area.

[0206] In the above embodiments, by refreshing at least two storage row blocks or the remaining storage row blocks in the data storage area, after completing the read / write processing, a close instruction is sent to at least two storage row blocks to close the read / write functions of at least two storage row blocks, thereby avoiding excessive refresh operations during the execution of read / write services from interrupting data read / write and effectively improving the data read / write efficiency.

[0207] In one of the embodiments, the first processing module 706 is further configured to, if the data volume of the data to be read / written is less than or equal to a first threshold and greater than a second threshold, perform read / write processing on the data to be read / written in batches in the data storage area; and refresh the data storage area when the read / write processing of the data to be read / written is completed.

[0208] In the above embodiments, when the storage capacity of at least two of the storage row blocks is less than the data volume of the data to be read / written, by accessing the remaining storage row blocks in the data storage area, the read / write of the data to be read / written can be completed.

[0209] In one of the embodiments, the first processing module 706 is further configured to, if the data volume of the data to be read / written is less than or equal to a first threshold and greater than a second threshold, perform pre-refresh on the data storage area; and perform read / write processing on the data to be read / written in batches in the pre-refreshed data storage area until the read / write processing of the data to be read / written is completed before the preset refresh time arrives.

[0210] In the above embodiments, during the execution of the read / write service, first determine the data volume of the data to be read / written and the data storage area. If the data volume is less than or equal to the first threshold and greater than the second threshold, a pre-refresh scheme can be adopted for refreshing, that is, first perform the refresh and then perform the read / write processing on the data to be read / written, thereby avoiding interrupting the process of read / write processing and effectively improving the data read / write efficiency. In addition, if the data volume is less than or equal to the first threshold and greater than the second threshold, a delayed refresh scheme can also be adopted for refreshing, that is, first perform the read / write processing on the data to be read / written and then perform the refresh, thereby avoiding interrupting the process of read / write processing and effectively improving the data read / write efficiency.

[0211] For the specific limitations of the memory refresh device, reference can be made to the limitations of the memory refresh method in the above text, which will not be elaborated here. Each module in the above memory refresh device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or be stored in the memory in the computer device in software form to facilitate the processor to call and execute the operations corresponding to the above modules.

[0212] In one embodiment, a computer device is provided. The computer device can be a server or a terminal. Taking the computer device being a server as an example for illustration, its internal structure diagram can be as Figure 9 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be read and written. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a method for refreshing a memory.

[0213] Those skilled in the art can understand that Figure 9 the structure shown in

[0214] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the steps in the above method embodiments are implemented.

[0215] In one embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0216] In one embodiment, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the above method embodiments.

[0217] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above various methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0218] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, 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, it should be considered as the scope described in this specification.

[0219] The above-described embodiments merely represent several implementation manners of this application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of the patent of this application should be subject to the appended claims.

Claims

1. A method for refreshing a memory, characterized in that, the method includes: When a data read / write request is obtained, determining the amount of data to be read / written and the data storage area in the memory for storing the data to be read / written; If the amount of data to be read / written is greater than a first threshold, pre-refreshing the data storage area; In the pre-refreshed data storage area, performing read / write processing on the data to be read / written in batches; During the read / write processing, when a preset refresh time is reached, refreshing the data storage area; the preset refresh time includes at least one refresh cycle; If the remaining amount of the data to be read / written after read / write processing within the current refresh cycle is less than or equal to a second threshold, continuing to perform read / write processing on the remaining amount of the data to be read / written; After completing the read / write processing, refreshing the data storage area; wherein, refreshing the data storage area includes sending at least one refresh instruction to the data storage area to refresh the data row blocks in the data storage area; each refresh instruction is a row instruction, respectively used to refresh a corresponding data row block in the data storage area.

2. The method according to claim 1, characterized in that, the step of if the amount of data to be read / written is greater than the first threshold, pre-refreshing the data storage area, includes: If the amount of data to be read / written is greater than the first threshold, determining the number of pre-refresh instructions according to the first threshold; Generating pre-refresh instructions with the number of pre-refresh instructions; Based on the pre-refresh instructions, pre-refreshing the data storage area.

3. The method according to claim 2, characterized in that, the method further includes: Based on the number of instructions of the pre-refresh instructions, determining the preset refresh time; According to the first threshold, the preset refresh time, and the read / write rate during read / write processing, determining the second threshold.

4. The method according to claim 2, characterized in that, the number of pre-refresh instructions is at least two; the step of based on the pre-refresh instructions, pre-refreshing the data storage area, includes: Sequentially sending at least two pre-refresh instructions to at least two storage row blocks of the data storage area to pre-refresh at least two storage row blocks; the step of in the pre-refreshed data storage area, performing read / write processing on the data to be read / written in batches, includes: Reading the data to be read / written in batches from at least two pre-refreshed storage row blocks; or, Writing the data to be read / written in batches into at least two pre-refreshed storage row blocks.

5. The method according to claim 4, characterized in that, the method further includes: Sending read / write activation instructions to at least two pre-refreshed storage row blocks to activate the read / write functions of at least two storage row blocks; the step of reading the data to be read / written in batches from at least two pre-refreshed storage row blocks; or, writing the data to be read / written in batches into at least two pre-refreshed storage row blocks, includes: Reading the data to be read / written in batches from at least two activated storage row blocks; or, Write the data to be read and written in batches into at least two activated storage row blocks.

6. The method according to claim 5, wherein, the refreshing of the data storage area includes: refreshing at least two of the storage row blocks; or refreshing the remaining storage row blocks in the data storage area; The method further includes: after completing the read and write processing, sending a closing instruction to at least two of the storage row blocks to close the read and write functions of the at least two storage row blocks.

7. The method according to claim 4, wherein, when the storage capacity of at least two of the storage row blocks is less than the data volume of the data to be read and written, the continuing to perform read and write processing on the remaining amount of data to be read and written includes: continuing to read the remaining amount of data to be read and written from the remaining storage row blocks in the data storage area; or, writing the remaining amount of data to be read and written into the remaining storage row blocks in the data storage area; the refreshing of the data storage area after completing the read and write processing includes: after completing the read and write processing, refreshing the remaining storage row blocks in the data storage area.

8. The method according to claim 1, wherein, the method further includes: if the data volume of the data to be read and written is less than or equal to the first threshold and greater than the second threshold, performing read and write processing on the data to be read and written in batches in the data storage area; when completing the read and write processing of the data to be read and written, refreshing the data storage area.

9. The method according to claim 1, wherein, the method further includes: if the data volume of the data to be read and written is less than or equal to the first threshold and greater than the second threshold, performing pre-refreshing on the data storage area; performing read and write processing on the data to be read and written in batches in the pre-refreshed data storage area until the read and write processing of the data to be read and written is completed before the preset refreshing time arrives.

10. The method according to any one of claims 1 to 9, wherein, the method further includes: if the remaining amount after performing read and write processing on the data to be read and written in the current refreshing cycle is greater than the second threshold, refreshing the data storage area; performing read and write processing on the remaining amount of data to be read and written in batches in the refreshed data storage area until the read and write processing of the remaining amount of data to be read and written is completed.

11. A refreshing device for a memory, wherein, the device includes: a determination module, configured to determine the data volume of the data to be read and written and the data storage area in the memory for storing the data to be read and written when obtaining a data read and write request; a first refreshing module, configured to perform pre-refreshing on the data storage area if the data volume of the data to be read and written is greater than a first threshold; a first processing module, configured to perform read and write processing on the data to be read and written in batches in the pre-refreshed data storage area; a second refreshing module, configured to refresh the data storage area when a preset refreshing time is reached during the read and write processing; the preset refreshing time includes at least one refreshing cycle; A second processing module, configured to continue performing read / write processing on the remaining amount of the data to be read / written if the remaining amount after read / write processing of the data to be read / written within the current refresh period is less than or equal to a second threshold; A third refresh module, configured to refresh the data storage area after completion of the read / write processing; Wherein, the refreshing of the data storage area includes sending at least one refresh instruction to the data storage area to refresh data row blocks in the data storage area; each of the refresh instructions is a row instruction, respectively used to refresh a corresponding data row block in the data storage area.

12. The apparatus according to claim 11, wherein, the first refresh module is further configured to, if the data volume of the data to be read / written is greater than a first threshold, determine a pre-refresh instruction number according to the first threshold; generate pre-refresh instructions with the pre-refresh instruction number; and perform pre-refreshing on the data storage area based on the pre-refresh instructions.

13. The apparatus according to claim 12, wherein, the determining module is further configured to: determine a preset refresh time based on the number of instructions of the pre-refresh instructions; determine a second threshold according to the first threshold, the preset refresh time, and the read / write rate during read / write processing.

14. The apparatus according to claim 12, wherein, the first refresh module is further configured to: sequentially send at least two of the pre-refresh instructions to at least two storage row blocks of the data storage area to perform pre-refreshing on at least two of the storage row blocks; the first processing module is further configured to: read the data to be read / written in batches from at least two of the pre-refreshed storage row blocks; or write the data to be read / written in batches into at least two of the pre-refreshed storage row blocks.

15. The apparatus according to claim 14, wherein, the apparatus further includes a sending module, configured to: send read / write activation instructions to at least two of the pre-refreshed storage row blocks to activate the read / write functions of at least two of the storage row blocks; the first processing module is further configured to: read the data to be read / written in batches from at least two of the activated storage row blocks; or write the data to be read / written in batches into at least two of the activated storage row blocks.

16. The apparatus according to claim 15, wherein, the third refresh module is further configured to: refresh at least two of the storage row blocks; or refresh the remaining storage row blocks in the data storage area; the apparatus further includes a sending module, configured to: after completion of the read / write processing, send closing instructions to at least two of the storage row blocks to close the read / write functions of at least two of the storage row blocks.

17. The apparatus according to claim 14, wherein, when the storage capacity of at least two of the storage row blocks is less than the data volume of the data to be read / written, the second processing module is further configured to: continue to read the remaining amount of the data to be read / written from the remaining storage row blocks in the data storage area; or write the remaining amount of the data to be read / written into the remaining storage row blocks in the data storage area; the third refresh module is further configured to: After completing the read / write process, refresh the remaining storage row blocks in the data storage area.

18. The apparatus according to claim 11, wherein, the first processing module is further configured to: if the data volume of the data to be read / written is less than or equal to the first threshold and greater than the second threshold, perform read / write processing on the data to be read / written in batches in the data storage area; when the read / write processing of the data to be read / written is completed, refresh the data storage area.

19. The apparatus according to claim 11, wherein, the first processing module is further configured to: if the data volume of the data to be read / written is less than or equal to the first threshold and greater than the second threshold, perform pre-refresh on the data storage area; in the pre-refreshed data storage area, perform read / write processing on the data to be read / written in batches until the read / write processing of the data to be read / written is completed before the preset refresh time arrives.

20. The apparatus according to any one of claims 11 to 19, wherein, the third refresh module is further configured to: if the remaining quantity after the read / write processing of the data to be read / written in the current refresh cycle is greater than the second threshold, refresh the data storage area; the second processing module is further configured to, in the refreshed data storage area, perform read / write processing on the remaining quantity of the data to be read / written in batches until the read / write processing of the remaining quantity of the data to be read / written is completed.

21. A computer device, comprising a memory and a controller, the memory storing a computer program, wherein, when the controller executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.

22. A computer-readable storage medium, storing a computer program, wherein, when the computer program is executed by a controller, the steps of the method according to any one of claims 1 to 10 are implemented.

23. A computer program product, comprising a computer program, wherein, when the computer program is executed by a controller, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Method and device for scheduling cache

    CN102223510A

  • Memory controller, storage device, information processing system, and memory controlling method

    US20170316826A1