A buffer implementation method, device and data processing equipment

By introducing a page table management unit into the cache and using virtual addresses to convert physical addresses, the problems of high hardware cost and insufficient data processing capabilities in existing cache designs are solved, and higher hardware resource utilization and caching are achieved. The device hit rate is reduced, hardware requirements and implementation costs are reduced.

CN113157606BActive Publication Date: 2024-09-10SHANGHAI SUIYUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110429510.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-21
Publication Date
2024-09-10
Estimated Expiration
2041-04-21

AI Technical Summary

Technical Problem

Existing cache designs result in high hardware costs and insufficient data processing capabilities when handling random access to main memory. In particular, address indexes occupy more resources, resulting in low cache data storage capabilities.

Method used

By introducing a page table management unit into the cache, using virtual addresses to convert physical addresses, using large data blocks and page table management methods to separate address index data, it improves hardware resource utilization and cache hit rates, and reduces hardware requirements and implementation costs. .

Benefits of technology

Without significantly increasing the cost of the cache, the data processing capability and hardware resource utilization of the cache are improved, the hit rate of the cache is improved, the hardware design is simplified, and the implementation cost is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157606B
    Figure CN113157606B
Patent Text Reader

Abstract

The present invention provides a cache implementation method, device and data processing equipment. When a data processing request is obtained, it is first determined whether the page management unit hits the request. If the request is hit, the cache is directly used to respond to the request. It can be seen that the technical solution disclosed in the present application breaks the traditional cache management method for address index and data, adopts a method of separately separating address index data, and for the situation where continuous linear addresses access the main memory, a large data block and page table management method are used to provide higher hardware resource utilization and higher cache hit rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a cache implementation method, device and data processing equipment based on virtual address translation. Background Art

[0002] In the design of large computing chips, cache memory (cache for short) is widely used. Compared with main memory, it has the characteristics of faster speed and smaller capacity.

[0003] Existing cache designs usually use addresses to index data. When the address index query is successful, the indexed data is immediately returned to the requesting unit (if it is a write operation, a write-through operation to the main memory is also required), which is called a cache hit; when the address index query fails, the data is first read from the main memory, and then the data is returned to the requesting unit (if it is a write operation, it is directly written to the cache and a write-through operation is performed on the main memory), which is called a cache miss. Figure 1 As shown, there are multiple correspondences between the data cells of the cache and the data cells of the main memory: direct mapping, fully associative mapping, and set associative mapping. When the cache is full of data, if new data needs to be put into the cache from the main memory, a replacement algorithm is needed to select cells in the cache to write the new address index and new data.

[0004] The applicant has found through research that the existing cache implementation method has a better effect on random access to the main memory. Figure 1 As shown, each small data block in the buffer needs to store its corresponding address data as an index. Assuming that the data size is: Size_Data, and the address index size is: Size_Address, the total size of the buffer is: Size_Total = Size_Data + Size_Address. In the prior art, the buffer utilization rate is characterized by the buffer occupancy ratio = Size_Data / Size_Total. From the occupancy ratio formula, it is not difficult to find that the smaller the data block corresponding to each address index, the less data the buffer can store, and the more hardware resources are used to store the address index. Since the data blocks are small, there will be frequent data read and write exchanges between the buffer and the main memory, and complex replacement strategies and algorithms must be used to obtain good performance. This places high design requirements on the hardware, thereby increasing the hardware cost. Summary of the invention

[0005] In view of this, the embodiments of the present invention provide a cache implementation method, apparatus, and data processing device to improve the data processing capability of the cache without significantly increasing the cost of the cache.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] A buffer implementation method, comprising:

[0008] Obtaining a data processing request sent by a request unit, wherein the data processing request has a first address;

[0009] When judging through the page table entry index that the page management unit hits the first address, judging the operation type of the data processing request;

[0010] When the data processing request is a read operation, requesting the buffer to process the data processing request, obtaining response data of the buffer to the data processing request, and sending the response data to the requesting unit;

[0011] When the data processing request is a write operation, the data processing request is sent to the cache and the main memory, so that the cache and the main memory update the stored data according to the write operation.

