Data Accessing Method and Data Accessing System Capable of Providing High Data Accessing Performance and Low Memory Utilization

Information

  • Patent Application
  • 20240012761
  • Publication Number
    20240012761
  • Date Filed
    November 09, 2022
    a year ago
  • Date Published
    January 11, 2024
    4 months ago
Abstract
A data accessing method includes providing a first memory including a plurality of memory pages, acquiring a usage order value of each memory page of the plurality of memory pages, acquiring a first usage order value having a highest priority from a plurality of usage order values corresponding to the plurality of memory pages in the first memory, updating the first memory after a first memory page having the first usage order value is used, acquiring a second usage order value having a highest priority from the updated first memory after the first memory is updated, and using a second memory page having the second usage order.
Description
BACKGROUND OF THE INVENTION
1. Field of the Invention

The present invention illustrates a data accessing method and a data accessing system, and more particularly, a data accessing method and a data accessing system capable of providing high data accessing performance and low memory utilization.


2. Description of the Prior Art

With the development of computer technology, various types of high-density storage devices are gradually adopted. For example, a memory having high-density data storage capability is popularly used in a computer. In general, the memory can be categorized into a volatile memory and a non-volatile memory according to storage characteristics. Specifically, the data stored in the volatile memory disappears after a power supply of the volatile memory is interrupted. However, the data stored in the non-volatile memory can be preserved even when the power supply is turned off. Once the power supply is turned on again, the data stored in the non-volatile memory can be re-accessed.


Currently, when the data of the memory is accessed, a linked list structure is often used for storing pointers of packets. The linked list structure is a common data structure. The linked list structure can use nodes for logging, indicating, and storing data. The linked list structure can further use an index of each node for pointing to the next node. Therefore, the linked list structure can link a plurality of nodes. However, the time complexity for searching data nodes in the linked list structure is equal to O(N). Further, the linked list structure requires a large memory capacity for saving indices of all nodes. Therefore, to develop a data accessing method capable of providing high data accessing performance and low memory utilization is an important issue.


SUMMARY OF THE INVENTION

In an embodiment of the present invention, a data accessing method is disclosed. The data accessing method comprises providing a first memory comprising a plurality of memory pages, acquiring a usage order value of each memory page of the plurality of memory pages, acquiring a first usage order value having a highest priority from a plurality of usage order values corresponding to the plurality of memory pages in the first memory, updating the first memory after a first memory page having the first usage order value is used, acquiring a second usage order value having a highest priority from the updated first memory after the first memory is updated, and using a second memory page having the second usage order.


In another embodiment of the present invention, a data accessing system is disclosed. The data accessing system comprises a first memory, a receiver, a transmitter, and a processor. The first memory comprises a plurality of memory pages and is configured to save data. The receiver is configured to receive input data and write the input data to the first memory. The transmitter is configured to read output data from the first memory. The processor is coupled to the first memory, the receiver, and the transmitter and configured to control the first memory, the receiver, and the transmitter. The processor acquires a usage order value of each memory page of the plurality of memory pages. The processor acquires a first usage order value having a highest priority from a plurality of usage order values corresponding to the plurality of memory pages in the first memory. The transmitter and the receiver access data through a first memory page having the first usage order value. The processor updates the first memory after the first memory page having the first usage order value is used. The processor acquires a second usage order value having a highest priority from the updated first memory after the first memory is updated. The transmitter and the receiver access data through a second memory page having the second usage order value.


These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.





BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 illustrates a block diagram of a data accessing system according to an embodiment of the present invention.



FIG. 2 is an illustration of acquiring a first usage order value having a highest priority from a first memory of the data accessing system in FIG. 1.



FIG. 3 is an illustration of acquiring a second usage order value having the highest priority from the first memory of the data accessing system in FIG. 1 after the first memory is updated.



FIG. 4 is a flow chart of performing a data accessing method by the data accessing system in FIG. 1.





DETAILED DESCRIPTION


