Flash controller for data caching, caching method and chip

By setting up multiple cache policies and storage media control logic circuits in the Flash controller, and determining the cache strategy based on the target address, the problem of improving the Flash data reading rate in the existing technology is solved, and efficient data reading in multiple scenarios is achieved Pick.

CN118939190APending Publication Date: 2024-11-12TONGXIN MICROELECTRONICS TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410975603.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The Flash controller cache strategy in the prior art is single, making it difficult to improve the data reading rate of the processor in Flash in a variety of application scenarios.

Method used

A Flash controller is designed, which includes multiple cache policies and storage media control logic circuits. The corresponding cache policies are determined according to the target address, and data is read in the Flash storage medium to realize data cache and improve processor data reading. rate.

Benefits of technology

Through the use of multi-cache strategy, the processor's data reading rate in Flash can be improved in a variety of scenarios and the processor's execution efficiency can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939190A_ABST
    Figure CN118939190A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a Flash controller for data caching, a caching method and a chip. The Flash controller comprises a cache region and a storage medium control logic circuit, wherein a plurality of cache strategies are arranged in the cache region; the storage medium control logic circuit is connected with the processor and is used for receiving a data access signal of the processor to a target address in the Flash controller; the storage medium control logic circuit is connected with the cache region and is used for determining a corresponding target cache strategy in the cache region according to a target address in the data access signal; the storage medium control logic circuit is connected with the Flash storage medium and used for reading data in the Flash storage medium, triggering data caching of the cache region according to a target caching strategy and returning target data corresponding to a target address to the processor, and the data reading rate of the processor in the Flash can be improved in multiple scenes through the multi-caching strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a Flash controller, a caching method and a chip for data caching. Background Art

[0002] Flash is an important component of the Microcontroller Unit (MCU), responsible for storing code and data. In the automotive electronics industry, Flash is a very important component, especially for automotive controllers. The code and data in Flash ensure that the controller behavior meets user expectations every time the car is powered on.

[0003] After the car is powered on, the processor (such as the CPU) will copy the key code to the static random access memory (SRAM) of the MCU. Among them, the access speed of SRAM is faster than Flash, which can improve the execution speed. Most of the remaining code and data are read from Flash by the CPU during the CPU execution process.

[0004] However, the cache strategy in the prior art is single. For example, when the CPU reads Flash data, it reads more data and puts the read data into the data cache of the Flash controller. This single cache strategy can only improve the data reading rate of the CPU in Flash in general scenarios. For data reading in specific scenarios, the existing cache strategy is difficult to achieve the effect of improving the data reading rate of the CPU in Flash. Therefore, the cache method in the Flash controller needs to be improved to support multiple cache strategies. Summary of the invention

[0005] The present invention provides a Flash controller, a caching method and a chip for data caching, so as to improve the data reading rate of a processor in Flash in various application scenarios.

[0006] According to one aspect of the present invention, a Flash controller for data caching is provided, the Flash controller comprising: a cache area and a storage medium control logic circuit; wherein:

[0007] A plurality of cache strategies are arranged in the cache area;

[0008] The storage medium control logic circuit is connected to the processor and is used to receive a data access signal from the processor to a target address in the Flash controller;

[0009] A storage medium control logic circuit is connected to the cache area and is used to determine a corresponding target cache strategy in the cache area according to a target address in the data access signal;

[0010] The storage medium control logic circuit is connected to the Flash storage medium, and is used for reading data in the Flash storage medium, triggering data caching of the cache area according to the target cache strategy, and returning target data corresponding to the target address to the processor.

[0011] Optionally, the Flash controller further includes: a cache policy execution logic circuit; the cache policy execution logic circuit is connected to the storage medium control logic circuit;

[0012] a cache policy execution logic circuit, configured to use the first cache policy as a target cache policy when determining that the target address in the data access signal is the first entry address in the first cache policy;

[0013] a cache policy execution logic circuit, configured to send each table entry address in the first cache policy to the storage medium control logic circuit and receive corresponding table entry data when the storage medium control logic circuit triggers data caching of the cache area according to the first cache policy;

