Data pre-storage method and system, storage medium and accelerator

By mounting an accelerator on the system bus and using a high-speed interconnect protocol to support cache consistency and pre-store data, the contradiction between cache hit rate and processor performance is solved, achieving high hit rate and low CPU burden.

CN118535489APending Publication Date: 2024-08-23INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410702690.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

While the existing technology improves the cache hit rate, it affects the processor performance. Especially when the prediction results are inaccurate, the CPU performance will decrease.

Method used

By mounting an accelerator on the system bus, using a high-speed interconnect protocol to support cache coherence, and reading data from memory under preset conditions and storing it in the processor cache, the processor avoids additional cache operations.

Benefits of technology

It improves the cache hit rate while ensuring processor performance and avoiding the impact of cache operations on CPU performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535489A
    Figure CN118535489A
Patent Text Reader

Abstract

The invention discloses a data pre-storage method and system, a storage medium and an accelerator, which are applied to the technical field of storage and applied to a preset accelerator, and the accelerator is mounted on a system bus by using a preset high-speed interconnection protocol and supports an input / output sub-protocol and a cache sub-protocol; comprising the following steps: receiving and storing a first pre-cache address and a trigger rule thereof sent by a first program; when it is determined that a triggering rule is established by monitoring the system bus, data pointed by the first pre-cache address is read from the memory and stored in a cache of the processor, and the cache consistency of the storage system is maintained based on communication between a high-speed interconnection protocol and a device on the system bus; and deleting the stored first pre-cache address and the trigger rule thereof. By applying the scheme of the invention, the cache consistency is maintained by utilizing the specially arranged accelerator and using the high-speed interconnection protocol, the cache hit rate is improved, and the performance of the processor can be ensured at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a data pre-storage method, system, storage medium and accelerator. Background Art

[0002] Cache Memory is also called Cache. It is an important part of the storage system and stores instructions and data frequently used by programs. Figure 1 , is a schematic diagram of a multi-level cache architecture. Fast and slow are relative concepts. Figure 1 Compared with L1 (first level cache), L2 (second level cache), and L3 (third level cache) in the disk I / O (Input / Output) system, DDR memory is a slow device, while in the disk I / O (Input / Output) system, DDR memory is a fast device. Therefore, in the disk I / O system, DDR memory is still used as the cache of the magnetic media.

[0003] The cache hit rate is a key indicator of CPU (Central Processing Unit) performance. Since each level of cache is faster than the next level of cache, L3 is also called LLC (Last Level Cache), which is faster than the memory. Therefore, when the CPU needs to access a piece of data or instruction, it first checks the closest level of cache L1. If the data exists, the cache hits. If it does not hit, it continues to query the next level of cache, and so on. The proportion of cache misses will affect CPU performance, especially when the last level cache misses, the damage to performance is particularly serious, because at this time, data can only be retrieved from the memory, and the system's memory bandwidth is limited. Retrieving data from the memory will occupy the memory bandwidth. Therefore, if the LLC miss rate is very high, it will occupy a higher memory bandwidth, resulting in increased memory read and write latency.

[0004] In this regard, one current solution is to predict and take out the data that may be read in the future in advance and put it into the cache, thereby improving the cache hit rate. This is a strategy of "trading space for time" because the price paid is the occupation of cache space. However, the higher the frequency of using the CPU to perform such operations, the more additional execution cycles the CPU needs to spend to perform related cache operations, and the CPU also needs to maintain cache consistency. Therefore, such a solution will also affect the CPU performance to a certain extent, especially when the prediction results are not particularly accurate, the overall performance of the CPU will decrease due to the use of such operations.

[0005] In summary, how to effectively improve the cache hit rate and ensure processor performance is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0006] The purpose of the present invention is to provide a data pre-storage method, system, storage medium and accelerator to effectively improve the hit rate of the cache and ensure processor performance.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0008] In a first aspect, the present invention provides a data pre-storage method, which is applied to a preset accelerator, wherein the accelerator is mounted on a system bus using a preset high-speed interconnection protocol, and the accelerator at least supports an input / output sub-protocol and a cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate a processor cache; the data pre-storage method comprises:

[0009] receiving a first pre-cache address and a triggering rule of the first pre-cache address sent by a first program and storing both;

[0010] When it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, reading the data pointed to by the first pre-cache address from the memory;

[0011] storing the data pointed to by the first pre-cache address read from the memory into the cache of the processor, and maintaining cache consistency of the storage system based on the communication with the device on the system bus based on the high-speed interconnect protocol;

[0012] The stored first pre-cache address and the triggering rule of the first pre-cache address are deleted.

[0013] On the other hand, the triggering rule of the first pre-cache address includes: a task pointing to the first target address appears in the system bus;

[0014] Correspondingly, when it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, reading the data pointed to by the first pre-cache address from the memory includes:

[0015] Monitoring the system bus and determining whether a task pointing to the first target address appears;

[0016] If yes, it is determined that the triggering rule of the first pre-cache address holds, and the data pointed to by the first pre-cache address is read from the memory.

[0017] On the other hand, the triggering rule of the first pre-cache address includes: a task pointing to the second target address and a task pointing to the third target address appear in the system bus successively;

[0018] The data pre-storage method further comprises:

[0019] receiving a first length corresponding to the first pre-cache address sent by the first program;

[0020] Correspondingly, when it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, reading the data pointed to by the first pre-cache address from the memory includes:

[0021] The system bus is monitored, and it is determined whether a task pointing to the second target address and a task pointing to the third target address appear successively;

[0022] If yes, it is determined that the triggering rule of the first pre-cache address holds, and a segment of data with continuous addresses and a total length equal to the first length is read from the memory, and the starting address of the read data is the first pre-cache address.