FIG. 1 illustrates a block diagram of a data accessing system 100 according to an embodiment of the present invention. The data accessing system 100 includes a first memory 10, a receiver RX, a transmitter TX, and a processor 11. The first memory 10 includes a plurality of memory pages for saving data. The first memory 10 can be a static random access memory (SRAM). Particularly, the first memory 10 can include two-dimensional memory pages. For example, in FIG. 1, the first memory 10 can include memory pages R1 in a first row, memory pages R2 in a second row, memory pages R3 in a third row, and memory pages R4 in a fourth row. The plurality of memory pages in the first memory 10 can include at least one available memory page and/or at least one unavailable (or say, already used) memory page. In the first memory 10, the available memory page has a usage order value. The unavailable memory page has no usage order value. For example, the memory pages R1 in the first row include available memory pages having usage order values 5′d10, 5′d9, 5′d11, and 5′d6. The memory pages R2 in the second row include available memory pages having usage order values 5′d7, 5′d4, 5′d15, and 5′d1. The memory pages R3 in the third row include available memory pages having usage order values 5′d3, 5′d0, and 5′d8. The memory pages R4 in the fourth row include available memory pages having usage order values 5′d2, 5′d5, 5′d12, 5′d14, and 5′d13. As shown in FIG. 1, the memory pages having usage order values 5′d0 to 5′d15 are indicated as a memory page sequence for accessing data by the receiver RX or the transmitter TX. Further, for the first memory 10, the memory pages having usage order values 5′d0 to 5′d15 can be consecutive memory pages or discrete memory pages. In the data accessing system 100, the receiver RX is used for receiving input data and writing the input data to the first memory 10. The transmitter RX is used for reading output data from the first memory 10. The processor 11 is coupled to the first memory 10, the receiver RX, and the transmitter TX for controlling the first memory 10, the receiver RX, and the transmitter TX. The processor 11 can be a frame page order link controller. In the data accessing system 100, a second memory 12 can be introduced. The second memory 12 is coupled to the first memory 10 and the processor 11. The second memory 12 can be a register for buffering a usage order having a highest priority of the memory pages in each row. Further, in the data accessing system 100, when the receiver RX or the transmitter TX uses the memory pages sequentially, data stored in the first memory 10 and the second memory 12 is also updated synchronously. In the data accessing system 100, the processor 11 can acquire a usage order value of each memory page of the plurality of memory pages. Then, the processor 11 can acquire a first usage order value having a highest priority from the plurality of usage order values corresponding to the plurality of memory pages in the first memory 10. The transmitter TX and the receiver RX can access data through a first memory page having the first usage order value. After the processor 11 uses the first memory page having the first usage order value, the first memory 10 and the second memory 12 can be updated synchronously. After the first memory 10 and the second memory 12 are updated synchronously, the processor 11 can acquire a second usage order value having a highest priority from the updated first memory. The transmitter TX and the receiver RX can access data through a second memory page having the second usage order value. Details of searching appropriate memory pages for accessing data in the data accessing system 100 are illustrated later.