[0012] Optionally, the cache implementation method further includes:

[0013] When the page management unit does not hit the first address through the page table entry index, determining the operation type of the data processing request;

[0014] When the data processing request is a read operation, the data processing request is sent to the main memory, feedback data whose size of the main memory is a preset value is obtained, the feedback data is written into the buffer, a mapping relationship between the feedback data in the buffer and the data processing request is established in the page management unit, and the feedback data is fed back to the request unit;

[0015] When the data processing request is a write operation, the data processing request is sent to the main memory, the data is written to the main memory, and then a data read request with a size of a preset value is sent to the main memory, and the feedback data of the memory is written into the cache, and a mapping relationship between the feedback data in the cache and the data processing request is established.

[0016] Optionally, in the above cache implementation method, when the data processing request is a write operation, sending the data processing request to the main memory includes:

[0017] When the data processing request is a write operation, the data processing request is sent to the main memory through the transport engine.

[0018] Optionally, in the above buffer implementation method, obtaining feedback data from the main memory and writing the feedback data into the buffer includes:

[0019] The transport engine obtains feedback data whose size is a preset value stored in the main memory, and sends the obtained feedback data to the page table management unit. The page table management unit writes the received feedback data into a cache using a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

[0020] Optionally, in the above buffer implementation method, writing the data written into the memory into the buffer includes:

[0021] A data read request with a preset size is sent to the main memory through a data transfer engine to obtain data to be written into the memory. The data transfer engine sends the read data to a page table management unit. The page table management unit writes the received data read by the data transfer engine into a cache according to a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

[0022] Optionally, in the above cache implementation method, the step of establishing a mapping relationship between the stored data in the cache and the data processing request includes:

[0023] A mapping relationship between the storage data of the cache and the data processing request is established by inserting or replacing a page table entry PTE, wherein the page table entry PTE stores a mapping relationship between the virtual address of the main memory and the physical address of the cache, wherein the data processing request includes a virtual address.

[0024] A buffer implementation device, comprising:

[0025] A request collection unit, configured to obtain a data processing request sent by the request unit, wherein the data request has a first address, and send the data processing request to the page management unit;

[0026] A page management unit, wherein the page management unit determines whether the acquired data processing request is hit, and when the page management unit hits the first address, determines the operation type of the data processing request; when the data processing request is a read operation, requests a cache to process the data processing request, obtains response data of the cache to the data processing request, and sends the response data to the request unit; when the data processing request is a write operation, sends the data processing request to the cache and the main memory, so that the cache and the main memory update the storage data according to the write operation.

[0027] Optionally, the cache implementation device further includes:

[0028] The page management unit is further used to: determine the operation type of the data processing request when the page management unit does not hit the first address through the page table entry index;

[0029] When the data processing request is a read operation, the data processing request is sent to the main memory, feedback data whose size of the main memory is a preset value is obtained, the feedback data is written into the buffer, a mapping relationship between the feedback data in the buffer and the data processing request is established in the page management unit, and the feedback data is fed back to the request unit;

[0030] When the data processing request is a write operation, the data processing request is sent to the main memory, the data is written to the main memory, and then a data read request with a size of a preset value is sent to the main memory, and the feedback data of the memory is written into the cache, and a mapping relationship between the feedback data in the cache and the data processing request is established.

[0031] Optionally, the cache implementation device further includes:

[0032] A transport engine unit, wherein the transport engine unit is used to implement data interaction between the page management unit and the main memory;

[0033] When sending the data processing request to the main memory, the page management unit is specifically used to:

[0034] The data processing request is sent to the main memory through the transport engine.

[0035] Optionally, in the above-mentioned buffer implementation device, when the page management unit obtains the feedback data of the main memory and writes the feedback data into the buffer, it is specifically used to:

[0036] The transport engine obtains feedback data whose size is a preset value stored in the main memory, and sends the obtained feedback data to the page table management unit. The page table management unit writes the received feedback data into a cache using a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

[0037] Optionally, in the above-mentioned buffer implementation device, when the page management unit writes the data written into the memory into the buffer, it is specifically used to:

[0038] A data read request with a preset size is sent to the main memory through a data transfer engine to obtain data to be written into the memory. The data transfer engine sends the read data to a page table management unit. The page table management unit writes the received data read by the data transfer engine into a cache according to a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

[0039] Optionally, in the above-mentioned cache implementation device, when establishing a mapping relationship between the storage data of the cache and the data processing request, the page management unit is specifically used to:

[0040] A mapping relationship between the storage data of the cache and the data processing request is established by inserting or replacing a page table entry PTE, wherein the page table entry PTE stores a mapping relationship between the virtual address of the main memory and the physical address of the cache, wherein the data processing request includes a virtual address.

[0041] Based on the above technical scheme, the above scheme provided by the embodiment of the present invention, when obtaining a data processing request, first determines whether the page management unit hits the request. If the request is hit, directly uses the cache to respond to the request. It can be seen that the technical scheme disclosed in the present application breaks the traditional cache management method of address index and data, and adopts a method of separately separating the address index data. For the situation where continuous linear addresses access the main memory, large data blocks and page table management are used to provide higher hardware resource utilization and higher cache hit rate. In addition, the scheme has low hardware requirements and low implementation cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0043] Figure 1 A processing flow chart of a data processing request disclosed in an embodiment of the present application;

[0044] Figure 2 A flowchart of a cache implementation method disclosed in an embodiment of the present application;

[0045] Figure 3 A flowchart of a cache implementation method disclosed in another embodiment of the present application;

[0046] Figure 4 This is a schematic diagram of the structure of the cache implementation device disclosed in the embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] In order to improve the data processing capability of a cache without significantly increasing the cost of the cache, the present application discloses a cache implementation method, device and cache.

[0049] See also Figure 2 , the cache implementation method disclosed in the embodiment of the present application may include:

[0050] Step S101: obtaining a data processing request sent by a request unit, wherein the data processing request has a first address;

[0051] In this embodiment, when the request unit IP has a data demand, the request unit IP sends a read / write operation request with Vir_Addr (virtual address / main memory address) to the device to which the buffer implementation method disclosed in this application is applied. The request can be a data read request or a data write request. In this embodiment, the Vir_Addr is recorded as the first address;

[0052] Step S102: when the page management unit hits the first address through the page table entry index, determining the operation type of the data processing request;

[0053] In this embodiment, when the data processing request is obtained, the first address contained in the data processing request is retrieved, and a hit judgment is performed on the first address through the page table entry index corresponding to the page management unit. The page table entry index stores a page table / PTE, and the page table / PTE records Vir_Addr->Phy_Addr (physical address / cache address), that is, the mapping relationship between Vir_Addr and Phy_Addr. When the Vir_Addr corresponding to the data processing request is recorded in the page table entry index, it indicates that the page management unit hits the data processing request. At this time, the Phy_Addr that matches the Vir_Addr corresponding to the data processing request can be retrieved based on the page table / PTE.

[0054] When the page management unit hits the data processing request, the data processing request is parsed, and based on the parsing result, it is determined whether the data processing request is a read operation or a write operation. If it is a read operation, step S103 is executed, and if it is a write operation, step S104 is executed.

[0055] Step S103: when the data processing request is a read operation, request the buffer to process the data processing request, obtain response data of the buffer to the data processing request, and send the response data to the request unit;

[0056] Specifically, in this step, if the data processing request is a read operation, the page table management unit sends the read operation carrying Phy_Addr to the cache. After obtaining the read operation, the cache retrieves data based on the Phy_Addr and returns the retrieved data to the request unit IP.

[0057] Step S104: when the data processing request is a write operation, sending the data processing request to the cache and the main memory, so that the cache and the main memory update the stored data according to the write operation;

[0058] Specifically, in this step, if the data processing request is a write operation, the page table management unit sends the write operation carrying Phy_Addr to the cache and the main memory; the cache executes the write operation according to the Phy_Addr to update the data stored therein; at the same time, the main memory also responds to the write operation and writes the data to the main memory.