[0023] On the other hand, the triggering rule of the first pre-cache address includes: after the first pre-cache address is sent to the accelerator, the cumulative value of the number of tasks appearing in the system bus reaches a preset number threshold;

[0024] Correspondingly, when it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, reading the data pointed to by the first pre-cache address from the memory includes:

[0025] After receiving the first pre-cache address, when the cumulative value of the number of tasks appearing in the system bus reaches a preset number threshold, it is determined that the triggering rule of the first pre-cache address is established, and the data pointed to by the first pre-cache address is read from the memory.

[0026] On the other hand, it also includes:

[0027] After receiving and storing a first pre-cache address and a triggering rule of the first pre-cache address sent by a first program, adding a first tag to the first pre-cache address;

[0028] Wherein, the first tag represents a program priority pre-set for the first program;

[0029] receiving a second pre-cache address and a triggering rule of the second pre-cache address sent by a second program and storing both;

[0030] Determining whether the second pre-cache address is consistent with the first pre-cache address;

[0031] If they are consistent, merging the second pre-cache address with the first pre-cache address so that when any one of the triggering rules of the first pre-cache address and the triggering rule of the second pre-cache address is established, the data pointed to by the first pre-cache address is read from the memory;

[0032] If they are inconsistent, adding a second tag to the second pre-cache address;

[0033] Wherein, the second tag represents a program priority pre-set for the second program;

[0034] When the triggering rule of the first pre-cache address and the triggering rule of the second pre-cache address are both in a valid state, the execution order of the first pre-cache address and the second pre-cache address is determined based on the first tag of the first pre-cache address and the second tag of the second pre-cache address.

[0035] On the other hand, it also includes:

[0036] By monitoring the system bus, regular statistics are performed on the addresses pointed to by the tasks in the system bus to obtain regular statistical results;

[0037] When the task status in the system bus conforms to the regular statistical result, the corresponding data is read from the memory based on the regular statistical result and stored in the cache of the processor, and the cache consistency of the storage system is maintained based on the communication with the devices on the system bus based on the high-speed interconnection protocol.

[0038] On the other hand, it also includes:

[0039] Storing a pre-established first rule list;

[0040] When an address of the first type pointing to the first regular list appears in the system bus, each second type of address bound to the first type of address is determined based on the first regular list, and the data pointed to by each of the determined second type of addresses is read from the memory and stored in the cache of the processor, and based on the communication between the high-speed interconnection protocol and the devices on the system bus, the cache consistency of the storage system is maintained.

[0041] In a second aspect, the present invention provides a data pre-storage system, which is applied to a preset accelerator, wherein the accelerator is mounted on a system bus using a preset high-speed interconnection protocol, and the accelerator at least supports an input / output sub-protocol and a cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate a processor cache; the data pre-storage system comprises:

[0042] A data receiving module, used for receiving and storing a first pre-cache address and a triggering rule of the first pre-cache address sent by a first program;

[0043] a reading module, configured to read the data pointed to by the first pre-cache address from a memory when it is determined through monitoring of the system bus that the triggering rule of the first pre-cache address is established;

[0044] a data storage module, configured to store the data pointed to by the first pre-cache address read from the memory into the cache of the processor, and to maintain cache consistency of the storage system based on the communication between the high-speed interconnection protocol and the device on the system bus;

[0045] A deleting module is used to delete the stored first pre-cache address and the triggering rule of the first pre-cache address.

[0046] In a third aspect, the present invention provides an accelerator, the accelerator is mounted on a system bus using a preset high-speed interconnection protocol, and the accelerator at least supports an input and output sub-protocol and a cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate a processor cache, the accelerator comprising:

[0047] Memory for storing computer programs;

[0048] A processor is used to execute the computer program to implement the steps of the data pre-storage method as described above.

[0049] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the data pre-storage method as described above are implemented.

[0050] The present application takes into account that, in the traditional solution, the CPU is connected to peripheral devices based on the PCIE protocol, which requires the CPU to consume additional execution cycles to perform related cache operations to pre-place data into the cache, and the CPU also needs to maintain cache consistency, thus affecting the CPU performance.

[0051] In the solution of this application, considering that the high-speed interconnection protocol can support the realization of cache consistency, an accelerator is specially set up. The accelerator is mounted on the system bus using a preset high-speed interconnection protocol, and the accelerator is used to realize the pre-storage of data without the processor consuming additional execution cycles to perform related cache operations, so that the processor performance can be guaranteed.

[0052] Specifically, since the accelerator needs to implement relevant cache operations, based on the provisions of the high-speed interconnection protocol, the accelerator needs to at least support the input and output sub-protocol and cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate the processor cache. The accelerator can receive the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program and store them. When the triggering rule of the first pre-cache address is determined to be established through monitoring the system bus, it means that the data corresponding to the first pre-cache address will be used by the first program. Therefore, the accelerator can read the data pointed to by the first pre-cache address from the memory and store it in the processor's cache. After that, the first pre-cache address and the triggering rule of the first pre-cache address that were previously stored can be deleted. And the processor can maintain the cache consistency of the storage system based on the communication between the high-speed interconnection protocol and the devices on the system bus.

[0053] To summarize, the present application utilizes a specially configured accelerator, uses a high-speed interconnection protocol to maintain cache consistency, and pre-stores the data required by the first program into the processor cache, thereby maintaining cache consistency, improving the cache hit rate, and ensuring processor performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 A schematic diagram of a cache architecture of a multi-level cache;

[0056] Figure 2 A flowchart of a data pre-storage method according to a specific embodiment of the present invention;