FIG.2 is an illustration of acquiring the first usage order value having the highest priority from the first memory 10 of the data accessing system 100. As previously illustrated, in the data accessing system 100, the first memory 10 can include the memory pages R1 in the first row, the memory pages R2 in the second row, the memory pages R3 in the third row, and the memory pages R4 in the fourth row. The processor 11 can acquire a minimum row usage order value of usage order values in each row of the plurality of usage order values in the first memory 10. For example, the memory pages R1 in the first row include available memory pages having usage order values 5′d10, 5′d9, 5′d11, and 5′d6. The processor 11 can select a usage order value having the highest priority from a usage order value set {5′d10, 5′d9, 5′d11, 5′d6}. In other words, the processor 11 can select a minimum row usage order value 5′d6 from the memory pages R1 in the first row. The memory pages R2 in the second row include available memory pages having usage order values 5′d7, 5′d4, 5′d15, and 5′d1. The processor 11 can select a usage order value having the highest priority from a usage order value set {5′d7, 5′d4, 5′d15, 5′d1}. In other words, the processor 11 can select a minimum row usage order value 5′d1 from the memory pages R2 in the second row. The memory pages R3 in the third row include available memory pages having usage order values 5′d3, 5′d0, and 5′d8. The processor 11 can select a usage order value having the highest priority from a usage order value set {5′d3, 5′d0, and 5′d8}. In other words, the processor 11 can select a minimum row usage order value 5′d0 from the memory pages R3 in the third row. The memory pages R4 in the fourth row include available memory pages having usage order values 5′d2, 5′d5, 5′d12, 5′d14, and 5′d13. The processor 11 can select a usage order value having the highest priority from a usage order value set {5′d2, 5′d5, 5′d12, 5′d14, and 5′d13}. In other words, the processor 11 can select a minimum row usage order value 5′d2 from the memory pages R4 in the fourth row. Further, the processor 11 can use the second memory 12 for buffering the minimum row usage order value of the usage order values in each row. For example, in the memory pages R1 in the first row, the minimum row usage order value 5′d6 can be buffered as a first value of the second memory 12. In the memory pages R2 in the second row, the minimum row usage order value 5′d1 can be buffered as a second value of the second memory 12. In the memory pages R3 in the third row, the minimum row usage order value 5′d0 can be buffered as a third value of the second memory 12. In the memory pages R4 in the fourth row, the minimum row usage order value 5′d2 can be buffered as a fourth value of the second memory 12. Further, the processor 11 can acquire a minimum usage order value from the second memory 12 as the first usage order value. For example, after the second memory 12 buffers a usage order value set {5′d6, 5′d1, 5′d0, 5′d2}, the processor 11 can select a minimum usage order value 5′d0 as the first usage order value from the usage order value set {5′d6, 5′d1, 5′d0, 5′d2}. Therefore, the first memory page MP1 having the first usage order value 5′d0 can be regarded as a memory page having the highest priority of the first memory 10 accessed by the transmitter TX and the receiver RX.



FIG. 3 is an illustration of acquiring a second usage order value 5′d1 having the highest priority from the first memory 10 of the data accessing system 100 after the first memory 10 is updated. Based on the aforementioned process, after the processor 11 selects the minimum usage order value 5′d0 as the first usage order value from the usage order value set {5′d6, 5′dl, 5′dO, 5′d2}, the processor 11 can update the first memory 100. For example, after the first memory page MP1 having the first usage order value 5′d0 of the first memory 10 is used, the first memory page MP1 can be set to an unavailable state. Therefore, the usage order value of the first memory page MP1 can be set to “XXX” for indicating that the first memory page MP1 having the usage order value “XXX” is not a candidate memory page anymore. Further, after the first memory 10 is updated, the processor 11 can acquire a minimum row usage order value of usage order values in each row of the plurality of usage order values in the “updated” first memory 10 again. In FIG. 3, the first memory 10 only changes the usage order value 5′d0 (i.e., re-set to “xxx”) of the memory pages R3 in the third row. Therefore, the usage order value set {5′d10, 5′d9, 5′d11, 5′d6} of the memory pages R1 in the first row, the usage order value set {5′d7, 5′d4, 5′d15, 5′d1} of the memory pages R2 in the second row, and the usage order value set {5 ‘d2, 5’ d5, 5′d14, 5′d13} of the memory pages R4 in the fourth row are maintained. In other words, the memory pages R1 in the first row including the memory page having the usage order value 5′d6 saved as the first value of the second memory 12, the memory pages R2 in the second row including the memory page having the usage order value dl saved as the second value of the second memory 12, and the memory pages R4 in the fourth row including the memory page having the usage order value 5′d2 saved as the fourth value of the second memory 12 are maintained after the first memory 10 is updated. However, since the usage order value set of the third memory pages R3 is updated as { 5′d3, 5′d8}, the processor 11 can select a minimum row usage order value 5′d3 from the usage order value set {5′d3, 5′d8} of the memory pages R3 in the third row. Further, in the memory pages R3 of the third row, the minimum row usage order value 5′d3 can be buffered as the third value of the second memory 12. Therefore, the usage order value set {5′d6, 5′dl, 5′d0, 5′d2} buffered in the second memory 12 can be updated as {5′d6, 5′dl, 5′d3, 5′d2}. Similarly, the processor 11 can select a minimum usage order value 5′d1 from the usage order value set {5′d6, 5′d1, 5′d3, 5′d2} as the second usage order value. Therefore, the second memory page MP2 having the second usage order value 5′d1 can be regarded as a memory page having the highest priority of the “updated” first memory 10 accessed by the transmitter TX and the receiver RX. Further, after the second memory page MP2 having the second usage order value 5′d1 of the first memory 10 is used, the second memory page MP2 can be set to the unavailable state. Therefore, the usage order value of the second memory page MP2 can be set to “XXX” for indicating that the second memory page MP2 having the usage order value “XXX” is not a candidate memory page anymore. Similarly, after the first memory 10 and the second memory 12 are updated again, the processor 11 can select a memory page having a usage order value 5′d2. Then, the memory page having the usage order value 5′d2 is prepared to be accessed by the transmitter TX and the receiver RX. Therefore, since the first memory 10 can be combined with the second memory 12 for quickly searching an appropriate memory page to be accessed by the transmitter TX and the receiver RX according to the usage order values corresponding to the plurality of memory pages, the data accessing system 100 can reduce the memory capacity required to save pointers and can further reduce time complexity.