[0014] The cache strategy execution logic circuit is connected to the cache area and is used to cache each entry address and corresponding entry data into a data cache table corresponding to the first cache strategy in the cache area.

[0015] Optionally, the cache policy execution logic circuit is also used to trigger the storage medium control logic circuit to read the target data corresponding to the target address in the data cache table and return it to the processor when it is determined that the target address in the data access signal is an address in the data cache table.

[0016] Optionally, the cache policy execution logic circuit is further configured to use the second cache policy as the target cache policy when it is determined that the target address in the data access signal is not in the cache area.

[0017] Optionally, the storage medium control logic circuit is also used to read second cache data in the Flash storage medium according to a second cache strategy in the cache area, and cache the second cache data and the corresponding second cache address in a cache sub-area in the cache area corresponding to the second cache strategy.

[0018] Optionally, the cache policy execution logic circuit is further used to trigger the storage medium control logic circuit to read target data corresponding to the target address in the cache sub-area and return it to the processor when it is determined that the target address in the data access signal is an address in the cache sub-area.

[0019] Optionally, in the first cache strategy, the first table entry address has a start mark, the last table entry address has an end mark, and the middle table entry address has a process mark.

[0020] Optionally, the cache strategy execution logic circuit is specifically used to send each table entry address to the storage medium control logic circuit in the address order in the first cache strategy and receive the corresponding table entry data when the storage medium control logic circuit triggers the data cache of the cache area according to the first cache strategy.

[0021] According to another aspect of the present invention, a method for data caching in a Flash controller is provided, and the method is applied to a Flash controller for data caching provided in any embodiment of the present invention; the method comprises:

[0022] receiving a data access signal from a processor to a target address in a Flash controller through a storage medium control logic circuit;

[0023] Determining a corresponding target cache strategy in the cache area according to a target address in the data access signal by a storage medium control logic circuit;

[0024] The data is read from the Flash storage medium through the storage medium control logic circuit, the data cache of the cache area is triggered according to the target cache policy, and the target data corresponding to the target address is returned to the processor.

[0025] According to another aspect of the present invention, a chip is provided. The chip includes a Flash controller for data caching provided by any embodiment of the present invention.

[0026] According to another aspect of the present invention, a vehicle-mounted terminal is provided. The vehicle-mounted terminal includes a chip provided by any embodiment of the present invention.

[0027] The technical solution of the embodiment of the present invention is to set up a Flash controller for data caching including a cache area and a storage medium control logic circuit, wherein: a plurality of cache strategies are set in the cache area; the storage medium control logic circuit is connected to the processor, and is used to receive a data access signal of the processor to a target address in the Flash controller; the storage medium control logic circuit is connected to the cache area, and is used to determine a corresponding target cache strategy in the cache area according to the target address in the data access signal; the storage medium control logic circuit is connected to the Flash storage medium, and is used to read data in the Flash storage medium, trigger data caching in the cache area according to the target cache strategy, and return the target data corresponding to the target address to the processor, thereby solving the Flash data caching problem in multiple application scenarios, and the data reading rate of the processor in the Flash can be improved in multiple scenarios through multiple cache strategies, thereby improving the execution efficiency of the processor.

[0028] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0030] Figure 1 is a structural diagram of a Flash controller for data caching provided according to an embodiment of the present invention;

[0031] Figure 2 is a schematic diagram of the structure of a first cache strategy table provided according to an embodiment of the present invention;

[0032] Figure 3 is a flowchart of a first cache strategy setting provided according to an embodiment of the present invention;

[0033] Figure 4 is a schematic diagram of the structure of a data cache table provided according to an embodiment of the present invention;

[0034] Figure 5 is a flow chart of a data caching method in a Flash controller provided according to an embodiment of the present invention;

[0035] Figure 6 is a flow chart of another data caching method in a Flash controller provided according to an embodiment of the present invention;