[0057] Figure 3 This is a schematic diagram of an accelerator mounted on a system bus using the CXL protocol in a specific implementation manner of the present invention;

[0058] Figure 4 Schematic diagram of three peripheral devices using the CXL protocol;

[0059] Figure 5 A schematic diagram of the structure of a data pre-storage system provided by a specific implementation mode of the present invention;

[0060] Figure 6 A schematic diagram of the structure of an accelerator provided in a specific embodiment of the present invention;

[0061] Figure 7 The present invention is a schematic diagram of the structure of a computer-readable storage medium. DETAILED DESCRIPTION

[0062] The core of the present invention is to provide a data pre-storage method, system, storage medium and accelerator, which utilize a specially configured accelerator, use a high-speed interconnection protocol to maintain cache consistency, and pre-store the data required by the first program in the processor cache, so that while maintaining cache consistency and improving the cache hit rate, the processor performance can also be guaranteed.

[0063] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0064] Please refer to Figure 2 , Figure 2 The data pre-storage method of the present invention is implemented as a flowchart of a specific embodiment of the present invention. The data pre-storage method of the present invention is applied to a preset accelerator, which is mounted on a system bus using a preset high-speed interconnection protocol, for example Figure 3 In the example, the accelerator is mounted on the system bus through switch 1, and it can be understood that the Figure 3 Switch 1 and switch 2 in the example should also be switches using a high-speed interconnect protocol.

[0065] The data pre-storage method may include the following steps:

[0066] Step S101: receiving a first pre-cache address and a triggering rule of the first pre-cache address sent by a first program and storing both.

[0067] The high-speed interconnection protocol described in this application is also the CXL (Compute Express Link) protocol. The CXL protocol serves as the interconnection communication between the CPU and the accelerator (such as FPGA / GPU). Therefore, the accelerator in the solution of this application can usually be implemented using hardware such as FPGA.

[0068] In traditional solutions, the CPU has always been connected to related devices through the PCIe slot on the motherboard and the PCIe protocol. The CXL protocol is a new standard for ultra-high-speed interconnection that can solve the current problems of high latency and insufficient bandwidth of the PCIe protocol.

[0069] The CXL protocol specification consists of three independent protocols: CXL.io, the input and output subprotocol, CXL.cache, the cache subprotocol, and CXL.memory, the memory subprotocol.

[0070] CXL.io is used to provide management of underlying transmission channels and devices. It is based on PCIe 5.0 and combines some improved functions. CXL.io is similar to PCIe events and is mainly used for initialization, linking, device discovery, enumeration, and register access. To some extent, it can be regarded as a variant of PCIe events.

[0071] CXL.cache provides peripheral devices with the ability to read and write host memory, allowing peripheral devices to use the host's main RAM (Random Access Memory), which means that peripheral devices can directly access the host's RAM and, based on CXL.cache, can also maintain data consistency with the CPU's cache.

[0072] CXL.memory provides the host CPU with the function of reading and writing the memory of the peripheral device, including volatile and non-volatile memory, in a consistent cache manner.

[0073] The three sub-protocols can operate independently or in combination. Based on these three sub-protocols, three different types of devices are derived. Among them, CXL.io is the protocol required by all device types because it includes the device enumeration process so that it can be identified and communicated. The other two protocols can be combined to produce specific functions.

[0074] See also Figure 4 , which is a schematic diagram of the morphology of three peripheral devices using the CXL protocol.

[0075] For form 1, it can be applied to peripheral devices that do not have independent memory and need to use the CPU memory using the CXL protocol. For example, in one scenario, the peripheral devices of form 1 usually support the CXL.io sub-protocol and the CXL.cache sub-protocol.

[0076] For form 2, it can be applied to peripheral devices that have high-performance memory. The CXL protocol is used to allow the CPU and peripheral devices to read and write each other's memory, and dynamically adjust the memory resource allocation between the two. For example, in one scenario, form 2 peripheral devices usually support CXL.io subprotocol, CXL.cache subprotocol and CXL.memory subprotocol.

[0077] For form 3, it can be applied to memory expansion cards containing DRAM or SCM memory, and the CXL protocol can be used to allow the CPU to read and write memory resources on the expansion card, thereby increasing the CPU's memory capacity and bandwidth. For example, in one scenario, form 3 peripheral devices usually support the CXL.io sub-protocol and the CXL.memory sub-protocol.

[0078] Therefore, in the solution of the present application, in order to support the accelerator to operate the processor cache and ensure cache consistency, the accelerator needs to support at least the input and output sub-protocol and the cache sub-protocol of the high-speed interconnect protocol. For example, the accelerator can be set in the form of a peripheral device of form 1 in the above example, or in the form of a peripheral device of form 2 in the above example.

[0079] When implementing data pre-storage, the accelerator may receive the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program and store both.

[0080] It is understandable that the first program can be any preset program. The first pre-cache address is an address sent by the first program, which means that the first program believes that the data in this address will be used in the near future and needs to be read into the cache in advance, so that when the data in this address is really needed in the future, the data can be directly obtained from the cache, which can effectively reduce the acquisition time and improve the cache hit rate. Therefore, this address is called the first pre-cache address, indicating that the corresponding data in this address will be pre-placed in the processor cache.

[0081] It can also be understood that in actual applications, as the first program continues to run, the first program will continuously issue different pre-cache addresses and their corresponding triggering rules. This application uses the processing process of any one of the pre-cache addresses as an example to illustrate, that is, the first pre-cache address can be any pre-cache address issued by the first program.