[0059] It can be seen from the above embodiments that when a data processing request is obtained, it is first determined whether the page management unit hits the request. If the request is hit, the cache is directly used to respond to the request. It can be seen that the technical solution disclosed in the present application breaks the traditional cache management method for address indexes and data, and adopts a method of separately separating address index data. For the situation where continuous linear addresses access the main memory, large data blocks and page table management are used to provide higher hardware resource utilization and higher cache hit rates. In addition, the solution has low hardware requirements and low implementation costs.

[0060] In another embodiment of the present application, a technical solution disclosed in the embodiment of the present application is also disclosed. When the page management unit does not hit the first address, a processing solution for the data processing request is also disclosed. For details, see Figure 3 , the method may include:

[0061] Step S201: when the page management unit does not hit the first address through the page table entry index, determining the operation type of the data processing request;

[0062] In this step, when the Vir_Addr corresponding to the data processing request is not found in the page table / PTE, it indicates that the page management unit does not hit the data processing request. At this time, the data processing request is parsed, and based on the parsing result, it is determined whether the data processing request is a read operation or a write operation. When it is a read operation, step S202 is executed, and when it is a write operation, step S203 is executed;

[0063] Step S202: when the data processing request is a read operation, the data processing request is sent to the main memory, feedback data output by the main memory with a size of a preset value is obtained, the feedback data is written into the buffer, a mapping relationship between the feedback data in the buffer and the data processing request is established in the page management unit, and the feedback data is fed back to the request unit;

[0064] When the type of the data processing request is a read operation, the page table management unit sends a read request of 4KB (or other preset values) to the main memory, the request carries an address Vir_4KB, and the address range covers the Vir_Addr of the above read operation. The main memory reads the stored data based on the Vir_4KB, and returns the read data to the page table management unit as feedback data, and writes the feedback data into the buffer.

[0065] The data handling engine sends a 4KB read operation (with address Vir_4KB, the address range of which covers Vir_Addr of the above read operation), forwards the read operation to the main memory, writes the data returned by the main memory into the buffer, and establishes a mapping relationship between the feedback data in the buffer and the data processing request in the page management unit, the mapping relationship may be Vir_4KB->Phy_4KB, wherein Phy_4KB represents the storage address of the buffer for the feedback data;

[0066] Before writing the feedback data into the cache, the page table management unit may first query whether there is an unused blank page in the cache. If so, the address of the page is used as Phy_4KB. If not, a first used page is selected in the cache, and the address of the page is used as Phy_4KB. Then, the feedback data of the main memory is written into the selected cache page. At this time, the page table management unit may directly return the part of the data required by the request unit IP in the 4KB feedback data of the main memory to the request unit IP, or may read the data from the cache based on the mapping relationship Vir_4KB->Phy_4KB and feed it back to the request unit IP. When a miss occurs, the data read from the main memory is 4KB in size, and the IP requests only a part of the 4KB. Therefore, only the part of the data required by the request unit IP in the 4KB feedback data needs to be returned to the request unit IP.

[0067] Step S203: When the data processing request is a write operation, the data processing request is sent to the main memory, the data is written to the main memory, and then a data read request with a size of a preset value is sent to the main memory, and the feedback data of the main memory is written into the cache, and a mapping relationship between the feedback data in the cache and the data processing request is established.

[0068] In this solution, when the data processing request is a write operation, the page table management unit sends the write operation (with Vir_Addr) to the main memory, and writes the data to be written into the main memory;

[0069] After writing the data to the main memory, the page table management unit sends a 4KB read operation to the main memory (with address Vir_4KB, the address range covers the Vir_Addr of the above read operation), then the page table management unit queries the cache for unused pages, if so, uses the address of the page as Phy_4KB, if not, selects a first used page in the cache, uses the address of the page as Phy_4KB, writes the data fed back by the main memory to the selected cache page, and replaces or inserts the PTE data (Vir_4KB->Phy_4KB) in the page table management unit.