[0036] Figure 7 is a schematic diagram of the structure of a chip provided according to an embodiment of the present invention;

[0037] Figure 8 It is a structural schematic diagram of a vehicle-mounted terminal provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0040] Embodiment 1

[0041] Figure 1 1 is a schematic diagram of a Flash controller for data caching according to an embodiment of the present invention. This embodiment can be applied to multiple application scenarios where the CPU reads data from the Flash in advance to improve the CPU execution efficiency. Figure 1 As shown, the Flash controller 100 includes: a cache area 110 and a storage medium control logic circuit 120. Among them:

[0042] A plurality of cache strategies are set in the cache area. The cache strategy may include a general cache strategy and one or more custom cache strategies. Exemplarily, in an embodiment of the present invention, the cache strategy includes a first cache strategy and a second cache strategy. The first cache strategy may be a custom cache strategy. The second cache strategy may be a general cache strategy.

[0043] like Figure 1As shown, a register interface can be set in the Flash control. The register interface is used to receive the cache policy set by the user. For example, in a specific application scenario, the user can specify a set of addresses that need to be cached according to the program to be executed in advance, thereby setting the data reading order and generating a first cache policy. The second cache policy can be designed based on the assumption of spatial correlation. For example, it is believed that data with adjacent addresses is more likely to be accessed. Under the second cache policy, for example, the CPU only requires to read 64 bits of data starting from address 0, the Flash controller reads 256 bits of data from address 0, sends the first 64 bits of data to the CPU, and the read 256 bits of data are all placed in the cache area.

[0044] The cache area may be a memory and / or a register. Exemplarily, the first cache strategy includes a cache strategy table and a data cache table. The cache strategy table may be set in a memory or a register. The data cache table may be set in a memory. The second cache strategy may be set in a memory. The memory may be an SRAM. Since the read rate of the SRAM is faster than that of the register, in an embodiment of the present invention, by setting the data cache table of the first cache strategy in the memory and setting the second cache strategy in the memory, the data read rate of the processor in the Flash controller can be further improved.

[0045] like Figure 1 As shown, the storage medium control logic circuit is connected to the processor, and is used to receive the data access signal of the processor to the target address in the Flash controller; the storage medium control logic circuit is connected to the cache area, and is used to determine the corresponding target cache strategy in the cache area according to the target address in the data access signal; the storage medium control logic circuit is connected to the Flash storage medium, and is used to read data in the Flash storage medium, trigger data caching in the cache area according to the target cache strategy, and return the target data corresponding to the target address to the processor.

[0046] In an embodiment of the present invention, the target cache strategy is determined based on the target address. For example, when the target address is the first table entry address in the first cache strategy, the first cache strategy is determined as the target cache strategy. For another example, when the target address is not the first table entry address in the first cache strategy, and the data corresponding to the target address is not cached, the second cache strategy can be determined as the target cache strategy. That is, when the CPU accesses data to the Flash controller, it is necessary to determine whether the target address in the current data access signal is the first table entry address in the first cache strategy to determine the target cache strategy.

[0047] The storage medium control logic circuit can exchange data, addresses and control signals with the Flash storage medium. The storage medium control logic circuit can read data from the Flash storage medium according to the target cache strategy, so that the cache area caches the read address and data according to the target cache strategy.

[0048] In order to accurately determine the target cache strategy, in an optional implementation of an embodiment of the present invention, the Flash controller also includes: a cache strategy execution logic circuit; the cache strategy execution logic circuit is connected to the storage medium control logic circuit; the cache strategy execution logic circuit is used to use the first cache strategy as the target cache strategy when it is determined that the target address in the data access signal is the first table entry address in the first cache strategy; the cache strategy execution logic circuit is used to send each table entry address in the first cache strategy to the storage medium control logic circuit and receive the corresponding table entry data when the storage medium control logic circuit triggers data caching in the cache area according to the first cache strategy; the cache strategy execution logic circuit is connected to the cache area, and is used to cache each table entry address and the corresponding table entry data into the data cache table corresponding to the first cache strategy in the cache area.