[0082] After the accelerator receives the first pre-cache address sent by the first program, it does not immediately read the data pointed to by the first pre-cache address from the memory and store it in the processor's cache. This is because the processor's cache space is limited. In order to achieve the best effect, the data pointed to by the first pre-cache address should be stored in the processor's cache several instructions before the data pointed to by the first pre-cache address is about to be read or written. If the data pointed to by the first pre-cache address is stored in the processor's cache too early, since other devices in the system will also read and write the cache, the data pointed to by the first pre-cache address may be replaced by other devices after being stored in the processor's cache, thereby failing to achieve the effect of data pre-storage.

[0083] Therefore, the first program not only sends the first pre-cache address, but also needs to send the triggering rule of the first pre-cache address. The triggering rule of the first pre-cache address indicates when the data pointed to by the first pre-cache address should be stored in the processor's cache.

[0084] It should be noted that, in addition to L1 / L2 / L3Cache, various levels of TLB (Translation Lookaside Buffer) used for virtual-to-real address conversion, MOB (Memory Ordering Buffers), RegisterFile and BTB in the instruction pipeline, etc. are also a kind of Cache. The cache in this application is a cache in a narrow sense, specifically referring to the L1 / L2 / L3 Cache of the pipeline and memory, that is, the cache of the processor described in this application.

[0085] Step S102: when it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, the data pointed to by the first pre-cache address is read from the memory.

[0086] The accelerator monitors the system bus. If it determines that the trigger rule of the first pre-cache address is established, it means that it is a suitable time to read the data pointed to by the first pre-cache address from the memory and store it in the processor's cache. Therefore, the data pointed to by the first pre-cache address can be read from the memory.

[0087] The specific content of the trigger rule can be set and adjusted according to actual needs, and can effectively reflect that it is a suitable time to store the data pointed to by the first pre-cache address into the cache of the processor.

[0088] Step S103: storing the data pointed to by the first pre-cache address read from the memory into the cache of the processor, and maintaining the cache consistency of the storage system based on the communication with the device on the system bus based on the high-speed interconnection protocol.

[0089] After the triggering rule of the first pre-cache address is established, the accelerator can store the data pointed to by the first pre-cache address read from the memory into the cache of the processor. Of course, the specific level of cache to be placed can be set according to the actual needs. The application will not elaborate on this. In addition, it should be pointed out that the above Figure 1 The example is only used to illustrate the multi-level cache of the processor. In other implementations, the processor may have other forms of multi-level cache, which does not affect the implementation of the present invention. For example, in some cases, a fourth-level cache L4 is set at the next level of L3.

[0090] It should also be noted that, due to the cache operation, the accelerator needs to communicate with the devices on the system bus based on the CXL protocol to maintain the cache consistency of the storage system.

[0091] Cache consistency, also known as cache consistency, refers to a mechanism that ensures that the data in the cache memory is the same as the data in the main memory in a hierarchical storage system. In a storage system, when many different devices share a common memory resource, problems will arise if the data in the cache is inconsistent. This problem is particularly prone to occur in a multi-processor system with several CPUs, that is, a cache consistency mechanism is set, usually in the case of a multi-core processor, such as the above Figure 1 The system is a dual-core processor.

[0092] The CXL protocol has the function of ensuring cache consistency. That is, the present application uses an accelerator that adopts the CXL protocol to replace the CPU in the traditional solution to perform related cache operations to ensure cache consistency. This is equivalent to removing the CPU's function of maintaining cache consistency, so that the CPU no longer needs to spend extra execution cycles to execute related cache instruction operations, and only needs to focus on executing application software or operating system, thereby improving the overall performance of CPU and system execution.

[0093] Step S104: deleting the stored first pre-cache address and the triggering rule of the first pre-cache address.

[0094] After the data pointed to by the first pre-cache address read from the memory is stored in the processor cache, the stored first pre-cache address and the triggering rule of the first pre-cache address can be deleted to avoid the situation of continuously storing duplicate data in the processor cache.

[0095] In a specific embodiment of the present invention, it may also include:

[0096] After receiving the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program and storing them, a life cycle of the first pre-cache address is set for the first pre-cache address. When the life cycle of the first pre-cache address is reduced to 0 and the first pre-cache address is still stored in the accelerator, the accelerator will actively delete the first pre-cache address and the triggering rule of the first pre-cache address.

[0097] This implementation method takes into account that after receiving the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program and storing them, the triggering rule of the first pre-cache address may not be established. It can be understood that the data pointed to by the first pre-cache address should theoretically be needed to be used by the first program soon. If the triggering rule of the first pre-cache address is not satisfied for a long time, the data pointed to by the first pre-cache address may have been read from the memory to the cache by the CPU, or the first program has not used the first pre-cache address, because it means that if the life cycle of the first pre-cache address is reduced to 0, it is no longer meaningful to read the data pointed to by the first pre-cache address to the cache, and in order to avoid the first pre-cache address and the triggering rule of the first pre-cache address from occupying the storage space of the accelerator for a long time, in this implementation method, a life cycle is set for the first pre-cache address, so that after a certain period of time, the accelerator can automatically delete the pre-cache address and its triggering rule that have not been processed for a long time.

[0098] In a specific implementation of the present invention, the triggering rule of the first pre-cache address may include: a task pointing to the first target address appears in the system bus;

[0099] Accordingly, step S102 may specifically include:

[0100] Monitor the system bus and determine whether a task pointing to the first target address appears;

[0101] If yes, it is determined that the triggering rule of the first pre-cache address holds, and the data pointed to by the first pre-cache address is read from the memory.

[0102] This implementation takes into account that, in some cases, the data content read and written by the first program exists in the following situation: A—XXX—B, where A here means that the first program reads and writes the data content in address A, and B here means that the first program reads and writes the data content in address B, and XXX represents the intermediate link between the two events, that is, the first program reads and writes the data content in several other addresses, and there may not be any regularity.