Further, after the first memory 10 is used, when all memory pages in a certain row of the first memory 10 are unavailable, the certain row can be labeled as a null row for reducing a scanning dimension. For example, after the first memory 10 and the second memory 12 are updated several times, when all memory pages in a certain row of the first memory 10 have usage order values “XXX”, it implies that all memory pages in the certain row are unavailable. Therefore, the processor 11 can label the certain row as a null row. Since the null row is unprocessed, the search dimension and the time complexity can be reduced. Further, as previously mentioned, for the first memory 10, the memory pages having usage order values 5′d0 to 5′d15 can be consecutive memory pages or discrete memory pages. Further, in the data accessing system 100, the processor 11 can convert the plurality of memory pages in the first memory 10 to a plurality of consecutive memory pages or a plurality of discrete memory pages according to a mapping table. Any reasonable hardware or technology modification falls into the scope of the present invention.


FIG.4 is a flow chart of performing a data accessing method by the data accessing system 100. The data accessing method includes step S401 to step S406. Any reasonable step modification falls into the scope of the present invention. Step S401 to step S406 are illustrated below.

    • step S401: providing the first memory 10 comprising the plurality of memory pages;
    • step S402: acquiring the usage order value of each memory page of the plurality of memory pages;
    • step S403: acquiring the first usage order value 5′d0 having the highest priority from the plurality of usage order values corresponding to the plurality of memory pages in the first memory 10;
    • step S404: updating the first memory 10 after the first memory page MP1 having the first usage order value 5′d0 is used;
    • step S405: acquiring the second usage order value 5′d1 having the highest priority from the updated first memory after the first memory 10 is updated;
    • step S406: using the second memory page MP2 having the second usage order 5′d1.


Details of step S401 to step S406 are previously illustrated. Thus, they are omitted here. By using step S401 to step S406, the data accessing system 100 can quickly search an appropriate memory page to be accessed by the transmitter TX and the receiver RX according to the usage order values corresponding to the plurality of memory pages. Therefore, the data accessing system 100 can reduce the memory capacity required to save pointers and can further reduce time complexity.


To sum up, the present invention discloses a data accessing method and a data accessing system. The static random access memory of the data accessing system includes a plurality of memory pages and their usage order values. The data accessing system can use the usage order values and a register space for quickly searching an appropriate memory page to be accessed by the transmitter and the receiver. Further, the data accessing system can synchronously update contents stored in the static random access memory and the register space. Unlike conventional linked list structure, the data accessing system can process memory pages having usage order values. Therefore, the data accessing system can reduce the memory capacity required to save pointers and can further reduce time complexity.


Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.