[0049] For example, Figure 2 is a schematic diagram of the structure of a first cache strategy table provided according to an embodiment of the present invention. Figure 2 As shown, the first cache strategy table includes multiple table entry addresses. Each table entry address may be marked with information. In an optional implementation of the embodiment of the present invention, the first table entry address in the first cache strategy has a start mark, the last table entry address has an end mark, and the middle table entry address has a process mark.

[0050] In the embodiment of the present invention, the user can set the first cache strategy through the register interface. For example, Figure 3 FIG. 1 is a flowchart of a first cache strategy setting provided according to an embodiment of the present invention. Figure 3 As shown, the user can set cache policy table item 0, that is, write the first cache policy table, and the cache policy table item includes the table item address and the start mark; the user sets cache policy table item 1, that is, writes the table item address and the process mark; wherein, there can be multiple process marks and corresponding table item addresses; finally, the user sets cache policy table item N, that is, writes the table item address and the end mark. A maximum of M items can be set in the first cache policy table, and the user can configure the first cache policy table item with no more than M items.

[0051] The basis for determining the first cache strategy as the target cache strategy is that the CPU reads the data corresponding to the first table entry address in the first cache strategy table. When data is read according to the first cache strategy table, it can be performed in the order in which the table entry addresses are arranged. In an optional implementation of an embodiment of the present invention, the cache strategy execution logic circuit is specifically used to send each table entry address to the storage medium control logic circuit according to the address order in the first cache strategy when the storage medium control logic circuit triggers data caching in the cache area according to the first cache strategy, and receives the corresponding table entry data.

[0052] At this time, since the target address in the data access signal of the CPU is the first table entry address in the first cache strategy table, the execution of the first cache strategy is triggered. Therefore, the Flash controller can read the corresponding other table entry data from the Flash storage medium according to the other table entry addresses in the first cache strategy table, so that the cache area performs data and address caching.

[0053] When the cache area caches data and addresses according to the first cache strategy table, the data and addresses may be cached in the data cache table. Figure 4 Schematic diagram of a data cache table provided according to an embodiment of the present invention. Figure 4 As shown, in the data cache table, there is a one-to-one correspondence between the address and the data, so that the Flash controller can read the corresponding data according to the address required by the CPU.

[0054] When the cache strategy execution logic circuit reads the last table entry address corresponding to the end mark in the first cache strategy table, it stops sending the table entry address to the storage medium control logic circuit. After the storage medium control logic circuit reads the data corresponding to the last table entry address from the Flash storage medium, it stops reading data from the Flash storage medium. The cache area caches each table entry address and the corresponding data in the first cache strategy table. The cache is specifically in the data cache table in the cache area. When caching, the data cache table can be generated according to the order of the table entry addresses in the first cache strategy table.

[0055] In an optional implementation of an embodiment of the present invention, the cache policy execution logic circuit is also used to trigger the storage medium control logic circuit to read the target data corresponding to the target address in the data cache table and return it to the processor when it is determined that the target address in the data access signal is an address in the data cache table.

[0056] If the target address is in the data cache table, the Flash controller can read the data in the data cache table and send the data to the CPU, which is suitable for accelerating CPU data reading in specific scenarios. When the CPU accesses data from the Flash controller, it can read data from the data cache table to increase the data reading rate, thereby improving the CPU execution efficiency. When the data cache table is set in SRAM, the data reading rate of the CPU can be further increased because the SRAM data reading rate is faster than the register.

[0057] In an optional implementation of the embodiment of the present invention, the cache policy execution logic circuit is further configured to use the second cache policy as the target cache policy when it is determined that the target address in the data access signal is not in the cache area.

[0058] When the target address is not in the cache area, it indicates that the data corresponding to the target address is not cached and the target address does not match the first cache strategy. At this time, the second cache strategy can be used to pre-cache the data corresponding to the target address and the data that the CPU may want to read.