[0103] Therefore, it can be seen that in such a situation, after the first program reads and writes the data content in address A, there is a high probability that it will need to read and write the data content in address B in a short period of time. Therefore, for such a situation, address A in this example can be used as the first target address, and address B in this example can be used as the first pre-cache address. If the accelerator detects the emergence of a task pointing to the first target address, it means that there is a high probability that the first program currently needs to read and write the data content in address A. Therefore, it can be determined that the trigger rule of the first pre-cache address is established, and the data pointed to by the first pre-cache address is read from the memory and then stored in the processor cache, that is, the data in address B is read from the memory and stored in the processor cache, so that when the first program wants to read and write the data content in address B later, it will hit the cache without the need for the CPU to access the memory.

[0104] In a specific implementation of the present invention, the triggering rule of the first pre-cache address includes: a task pointing to the second target address and a task pointing to the third target address appear in the system bus successively;

[0105] The data pre-storage method also includes:

[0106] receiving a first length corresponding to a first pre-cache address sent by a first program;

[0107] Accordingly, step S102 may specifically include:

[0108] The system bus is monitored to determine whether a task pointing to the second target address and a task pointing to the third target address appear successively;

[0109] If yes, it is determined that the triggering rule of the first pre-cache address is established, and a segment of data with continuous addresses and a total length equal to the first length is read from the memory, and the starting address of the read data is the first pre-cache address.

[0110] This implementation takes into account that in some cases, the first program will read and write a segment of data with a continuous address. In this regard, after the accelerator receives the first pre-cache address and its triggering rule, if it detects that a task pointing to the second target address and a task pointing to the third target address appear successively, it indicates that there is a high probability that the first program has started reading and writing a segment of data with a continuous address.

[0111] In this regard, in this implementation, it can be determined that the triggering rule of the first pre-cache address is established, and a segment of data with a continuous address and a total length equal to the first length is read from the memory, and the starting address of the read data is the first pre-cache address. In addition, it can be understood that in this implementation, the first program is required to send the first length corresponding to the first pre-cache address to the accelerator.

[0112] In a specific embodiment of the present invention, the triggering rule of the first pre-cache address includes: after the first pre-cache address is sent to the accelerator, the cumulative value of the number of tasks appearing in the system bus reaches a preset number threshold;

[0113] Accordingly, step S102 may specifically include:

[0114] After receiving the first pre-cache address, when the cumulative value of the number of tasks appearing in the system bus reaches a preset number threshold, it is determined that the triggering rule of the first pre-cache address is established, and the data pointed to by the first pre-cache address is read from the memory.

[0115] This implementation method takes into account that in some cases, the first program will use some prediction methods to determine that in the short future period, there is a high probability that data at a certain address will need to be read and written, but there is no obvious sign that read / write address A exists before read / write address B as in the previous implementation method.

[0116] In this regard, in this implementation, after receiving the first pre-cache address, the accelerator can count the number of tasks appearing in the system bus. If the cumulative value reaches a preset quantity threshold, it means that the first pre-cache address has been received for a certain period of time, and the data pointed to by the first pre-cache address is likely to be used by the first program. Therefore, it can be determined at this time that the trigger rule of the first pre-cache address is established, and the data pointed to by the first pre-cache address is read from the memory.

[0117] In a specific embodiment of the present invention, it may also include:

[0118] After receiving and storing the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program, adding a first tag to the first pre-cache address;

[0119] The first label indicates the program priority pre-set for the first program;

[0120] receiving a second pre-cache address and a triggering rule of the second pre-cache address sent by a second program and storing both;

[0121] Determining whether the second pre-cache address is consistent with the first pre-cache address;

[0122] If they are consistent, the second pre-cache address is merged with the first pre-cache address, so that when any one of the triggering rule of the first pre-cache address and the triggering rule of the second pre-cache address is established, the data pointed to by the first pre-cache address is read from the memory;

[0123] If they are inconsistent, adding a second tag to the second pre-cache address;

[0124] The second label indicates the program priority pre-set for the second program;

[0125] When the triggering rule of the first pre-cache address and the triggering rule of the second pre-cache address are both established, the execution order of the first pre-cache address and the second pre-cache address is determined based on the first tag of the first pre-cache address and the second tag of the second pre-cache address.

[0126] In the above implementation, the processing of a single pre-cache address issued by a single program is taken as an example for explanation, but it can be understood that in actual applications, there may be a demand for data pre-storage for different programs.

[0127] In this regard, in this implementation, for the pre-cache addresses sent by different programs, the priorities will be differentiated according to the program sources, that is, after receiving and storing the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program, a first label will be added to the first pre-cache address, and the first label indicates the program priority pre-set for the first program. Correspondingly, after receiving and storing the second pre-cache address and the triggering rule of the second pre-cache address sent by the second program, a second label can be added to the second pre-cache address, and the second label indicates the program priority pre-set for the second program.

[0128] In addition, it can be understood that since different programs are supported to issue pre-cache addresses, there may be duplicate pre-cache addresses. In this regard, the present application supports address merging, that is, in this implementation, it can be determined whether the second pre-cache address is consistent with the first pre-cache address. If they are consistent, they can be merged, which means that when any one of the triggering rules of the first pre-cache address and the triggering rules of the second pre-cache address is established, the data pointed to by this pre-cache address can be read from the memory.

[0129] In addition, it can be understood that here two pre-cache addresses are taken as an example to determine whether the two are consistent. In other implementations, when more programs send pre-cache addresses to the accelerator, the accelerator can also merge the same pre-cache addresses.