Claims
  • 1. A data accessing method comprising: providing a first memory comprising a plurality of memory pages;acquiring a usage order value of each memory page of the plurality of memory pages;acquiring a first usage order value having a highest priority from a plurality of usage order values corresponding to the plurality of memory pages in the first memory;updating the first memory after a first memory page having the first usage order value is used;acquiring a second usage order value having a highest priority from the updated first memory after the first memory is updated; andusing a second memory page having the second usage order.
  • 2. The method of claim 1, wherein acquire the first usage order value having the highest priority from the plurality of usage order values corresponding to the plurality of memory pages in the first memory comprises: acquiring a minimum row usage order value of usage order values in each row of the plurality of usage order values in the first memory;buffering the minimum row usage order value of the usage order values in each row to a second memory; andacquiring a minimum usage order value from the second memory as the first usage order value.
  • 3. The method of claim 2, further comprising: updating a plurality of usage order values buffered in the second memory after the first memory is updated; andafter the first memory page having the first usage order value is used, setting the first memory page to an unavailable state for updating the first memory.
  • 4. The method of claim 1, wherein acquiring the second usage order value having the highest priority from the updated first memory after the first memory is updated comprises: acquiring a minimum row usage order value of usage order values in each row of the plurality of usage order values in the first memory;buffering the minimum row usage order value of the usage order values in each row to a second memory; andacquiring a minimum usage order value from the second memory as the second usage order value.
  • 5. The method of claim 4, further comprising after the second memory page having the second usage order value is used, setting the second memory page to an unavailable state for updating the second memory.
  • 6. The method of claim 1, further comprising: converting the plurality of memory pages in the first memory to a plurality of consecutive memory pages or a plurality of discrete memory pages according to a mapping table.
  • 7. The method of claim 1, wherein the plurality of memory pages in the first memory comprises at least one available memory page and at least one unavailable memory page, and the at least one unavailable memory page has no usage order value.
  • 8. The method of claim 1, wherein the first memory is a static random access memory (SRAM), and the second memory is a register.
  • 9. The method of claim 1, further comprising after the first memory is updated, when all memory pages in a certain row of the first memory are unavailable, labeling the certain row as a null row for reducing a scanning dimension.
  • 10. The method of claim 1, wherein the first memory comprises two-dimensional memory pages.
  • 11. A data accessing system comprising: a first memory comprising a plurality of memory pages and configured to save data;a receiver configured to receive input data and write the input data to the first memory;a transmitter configured to read output data from the first memory;and a processor coupled to the first memory, the receiver, and the transmitter and configured to control the first memory, the receiver, and the transmitter;wherein the processor acquires a usage order value of each memory page of the plurality of memory pages, the processor acquires a first usage order value having a highest priority from a plurality of usage order values corresponding to the plurality of memory pages in the first memory, the transmitter and the receiver access data through a first memory page having the first usage order value, the processor updates the first memory after the first memory page having the first usage order value is used, the processor acquires a second usage order value having a highest priority from the updated first memory after the first memory is updated, and the transmitter and the receiver access data through a second memory page having the second usage order value.
  • 12. The system of claim 1, wherein the processor acquires a minimum row usage order value of usage order values in each row of the plurality of usage order values in the first memory, a second memory is configured to buffer the minimum row usage order value of the usage order values in each row, and the processor acquires a minimum usage order value from the second memory as the first usage order value.
  • 13. The system of claim 12, the processor updates a plurality of usage order values buffered in the second memory after the first memory is updated, and after the first memory page having the first usage order value is used, the first memory page is set to an unavailable state for updating the first memory.
  • 14. The system of claim 11, wherein the processor acquires a minimum row usage order value of usage order values in each row of the plurality of usage order values in the first memory, a second memory is configured to buffer the minimum row usage order value of the usage order values in each row.
  • 15. The system of claim 14, wherein after the second memory page having the second usage order value is used, the second memory page is set to an unavailable state for updating the second memory.
  • 16. The system of claim 11, wherein the processor converts the plurality of memory pages in the first memory to a plurality of consecutive memory pages or a plurality of discrete memory pages according to a mapping table.
  • 17. The system of claim 11, wherein the plurality of memory pages in the first memory comprises at least one available memory page and at least one unavailable memory page, and the at least one unavailable memory page has no usage order value.
  • 18. The system of claim 11, wherein the first memory is a static random access memory (SRAM) , and the second memory is a register.
  • 19. The system of claim 11, wherein after the first memory is updated, when all memory pages in a certain row of the first memory are unavailable, the certain row is labeled as a null row for reducing a scanning dimension.
  • 20. The system of claim 11, wherein the first memory comprises two-dimensional memory pages.
Priority Claims (1)
Number Date Country Kind
111125763 Jul 2022 TW national