Method and system for managing access to first memory through second memory
By automatically copying data and using pointer management, the problem of data transmission delay between long-latency memory and fast memory in the API is solved, improving data access efficiency and simplifying memory management.
Patent Information
- Application Number
- CN202410243548.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-01-09
- Filing Date
- 2024-03-04
- Publication Date
- 2024-09-24
AI Technical Summary
In application programming interfaces (APIs), the data transmission delay between long-latency memory and fast memory affects user experience, and existing methods require management of memory addresses, which is complex and cumbersome.
By automatically copying data from long-latency memory to fast memory and using pointers to eliminate address determination and management, the latency of long-latency memory access data is hidden, avoiding the need to manage addresses.
The data access delay in long-latency memory is reduced, data transmission efficiency is improved, and the memory management process is simplified.
Smart Images

Figure CN118689385A_ABST
Abstract
Description
Technical Field
[0001] Some aspects of the present disclosure relate to memory access in an application programming interface (API), and more particularly, to automatic copying between external memory and internal memory. Background Art
[0002] Any software that performs a function can be considered an application. APIs simplify integration between applications and facilitate seamless communication when applications interact with each other. APIs provide security by isolating the infrastructure of each application connected through the API. Data transfer between applications is one of the core functions of APIs. Therefore, when designing APIs, the delay (i.e., time latency) between a request for information by one of multiple applications and the delivery of that information is one of the factors to be considered. Summary of the invention
[0003] The present disclosure provides a method and system for managing access to a first memory through a second memory.
[0004] In an optional embodiment, the present disclosure provides a method for managing access to a first memory through a second memory, wherein the access speed to the first memory is a first speed, the first memory includes a first group of data blocks, the access speed to the second memory is a second speed different from the first speed, and the second memory includes a second group of data blocks, the method comprising: automatically and sequentially copying data from one or more data blocks in the first group of data blocks in the first memory to corresponding one or more data blocks in the second group of data blocks in the second memory; receiving a read command to the second memory; in response to receiving the read command, obtaining a pointer indicating an address of a data block in the second memory, the data block in the second memory containing the first accessible data copied from the first memory; and obtaining the first accessible data of the data block in the second memory according to the pointer.
[0005] In another optional embodiment, the present disclosure provides a system, comprising: an internal memory; and one or more processors, configured to access an external memory through the internal memory, access the external memory at a first speed, the external memory including a first group of data blocks, access the internal memory at a second speed different from the first speed, and the internal memory including a second group of data blocks, the one or more processors are also configured to: automatically and sequentially copy data from one or more data blocks in the first group of data blocks in the external memory to corresponding one or more data blocks in the second group of data blocks in the internal memory; receive a read command to the internal memory; in response to receiving the read command to the internal memory, obtain a pointer indicating an address of a data block in the internal memory, the data block containing the first accessible data copied from the external memory; and obtain the first accessible data in the data block in the internal memory according to the pointer.
[0006] Implementation of the embodiments provided by the present disclosure may enable automatic replication of data and eliminate address determination and management by using pointers. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 is a block diagram of an example system 100 that may access external memory 140 according to some embodiments.
[0008] Figure 2A An exemplary memory transfer scheme is shown according to certain embodiments.
[0009] Figure 2B According to some embodiments, Figure 2A Operations involved in an exemplary memory transfer scheme.
[0010] Figure 3A Examples of memory operations related to copying data from the external memory 140 to the internal memory 110 and loading data from the internal memory 110 to the processor 120 are shown according to certain embodiments.
[0011] Figure 3B Examples of memory operations related to storing data from the processor 120 to the internal memory 110 and copying data from the internal memory 110 to the external memory 140 are shown according to certain embodiments.
[0012] Figure 4 is a process flow of a method 400 of controlling memory operations associated with copying data from an external memory 140 to an internal memory 110 and retrieving data from the internal memory 110 by one or more processors 120 in accordance with some embodiments.
[0013] Figure 5 is a process flow of a method 500 of controlling memory operations associated with storing data from one or more processors 120 in internal memory 110 and copying data from internal memory 110 to external memory 140 in accordance with some embodiments. DETAILED DESCRIPTION
[0014] The present disclosure will now be described in detail with reference to the drawings. It should be understood that the drawings and exemplary embodiments are not limited to the details described in the present disclosure. Modifications can be made without departing from the spirit and scope of the disclosed subject matter.
[0015] As mentioned earlier, APIs facilitate seamless communication and data transfer between applications. The delay or latency between a request for data from one of multiple applications and the fulfillment of that request may affect the efficiency of the user experience API based on the latency. One factor that affects latency is the time required for the processor implementing the API function to transfer data from long-latency memory to fast memory. Long-latency memory (also known as external memory or secondary memory) is generally considered to be memory that is not directly connected to the processor implementing the API function, while fast memory (also known as internal memory or main memory) may be memory that is connected to and can be directly accessed by the processor implementing the API function. Long-latency or secondary memory can be accessed through fast or main memory. Some examples of long-latency memory include cloud storage, solid-state drives, and optical disks. Some examples of fast memory include read-only memory (ROM), random access memory (RAM), and cache memory.
[0016] When the processor implementing the API function needs to load and use data stored in the long delay memory or write data to the long delay memory, the delay associated with the data transfer between the long delay memory and the fast memory may be noticed by the user of the API. At the same time, the storage capacity of the long delay memory is generally greater than the storage capacity of the fast memory. Therefore, as an example, all the data in the long delay memory may not be moved to the fast memory at once to make it more quickly accessible. A previous method of reducing the access delay to data in the long delay memory includes moving a subset of the data from the long delay memory to the fast memory to reduce the delay in accessing the subset of data. However, this previous method may require tracking the storage availability in the fast memory to determine when more data can be copied from the long delay memory, and the need to manage the memory addresses in the fast memory. That is, when data is placed from the long delay memory to the fast memory by program commands and then released, the programmer of the API may need to calculate the command for the memory address in the fast memory. This can be cumbersome.
[0017] Beneficially, any one or combination of the methods detailed in this disclosure facilitates automatically copying data from long latency memory to fast memory when space is available in fast memory. Space may be referenced in units called tiles or blocks, for example, the fast memory may include a one-dimensional or two-dimensional array of tiles / blocks. In addition to automatic copying, address determination and management may be eliminated through the use of multiple pointers. This approach may hide the latency associated with accessing data to long latency memory by providing the data in fast memory before the processor needs it, while potentially avoiding the need to manage addresses. While the API is specifically discussed for purposes of explanation, any application that needs to access secondary memory storage may benefit from the various aspects of automatic copying and pointer-based access detailed herein.
[0018] Figure 1 is a block diagram of an example system 100 that can access an external memory 140 according to certain embodiments. As an example, the external memory 140 can be composed of multiple blocks or bricks. The system 100 includes an internal memory 110, whose storage capacity is generally smaller than the external memory 140. The internal memory 110 can also be constructed to include multiple blocks or bricks. The system 100 includes one or more processors 120, and the processors 120 can directly access the internal memory 110, but cannot directly access the external memory 140. The access speed S1 and the delay L1 can be related to the data transmission between the external memory 140 and the internal memory 110. The access speed S2 and the delay L2 can be related to the data transmission between one or more processors 120 and the internal memory 110. The access speed S2 may be faster than S1. Therefore, since the access speed and the delay are inversely proportional, the delay L2 may be less than L1.
[0019] The system 100 may also include other memory 130. The other memory 130 may store, for example, instructions that cause the processor 120 to implement operations such as an API. The system 100 may also include other components that facilitate the functionality of the system 100. When one or more memory blocks in the internal memory 110 are not in use, data is automatically copied from the external memory 140 to available blocks in the internal memory 110. Instructions processed by the processor 120 (e.g., stored in the other memory 130) may access data in the internal memory 110 using a pointer that stores the address of the next readable block in the internal memory 110, rather than accessing the data by determining an address to use to access the data. Additional pointers may be used to determine whether an automatic copy from the external memory 140 to the internal memory 110 may be performed, and whether data in the internal memory 110 has been loaded into one or more processors 120 for use, thereby freeing data from the internal memory 110 to accommodate additional copies from the external memory 140. Reference will be made to FIG. 2A to FIG. 3B Discuss the use of pointers.
[0020] Figure 2A An exemplary memory transfer scheme is shown according to certain embodiments. Exemplary blocks of external memory 140 are shown to include data indicated by A1-A3 and B1-B3. Internal memory 110 is shown to include three blocks. The exemplary icons are not intended to limit the arrangement or number of memory blocks of external memory 140 or internal memory 110. By way of example, the memory blocks can be arranged in a two-dimensional array and can include any number of memory blocks.
[0021] As shown by the arrows, the three blocks of the internal memory 110 are first filled with data A1, A2, and A3 respectively by automatic copying from the external memory 140 (i.e., data A1 is copied to the first block of the internal memory 110, data A2 is copied to the second block, and data A3 is copied to the third block). When each data block in the internal memory 110 is read out (i.e., loaded into the processor 120), automatic copying is performed to fill the block. For example, as shown by the arrows, after data A1 is loaded from the internal memory 110 to the processor 120, the first block of the internal memory 110 is filled with data B1 by automatic copying from the external memory 140. After data A2 is loaded into the processor 120, the second block of the internal memory 110 is filled with data B2 by automatic copying from the external memory, and after data A3 is loaded into the processor 120, the third block of the internal memory 110 is filled with data B3 by automatic copying from the external memory.
[0022] Figure 2B According to some embodiments, Figure 2A Operations involved in an exemplary memory transfer scheme. Figure 2B 1 shows a sequential automatic copy operation from the external memory 140 to the internal memory 110, and a load operation from the internal memory 110 to the processor 120, which can be performed at least partially in parallel with the automatic copy operation. Figure 3A and Figure 3B As described in detail, different pointers can be used to determine the next data block in the internal memory 110 that should be automatically copied from the external memory 140, the next data block in the internal memory 110 that can be read or written by the processor 120, and the next data block in the internal memory 110 that can be read by or copied from the external memory 140.
[0023] Figure 3AAn example of memory operations related to copying data from the external memory 140 to the internal memory 110 and loading data from the internal memory 110 to the processor 120 is shown according to some embodiments. In the exemplary illustration, nine data blocks of the external memory 140 are shown, and the internal memory 110 includes three memory blocks. As previously mentioned, this exemplary diagram does not limit the number and arrangement of memory blocks in the external memory 140 and the internal memory 110.
[0024] The snapshot sequence of the internal memory 110 is numbered “(1)” to “(12)”. In each snapshot of the sequence, the positions of three pointers “Copy”, “Next” and “Release” are indicated. The copy pointer stores the address of the next block in the internal memory 110 to which data can be copied from the external memory 140, and the copy pointer is automatically increased each time the automatic copy from the external memory 140 to the internal memory 110 is completed. Therefore, as shown in the figure, in sequence (1), the copy pointer indicates the first block of the internal memory 110. Between sequence (1) and sequence (2), automatic copying is performed to fill all three blocks of the internal memory 110. Therefore, the copy pointer returns to the starting position in sequence (2) to indicate the first block of the internal memory 110 as the next block to be automatically copied to.
[0025] The next pointer may be used in program instructions (e.g., stored in other memory 130) to allow one or more processors 120 to load data into or out of internal memory 110 (e.g., into or out of the block between the next pointer and the copy pointer). The release pointer may also be used in program instructions and specifies a block in internal memory 110 that can be used for automatic copying (e.g., the block between the copy pointer and the release pointer). Unlike the copy pointer, which is automatically updated after automatic copying, the next pointer and the release pointer are updated using program instructions. Figure 3A As shown in the exemplary icons in , the automatic copying from the external memory 140 to the internal memory 110 is triggered by the user controlling the next pointer and the release pointer through program instructions. The title of each sequence indicates an exemplary instruction that may be stored (e.g., in other memory 130) and processed by one or more processors 120, for example, "get next" indicates an instruction to obtain the next block for reading or writing, and "release" indicates an instruction to allow data to be overwritten. However, "automatic copy" is not an instruction to be processed, but an automatic operation. As shown in reference Figure 4 As mentioned, there may be checks associated with these instructions.
[0026] like Figure 3AAs shown, in the snapshots associated with sequences (2) to (3), (5) to (6), (8) to (9), and (11) to (12), the release pointer is incremented when data is loaded from a block of the internal memory 110 to the processor 120. That is, the next pointer indicates the next block to be loaded with data, and the release pointer initially points to the same block as the next pointer (e.g., as shown in sequence (2)), and then the release pointer is incremented based on loading from the previously indicated block (e.g., as shown in sequence (3)). As shown in the snapshots associated with sequences (3) to (4), (6) to (7), and (9) to (10), an automatic copy of the released block from the external memory 140 to the internal memory 110 is performed, and the copy pointer is automatically incremented after the copy.
[0027] As shown in sequence (9) to (11), in an exemplary internal memory 110 having three blocks, the pointers return to the first block after the third block. That is, the release pointer returns to the first block in sequence (9), the copy pointer returns to the first block in sequence (10), and the next pointer returns to the first block in sequence (11). Because the pointers cycle through the blocks in this manner, according to some embodiments, the internal memory 110 can be depicted and viewed as a circular ring buffer. As shown in reference Figure 4 As mentioned above, the program code may be written to perform checks to ensure that only valid blocks are obtained based on the position of the pointer or related error messages are sent.
[0028] Figure 3B Examples of memory operations related to storing data from the processor 120 to the internal memory 110 and copying data from the internal memory 110 to the external memory 140 are shown according to certain embodiments. Figure 3A As shown, the exemplary diagram shows nine data blocks of the external memory 140 and three memory blocks of the internal memory 110. Figure 3A , a series of snapshots of the internal memory 110 are numbered from "(1)" to "(12)". In each snapshot of the sequence, the positions of "copy", "next", and "release" are indicated. Except for "store and release", the titles in this figure are the same as Figure 3A The same as in "store and release" is used to indicate that the data in the block is written from the internal memory 110 to the external memory 140 before the block is released. For more details, please refer to Figure 5 Have a discussion.
[0029] like Figure 3BAs shown, in the snapshots associated with sequences (2) to (3), (5) to (6), (8) to (9), and (11) to (12), when data is written from the processor 120 to a block in the internal memory 110, the release pointer is incremented. That is, the next pointer indicates the next block to which data is to be written, the release pointer and the next pointer initially point to the same block (e.g., as shown in sequence (2)), and then based on data being written to the previously indicated block, the release pointer is incremented (e.g., as shown in sequence (3)). As shown in the snapshots associated with sequences (3) to (4), (6) to (7), and (9) to (10), an automatic copy is performed from the internal memory 110 to the external memory 140, and the copy pointer is automatically incremented after the copy. As shown in reference Figure 3A As described, because the pointer cycles through the blocks, as shown in sequences (9), (10), and (11), according to some embodiments, the internal memory 110 can be depicted and viewed as a circular ring buffer.
[0030] Figure 4 4 is a process flow of a method 400 for controlling memory operations associated with copying data from external memory 140 to internal memory 110 and fetching data from internal memory 110 by one or more processors 120 according to some embodiments. The method may be performed by system 100. Various aspects of memory operations have been described in detail in Figure 3A At 401, the internal memory 110 is initialized, which may include setting a copy buffer, a release buffer, and a next buffer (i.e., setting a copy pointer, a release pointer, and a next pointer) to store the same address (i.e., the address of the first block of the internal memory 110 (e.g., Figure 3A At 402, one or more data blocks are automatically copied sequentially from the external memory 140 to the internal memory 110, for example, as shown in the sequence (1) in FIG. Figure 3A shown in sequence (2).
[0031] At 404, a command for reading from the internal memory 110 is received. Specifically, the one or more processors 120 receive instructions associated with reading data from the internal memory 110 (for example, stored in the other memory 130). At 406, the command for reading from the internal memory 110 is processed, and the processing includes determining, for example, a valid data block indicated by a next pointer, and may involve a set of commands. For example, a command to obtain a next pointer may be issued first to determine whether there is a valid data block available for access or whether an error code is returned. One or more valid data blocks for reading from the internal memory 110 are blocks between the next pointer and the copy pointer. Therefore, if the next pointer and the copy pointer are at the same position, there is no valid block available for reading. If the check at 406 passes, this may cause the one or more processors 120 to load data from the internal memory 110. At 408, a command to release the internal memory is received, and this step specifically refers to the one or more processors 120 executing instructions to release one or more blocks of the internal memory 110, and at 410, the release pointer is increased. In an optional implementation, at step 406, one or more processors 120 may load data from the internal memory starting from the first accessible data in the internal memory 110. The "first accessible data" mentioned here refers to the location pointed to by the next pointer at a specific access time, and when the access time changes or the next pointer moves, the "first accessible data" changes or moves accordingly.
[0032] At 412, a check may be performed to determine whether a condition for automatic copying from the external memory 140 to the internal memory 110 is met. For example, a check may be performed whether the address indicated by the copy pointer is the same as the address indicated by the release pointer. If the check at 412 indicates that the condition for automatic copying is met (e.g., there is at least one block between the copy pointer and the release pointer), another iteration starting from 402 may be implemented. Conversely, if the result of the check at 412 is that the condition for automatic copying is not met, the process of copying from the external memory ends. Because this is an asynchronous end, at 414, a (synchronous) wait command may be received. That is, the instructions implemented by the one or more processors 120 may include a wait instruction to synchronously wait for the corresponding asynchronous end to complete when the result of the check at 412 is that the condition is not met. After waiting, the process may end at 416. The end (at 416) may indicate the release of the internal memory 110, which may then be reinitialized (at 401). If the check (at 406) of a portion of the processing of the read command indicates that no valid block is available in the internal memory 110, the processing of 414 may also be performed.
[0033] Figure 51 is a process flow of a method 500 for controlling memory operations associated with storing data from one or more processors 120 in internal memory 110 and copying data from internal memory 110 to external memory 140 in accordance with some embodiments. Various aspects of memory operations have been described in detail in Figure 3B Like the process of method 400, the process of method 500 may be performed by system 100. At 501, the internal memory 110 is initialized, which may include setting a copy buffer, a release buffer, and a next buffer (i.e., a copy pointer, a release pointer, and a next pointer) to store the same address (i.e., the address of the first block of the internal memory 110 (e.g., Figure 3B At 502, one or more data blocks are automatically copied sequentially from the internal memory 110 to the external memory 140, for example, as shown in the sequence (1) in FIG. Figure 3B As shown in sequence (4), “A” is copied from the first block of the internal memory 110 to the external memory 140 .
[0034] At 504, a command for writing data to the internal memory 110 is received from the one or more processors 120. This step refers to the one or more processors 120 receiving an instruction to write data to the internal memory 110. At 506, the command for writing data to the internal memory 110 is processed, which may include verifying that a valid block of the internal memory 110 is available. This verification may involve comparing the address of a next pointer indicating an address of a block in the internal memory 110 with the address of the copy pointer to ensure that there is at least one block between the next pointer and the copy pointer. As previously described, it is necessary to take into account cyclic access (e.g., according to Figure 3B , reaching the first block after the last block). That is, due to the reference Figure 3A and 3B In the described loop scheme, an address (e.g., the address of the first block) after another address (e.g., the address of the last block) may have a lower address value and an address (e.g., the address of the last block) before another address (e.g., the address of the first block) may have a higher address value. Therefore, when there is at least one block between the next pointer and the copy pointer, the copy pointer may have a lower address value than the next pointer. Based on this verification, one or more processors 120 may write data to one or more blocks of the internal memory 110. At 508, a command for releasing the internal memory is received, which specifically refers to one or more processors 120 implementing an instruction to release one or more blocks of the internal memory. At 510, the release pointer is increased.
[0035] At 512, a check may be performed to determine whether the conditions for automatic copying from the internal memory 110 to the external memory 140 are met. As an example, this check may be similar to the reference Figure 4 The purpose of the check is to determine whether there are one or more blocks between the copy pointer and the release pointer. If the result of the check at 512 indicates that the condition for automatic copying is met, another iteration starting at 502 can be implemented. On the contrary, if the result of the check at 512 is that the condition for automatic copying is not met, a wait command can be received at 514 to resolve the asynchronous end of the process. After the synchronous wait command is completed, the process can end at 516.
[0036] The technology operated according to the principles described herein can be implemented in any suitable manner. The processing and decision blocks of the above flowcharts represent the steps and actions that can be included in the algorithms for executing these processes. The algorithms derived from these processes can be implemented as software that integrates with one or more single-purpose or multi-purpose processors and guides their operation, or can be implemented as functionally equivalent circuits, such as DSP circuits or ASICs, or can be implemented in any other suitable manner. It should be understood that the flowcharts contained herein do not show the syntax or operation of any specific circuit or any specific program language or program language type. On the contrary, the flowchart shows the functional information of the processing of a specific device that can be used by a person with ordinary knowledge in the art to manufacture a circuit or implement a computer software algorithm to perform the technology type described herein. For example, the flowchart or a part thereof can be implemented separately by various process hardware (e.g., one or more analog or digital circuits, one or more hardware-implemented state machines, etc.) configured or constructed to execute the flowchart, and / or any combination thereof. In some examples, the flowchart or a part thereof can be implemented by machine executable instructions (e.g., machine readable instructions, computer readable instructions, computer executable instructions, etc.), and when the instructions are executed by one or more single-purpose or multi-purpose processors, various processes of the flowchart are executed. It should also be understood that unless otherwise indicated herein, the specific sequence of steps and / or actions described in each flow chart is merely illustrative of algorithms that may be implemented and may be varied in implementations and embodiments of the principles described herein.
[0037] Therefore, in some embodiments, the techniques described herein may be implemented as software, specifically embodied in machine executable instructions, including application software, system software, firmware, middleware, embedded program code, or any other suitable type of computer program code. Such machine executable instructions may be generated, written, etc. using any of a variety of suitable programming languages and / or programming or scripting tools, and may also be compiled into executable machine language program code or intermediate code executed on a framework, virtual machine, or container.
[0038] When the techniques described herein are embodied as machine-executable instructions, these machine-executable instructions may be implemented in any suitable manner, including as multiple functional devices, each of which provides one or more operations to complete the execution of an algorithm according to the techniques described herein. Regardless of how it is instantiated, a "functional device" is a structural component of a computer system that, when integrated with and executed by one or more computers, enables the one or more computers to perform a specific operational role. A functional device may be part of a software element or all of it. For example, a functional device may be implemented as a process function, or a discrete process, or any other appropriate processing unit. If the techniques described herein are implemented as multiple functional devices, each functional device may be implemented in its own way; they do not need to be implemented in the same way. In addition, these functional devices may be executed in parallel and / or serially as appropriate, and may communicate information using shared memory on the computers on which they are executing, using message protocols, or other suitable means.
[0039] Generally speaking, functional devices include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. Usually, the functions of functional devices can be combined or distributed in the system in which they are operated as needed. In some embodiments, one or more functional devices that perform the technology of this article can form a complete software package together. In alternative embodiments, these functional devices can be suitable for interacting with other unrelated functional devices and / or processes to realize software program applications.
[0040] Some exemplary functional devices for performing one or more tasks have been described herein. However, it should be understood that the functional devices and task division described are merely illustrations of the types of functional devices that can be implemented using the exemplary techniques described herein, and embodiments are not limited to being implemented with any specific number, division, or type of functional devices. In some implementations, all functions can be implemented in a single functional device. It should also be understood that in some embodiments, some of the functional devices described herein can be implemented together with other functional devices or implemented separately (e.g., as a single unit or a separate unit), or some of these functional devices may not be implemented.
[0041] In some embodiments, machine executable instructions that implement the techniques described herein (when implemented as one or more functional devices or implemented in any other manner) may be encoded on one or more computer-readable media, machine-readable media, etc. to provide media functionality. Computer-readable media include magnetic media such as hard disks, optical media such as CDs or DVDs, persistent or non-persistent solid-state memory (e.g., flash memory, magnetic RAM, etc.), or any other suitable storage media. Such computer-readable media may be implemented in any suitable manner. As used herein, the terms "computer-readable media" (also referred to as "computer-readable storage media") and "machine-readable media" (also referred to as "machine-readable storage media") refer to tangible storage media. Tangible storage media are non-transitory and have at least one physical structural component. In "computer-readable media" and "machine-readable media" as used herein, at least one physical structural component has at least one physical property that can be changed in some way during the process of creating a medium with embedded information, the process of recording information thereon, or any other process of encoding the medium with information. For example, the magnetization state of a portion of the physical structure of a computer-readable medium, machine-readable medium, etc. may change during the recording process.
[0042] In addition, some of the above-described techniques include acts of storing information (e.g., data and / or instructions) in some manner for use by these techniques. In some implementations of these techniques, such as implementations in which these techniques are implemented as machine-executable instructions, the information may be encoded on a computer-readable storage medium. Where certain structures are described herein as advantageous formats for storing such information, these structures may be used to impart physical organization to the information when encoded on the storage medium. These advantageous structures may then provide functionality to the storage medium by affecting the operation of one or more processors that interact with the information; for example, by increasing the efficiency of computer operations performed by the processors.
[0043] In some, but not all, implementations, these techniques may be embodied as machine-executable instructions that may be executed on one or more suitable computing devices and / or electronic devices operating in any suitable computer and / or electronic system, or may be executed on one or more computing devices (or one or more processors of one or more computing devices) and / or one or more electronic devices (or one or more processors of one or more electronic devices) that are programmed to execute machine-executable instructions. A computing device, electronic device, or processor (e.g., processor circuitry) may be programmed to execute instructions when the instructions are stored in a manner accessible to the computing device, electronic device, or processor, such as a data store (e.g., an on-chip cache or instruction register, a computer-readable storage medium and / or machine-readable storage medium accessible via a bus, a computer-readable storage medium and / or machine-readable storage medium accessible via one or more networks and accessible by a device / processor, etc.). The functional devices including these machine-executable instructions may be integrated with and direct the operation of a single multi-purpose programmable digital computing device, a coordinated system of two or more multi-purpose computing devices that share processing power and jointly perform the techniques described herein, a single computing device or a coordinated system of computing devices (either co-located or geographically distributed) dedicated to performing the techniques described herein, one or more FPGAs for performing the techniques described herein, or any other suitable system.
[0044] Embodiments of the technology implemented herein with circuits and / or machine executable instructions have been described. It should be understood that some embodiments may be in the form of methods, of which at least one example has been provided. The actions performed as part of the method may be ordered in any suitable manner. Therefore, even though actions are shown as being performed sequentially in the illustrative embodiments, embodiments may be constructed in which the actions are performed in an order different from the order shown, which may include performing some actions simultaneously.
[0045] The various aspects of the above-described embodiments may be used alone, in combination, or in various arrangements not specifically discussed in the previously described embodiments, and are therefore not limited in application to the details and arrangements of the component groups set forth in the previous description or shown in the accompanying drawings. For example, aspects in one embodiment may be combined in any manner with aspects in other embodiments.
[0046] The phrase "and / or" as used herein in the specification and claims should be understood to mean "one or both" of the components so combined, e.g., components present in combination in some cases and separately in other cases. Multiple elements listed with "and / or" should be interpreted in the same manner, e.g., "one or more" elements so connected. In addition to the elements specifically identified by the "and / or" clause, other elements may optionally be present, whether related or unrelated to those specifically identified. Thus, as a non-limiting example, when used in conjunction with open language such as "comprising," a reference to "A and / or B" may refer to only A (optionally including elements other than B) in one embodiment; to only B (optionally including elements other than A) in another embodiment; and to both A and B (optionally including other elements) in another embodiment.
[0047] The indefinite articles "a" and "an" as used in the specification and claims should be understood to mean "at least one" unless explicitly indicated to the contrary.
[0048] As used herein in the specification and claims, the phrase "at least one" referring to a list of one or more elements should be understood to mean at least one element selected from any one or more elements in the list of elements, but not necessarily including at least one of each element specifically listed in the list of elements, and not excluding any combination of elements in the list of elements. This definition also allows that elements other than the elements specifically identified in the list of elements referred to by the phrase "at least one" may optionally exist, whether related or unrelated to those specifically identified elements. Thus, as a non-limiting example, "at least one of A and B" (or equivalently, "at least one of A or B", or equivalently, "at least one of A and / or B") may, in one embodiment, refer to at least one, optionally including more than one A, without B (and optionally including elements other than B); in another embodiment, refer to at least one, optionally including more than one B, without A (and optionally including elements other than A); in yet another embodiment, refer to at least one, optionally including more than one A, and optionally including more than one B (and optionally including other elements).
[0049] The use of ordinal terms such as "first," "second," "third," etc. in the claims to modify claim elements does not in itself imply any priority, precedence, or order of one claim element relative to another claim element, or a temporal order for performing method actions, but serves merely as a label to distinguish one claim element with a particular name from another element with the same name (but using an ordinal term) to distinguish the claim elements.
[0050] In addition, the words and terms used herein are for descriptive purposes and should not be considered limiting. The words "including", "comprising", "having", "involving" and their variations used herein are intended to cover the items listed thereafter and their equivalents as well as additional items.
[0051] All definitions, as defined and used herein, should be understood to be based on dictionary definitions, definitions in documents incorporated by reference, and / or ordinary meanings of the defined terms.
[0052] The word "exemplary" as used herein means serving as an example, instance or illustration. Therefore, unless otherwise specified, any embodiment, implementation, process, feature, etc. described herein as exemplary should be understood as an illustrative example and not as a preferred or advantageous example.
[0053] Having described several aspects of at least one embodiment, it will be appreciated that various changes, modifications, and improvements will readily occur to those of ordinary skill in the art. Such changes, modifications, and improvements are intended to be part of this disclosure and are intended to be within the spirit and scope of the principles described herein. Therefore, the foregoing description and accompanying drawings are intended only as examples.
Claims
1. A method for managing access to a first memory through a second memory, characterized in that: The access speed to the first memory is a first speed, the first memory includes a first group of data blocks, the access speed to the second memory is a second speed different from the first speed, and the second memory includes a second group of data blocks, the method includes: Automatically copying data from one or more data blocks in the first set of data blocks in the first memory to corresponding one or more data blocks in the second set of data blocks in the second memory; receiving a read command to the second memory; In response to receiving the read command, obtaining a pointer indicating an address of a data block in the second memory, the data block in the second memory containing first accessible data copied from the first memory; and The first accessible data of the data block in the second memory is obtained according to the pointer.
2. The method according to claim 1, characterized in that The second speed is faster than the first speed.
3. The method according to claim 1, characterized in that The second memory is an internal memory directly connected to the one or more processors, and the first memory is an external memory not directly connected to the one or more processors.
4. The method according to claim 1, characterized in that The automatic replication includes performing one or more iterations of the following operations: using a copy pointer, the copy pointer indicating the address of a next data block in the second memory that can receive data from the first memory; copying data from a data block in the first set of data blocks to the next data block in the second memory; as well as Increment the value of the copy pointer.
5. The method according to claim 4, characterized in that The automatic replication also includes determining whether to stop the one or more iterations by: Determining whether the copy pointer is an address indicated by a release pointer; In response to determining that the copy pointer is the address indicated by the release pointer, stopping the one or more iterations; In response to determining that the copy pointer is not the address indicated by the release pointer, the one or more iterations are continued.
6. The method according to claim 5, characterized in that Further including: In response to receiving a command to release the second memory, the release pointer is increased.
7. The method according to claim 6, characterized in that Further including: The second memory is initialized by setting the pointer, the copy pointer, and the release pointer to initial locations in the second memory.
8. The method according to claim 7, characterized in that The initialization of the second memory also includes triggering the automatic copying, and the second memory includes a first data block and a last data block, and when the increase of the pointer, the copy pointer and the release pointer exceeds the last data block of the second memory, it will advance to the first data block of the second memory.
9. The method according to claim 6, characterized in that Further including: Determining whether a condition for automatic copying is met according to the copy pointer and the release pointer; as well as After determining that the condition for the automatic replication is met, the automatic replication is triggered.
10. The method according to claim 1, characterized in that Further including: In response to receiving the wait command, determining whether an event is completed; After determining that the event has been completed, the automatic replication is terminated.
11. The method of claim 1, further comprising: Automatically copying one or more data blocks in the second memory to corresponding data blocks in the first memory; receiving a command to write data into the second memory; In response to receiving the command to write data to the second memory, obtaining a pointer indicating an address of a data block in the second memory that can be used to store new data; as well as The data is written as the new data into the data block in the second memory that can be used to store new data according to the pointer of the address of the data block in the second memory that can be used to store new data.
12. A system, characterized in that: include: Internal memory; as well as One or more processors are configured to access an external memory through the internal memory, access the external memory at a first speed, the external memory including a first set of data blocks, access the internal memory at a second speed different from the first speed, and the internal memory including a second set of data blocks, and the one or more processors are further configured to: Automatically copying data from one or more data blocks in the first set of data blocks in the external memory to corresponding one or more data blocks in the second set of data blocks in the internal memory in sequence; receiving a read command to the internal memory; In response to receiving a read command to the internal memory, obtaining a pointer indicating an address of a data block in the internal memory, the data block containing first accessible data copied from the external memory; and The first accessible data in the data block in the internal memory is obtained according to the pointer.
13. The system of claim 12, wherein: The second speed is faster than the first speed.
14. The system of claim 12, wherein: The one or more processors are configured to perform one or more iterations of: using a copy pointer, the copy pointer indicating the address of a next data block in the internal memory that can receive data from the external memory; Copying data from a data block in the first set of data blocks in the external memory to the next data block in the internal memory; as well as Increment the value of the copy pointer.
15. The system of claim 14, wherein: The one or more processors are configured to determine whether to stop the one or more iterations by: Determining whether the copy pointer is an address indicated by a release pointer; In response to determining that the copy pointer is the address indicated by the release pointer, stopping the one or more iterations; In response to determining that the copy pointer is not the address indicated by the release pointer, the one or more iterations are continued.
16. The system of claim 14, wherein: The one or more processors are further configured to: receiving a command to release memory; In response to receiving the command to release memory, the release pointer is increased.
17. The system of claim 16, wherein: The one or more processors are further configured to trigger the automatic copying by setting the pointer, the copy pointer, and the release pointer to initial locations in the internal memory.
18. The system of claim 17, wherein: The plurality of data blocks in the internal memory are arranged in a data structure such that a first data block among the plurality of data blocks is appended to a last data block in the internal memory, and when the pointer, the copy pointer, and the release pointer of the one or more processors are incremented beyond the last data block in the internal memory, any one of the pointer, the copy pointer, and the release pointer is advanced to the first data block in the internal memory.
19. The system of claim 16, wherein: The one or more processors are further configured to trigger the automatic copying when determining that the copy pointer reaches the condition for automatic copying.
20. The system of claim 12, wherein: The one or more processors are further configured to: Automatically copying one or more data blocks in the internal memory to corresponding data blocks in the external memory; receiving a command to write data into the internal memory; In response to receiving the command to write data to the internal memory, obtaining an address pointer indicating a data block in the internal memory that can be used to store new data; as well as The pointer writes the data as the new data into the data block in the internal memory that can be used to store new data according to the address of the data block in the internal memory that can be used to store new data.
21. The system of claim 12, wherein: The one or more processors are configured to maintain a pointer indicating an address of a data block in the internal memory that includes accessible data copied from the external memory, maintain a copy pointer indicating an address of a next data block in the internal memory that can receive data from the external memory, and a release pointer indicating an address of a last data block in the internal memory that can receive data from the external memory.
22. The system of claim 21, wherein: The multiple data blocks in the internal memory are logically arranged in sequence, wherein the last data block in the internal memory references the first data block in the internal memory, so that the increase of the pointer indicating the last data block in the internal memory causes the increased pointer to indicate the first data block in the internal memory.