[0130] Since this implementation method sets a priority, when the second pre-cache address is inconsistent with the first pre-cache address and does not need to be merged, if the triggering rules of the first pre-cache address and the second pre-cache address are both established, it is necessary to determine the execution order of the first pre-cache address and the second pre-cache address based on the first label of the first pre-cache address and the second label of the second pre-cache address, that is, the one with higher priority will be executed first. Of course, which specific programs have higher priority can be set and adjusted according to actual needs, and it does not affect the implementation of the present invention. For example, for more important programs, their program priority should be higher.

[0131] In a specific embodiment of the present invention, it may also include:

[0132] By monitoring the system bus, regular statistics are performed on the addresses pointed to by the tasks in the system bus to obtain regular statistical results;

[0133] When the task status in the system bus conforms to the regular statistical results, the corresponding data is read from the memory based on the regular statistical results and stored in the processor's cache, and the cache consistency of the storage system is maintained based on the communication with the devices on the system bus based on the high-speed interconnection protocol.

[0134] This implementation takes into account that there are certain limitations in the program actively informing the accelerator of the addresses to be read and written in the future. On the one hand, the prediction function of the program may not be well configured. On the other hand, in some occasions and at some time periods, the reading and writing of related addresses by different programs may also show a certain regularity, which provides an opportunity to further improve the cache hit rate.

[0135] In this regard, in this implementation, the accelerator is supported to actively perform regular statistics on the addresses pointed to by the tasks in the system bus to obtain regular statistical results, so as to further improve the cache hit rate.

[0136] For example, in one case, in a certain period of time, the address pointed to by the task in the system bus has the situation of address C-address D-address E-address F for many times. After the accelerator obtains the statistical result of this rule, when it is found that the address pointed to by the task in the system bus is address C, it is determined that the task state in the system bus conforms to the statistical result of this rule, and then according to this statistical result of this rule, the data in address C, address D, address E and address F are read from the memory and stored in the processor cache. Of course, it is also necessary to communicate with the devices on the system bus based on the high-speed interconnection protocol to maintain the cache consistency of the storage system.

[0137] It can be understood that the above examples are used to illustrate the regular statistical results. In other implementations, there may be other regular statistical methods and corresponding regular statistical results, which can be set according to actual needs. For example, in some cases, if the accelerator uses hardware with sufficient computing resources such as a GPU, the accelerator can perform regular statistics on the addresses pointed to by tasks in the system bus based on a deep learning model to obtain deeper and more accurate regular statistical results.

[0138] In a specific embodiment of the present invention, it may also include:

[0139] Storing a pre-established first rule list;

[0140] When an address of the first type pointing to a first regular list appears in the system bus, each second type of address bound to the first type of address is determined based on the first regular list, and the data pointed to by each of the determined second type of addresses is read from the memory and stored in the processor's cache, and based on the high-speed interconnection protocol, the cache consistency of the storage system is maintained by communicating with the devices on the system bus.

[0141] In this implementation, the accelerator can store a pre-established first rule list, which reflects the association between different addresses. For example, it can be the first rule list obtained after the staff uses the relevant model to analyze the task rules in the system bus. Of course, the first rule list can also be supplemented and adjusted based on work experience.

[0142] For each first type of address in the first rule list, there is one or more second type of addresses bound to it, which means that according to the rule analysis, when a read / write task pointing to a first type of address appears, in the short future time, for each second type of address bound to the first type of address in the first rule list, there is a certain probability that read / write tasks pointing to these addresses will appear. Therefore, in this implementation, when a first type of address pointing to the first rule list appears in the system bus, the accelerator needs to determine each second type of address bound to the first type of address based on the first rule list, and then store all the data pointed to by these addresses in the processor's cache to improve the cache hit rate. Of course, it is also necessary to maintain the cache consistency of the storage system based on the communication between the high-speed interconnection protocol and the devices on the system bus.

[0143] The present application takes into account that, in the traditional solution, the CPU is connected to peripheral devices based on the PCIE protocol, which requires the CPU to consume additional execution cycles to perform related cache operations to pre-place data into the cache, and the CPU also needs to maintain cache consistency, thus affecting the CPU performance.

[0144] In the solution of this application, considering that the high-speed interconnection protocol can support the realization of cache consistency, an accelerator is specially set up. The accelerator is mounted on the system bus using a preset high-speed interconnection protocol, and the accelerator is used to realize the pre-storage of data without the processor consuming additional execution cycles to perform related cache operations, so that the processor performance can be guaranteed.

[0145] Specifically, since the accelerator needs to implement relevant cache operations, based on the provisions of the high-speed interconnection protocol, the accelerator needs to at least support the input and output sub-protocol and cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate the processor cache. The accelerator can receive the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program and store them. When the triggering rule of the first pre-cache address is determined to be established through monitoring the system bus, it means that the data corresponding to the first pre-cache address will be used by the first program. Therefore, the accelerator can read the data pointed to by the first pre-cache address from the memory and store it in the processor's cache. After that, the first pre-cache address and the triggering rule of the first pre-cache address that were previously stored can be deleted. And the processor can maintain the cache consistency of the storage system based on the communication between the high-speed interconnection protocol and the devices on the system bus.

[0146] To summarize, the present application utilizes a specially configured accelerator, uses a high-speed interconnection protocol to maintain cache consistency, and pre-stores the data required by the first program into the processor cache, thereby maintaining cache consistency, improving the cache hit rate, and ensuring processor performance.

[0147] Corresponding to the above method embodiment, an embodiment of the present invention further provides a data pre-storage system, which can be referred to in correspondence with the above.