[0070] In the technical solution disclosed in the embodiment of the present application, when responding to the data processing request, the page table management unit always goes to the cache Memory to read 4KB of data, so that the continuity of the access data address can be reasonably utilized to improve the hit rate of the cache, so that there is no need to continuously read data from the main memory. At the same time, because a page table entry is used to index 4KB of data, the occupancy ratio of the cache can be greatly increased, thereby improving the utilization rate of the cache. Assuming that the size of an address index is 24bits=3Bytes, the size of the data block in the implementation of the traditional cache is 1024bits=128Bytes, and the size of the data block in the method proposed in this article is 4Kbytes. Then, according to the cache occupancy ratio formula Size_Data / Size_Total mentioned above, the calculation is performed: the occupancy ratio of the traditional cache is: 128 / (128+3)=97.7% The cache occupancy ratio of the method in this article is: 4K / (4K+3)=99.9%. It can be seen that the occupancy ratio of the technical solution disclosed in the embodiment of the present application is significantly improved compared with the traditional technology. And because of the regularity of memory access addresses, this method only needs a simple page table replacement algorithm to achieve good performance.

[0071] On the other hand, the present solution can also provide a software interface, which can be used to control the transfer of data between the buffer and the main memory and the update of the page table in the page table management unit. In this way, two software modes can be provided: completely skip the buffer, and the request unit IP directly accesses data in the main memory; or the software controls the content of the buffer, and according to the rule of the request unit IP accessing the main memory address, the data is transferred to the buffer in advance, and the page table content in the corresponding page table management unit is updated. In this solution, the data request unit IP is not aware of the existence of the two modes, and the switching between the two modes is completely controlled by the software. For example, the software can choose which mode to use for data reading based on its own working mode. For example, when the system is working in debug mode, the former data reading mode is used to read data, and in other working modes, the second data reading mode is used to read data.

[0072] In the technical solution disclosed in the embodiment of the present application, the data interaction between the page table management unit, the cache and the main memory can be achieved through the transport engine. For example, in the above solution, sending the data processing request to the main memory can be specifically: when the data processing request is a write operation, the data processing request is sent to the main memory through the transport engine. When the data write request is completed, the page table management unit sends a data read operation of 4KB in size to the transport engine. The read operation carries the address Vir_4KB, and the address range covers the Vir_Addr of the above read operation.

[0073] Acquiring feedback data from the main memory and writing the feedback data into the buffer comprises:

[0074] The feedback data whose size stored in the main memory is a preset value is obtained through the transport engine, and the preset value may be 4KB. The obtained feedback data is sent to the page table management unit. The page table management unit obtains a physical address through a page replacement algorithm. The virtual address is the storage address Vir_4KB of the main memory for the data, and the physical address is the address Phy_4KB corresponding to the cache. Based on the physical address, the received feedback data is written into the cache, and a mapping relationship between the storage data of the cache and the data processing request is established in the page table management unit, that is, a mapping relationship Vir_4KB->Phy_4KB is established.

[0075] Writing the data written into the memory into the buffer comprises:

[0076] A data read request with a preset value of size is sent to the main memory through the data transfer engine, and the preset value may be 4KB, to obtain data to be written into the memory. The data transfer engine sends the read data to the page table management unit. The page table management unit obtains the physical address through the page replacement algorithm, writes the received data read by the data transfer engine into the cache, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

[0077] In the technical solution disclosed in the embodiment of the present application, the step of establishing a mapping relationship between the stored data in the buffer and the data processing request includes:

[0078] A mapping relationship Vir_4KB->Phy_4KB between the storage data of the cache and the data processing request is established by inserting or replacing a page table entry PTE, wherein the page table entry PTE stores a mapping relationship Vir_4KB->Phy_4KB between the virtual address of the main memory and the physical address of the cache, wherein the data processing request includes a virtual address.

[0079] In the present embodiment, corresponding to the above method, a cache implementation device is also disclosed. For the specific working contents of each unit in the device, please refer to the contents of the above method embodiment. The cache implementation device provided in the embodiment of the present invention is described below. The cache implementation device described below and the cache implementation method described above can be referenced to each other.

[0080] For details, see Figure 4 , the cache implementation device may include:

[0081] Request collection unit 100 and page management unit 200;

[0082] Corresponding to the above method, the request collection unit 100 is used to obtain a data processing request sent by a request unit, the data request having a first address, and send the data processing request to a page management unit;