[0059] In an optional implementation of an embodiment of the present invention, the storage medium control logic circuit is also used to read the second cache data in the Flash storage medium according to the second cache strategy in the cache area, and cache the second cache data and the corresponding second cache address in a cache sub-area in the cache area corresponding to the second cache strategy.

[0060] Among them, the second cache strategy is set based on the spatial correlation assumption. Therefore, when the storage medium control logic circuit reads the second cache data in the Flash storage medium according to the second cache strategy in the cache area, the second cache data corresponding to the preset address number after the target address can be directly read. The second cache data and the corresponding second cache address can be cached in the cache area. Specifically, the second cache data and the corresponding second cache address can be cached in a cache sub-area. The cache sub-area can be a storage area in the memory.

[0061] In an optional implementation of an embodiment of the present invention, the cache policy execution logic circuit is also used to trigger the storage medium control logic circuit to read the target data corresponding to the target address in the cache sub-area and return it to the processor when it is determined that the target address in the data access signal is an address in the cache sub-area.

[0062] If the target address is in the cache sub-area, the Flash controller can directly read the data in the cache sub-area and send the data to the CPU, which is suitable for accelerating CPU data reading in general scenarios.

[0063] The technical solution of the embodiment of the present invention is to set up a Flash controller for data caching including a cache area and a storage medium control logic circuit, wherein: a plurality of cache strategies are set in the cache area; the storage medium control logic circuit is connected to the processor, and is used to receive a data access signal of the processor to a target address in the Flash controller; the storage medium control logic circuit is connected to the cache area, and is used to determine a corresponding target cache strategy in the cache area according to the target address in the data access signal; the storage medium control logic circuit is connected to the Flash storage medium, and is used to read data in the Flash storage medium, trigger data caching in the cache area according to the target cache strategy, and return the target data corresponding to the target address to the processor, thereby solving the Flash data caching problem in multiple application scenarios, and the data reading rate of the processor in the Flash can be improved in multiple scenarios through multiple cache strategies, thereby improving the execution efficiency of the processor.

[0064] The Flash controller for data caching provided in the embodiment of the present invention can add a cache strategy mechanism for specific scenarios on the basis of a general cache method. The data pre-read cache in the specific scenario is more consistent with the data read by the CPU program execution, thereby improving the data reading rate of the CPU in the Flash controller in the specific scenario to improve the CPU execution efficiency.

[0065] Embodiment 2

[0066] Figure 5 1 is a flow chart of a data caching method in a Flash controller provided according to an embodiment of the present invention. The method can be executed by a Flash controller. The technical solution in this embodiment can be combined with each optional solution in one or more of the above embodiments. Figure 5 As shown, the method includes:

[0067] Step 510: Receive a data access signal from a processor to a target address in a Flash controller through a storage medium control logic circuit.

[0068] Step 520: Determine a corresponding target cache strategy in the cache area according to the target address in the data access signal through the storage medium control logic circuit.

[0069] Step 530: read data from the Flash storage medium through the storage medium control logic circuit, trigger data caching in the cache area according to the target cache policy, and return the target data corresponding to the target address to the processor.

[0070] On the basis of the above implementation, optionally, the method further includes: when the cache policy execution logic circuit determines that the target address in the data access signal is the first table entry address in the first cache policy, the first cache policy is used as the target cache policy; when the storage medium control logic circuit triggers data caching in the cache area according to the first cache policy, the cache policy execution logic circuit sends each table entry address in the first cache policy to the storage medium control logic circuit and receives corresponding table entry data; and the cache policy execution logic circuit caches each table entry address and the corresponding table entry data into the data cache table corresponding to the first cache policy in the cache area.

[0071] Based on the above implementation, optionally, the method further includes: when the cache policy execution logic circuit determines that the target address in the data access signal is an address in the data cache table, triggering the storage medium control logic circuit to read the target data corresponding to the target address in the data cache table and return it to the processor.

[0072] Based on the above implementation, optionally, the method further includes: executing the second cache strategy as the target cache strategy when it is determined, through the cache strategy execution logic circuit, that the target address in the data access signal is not in the cache area.