[0148] See also Figure 5 As shown, it is a structural schematic diagram of a data pre-storage system in the present invention, which is applied to a preset accelerator, the accelerator is mounted on the system bus using a preset high-speed interconnection protocol, and the accelerator at least supports the input and output sub-protocol and the cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate the processor cache; the data pre-storage system includes:

[0149] The data receiving module 501 is used to receive and store the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program;

[0150] The reading module 502 is used to read the data pointed to by the first pre-cache address from the memory when it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established;

[0151] The data storage module 503 is used to store the data pointed to by the first pre-cache address read from the memory into the cache of the processor, and maintain the cache consistency of the storage system based on the communication with the device on the system bus based on the high-speed interconnection protocol;

[0152] The deleting module 504 is configured to delete the stored first pre-cache address and the triggering rule of the first pre-cache address.

[0153] In one embodiment of the present invention, the triggering rule of the first pre-cache address includes: a task pointing to the first target address appears in the system bus;

[0154] Accordingly, the reading module 502 is specifically used for:

[0155] Monitor the system bus and determine whether a task pointing to the first target address appears;

[0156] If yes, it is determined that the triggering rule of the first pre-cache address holds, and the data pointed to by the first pre-cache address is read from the memory.

[0157] In one embodiment of the present invention, the triggering rule of the first pre-cache address includes: a task pointing to the second target address and a task pointing to the third target address appear in the system bus successively;

[0158] The data receiving module 501 is also used for:

[0159] receiving a first length corresponding to a first pre-cache address sent by a first program;

[0160] Accordingly, the reading module 502 is specifically used for:

[0161] The system bus is monitored, and it is determined whether a task pointing to the second target address and a task pointing to the third target address appear successively;

[0162] If yes, it is determined that the triggering rule of the first pre-cache address is established, and a segment of data with continuous addresses and a total length equal to the first length is read from the memory, and the starting address of the read data is the first pre-cache address.

[0163] In one embodiment of the present invention, the triggering rule of the first pre-cache address includes: after the first pre-cache address is sent to the accelerator, the cumulative value of the number of tasks appearing in the system bus reaches a preset number threshold;

[0164] Accordingly, the reading module 502 is specifically used for:

[0165] After receiving the first pre-cache address, when the cumulative value of the number of tasks appearing in the system bus reaches a preset number threshold, it is determined that the triggering rule of the first pre-cache address is established, and the data pointed to by the first pre-cache address is read from the memory.

[0166] In one embodiment of the present invention, a label adding module is further included, which is used to:

[0167] After receiving and storing the first pre-cache address and the triggering rule of the first pre-cache address sent by the first program, adding a first tag to the first pre-cache address;

[0168] The first label indicates the program priority pre-set for the first program;

[0169] The data receiving module 501 is also used to: receive the second pre-cache address and the triggering rule of the second pre-cache address sent by the second program and store them;

[0170] It also includes a merging processing module, which is used to determine whether the second pre-cache address is consistent with the first pre-cache address;

[0171] If they are consistent, the second pre-cache address is merged with the first pre-cache address, so that when any one of the triggering rule of the first pre-cache address and the triggering rule of the second pre-cache address is established, the data pointed to by the first pre-cache address is read from the memory;

[0172] If they are inconsistent, the label adding module is further used to add a second label to the second pre-cache address;

[0173] The second label indicates the program priority pre-set for the second program;

[0174] The priority processing module is used to determine the execution order of the first pre-cache address and the second pre-cache address based on the first tag of the first pre-cache address and the second tag of the second pre-cache address when the triggering rule of the first pre-cache address and the triggering rule of the second pre-cache address are both in the established state.

[0175] In one embodiment of the present invention, it also includes:

[0176] A regularity statistics module is used to perform regularity statistics on the addresses pointed to by the tasks in the system bus by monitoring the system bus to obtain regularity statistics results;

[0177] The data storage module 503 is also used to read the corresponding data from the memory and store it in the processor's cache based on the regular statistical results when the task status in the system bus conforms to the regular statistical results, and to communicate with the devices on the system bus based on the high-speed interconnection protocol to maintain the cache consistency of the storage system.

[0178] In one embodiment of the present invention, the data storage module 503 is also used for:

[0179] Storing a pre-established first rule list;

[0180] When an address of the first type pointing to a first regular list appears in the system bus, each second type of address bound to the first type of address is determined based on the first regular list, and the data pointed to by each of the determined second type of addresses is read from the memory and stored in the processor's cache, and based on the high-speed interconnection protocol, the cache consistency of the storage system is maintained by communicating with the devices on the system bus.

[0181] Corresponding to the above method and system embodiments, the embodiments of the present invention further provide an accelerator, which can be referred to in correspondence with the above text. The accelerator is mounted on the system bus using a preset high-speed interconnection protocol, and the accelerator at least supports the input and output sub-protocol and the cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate the processor cache. Figure 6 , the accelerator includes:

[0182] Memory 601, used for storing computer programs;

[0183] The processor 602 is configured to execute a computer program to implement the steps of the data pre-storage method in any of the above embodiments.

[0184] Corresponding to the above method and system embodiments, the embodiments of the present invention further provide a computer-readable storage medium and a computer program product, which can be referred to in correspondence with the above.

[0185] The computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the data pre-storage method in any of the above embodiments are implemented.

[0186] See also Figure 7 The computer readable storage medium 70 stores a computer program 71, and when the computer program 71 is executed by the processor, the steps of the data pre-storage method in any of the above embodiments are implemented. The computer readable storage medium 70 mentioned here includes RAM (Random Access Memory), memory, ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), register, hard disk, removable disk, or any other form of storage medium known in the technical field.

[0187] 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.