[0083] Corresponding to the above method, the page management unit 200 is used to determine whether the acquired data processing request is hit. When the page management unit hits the first address, it determines the operation type of the data processing request; when the data processing request is a read operation, it requests the cache to process the data processing request, obtains the cache's response data to the data processing request, and sends the response data to the request unit; when the data processing request is a write operation, it sends the data processing request to the cache and the main memory, so that the cache and the main memory update the stored data according to the write operation.

[0084] Corresponding to the above method, the page management unit is further used to: when the page management unit does not hit the first address through the page table entry index, determine the operation type of the data processing request;

[0085] When the data processing request is a read operation, the data processing request is sent to the main memory, feedback data whose size of the main memory is a preset value is obtained, the feedback data is written into the buffer, a mapping relationship between the feedback data in the buffer and the data processing request is established in the page management unit, and the feedback data is fed back to the request unit;

[0086] When the data processing request is a write operation, the data processing request is sent to the main memory, the data is written to the main memory, and then a data read request with a size of a preset value is sent to the main memory, and the feedback data of the memory is written into the cache, and a mapping relationship between the feedback data in the cache and the data processing request is established.

[0087] Corresponding to the above method, the above device further includes:

[0088] A transport engine unit, wherein the transport engine unit is used to implement data interaction between the page management unit and the main memory;

[0089] When sending the data processing request to the main memory, the page management unit is specifically used to:

[0090] The data processing request is sent to the main memory through the transport engine.

[0091] Corresponding to the above method, when the page management unit obtains the feedback data of the main memory and writes the feedback data into the buffer, it is specifically used to:

[0092] The transport engine obtains feedback data whose size is a preset value stored in the main memory, and sends the obtained feedback data to the page table management unit. The page table management unit writes the received feedback data into a cache using a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

[0093] Corresponding to the above method, when the page management unit writes the data written into the memory into the buffer, it is specifically used to:

[0094] A data read request with a preset size is sent to the main memory through a data transfer engine to obtain data to be written into the memory. The data transfer engine sends the read data to a page table management unit. The page table management unit writes the received data read by the data transfer engine into a cache according to a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

[0095] Corresponding to the above method, when establishing a mapping relationship between the storage data of the buffer and the data processing request, the page management unit is specifically used to:

[0096] A mapping relationship between the storage data of the cache and the data processing request is established by inserting or replacing a page table entry PTE, wherein the page table entry PTE stores a mapping relationship between the virtual address of the main memory and the physical address of the cache, wherein the data processing request includes a virtual address.

[0097] Corresponding to the above-mentioned apparatus, the present application further discloses a data processing device, which may include: a main memory, a cache, and the data processing device disclosed in any one of the above-mentioned embodiments of the present application.

[0098] Combining the above methods and devices, the above scheme disclosed in the embodiment of the present application breaks the traditional cache management method of address index and data, separates the address index data separately, and adopts large data blocks and page table management to provide higher hardware resource utilization and higher cache hit rate in the case of continuous linear address access to main memory.

[0099] For the convenience of description, the above system is described as being divided into various modules according to their functions. Of course, when implementing the present invention, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0100] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0101] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0102] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0103] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0104] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A buffer implementation method, characterized in that: include: Obtaining a data processing request sent by a request unit, wherein the data processing request has a first address; When judging through the page table entry index that the page management unit hits the first address, judging the operation type of the data processing request; When the data processing request is a read operation, requesting the buffer to process the data processing request, obtaining response data of the buffer to the data processing request, and sending the response data to the requesting unit; When the data processing request is a write operation, sending the data processing request to the buffer and the main memory, so that the buffer and the main memory update the stored data according to the write operation; Wherein, when the data processing request is a write operation, sending the data processing request to the main memory includes: When the data processing request is a write operation, the data processing request is sent to the main memory through the transport engine.

2. The buffer implementation method according to claim 1, characterized in that: Also includes: When the page management unit does not hit the first address through the page table entry index, determining the operation type of the data processing request; When the data processing request is a read operation, the data processing request is sent to the main memory, feedback data whose size of the main memory is a preset value is obtained, the feedback data is written into the buffer, a mapping relationship between the feedback data in the buffer and the data processing request is established in the page management unit, and the feedback data is fed back to the request unit; When the data processing request is a write operation, the data processing request is sent to the main memory, the data is written to the main memory, and then a data read request with a size of a preset value is sent to the main memory, and the feedback data of the memory is written into the cache, and a mapping relationship between the feedback data in the cache and the data processing request is established.