[0073] Based on the above implementation, optionally, the method also includes: reading the second cache data in the Flash storage medium according to the second cache strategy in the cache area through the storage medium control logic circuit, and caching the second cache data and the corresponding second cache address in the cache sub-area corresponding to the second cache strategy in the cache area.

[0074] Based on the above implementation, optionally, the method further includes: when the cache policy execution logic circuit determines that the target address in the data access signal is an address in the cache sub-area, triggering the storage medium control logic circuit to read the target data corresponding to the target address in the cache sub-area and return it to the processor.

[0075] Based on the above implementation, optionally, in the first cache strategy, the first entry address has a start mark, the last entry address has an end mark, and the middle entry address has a process mark.

[0076] Based on the above implementation, optionally, the method further includes: when the storage medium control logic circuit triggers data caching of the cache area according to the first cache strategy through the cache strategy execution logic circuit, the address of each table entry is sent to the storage medium control logic circuit in accordance with the address order in the first cache strategy, and the corresponding table entry data is received.

[0077] The technical solution of the embodiment of the present invention receives a data access signal of a processor to a target address in a Flash controller through a storage medium control logic circuit; determines a corresponding target cache strategy in a cache area according to the target address in the data access signal through the storage medium control logic circuit; reads data in a Flash storage medium through the storage medium control logic circuit, triggers data caching in the cache area according to the target cache strategy, and returns the target data corresponding to the target address to the processor, thereby solving the Flash data cache problem in multiple application scenarios. Through multiple cache strategies, the data reading rate of the processor in Flash can be improved in multiple scenarios, thereby improving the execution efficiency of the processor.

[0078] Figure 6 FIG. 1 is a flow chart of another data caching method in a Flash controller provided according to an embodiment of the present invention. Figure 6 As shown, a specific usage process of the data caching method in the Flash controller provided by the embodiment of the present invention may be: the CPU initiates a data access signal of the target address to the Flash controller; the cache policy execution logic circuit in the Flash controller determines whether the target address is the first table entry address in the first cache strategy table, the address in the cache sub-area, or the address in the data cache table according to the data access signal.

[0079] If the target address is the first table item address in the first cache strategy table, the first cache strategy execution mechanism is triggered, and the storage medium control logic circuit in the Flash controller reads the target data corresponding to the target address from the Flash storage medium, returns the target data to the processor, and reads the corresponding other table item data from the Flash storage medium according to other table item addresses in the first cache strategy table; the cache strategy execution logic circuit in the Flash controller caches the target address and the corresponding target data, as well as other table item addresses and corresponding other table item data, in the data cache table until they are cached to the table item address corresponding to the end mark in the order of addresses in the first cache strategy table. By pre-caching data in the data cache table in the order of addresses in the first cache strategy table, the CPU can directly read the data in the data cache table when it reads the matching data in a specific scenario in the subsequent process, thereby improving the data reading rate of the CPU in the Flash controller and improving the CPU execution efficiency.

[0080] If the target address is an address in a cache sub-area or an address in a data cache table, the storage medium control logic circuit in the Flash controller reads the target data corresponding to the target address in the cache sub-area or the data cache table; and returns the target data to the processor.

[0081] If the target address is not the first entry address in the first cache strategy table, the address in the cache sub-area, or the address in the data cache table, the storage medium control logic circuit in the Flash controller reads the corresponding second cache data from the Flash storage medium according to the second cache strategy, and caches the second cache data and the corresponding second cache address to the cache sub-area. By caching data in the cache sub-area in advance, when the CPU reads matching data in a general scenario later, it can directly read in the cache sub-area, thereby improving the data reading rate of the CPU in the Flash controller and improving the CPU execution efficiency.

[0082] The data caching method in the Flash controller provided in the embodiment of the present invention can add a cache strategy mechanism in a specific scenario on the basis of a general cache method. The data pre-read cache in the specific scenario is more consistent with the data required for the CPU program execution, thereby increasing the data reading rate of the CPU in the Flash controller to improve the CPU execution efficiency.