[0188] Professionals may further realize 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 the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can 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. Specific examples are used herein to illustrate the principles and implementation methods of the present invention, and the description of the above embodiments is only used to help understand the technical solution and its core idea of ​​the present invention. It should be pointed out that for ordinary technicians in the technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A data pre-storage method, It is characterized in that Applied to a preset accelerator, the accelerator is mounted on a system bus using a preset high-speed interconnection protocol, and the accelerator at least supports an input / output sub-protocol and a cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate a processor cache; The data pre-storage method comprises: receiving a first pre-cache address and a triggering rule of the first pre-cache address sent by a first program and storing both; When it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, reading the data pointed to by the first pre-cache address from the memory; storing the data pointed to by the first pre-cache address read from the memory into the cache of the processor, and maintaining cache consistency of the storage system based on the communication with the device on the system bus based on the high-speed interconnect protocol; The stored first pre-cache address and the triggering rule of the first pre-cache address are deleted.

2. The data pre-storage method according to claim 1, It is characterized in that The triggering rule of the first pre-cache address includes: a task pointing to the first target address appears in the system bus; Correspondingly, when it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, reading the data pointed to by the first pre-cache address from the memory includes: Monitoring the system bus and determining whether a task pointing to the first target address appears; If yes, it is determined that the triggering rule of the first pre-cache address holds, and the data pointed to by the first pre-cache address is read from the memory.

3. The data pre-storage method according to claim 1, It is characterized in that The triggering rule of the first pre-cache address includes: a task pointing to the second target address and a task pointing to the third target address appear in the system bus successively; The data pre-storage method further comprises: receiving a first length corresponding to the first pre-cache address sent by the first program; Correspondingly, when it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, reading the data pointed to by the first pre-cache address from the memory includes: The system bus is monitored, and it is determined whether a task pointing to the second target address and a task pointing to the third target address appear successively; If yes, it is determined that the triggering rule of the first pre-cache address holds, and a segment of data with continuous addresses and a total length equal to the first length is read from the memory, and the starting address of the read data is the first pre-cache address.

4. The data pre-storage method according to claim 1, It is characterized in that The triggering rule of the first pre-cache address includes: after the first pre-cache address is sent to the accelerator, the accumulated value of the number of tasks appearing in the system bus reaches a preset number threshold; Correspondingly, when it is determined through monitoring the system bus that the triggering rule of the first pre-cache address is established, reading the data pointed to by the first pre-cache address from the memory includes: After receiving the first pre-cache address, when the accumulated value of the number of tasks appearing in the system bus reaches a preset number threshold, it is determined that the triggering rule of the first pre-cache address is established, and the data pointed to by the first pre-cache address is read from the memory.

5. The data pre-storage method according to claim 1, It is characterized in that Also includes: After receiving and storing a first pre-cache address and a triggering rule of the first pre-cache address sent by a first program, adding a first tag to the first pre-cache address; Wherein, the first tag represents a program priority pre-set for the first program; receiving a second pre-cache address and a triggering rule of the second pre-cache address sent by a second program and storing both; Determining whether the second pre-cache address is consistent with the first pre-cache address; If they are consistent, merging the second pre-cache address with the first pre-cache address so that when any one of the triggering rules of the first pre-cache address and the triggering rule of the second pre-cache address is established, the data pointed to by the first pre-cache address is read from the memory; If they are inconsistent, adding a second tag to the second pre-cache address; Wherein, the second tag represents a program priority pre-set for the second program; When the triggering rule of the first pre-cache address and the triggering rule of the second pre-cache address are both in a valid state, the execution order of the first pre-cache address and the second pre-cache address is determined based on the first tag of the first pre-cache address and the second tag of the second pre-cache address.

6. The data pre-storage method according to any one of claims 1 to 5, It is characterized in that Also includes: By monitoring the system bus, regular statistics are performed on the addresses pointed to by the tasks in the system bus to obtain regular statistical results; When the task status in the system bus conforms to the regular statistical result, the corresponding data is read from the memory based on the regular statistical result and stored in the cache of the processor, and the cache consistency of the storage system is maintained based on the communication with the devices on the system bus based on the high-speed interconnection protocol.

7. The data pre-storage method according to claim 6, It is characterized in that Also includes: Storing a pre-established first rule list; When an address of the first type pointing to the first regular list appears in the system bus, each second type of address bound to the first type of address is determined based on the first regular list, and the data pointed to by each of the determined second type of addresses is read from the memory and stored in the cache of the processor, and based on the communication between the high-speed interconnection protocol and the devices on the system bus, the cache consistency of the storage system is maintained.

8. A data pre-storage system, It is characterized in that Applied to a preset accelerator, the accelerator is mounted on a system bus using a preset high-speed interconnection protocol, and the accelerator at least supports an input / output sub-protocol and a cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate a processor cache; The data pre-storage system comprises: A data receiving module, used for receiving and storing a first pre-cache address and a triggering rule of the first pre-cache address sent by a first program; a reading module, configured to read the data pointed to by the first pre-cache address from a memory when it is determined through monitoring of the system bus that the triggering rule of the first pre-cache address is established; A data storage module, used for storing the data pointed to by the first pre-cache address read from the memory into the cache of the processor, and maintaining the cache consistency of the storage system based on the communication between the high-speed interconnection protocol and the device on the system bus; A deleting module is used to delete the stored first pre-cache address and the triggering rule of the first pre-cache address.

9. An accelerator, It is characterized in that The accelerator is mounted on the system bus using a preset high-speed interconnection protocol, and the accelerator at least supports the input and output sub-protocol and the cache sub-protocol of the high-speed interconnection protocol to support the accelerator to operate the processor cache, and the accelerator includes: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the data pre-storage method according to any one of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data pre-storage method according to any one of claims 1 to 7 are implemented.