Method for setting and retrieving data attributes of Flash controller and related equipment
By setting the target data attributes and determining the search method in the Flash controller, and matching the data attributes, the problem of inaccurate data retrieval in Flash storage media is solved, and efficient and accurate data retrieval is achieved.
Patent Information
- Application Number
- CN202411123317.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-17
AI Technical Summary
The prior art cannot meet users' precise retrieval needs for data in Flash storage media, and cannot accurately locate and read target data.
By setting the target data attributes in the Flash controller and determining the search method, and accurately matching the data attributes, the target data corresponding to the target data attributes in the Flash storage medium and its storage address are read.
It realizes accurate positioning and reading of data in Flash storage media, improves the accuracy and efficiency of data access, and meets users' accurate retrieval needs.
Smart Images

Figure CN119148930A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Flash technology, for example, to a method for setting and retrieving data attributes of a Flash controller, a Flash controller, and a Flash storage medium. Background Art
[0002] In the automotive electronics industry, Flash is an important component of MCU (Microcontroller Unit), responsible for storing code and data. Especially for car controllers, the data in Flash ensures that the car controller behaves as expected every time the car is powered on.
[0003] The Flash controller is an interface for users to use the Flash storage medium, which encapsulates the complex operation process of the Flash storage medium. In the related art, the Flash controller sends a read command containing the starting address and read length of the target data to the Flash storage medium. After receiving the read command, the Flash storage medium reads the corresponding data according to the starting address and read length in the command, and returns it to the Flash controller through the communication interface, thereby realizing the reading of data in the Flash storage medium.
[0004] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art: a read command including the starting address and read length of the target data is sent to the Flash storage medium through the Flash controller, so that the data in the Flash storage medium is read according to the starting address and read length in the command, which cannot meet the user's demand for accurate retrieval of data in the Flash storage medium.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0007] The embodiments of the present disclosure provide a method for setting and retrieving data attributes of a Flash controller, a Flash controller, and a Flash storage medium, so as to meet the user's demand for accurate retrieval of data in a Flash storage medium.
[0008] In some embodiments, a Flash controller is connected to a Flash storage medium, and data attributes of user data are stored in the Flash storage medium. A data retrieval method for the Flash controller includes: setting target data attributes and determining a target data retrieval method; reading target data corresponding to the target data attributes in the Flash storage medium according to the target data retrieval method; and obtaining the target data and a storage address corresponding to the target data.
[0009] In some embodiments, a Flash controller is connected to a Flash storage medium, and data attributes of user data are stored in the Flash storage medium; the Flash controller includes a data attribute setting module, a data attribute search module and a Flash storage medium control module, wherein: the data attribute setting module is configured to set target data attributes; the data attribute search module is configured to determine a target data retrieval method; the Flash storage medium control module is connected to the data attribute setting module, the data attribute search module and the Flash storage medium, and is configured to read the target data corresponding to the target data attributes in the Flash storage medium according to the target data retrieval method, and obtain the target data and the storage address corresponding to the target data.
[0010] In some embodiments, the Flash controller includes a processor and a memory storing program instructions, and the processor is configured to perform the aforementioned method for setting and retrieving Flash controller data attributes when executing the program instructions.
[0011] In some embodiments, the Flash storage medium is connected to the aforementioned Flash controller, and includes a user data storage area and a data attribute storage area, wherein: the user data storage area is configured to store user data; and the data attribute storage area is configured to store data attributes of user data.
[0012] The method for setting and retrieving data attributes of a Flash controller, the Flash controller, and the Flash storage medium provided in the embodiments of the present disclosure can achieve the following technical effects:
[0013] In the disclosed technical solution, the Flash controller is connected to the Flash storage medium, and the data attributes of the user data are stored in the Flash storage medium. After the Flash controller determines the target data retrieval method and the target data attributes, the target data corresponding to the target data attributes in the Flash storage medium are read according to the target data retrieval method, thereby obtaining the target data and the storage address corresponding to the target data. In this way, by determining the target data retrieval method and the target data attributes, accurate positioning and reading of the data in the Flash storage medium are achieved, allowing the user to select a suitable retrieval method according to specific needs, and accurately match the data attributes, thereby ensuring that the required target data corresponding to the target data attributes and its storage address can be accurately retrieved from the Flash storage medium. This solution effectively meets the user's demand for accurate retrieval of data in the Flash storage medium, and improves the accuracy and efficiency of data access.
[0014] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0016] Figure 1 is a schematic diagram of a connection between a Flash controller and a Flash storage medium provided by an embodiment of the present disclosure;
[0017] Figure 2 is a schematic diagram of the structure of a Flash storage medium provided by an embodiment of the present disclosure;
[0018] Figure 3 It is a flowchart of a method for setting and retrieving data attributes of a Flash controller provided by an embodiment of the present disclosure;
[0019] Figure 4 is a flowchart of another method for setting and retrieving Flash controller data attributes provided by an embodiment of the present disclosure;
[0020] Figure 5 It is a flowchart of a method for setting data attributes of a Flash controller provided by an embodiment of the present disclosure;
[0021] Figure 6 is a flowchart of another method for setting and retrieving Flash controller data attributes provided by an embodiment of the present disclosure;
[0022] Figure 7 is a schematic diagram of the structure of a Flash controller provided by an embodiment of the present disclosure;
[0023] Figure 8 It is a structural diagram of another Flash controller provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0025] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure 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 terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0026] Unless otherwise specified, the term "plurality" means two or more than two. In the disclosed embodiment, the character " / " indicates that the objects before and after are in an "or" relationship. For example, A / B means: A or B. The term "and / or" is a description of the association relationship between objects, indicating that three relationships may exist. For example, A and / or B means: A or B, or, the three relationships of A and B. The term "corresponding" may refer to an association relationship or a binding relationship, and the correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0027] Figure 1 FIG. 1 is a schematic diagram of a connection between a Flash controller and a Flash storage medium provided by an embodiment of the present disclosure. Figure 1 As shown, the Flash controller obtains user input through a user interface. In addition, the Flash controller establishes a communication connection with the Flash storage medium to transmit data, addresses, and control signals. The data includes user data, ECC (Error Checking and Correction) check data calculated from the user data, and data attributes specified by the user.
[0028] Generally speaking, Flash storage media has fixed specifications, such as 141-bit width, 280-bit width, etc. The meaning of the bits in the Flash storage media is defined by the Flash controller, and is generally divided into data bits and ECC check bits. Among them, the data bits are used to store user data, and the bit widths are generally selected to be 32 bits, 64 bits, 128 bits, 256 bits, etc.; the ECC check bits are calculated based on user data to protect the integrity of user data, and the length of the ECC check bits is determined by the selected ECC algorithm. This bit width definition method may not completely occupy all the bits of the Flash storage medium. For example, out of 141 bits, 128 bits are used as user data, 9 bits are used as ECC check bits, and the remaining 4 bits are not used.
[0029] In the embodiment of the present disclosure, the Flash controller is connected to the Flash storage medium, and the Flash storage medium stores data attributes of user data. Figure 2 As shown, the bit width of the Flash storage medium is N bits, the bit width of the user data is X bits, the ECC check data of the selected ECC algorithm is Y bits, and the remaining (NXY) bits are used as data attributes. The data attributes are designed according to the type of data that the Flash needs to store. In some practical applications, the data attributes include management data and ordinary data, such as the file header data of the file system, which belongs to management data, and the file body data of the file system, which belongs to ordinary data. In other practical applications, the data attributes include large data and small data, such as file data larger than 100M in the file system, which belongs to large data, and file data smaller than 100M in the file system, which belongs to small data.
[0030] Taking a Flash storage medium with a bit width of 141 as an example (i.e., N=141), 128 bits are used as user data (i.e., X=128), 9 bits are used as ECC check data (i.e., Y=9), and the remaining 4 bits store data attributes. Binary is used to represent data attributes, for example, binary 0101 represents management data, and binary 1111 represents ordinary data.
[0031] In the Flash storage medium, by adding data attributes, the remaining idle bits of the Flash storage medium are utilized, the utilization rate of the Flash storage medium is improved, and the user's retrieval operation on the Flash data of the target data attribute in the Flash storage medium is also convenient.
[0032] The present disclosure provides a data retrieval method for a Flash controller, combined with Figure 3 As shown, the following steps are included:
[0033] S301, setting target data attributes and determining target data retrieval method.
[0034] Here, the target data retrieval mode indicates the mode of retrieving data from the Flash storage medium, for example, it can be sequential reading, random reading or reading according to a set mode. The target data attribute indicates the characteristics of the target data to be retrieved, such as management data or ordinary data, and the target data attribute can be set according to the target data attribute set by the user.
[0035] S302, reading target data corresponding to the target data attribute in the Flash storage medium according to the target data retrieval method.
[0036] The Flash controller sends a read command to the Flash storage medium according to the target data retrieval mode and the target data attribute. The Flash storage medium responds to the read command, thereby comparing the target data attribute with the data attribute of the user data in the Flash storage medium according to the target data retrieval mode, and retrieves the target data corresponding to the target data attribute.
[0037] Optionally, according to the target data retrieval method, the target data corresponding to the target data attribute in the Flash storage medium is read, including: parsing the target data retrieval method to obtain the starting data address, the address change direction and the address change step; taking the starting data address as the starting point, along the address change direction, reading the data in the Flash storage medium according to the address change step to obtain the target data corresponding to the target data attribute.
[0038] According to the determined target data retrieval method, the Flash controller will parse the starting data address, as well as the address change direction (such as increasing or decreasing) and address change step size (such as the value of the address increase or decrease after each read) when reading data. In the process of reading data, the Flash controller will check whether each read data block meets the target data attributes. Once data that meets the target data attributes is found, it will be returned as the target data.
[0039] By clarifying the target data attributes and target data retrieval methods, the Flash controller can more accurately locate and read the required data, avoiding unnecessary data reading and transmission, and improving the efficiency of data retrieval.
[0040] Optionally, starting from the starting data address, along the address change direction, the data in the Flash storage medium is read according to the data query step length to obtain target data corresponding to the target data attribute, including: obtaining the starting data attribute corresponding to the starting data in the starting data address in the Flash storage medium; when the starting data attribute matches the target data attribute, the starting data is used as the target data.
[0041] When reading each data block, the Flash controller checks the data attributes of the data block, that is, obtains the starting data attributes corresponding to the starting data in the starting data address. The Flash controller compares the starting data attributes with the target data attributes specified by the user or system. If the two match, the starting data is used as the target data. Determining the target data by comparing data attributes, rather than just based on data address or data content, greatly improves the accuracy of data retrieval.
[0042] S303, obtaining target data and a storage address corresponding to the target data.
[0043] After determining the target data, the Flash controller records the target data and the storage address of the target data on the Flash storage medium.
[0044] Using the data retrieval method for a Flash controller provided by an embodiment of the present disclosure, the Flash controller is connected to a Flash storage medium, and the data attributes of user data are stored in the Flash storage medium. After the Flash controller determines the target data retrieval method and the target data attributes, the target data corresponding to the target data attributes in the Flash storage medium are read according to the target data retrieval method, thereby obtaining the target data and the storage address corresponding to the target data. In this way, by determining the target data retrieval method and the target data attributes, accurate positioning and reading of data in the Flash storage medium are achieved, allowing the user to select a suitable retrieval method according to specific needs, and accurately match the data attributes, thereby ensuring that the required target data corresponding to the target data attributes and its storage address can be accurately retrieved from the Flash storage medium. This solution effectively meets the user's demand for accurate retrieval of data in the Flash storage medium, and improves the accuracy and efficiency of data access.
[0045] In some embodiments, starting from the starting data address, data in the Flash storage medium is read along the address change direction according to the address change step, including: obtaining the starting data attribute corresponding to the starting data in the starting data address in the Flash storage medium; when the starting data attribute does not match the target data attribute, determining the next data address based on the starting data address along the address change direction according to the address change step; and continuing to read the data in the next data address until the data retrieval cutoff condition is met.
[0046] Optionally, the data retrieval cutoff condition includes: a data attribute corresponding to the data in the next data address matches a target data attribute.
[0047] When the data attribute corresponding to the data in the next data address matches the target data attribute, the Flash controller finds the target data required by the user or the system, so the Flash controller stops reading.
[0048] Optionally, the data retrieval cut-off condition includes: the next data address exceeds the address range of the Flash storage medium.
[0049] When the next data address exceeds the address range of the Flash storage medium, the Flash controller has traversed the entire Flash storage medium but has not found data that matches the target data attribute. Therefore, the Flash controller stops reading.
[0050] Through detailed data attribute matching checks, it is possible to ensure that the data found does meet the needs of the user or system, thereby improving the accuracy of data retrieval. At the same time, setting clear data retrieval cutoff conditions can avoid unnecessary reading operations, thereby optimizing the data retrieval process and improving retrieval efficiency.
[0051] In some practical applications, the next data address is determined based on the starting data address along the address change direction and according to the address change step length, including determining the next data address in the following manner:
[0052] address n =address 0 +D 1 ×step 1 +……+D n ×step n
[0053] Among them, address 0 is the starting data address, address n is the next data address, D 1 Change direction for the first address, step 1 is the first address change step, D n Change direction for the nth address, step n is the nth address change step, and n is the next data address number.
[0054] Here, D n Change direction for the nth address. When D n When the value is +1, it means that the change address (that is, the next data address) increases. n When the value is -1, it means that the change address decreases.
[0055] In some possible implementations, the address change direction D n Satisfies the following relationship:
[0056] D m =-D m-1
[0057] Among them, D m The mth address changes direction, D m-1 Change direction for the m-1th address.
[0058] m=N / P, m is the reverse data address number, N is the total data address number, p is the ratio number, p=5, 3, 2.
[0059] Address change step length n Satisfies the following relationship:
[0060] step m <step m-1
[0061] Among them, step m is the mth address change step, step m-1 is the m-1th address change step.
[0062] For large amounts of data (e.g., tens of thousands of records) in Flash storage media, when a larger address change step is selected, the previous data can be randomly reviewed according to the above retrieval method, thereby better optimizing the data retrieval process and improving the accuracy of data retrieval.
[0063] In the above practical application, the starting data address is a fixed initial data address.
[0064] When the next data address is the first data address, that is, address n =address 1 , the first data address is calculated as follows:
[0065] address 1 =address 0 +D 1 ×step 1
[0066] Among them, address 0 is the starting data address, address 1 is the first data address, D 1 Change direction for the first address, step 1 This is the first address change step.
[0067] When the next data address is the second data address, that is, address n =address 2, the second data address is calculated as follows:
[0068] address 2 =address 0 +D 1 ×step 1 +D 2 ×step 2
[0069] Among them, address 0 is the starting data address, address 2 is the second data address, D 1 Change direction for the first address, step 1 is the first address change step, D 2 Change direction for the second address, step 2 This is the second address change step.
[0070] In some practical applications, the next data address is determined based on the starting data address along the address change direction and according to the address change step length, including determining the next data address in the following manner:
[0071] address n =address 0 +D×step
[0072] Among them, address 0 is the starting data address, address n is the next data address, D is the address change direction, and step is the address change step size.
[0073] In the above practical application, the starting data address is a variable data address. 0 The initial data address specified by the user or system. 0 Determine the next data address address 1 After that, the next data address address 1 The value of is assigned to the starting data address address 0 , that is, address 0 =address 1 Similarly, according to the starting data address address 0 Determine the next data address address 2 After that, the next data address address 2 The value of is assigned to the starting data address address 0 , that is, address0 =address 2 .
[0074] In some practical application scenarios, the storage data of the Flash storage medium is taken as an example in Table 1 below:
[0075] Table 1. Data example of Flash storage media
[0076]
[0077] Analyze the target data retrieval method and obtain the starting data address as 0x00, the address change direction as the high address direction (ie D=+1), the address change step as a fixed value of 1 (ie one programming unit is moved each time, which is 141 bits in this case), and the target data attribute as the management data 0101.
[0078] Then, the Flash controller obtains: (1) the target data is 0x2102030405060708090A0B 0C 0D 0E 0F10; (2) the storage address corresponding to the target data is 0x20.
[0079] like Figure 4 As shown, the data retrieval method for a Flash controller provided by an embodiment of the present disclosure includes the following steps:
[0080] S401, setting target data attributes and determining target data retrieval method.
[0081] S402, parsing the target data retrieval method to obtain the starting data address, address change direction and address change step.
[0082] S403, obtaining a starting data attribute corresponding to the starting data in the starting data address in the Flash storage medium.
[0083] S404, determining whether the initial data attribute matches the target data attribute.
[0084] S405: When the attributes of the starting data match the attributes of the target data, the starting data is used as the target data and the data search ends.
[0085] S406: When the starting data attribute does not match the target data attribute, determine the first data address based on the starting data address along the address change direction and according to the address change step length.
[0086] S407, obtaining a first data attribute corresponding to the first data in the first data address.
[0087] S408: Determine whether the first data attribute matches the target data attribute.
[0088] S409: When the first data attribute matches the target data attribute, the first data is used as the target data and the data search is ended.
[0089] S410, determining whether the first data address exceeds the address range of the Flash storage medium.
[0090] S411 , when the first data attribute does not match the target data attribute and the first data address does not exceed the address range of the Flash storage medium, determine a next data address.
[0091] S412: When the first data address exceeds the address range of the Flash storage medium, a prompt message is set and data retrieval is terminated.
[0092] S413, obtaining target data and a storage address corresponding to the target data.
[0093] The data retrieval method for the Flash controller provided by the embodiment of the present disclosure firstly obtains the key starting data address, address change direction and address change step length by parsing the target data retrieval method, thereby providing clear guidance for the subsequent retrieval process, avoiding unnecessary traversal and search, and further improving the retrieval efficiency; secondly, during the retrieval process, the matching degree between the data attribute and the target data attribute is continuously compared, thereby ensuring that the retrieved data is highly consistent with the needs of the user or system, thereby improving the accuracy of data retrieval; thirdly, during the retrieval process, the data address is continuously checked to see if it exceeds the address range of the Flash storage medium, thereby effectively preventing invalid memory access and potential errors, and enhancing the stability and reliability of the system. In this way, through flexible data retrieval methods, precise data attribute matching, effective range control, error handling and user prompts, continuous data retrieval and clear result output, an efficient, accurate and reliable data retrieval method is provided for the Flash controller.
[0094] In some embodiments, the data retrieval method for the Flash controller also includes storing data attributes of user data in the Flash storage medium in the following manner: obtaining user data, and determining the data attributes corresponding to the user data and the target write address in the Flash storage medium; after receiving the user's write operation instruction, calculating the verification data of the user data; splicing the user data, the verification data and the data attributes to obtain the spliced data; and writing the spliced data to the target write address.
[0095] Here, the check data is obtained by calculating through an ECC algorithm, and can also be obtained through a hash algorithm or a checksum algorithm. The check data of the user data is calculated to ensure the integrity and accuracy of the user data.
[0096] The user data, the check data and the data attributes are spliced together in a predetermined splicing order, which is user data, check data and data attributes. In practical applications, a buffer can be created to store the spliced data. The user data is copied to the beginning of the buffer, and then the check data is copied after the user data, and then the data attributes are copied after the check data, thereby completing the splicing of the user data, the check data and the data attributes. The check data follows the user data, so that the integrity of the user data can be verified immediately during the data reading or transmission process to ensure that the accuracy of the data is not destroyed; at the same time, the data attributes are located at the end of the spliced data. This design allows the relevant data attribute information to be quickly obtained when accessing the user data or performing data processing, without the need for additional search or matching operations.
[0097] By calculating and storing the check data, the integrity and correctness of the data stored in the Flash storage medium can be ensured. If an error occurs during the data writing or reading process, it can be detected and corrected through the check data. At the same time, by writing the spliced data (including user data, check data and data attributes) at one time, the number of writes to the Flash storage medium can be reduced, thereby improving data writing efficiency.
[0098] In some actual application scenarios, the user sets the data attribute to normal data 1111, sets the user data to 0x0102030405060708090A 0B 0C 0D 0E 0F 10, sets the write address to 0x00, and then initiates a write operation. At this time, the spliced data written to the flash storage medium is shown in Table 2 below:
[0099] Table 2. Data example of Flash storage media
[0100]
[0101] In some possible implementations, the bit width of a data attribute is determined as follows:
[0102] R=NXY
[0103] Wherein, R is the bit width of the data attribute, N is the total bit width of the Flash storage medium, X is the bit width of the user data, and Y is the bit width of the check data.
[0104] As shown above, taking a 141-bit wide Flash storage medium as an example (ie, N=141), 128 bits are used as user data (ie, X=128), 9 bits are used as ECC check data (ie, Y=9), and the remaining 4 bits store data attributes. Binary is used to represent data attributes, for example, binary 0101 represents management data, and binary 1111 represents ordinary data.
[0105] In this way, in the Flash storage medium, by adding data attributes, the remaining idle bits of the Flash storage medium are utilized, thereby improving the utilization rate of the Flash storage medium.
[0106] Combination Figure 5 As shown, storing data attributes of user data in a Flash storage medium includes the following steps:
[0107] S501, obtaining user data, and determining data attributes corresponding to the user data and a target write address in a Flash storage medium.
[0108] S502, after receiving the user's write operation instruction, calculate the verification data of the user data.
[0109] S503, splicing user data, verification data and data attributes to obtain spliced data.
[0110] S504, writing the spliced data into the target write address.
[0111] In actual operation, the Flash controller may send the splicing data to the Flash storage medium, so that the Flash storage medium writes the splicing data into the target write address.
[0112] In the disclosed embodiment, user data is obtained and its corresponding data attributes, target write address and verification data are determined, and the spliced data is obtained by splicing the user data, verification data and data attributes, and then written into the target write address. Thus, the integrity and correctness of the data are ensured, and effective management of the data is achieved by storing data attributes, which not only helps to optimize the storage layout of the Flash storage medium and improve the utilization of the storage space, but also ensures the orderly storage of data, providing more flexibility for subsequent data retrieval and processing.
[0113] like Figure 6 As shown, the data retrieval method for a Flash controller provided by an embodiment of the present disclosure includes the following steps:
[0114] S601, obtaining user data, and determining data attributes corresponding to the user data and a target write address in a Flash storage medium.
[0115] S602, after receiving a write operation instruction from the user, calculate verification data of the user data.
[0116] S603, splicing user data, verification data and data attributes to obtain spliced data.
[0117] S604, writing the spliced data into the target write address.
[0118] S605, setting target data attributes and determining target data retrieval method.
[0119] S606, reading the target data corresponding to the target data attribute in the Flash storage medium according to the target data retrieval method.
[0120] S607, obtaining target data and a storage address corresponding to the target data.
[0121] In the disclosed technical solution, on the one hand, user data is obtained and its corresponding data attributes, target write address and verification data are determined, and spliced data is obtained by splicing user data, verification data and data attributes, and then written into the target write address. Thus, the integrity and correctness of the data are ensured, and effective management of the data is achieved by storing data attributes, which not only helps to optimize the storage layout of the Flash storage medium and improve the utilization rate of the storage space, but also ensures the orderly storage of data, providing more flexibility for subsequent data retrieval and processing. On the other hand, by determining the target data retrieval method and target data attributes, and reading the target data corresponding to the target data attributes in the Flash storage medium according to the target data retrieval method, efficient and accurate data retrieval is achieved. This targeted data retrieval method not only improves the efficiency of data retrieval, but also ensures that the retrieved data is highly consistent with the needs of the user or system.
[0122] Combination Figure 7 As shown, an embodiment of the present disclosure provides a Flash controller 700, which is connected to a Flash storage medium. The Flash storage medium stores data attributes of user data. The Flash controller includes a data attribute setting module 73, a data attribute search module 71 and a Flash storage medium control module 72.
[0123] Among them, the data attribute setting module 73 is configured to set the target data attributes; the data attribute search module 71 is configured to determine the target data retrieval method; the Flash storage medium control module 72 is connected to the data attribute setting module 73, the data attribute search module 71 and the Flash storage medium, and is configured to read the target data corresponding to the target data attributes in the Flash storage medium according to the target data retrieval method, and obtain the target data and the storage address corresponding to the target data.
[0124] Optionally, the data attribute setting module 73 is configured to set data attributes in the Flash storage medium in the following manner: obtain user data, and determine the data attributes corresponding to the user data and the target write address in the Flash storage medium; after receiving the user's write operation instruction, calculate the verification data of the user data; splice the user data, the verification data and the data attributes to obtain the spliced data. The Flash storage medium control module 72 is connected to the data attribute setting module 73 and the Flash storage medium, and is configured to write the spliced data to the target write address.
[0125] Optionally, the data attribute setting module 73 is configured to determine the bit width of the data attribute in the following manner:
[0126] R=NXY
[0127] Wherein, R is the bit width of the data attribute, N is the total bit width of the Flash storage medium, X is the bit width of the user data, and Y is the bit width of the check data.
[0128] Combination Figure 8 As shown, the embodiment of the present disclosure provides a Flash controller 800, including a processor 80 and a memory 81, and may also include a communication interface 82 and a bus 83. The processor 80, the communication interface 82, and the memory 81 may communicate with each other through the bus 83. The communication interface 82 may be used for information transmission. The processor 80 may call the logic instructions in the memory 81 to execute the method for setting and retrieving data attributes of the Flash controller in the above embodiment.
[0129] In addition, the logic instructions in the above-mentioned memory 81 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0130] The memory 81 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 80 executes the function application and data processing by running the program instructions / modules stored in the memory 81, that is, the method for setting and retrieving the data attributes of the Flash controller in the above method embodiment is implemented.
[0131] The memory 81 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 81 may include a high-speed random access memory and may also include a non-volatile memory.
[0132] By using the Flash controller provided by the embodiment of the present disclosure, the target data retrieval method and the target data attribute are determined to achieve accurate positioning and reading of data in the Flash storage medium, allowing the user to select a suitable retrieval method according to specific needs, and accurately match the data attribute, thereby ensuring that the required target data corresponding to the target data attribute and its storage address can be accurately retrieved from the Flash storage medium. In this way, the user's demand for accurate retrieval of data in the Flash storage medium can be effectively met, and the accuracy and efficiency of data access can be improved.
[0133] The embodiments of the present disclosure provide an electronic device (eg, a computer, a car controller, etc.), comprising the above-mentioned Flash controller.
[0134] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned method for setting and retrieving data attributes of a Flash controller.
[0135] An embodiment of the present disclosure provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the above-mentioned method for setting and retrieving Flash controller data attributes.
[0136] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0137] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0138] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, individual components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. The scope of the embodiments of the present disclosure includes the entire scope of the claims, and all available equivalents of the claims. When used in this application, although the terms "first", "second", etc. may be used in this application to describe each element, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, without changing the meaning of the description, the first element can be called the second element, and similarly, the second element can be called the first element, as long as all occurrences of the "first element" are renamed consistently and all occurrences of the "second element" are renamed consistently. The first element and the second element are both elements, but may not be the same element. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms "a", "an" and "the" are intended to include the plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0139] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0140] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0141] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for setting and retrieving data attributes of a Flash controller, characterized in that: The Flash controller is connected to a Flash storage medium, and the Flash storage medium stores data attributes of user data; the method includes: Set the target data attributes and determine the target data retrieval method; Reading target data corresponding to the target data attribute in the Flash storage medium according to the target data retrieval method; Obtain target data and the storage address corresponding to the target data.
2. The method according to claim 1, characterized in that According to the target data retrieval method, the target data corresponding to the target data attribute in the Flash storage medium is read, including: Analyze the target data retrieval method to obtain the starting data address, address change direction and address change step size; Taking the start data address as the starting point, along the address change direction, the data in the Flash storage medium is read according to the address change step length to obtain the target data corresponding to the target data attribute.
3. The method according to claim 2, characterized in that Starting from the start data address, along the address change direction, read the data in the Flash storage medium according to the address change step length to obtain the target data corresponding to the target data attribute, including: Obtaining the starting data attribute corresponding to the starting data of the starting data address in the Flash storage medium; In the case where the attributes of the starting data match the attributes of the target data, taking the starting data as the target data; and / or, When the starting data attribute does not match the target data attribute, the next data address is determined based on the starting data address along the address change direction according to the address change step length; and the data in the next data address is continuously read until the data retrieval cutoff condition is met.
4. The method according to claim 3, characterized in that Determining the next data address based on the starting data address along the address change direction according to the address change step length includes determining the next data address in the following manner: address n =address0+D1×step1+……+D n ×step n Among them, address0 is the starting data address, address n is the next data address, D1 is the first address change direction, step1 is the first address change step, D n Change direction for the nth address, step n is the nth address change step, and n is the next data address number.
5. The method according to claim 3, characterized in that: Data retrieval cut-off conditions include: The data attribute corresponding to the data in the next data address matches the target data attribute; or, The next data address exceeds the address range of the Flash storage medium.
6. The method according to any one of claims 1 to 5, characterized in that: It also includes data attributes for storing user data in the Flash storage medium in the following manner: Obtain user data, and determine the data attributes corresponding to the user data and the target write address in the Flash storage medium; After receiving the user's write operation instruction, calculate the verification data of the user data; Splicing user data, verification data and data attributes to obtain spliced data; Write the spliced data to the target write address.
7. The method according to claim 6, characterized in that The bit width of a data attribute is determined as follows: R=NXY Wherein, R is the bit width of the data attribute, N is the total bit width of the Flash storage medium, X is the bit width of the user data, and Y is the bit width of the check data.
8. A Flash controller, characterized in that: The Flash controller is connected to the Flash storage medium, and the Flash storage medium stores data attributes of user data; The Flash controller includes: A data attribute setting module, configured to set target data attributes; a data attribute search module configured to determine a target data retrieval method; The Flash storage medium control module is connected to the data attribute setting module, the data attribute search module and the Flash storage medium, and is configured to read the target data corresponding to the target data attribute in the Flash storage medium according to the target data retrieval method, and obtain the target data and the storage address corresponding to the target data.
9. A Flash controller, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to perform the method for setting and retrieving Flash controller data attributes as claimed in any one of claims 1 to 7 when executing the program instructions.
10. A Flash storage medium, characterized in that: Connected to the Flash controller according to claim 8 or 9, comprising: A user data storage area configured to store user data; The data attribute storage area is configured to store data attributes of user data.