[0083] Embodiment 3

[0084] Figure 7 is a schematic diagram of the structure of a chip provided according to an embodiment of the present invention. Figure 7 As shown, the chip includes: a Flash controller provided by any embodiment of the present invention.

[0085] Embodiment 4

[0086] Figure 8 is a schematic diagram of the structure of a vehicle-mounted terminal provided according to an embodiment of the present invention. Figure 8 As shown, the vehicle-mounted terminal includes: a chip provided by any embodiment of the present invention.

[0087] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0088] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A Flash controller for data caching, It is characterized in that The Flash controller includes: a cache area and a storage medium control logic circuit; wherein: A plurality of cache strategies are arranged in the cache area; The storage medium control logic circuit is connected to the processor and is used to receive a data access signal from the processor to a target address in the Flash controller; A storage medium control logic circuit is connected to the cache area and is used to determine a corresponding target cache strategy in the cache area according to a target address in the data access signal; The storage medium control logic circuit is connected to the Flash storage medium, and is used for reading data in the Flash storage medium, triggering data caching of the cache area according to the target cache strategy, and returning target data corresponding to the target address to the processor.

2. The Flash controller according to claim 1, It is characterized in that Also includes: Cache policy execution logic circuit; The cache policy execution logic circuit is connected to the storage medium control logic circuit; a cache policy execution logic circuit, configured to use the first cache policy as a target cache policy when determining that the target address in the data access signal is the first entry address in the first cache policy; a cache policy execution logic circuit, configured to send each table entry address in the first cache policy to the storage medium control logic circuit and receive corresponding table entry data when the storage medium control logic circuit triggers data caching of the cache area according to the first cache policy; The cache strategy execution logic circuit is connected to the cache area and is used to cache each entry address and corresponding entry data into a data cache table corresponding to the first cache strategy in the cache area.

3. The Flash controller according to claim 2, It is characterized in that The cache policy execution logic circuit is also used to trigger the storage medium control logic circuit to read the target data corresponding to the target address in the data cache table and return it to the processor when it is determined that the target address in the data access signal is the address in the data cache table.

4. The Flash controller according to claim 2, It is characterized in that The cache strategy execution logic circuit is further configured to use the second cache strategy as the target cache strategy when it is determined that the target address in the data access signal is not in the cache area.

5. The Flash controller according to claim 4, It is characterized in that The storage medium control logic circuit is also used to read the second cache data in the Flash storage medium according to the second cache strategy in the cache area, and cache the second cache data and the corresponding second cache address in the cache sub-area corresponding to the second cache strategy in the cache area.

6. The Flash controller according to claim 5, It is characterized in that The cache policy execution logic circuit is also used to trigger the storage medium control logic circuit to read the target data corresponding to the target address in the cache sub-area and return it to the processor when it is determined that the target address in the data access signal is an address in the cache sub-area.

7. The Flash controller according to claim 2, It is characterized in that In the first cache strategy, the first table entry address has a start mark, the last table entry address has an end mark, and the middle table entry address has a process mark.

8. The Flash controller according to claim 7, It is characterized in that The cache strategy execution logic circuit is specifically used to send each table entry address to the storage medium control logic circuit according to the address sequence in the first cache strategy and receive the corresponding table entry data when the storage medium control logic circuit triggers the data cache of the cache area according to the first cache strategy.

9. A data caching method in a Flash controller, It is characterized in that The method is applied to a Flash controller for data caching according to any one of claims 1 to 8; the method comprises: receiving a data access signal from a processor to a target address in a Flash controller through a storage medium control logic circuit; Determining a corresponding target cache strategy in the cache area according to a target address in the data access signal by a storage medium control logic circuit; The data is read from the Flash storage medium through the storage medium control logic circuit, the data cache of the cache area is triggered according to the target cache policy, and the target data corresponding to the target address is returned to the processor.

10. A chip, It is characterized in that The chip includes a Flash controller for data caching as described in any one of claims 1-8.