3. The cache implementation method according to claim 2, characterized in that: Acquiring feedback data from the main memory and writing the feedback data into the buffer comprises: The transport engine obtains feedback data whose size is a preset value stored in the main memory, and sends the obtained feedback data to the page table management unit. The page table management unit writes the received feedback data into a cache using a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

4. The buffer implementation method according to claim 2, characterized in that: Writing the data written into the memory into the buffer comprises: A data read request with a preset size is sent to the main memory through a data transfer engine to obtain data to be written into the memory. The data transfer engine sends the read data to a page table management unit. The page table management unit writes the received data read by the data transfer engine into a cache according to a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

5. The cache implementation method according to any one of claims 3 or 4, characterized in that: The establishing of a mapping relationship between the storage data of the buffer and the data processing request comprises: A mapping relationship between the storage data of the cache and the data processing request is established by inserting or replacing a page table entry PTE, wherein the page table entry PTE stores a mapping relationship between the virtual address of the main memory and the physical address of the cache, wherein the data processing request includes a virtual address.

6. A cache implementation device, characterized in that: include: A request collection unit, configured to obtain a data processing request sent by the request unit, wherein the data request has a first address, and send the data processing request to the page management unit; A page management unit, which determines whether the acquired data processing request is hit by indexing the page management unit through a page table entry, and when the page management unit hits the first address, determines the operation type of the data processing request; When the data processing request is a read operation, request the cache to process the data processing request, obtain response data of the cache to the data processing request, and send the response data to the request unit; when the data processing request is a write operation, send the data processing request to the cache and the main memory, so that the cache and the main memory update the storage data according to the write operation; A transport engine unit, wherein the transport engine unit is used to implement data interaction between the page management unit and the main memory; When sending the data processing request to the main memory, the page management unit is specifically used to: The data processing request is sent to the main memory through the transport engine.

7. The cache implementation device according to claim 6, characterized in that: Also includes: The page management unit is further used to: determine the operation type of the data processing request when the page management unit does not hit the first address through the page table entry index; When the data processing request is a read operation, the data processing request is sent to the main memory, feedback data whose size of the main memory is a preset value is obtained, the feedback data is written into the buffer, a mapping relationship between the feedback data in the buffer and the data processing request is established in the page management unit, and the feedback data is fed back to the request unit; When the data processing request is a write operation, the data processing request is sent to the main memory, the data is written to the main memory, and then a data read request with a size of a preset value is sent to the main memory, and the feedback data of the memory is written into the cache, and a mapping relationship between the feedback data in the cache and the data processing request is established.

8. The cache implementation device according to claim 7, characterized in that: When the page management unit obtains the feedback data of the main memory and writes the feedback data into the buffer, it is specifically used to: The transport engine obtains feedback data whose size is a preset value stored in the main memory, and sends the obtained feedback data to the page table management unit. The page table management unit writes the received feedback data into a cache using a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

9. The cache implementation device according to claim 7, characterized in that: When the page management unit writes the data written into the memory into the buffer, it is specifically used to: A data read request with a preset size is sent to the main memory through a data transfer engine to obtain data to be written into the memory. The data transfer engine sends the read data to a page table management unit. The page table management unit writes the received data read by the data transfer engine into a cache according to a physical address obtained through a page replacement algorithm, and establishes a mapping relationship between the storage data of the cache and the data processing request in the page table management unit.

10. The cache implementation device according to any one of claims 8 or 9, characterized in that: When establishing a mapping relationship between the storage data of the buffer and the data processing request, the page management unit is specifically used to: A mapping relationship between the storage data of the cache and the data processing request is established by inserting or replacing a page table entry PTE, wherein the page table entry PTE stores a mapping relationship between the virtual address of the main memory and the physical address of the cache, wherein the data processing request includes a virtual address.