Data storage method and device, electronic equipment and storage medium

By modifying the driver region and storage region variables of the memory, the problem of the firmware driver not being able to support large-page Nand Flash was solved, enabling large-capacity data storage and normal access, and improving the firmware experience.

CN115390769BActive Publication Date: 2025-12-19LOONGSON TECH CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211134293.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2025-12-19
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

Existing firmware drivers cannot support large-page Nand Flash memory with page sizes exceeding 2048 bytes, which limits the selection of such memory, affects the user experience, and may cause access errors and data loss when reading and writing data.

Method used

By obtaining variables from the memory's drive region and storage region, adjustments are made to increase page capacity, and the adjusted variables are associated with a matching list to support large-capacity data storage.

Benefits of technology

It enables normal access to large-page Nand Flash, resolves access anomalies and data loss issues, expands market demand, is compatible with existing functions, and improves the firmware experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115390769B_ABST
    Figure CN115390769B_ABST
Patent Text Reader

Abstract

The application provides a data storage method and device, electronic equipment and a storage medium, and relates to the technical field of data storage. The method is applied to a memory, and the method comprises the following steps: obtaining a target drive variable in a drive area of the memory and a target storage variable in a storage area of the memory; correcting the target drive variable and the target storage variable, so that the capacity of a page supported by the memory is increased; and storing the device identifier of the memory, the corrected target drive variable and the corrected target storage variable into a predetermined matching list in association, so that the memory stores data in a large-capacity unit according to the corrected target drive variable and the corrected target storage variable. In this way, the memory can access more addresses, store more data, support large pages, expand market demand, improve the firmware experience of the memory and perfect the firmware function of the memory.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of data processing, and particularly relates to a data storage method and device, an electronic device, and a storage medium. BACKGROUND

[0002] Nand Flash memory is a kind of memory, which uses a nonlinear macrocell mode inside, and provides a cheap and effective solution for the implementation of solid-state mass storage. Nand Flash has the advantages of large capacity and fast rewriting speed, and is suitable for the storage of a large amount of data, and thus has been more and more widely used in the industry.

[0003] However, in the current firmware driver, some only support the memory with a page size of no more than 2048 bytes. With the emergence of big data technology, the data to be stored is massive. Thus, these firmware drivers cannot support the large page memory with a page size of more than 2048 bytes, which will limit the selection of the memory device. SUMMARY

[0004] Therefore, the embodiments of the present application provide a data storage method and device, an electronic device, and a storage medium, to solve the technical problem that the related firmware driver cannot support the large page data access with a page size of more than 2048 bytes.

[0005] In a first aspect, the present application provides a data storage method applied to a memory, and the method comprises the following steps.

[0006] obtaining a target drive variable in a drive area of the memory and a target storage variable in a storage area of the memory;

[0007] correcting the target drive variable and the target storage variable, so that the capacity of the page supported by the memory is increased;

[0008] storing the device identifier of the memory, the corrected target drive variable, and the corrected target storage variable in a predetermined matching list, so that the memory stores data in a large capacity unit according to the corrected target drive variable and the corrected target storage variable.

[0009] In a second aspect, the present application provides a data storage device applied to a memory, and the device comprises the following modules.

[0010] an obtaining module, configured to obtain a target drive variable in a drive area of the memory and a target storage variable in a storage area of the memory;

[0011] a correcting module, configured to correct the target drive variable and the target storage variable, so that the capacity of the page supported by the memory is increased.

[0012] The association module is configured to associate and store the device identifier of the memory, the corrected target drive variable and the corrected target storage variable into a matching list, so that the memory stores data in large capacity units according to the corrected target drive variable and the corrected target storage variable.

[0013] According to a third aspect of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the data storage method of the first aspect.

[0014] According to a fourth aspect of the present application, an electronic device is provided, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor. The program or instruction is executed by the processor to implement the data storage method of the first aspect.

[0015] Compared with the related art, the present application has the following advantages:

[0016] The data storage method, device, electronic device and storage medium provided by the present application can obtain a target drive variable in a drive area of a memory and a target storage variable in a storage area of the memory, correct the target drive variable and the target storage variable, so that the accessible address of the memory is increased, the memory can store more data, and the capacity of a page supported by the memory is increased. Then, the device identifier of the memory and the corrected target drive variable and the corrected target storage variable are associated and stored in a matching list, so that the memory can store data in large capacity units according to the corrected target drive variable and the corrected target storage variable, and the memory can support the calling of a large page Nand Flash device.

[0017] The above description is only a summary of the technical solutions of the present application. In order to more clearly understand the technical means of the present application, the following detailed description of the embodiments of the present application can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following detailed description of the embodiments of the present application is provided. BRIEF DESCRIPTION OF DRAWINGS

[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art, upon reading the following detailed description of the preferred embodiments. The accompanying drawings are intended to depict only preferred embodiments of the application, and therefore should not be considered to limit the scope of the application in any way. Similarly, like reference numerals have been used in the drawings to depict like parts of the application. In the drawings:

[0019] Figure 1is a step flow chart of a data storage method provided by an embodiment of the present application;

[0020] Figure 2 is a step flow chart of another data storage method provided by an embodiment of the present application;

[0021] Figure 3 is a structural block diagram of a data storage device provided by an embodiment of the present application;

[0022] Figure 4 is a structural block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0023] Exemplary embodiments of the present application will be described in detail with reference to the drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.

[0024] In the current firmware driver of the memory, only Nand Flash with a page size of no more than 2048 bytes is supported, and Nand Flash with a page size of more than 2048 bytes is not supported, which will limit the selection of Nand Flash, and the functional defects are obvious, which will affect the user experience. And with the continuous popularity of the firmware driver of the memory and the diversified needs of the market, Nand Flash with large pages and large capacity will inevitably become a necessary support. For example, the support of Nand Flash chips with a page size of more than 2048 bytes, the smaller the page capacity means the smaller the chip capacity, and the larger the page capacity means the larger the chip capacity.

[0025] In the current memory firmware, Nand Flash devices are selected with a page size of no more than 2048 bytes, and there is a selection limit, and Nand Flash with a page size of more than 2048 bytes is not supported. For Nand Flash with a page size of more than 2048 bytes (such as Nand Flash with a page size of 4096 bytes and 8192 bytes), forced reading and writing data will cause access abnormalities such as reading and writing, erasing, and further affect the firmware experience.

[0026] To solve the above problems, the present application aims to provide a big data storage method, device, electronic equipment and storage medium, which fixes the address access anomaly of large page large capacity Nand Flash, partition display error, incorrect read manufacturer identifier and device identifier, read and write erase data anomaly, memory overflow of Nand Flash data direct memory access (Direct Memory Access, dma), and realizes the support of firmware to all page size Nand Flash. It can solve the problem that the firmware does not support Nand Flash with page size exceeding 2048 bytes in related technologies, realize the support of Nand Flash with page size 4096 and page size 8192, ensure that large page large capacity Nand Flash can be supported, expand market demand, and be compatible with previous support functions, improve firmware functions and improve firmware experience.

[0027] Figure 1 is a step flow chart of a data storage method provided by an embodiment of the present application. The method is applied to a memory, and can include:

[0028] In step 101, a target drive variable in a drive area of the memory and a target storage variable in a storage area of the memory are obtained.

[0029] In the embodiment of the present application, the memory can be a flash Nand Flash, or other memory (for example, memory nand). The target drive variable can be a drive variable with a first target byte data type in the drive area, and at least include a target capacity variable, a target partition variable and a target on-chip address variable. The target storage variable at least includes a free area array size, a number of check code positions, a maximum free area value and a page maximum value, which can be determined according to actual needs, and are not limited here.

[0030] In the embodiment of the present application, the memory can obtain the drive variable with the first target byte data type in the drive area as the target drive variable, and the free area array size, the number of check code positions, the maximum free area value and the page maximum value in the storage area as the target storage variable.

[0031] Exemplarily, the memory can obtain the storage variable in the storage area, the drive variable in the drive area and the data type corresponding to the drive variable, then take the drive variable with the first target byte data type as the target drive variable, and take the free area array size, the number of check code positions, the maximum free area value and the page maximum value in the storage variable as the target storage variable.

[0032] In step 102, the target driving variable and the target storage variable are corrected so that the capacity of the page supported by the memory is increased.

[0033] In the embodiments of the present application, the driving variable correction parameter can at least include a second target byte; the preset parameter can at least include an original data size, a preset maximum error correction capability, a maximum capacity of the free area, a maximum page size of the memory, and a free area array size; and the storage variable correction parameter can at least include a target free area array size, a target number of check code positions, a target maximum value of the free area, and a target maximum page value, which can be determined according to actual requirements and is not limited herein.

[0034] In the embodiments of the present application, after the target driving variable and the target storage variable are obtained, the memory can continue to obtain the driving variable correction parameter and the preset parameter, select the storage variable correction parameter according to the preset parameter, correct the target driving variable by using the driving variable correction parameter, and correct the target storage variable by using the storage variable correction parameter, so that the capacity of the page supported by the memory is increased.

[0035] Exemplarily, in order to realize the large page support of the Nand Flash under the memory firmware, the firmware code needs to be modified. In the firmware code Nand Flash driver, there are a large number of 32-bit driving variables. When the data type representing the capacity is the 32-bit driving variable, since the range represented by the 32-bit is below 2G, the variable will overflow when exceeding 2G, and the access to the overflow address will cause illegal access. Therefore, the 32-bit driving variable as the target driving variable needs to be modified, for example, using the driving variable modification parameter 64-bit, modifying all the 32-bit target driving variables to 64-bit, or modifying all the target capacity variables representing the capacity, all the target partition variables representing the partition, and all the target in-chip address variables representing the Nand Flash in-chip address to 64-bit. The Nand Flash storage area is divided into a main storage main area and a free oob area. The main area stores data, and the oob area stores the check code. The main area and the oob area of the Nand Flash of each page size are different. The storage variable representing the main area and the oob area information in the firmware code limits the Nand Flash to support only 2048 pages. The large page exceeding 2048M will cause data dma overflow exception. Since the type of many storage variables of the Nand Flash is 32-bit int, but the capacity of the Nand Flash larger than 2048 pages generally exceeds 2G. For the device with the Nand Flash page size exceeding 2048 bytes, the capacity is generally not less than 2G bytes, but the storage variable type is still 32-bit, which cannot represent the capacity exceeding 2GB and the address offset, causing data dma overflow exception. Therefore, the 32-bit storage variable as the target storage variable needs to be modified, for example, using the driving variable modification parameter 64-bit, modifying all the 32-bit target driving variables to 64-bit, or modifying the free area array size, the check code position quantity, the free area maximum value, and the page maximum value in the storage variable to the target free area array size, the target check code position quantity, the target free area maximum value, and the target page maximum value.

[0036] In step 103, the device identification of the memory, the modified target driving variable, and the modified target storage variable are associated and stored into the established matching list, so that the memory stores the large capacity unit data according to the modified target driving variable and the modified target storage variable.

[0037] In the embodiment of the present application, the manufacturer identification refers to the identification of the manufacturer producing the memory; the device identification refers to the identification of the device using the memory; and the matching list is used to indicate the manufacturer identification and the device identification supported by the memory, and the target driving variable and the target storage variable corresponding to the manufacturer identification and the device identification.

[0038] Since the equipment identification of different manufacturers is often different, in the embodiment of the present application, after the controller obtains the corrected target drive variable and the corrected target storage variable, the controller can only obtain the equipment identification of the memory and the matching list, and then associate and store the equipment identification, the corrected target drive variable and the corrected target storage variable into the established matching list, so that the memory can call the corrected target drive variable and the corrected target storage variable for large-capacity unit data storage according to the matching list during operation.

[0039] In addition, the manufacturer identification, the equipment identification and the matching list of the memory can also be obtained at the same time, and then the manufacturer identification, the equipment identification, the corrected target drive variable and the corrected target storage variable are associated and stored into the established matching list, so that the memory can call the corrected target drive variable and the corrected target storage variable for large-capacity unit data storage according to the matching list during operation.

[0040] Exemplarily, the Nand Flash firmware drive has a matching list nand_flash_ids, which represents all the Nand Flash types and sizes supported by the drive. In this way, according to the different read-out Nand Flash manufacturer identification id1 and equipment identification id2, all the Nand Flash in the support list can be supported, and then the equipment identification, the corrected target drive variable and the corrected target storage variable of the Nand Flash are associated and stored into the matching list nand_flash_ids, and the Nand Flash firmware drive will look up the matching list nand_flash_ids according to the read-out manufacturer identification id1 and equipment identification id2, and only the Nand Flash in the list will be supported. The manufacturer identification id1, the equipment identification id2, the target drive variable (such as capacity size, block size) and the target storage variable (such as page size) corresponding to the large-page Nand Flash are added in the nand_flash_ids structure, and the code can be as follows:

[0041]

[0042]

[0043] The data storage method provided by the embodiment of the present application comprises the following steps: obtaining a target drive variable in a drive area of a memory and a target storage variable in a storage area of the memory; correcting the target drive variable and the target storage variable so that the accessible addresses of the memory are increased, so that the memory can store more data, and the capacity of a page supported by the memory is increased; sending a reset instruction to a chip using the memory and waiting for a target delay time period, so as to ensure the reset timing and enable the device identification to be normally read each time, so that the device identification of the memory can be normally read; and storing the device identification, the corrected target drive variable and the corrected target storage variable in a matching list in association, so that the memory can store data in large-capacity units according to the corrected target drive variable and the corrected target storage variable, and the memory can support the calling of a large-page Nand Flash device.

[0044] Figure 2 The embodiment of the present application provides another data storage method, and a step flow chart of the method is shown in the figure. The method is applied to a memory, and the method can comprise the following steps:

[0045] In step 201, a target drive variable in a drive area of a memory and a target storage variable in a storage area of the memory are obtained.

[0046] The step can refer to the detailed description of step 101, and will not be described here again.

[0047] In step 202, the target drive variable is corrected by using a preset drive variable correction parameter.

[0048] In the embodiment of the present application, the preset drive variable correction parameter can be a drive variable of a first target byte type in the drive area. The first target byte can be a default value (for example, 32 bits) preset in a system, or a default value (for example, 64 bits) preset in a controller, and the specific value can be determined according to actual needs, which is not limited here.

[0049] In the embodiment of the present application, the memory can obtain the drive variable of the first target byte type in the drive area as the target drive variable, and modify the data type corresponding to the target drive variable to a second target byte which is larger.

[0050] Exemplarily, the first target byte can be 32 bits, the second target byte can be 64 bits, the memory can acquire an unsigned int (32 bits) drive variable in the drive region as a target drive variable, and then modify the data type corresponding to the target drive variable to a larger unsigned long long (64 bits); the memory can also acquire a float (32 bits) drive variable in the drive region as a target drive variable, and then modify the data type corresponding to the target drive variable to a larger double (64 bits).

[0051] By modifying the target drive variable by using the preset drive variable modification parameter, the application can increase the accessible address of the memory, so that the memory can store more data, and further increase the capacity of the page supported by the memory, so as to enable the memory to support the calling of a large page Nand Flash device.

[0052] Optionally, the target drive variable is a drive variable in the drive region, and the data type of the drive variable is the first target byte, and step 202 can include:

[0053] Substep A1: acquiring a drive variable in the drive region of the memory and a data type corresponding to the drive variable.

[0054] In the embodiment of the application, the memory can acquire all drive variables in the drive region, and determine the data types corresponding to the drive variables respectively.

[0055] Exemplarily, the memory can acquire the drive variables existing in the drive region and the data types corresponding to each drive variable.

[0056] Substep A2: taking the drive variable with the data type of the first target byte as the target drive variable.

[0057] In the embodiment of the application, the first target byte can be a default value (for example, 32 bits) preset in the system, or a default value (for example, 64 bits) preset in the controller, and the specific value can be determined according to actual needs, which is not limited here.

[0058] In the embodiment of the application, after the memory acquires all drive variables in the drive region and determines the data types corresponding to the drive variables respectively, the drive variable with the data type of the first target byte can be taken as the target drive variable.

[0059] Exemplarily, the first target byte can be 32 bits, and in the drive region of the memory Nand Flash, the 32-bit variable includes:

[0060] The addr, fail_addr, and len in the erase_info structure are used to pass the address addr to be erased, the address fail_addr of erase failure, and the size len of erase to the nand_erase function to perform the erase operation.

[0061] The size and erase_size in the mtd_info structure are used to indicate the size of the Nand Flash partition and the size of the block. The offset in the add_mtd_device function is used to indicate the address offset.

[0062] The chipsize in the nand_chip structure is used to indicate the total size of the Nand Flash. The chipsize and erase_size in the nand_flash_dev structure are used to indicate the total size of the Nand Flash and the size of the block.

[0063] The offset in the mtd_partition structure is used to indicate the address offset. The size in the mtd_partition structure is used to indicate the size of the partition. The part_size in the mtdfile structure is used to indicate the size of the partition. The part_offset in the mtdfile structure is used to indicate the offset of the partition.

[0064] The open_offset in the mtdpriv structure is used to indicate the offset of the data to be read relative to the start address of the partition. The open_size in the mtdpriv structure is used to indicate the size of the partition.

[0065] The start and end in the cmd_flash_erase function are used to indicate the start and end addresses of the target data to be accessed by the memory. The memory can use the addr, fail_addr, len, size, erase_size, offset, chipsize, part_size, part_offset, open_offset, open_size, start, and end as the target driver variables.

[0066] The embodiment of the present application can obtain the driver variables in the driver region of the memory and the data types corresponding to the driver variables. Then, the driver variable with the data type of the first target byte can be used as the target driver variable. The target driver variable can be modified by using the driver variable modification parameter, so that the accessible address of the memory can be increased, the memory can store more data, and the capacity of the page supported by the memory can be increased, thereby realizing the function of supporting large pages.

[0067] In substep A3, the data type corresponding to the target driver variable is modified to the second target byte.

[0068] In the embodiments of the present application, the second target byte can be a default value (for example, 64 bits) set in the system in advance, or a default value (for example, 128 bits) set in the controller in advance, which can be determined according to actual needs, and is not limited here. The second target byte is greater than the first target byte.

[0069] In the embodiments of the present application, after the memory takes the driving variable of the first target byte as the target driving variable, the data type corresponding to the target driving variable can be modified, so that the data type corresponding to the modified target driving variable occupies the second target byte.

[0070] For example, the first target byte can be 32 bits, and the second target byte can be 64 bits. After the memory takes 32-bit addr, fail_addr, len, size, erase_size, offset, chipsize, part_size, part_offset, open_offset, open_size, start and end as the target driving variable, the data type of addr, fail_addr, len, size, erase_size, offset, chipsize, part_size, part_offset, open_offset, open_size, start and end can be changed from float to double, or from unsigned int to unsigned long long.

[0071] According to the embodiments of the present application, the data type corresponding to the target driving variable is modified to the second target byte greater than the first target byte, so that the accessible address of the memory can be increased, so that the memory can store more data, and the capacity of the page supported by the memory is increased, so that the memory can support the calling of the large page Nand Flash device.

[0072] Optionally, the target driving variable can at least include a target capacity variable, a target partition variable and a target on-chip address variable, and sub-step A3 can include:

[0073] In sub-step a1, the data type corresponding to the target capacity variable is modified so that the modified data type occupies the second target byte.

[0074] In the embodiments of the present application, the target capacity variable refers to a driving variable in the memory driver indicating the capacity.

[0075] In the embodiment of the present application, after the memory takes the drive variable of the data type of the first target byte as the target drive variable, the drive variable representing the capacity in the target drive variable can be taken as the target capacity variable, and then the data type corresponding to the target capacity variable can be modified, so that the number of bytes occupied by the modified target capacity variable corresponding to the data type is the second target byte.

[0076] Exemplarily, the first target byte can be 32 bits, and the second target byte can be 64 bits. The target drive variable of 32 bits in the memory drive can include addr, fail_addr, len, size, erasesiz, offset, chipsize, part_size, part_offset, open_offset, open_size, start and end. The memory can take size, erasesize, chipsize and open_size representing the capacity as the target capacity variable, and then the number of bytes occupied by the data type of asize, erasesize, chipsize and open_size can be modified from 32 bits to 64 bits.

[0077] The sub-step a2 is modifying the data type corresponding to the target partition variable, so that the number of bytes occupied by the modified data type is the second target byte.

[0078] In the embodiment of the present application, the target partition variable refers to the drive variable representing the partition in the memory drive.

[0079] In the embodiment of the present application, after the memory takes the drive variable of the data type of the first target byte as the target drive variable, the drive variable representing the partition in the target drive variable can be taken as the target partition variable, and then the data type corresponding to the target partition variable can be modified, so that the number of bytes occupied by the modified target partition variable corresponding to the data type is the second target byte.

[0080] Exemplarily, the first target byte can be 32 bits, the second target byte can be 64 bits, the target drive variables of 32 bits in the memory drive can include: addr, fail_addr, len, size, erasesiz, offset, chipsize, part_size, part_offset, open_offset, open_size, start and end, the memory can take part_offset and open_size representing the partition as the target partition variable, and then the number of bytes occupied by the data type of part_offset and open_size can be changed from float to double, or from unsigned int to unsigned long long.

[0081] The sub-step a3 modifies the data type corresponding to the target in-chip address variable, so that the number of bytes occupied by the modified data type is the second target byte.

[0082] In the embodiments of the present application, the target partition variable refers to the drive variable representing the in-chip address of the memory in the memory drive.

[0083] In the embodiments of the present application, after the memory takes the drive variable with the data type of the first target byte as the target drive variable, the memory can take the drive variable representing the in-chip address of the memory in the target drive variable as the target in-chip address variable, and then modify the data type corresponding to the target in-chip address variable, so that the number of bytes occupied by the modified target in-chip address variable is the second target byte.

[0084] Exemplarily, the first target byte can be 32 bits, the second target byte can be 64 bits, the target drive variables of 32 bits in the memory drive can include: addr, fail_addr, len, size, erasesiz, offset, chipsize, part_size, part_offset, open_offset, open_size, start and end, the memory can take part_offset and open_size representing the in-chip address of the NandFlash as the target in-chip address variable, and then the data type of addr, fail_addr, len, offset, open_offset, start and end can be changed from float to double, or from unsigned int to unsigned long long.

[0085] The embodiment of the present application modifies the data type corresponding to the target capacity variable, so that the modified data type occupies the second target byte; modifies the data type corresponding to the target partition variable, so that the modified data type occupies the second target byte; and modifies the data type corresponding to the target in-chip address variable, so that the modified data type occupies the second target byte. The second target byte is greater than the first target byte, which can increase the accessible address of the memory, so that the memory can store more data, and further increase the capacity of the page supported by the memory, so as to realize the calling of the large-page Nand Flash device supported by the memory.

[0086] In step 203, the preset parameter is read, the corresponding storage variable correction parameter is selected according to the preset parameter, and the target storage variable is corrected through the storage variable correction parameter.

[0087] In the embodiment of the present application, after the target storage variable is obtained, the memory can continue to obtain the storage variable correction parameter, and then correct the target storage variable through the storage variable correction parameter, so as to increase the capacity of the page supported by the memory.

[0088] Exemplarily, the target storage variable in the storage area of the memory Nand Flash that needs to be corrected can include: MTD_MAX_OOBFREE_ENTRIES representing the size of the oobfree array in the nand_ecclayout layout, eccpos in the nand_ecclayout structure representing the total number of positions for the error checking and correction (ecc) algorithm of the Nand Flash, NAND_MAX_OOBSIZE representing the maximum value of the oob area of the Nand Flash, and NAND_MAX_PAGESIZE representing the maximum size of the page nand page supported by the Nand Flash. After the storage variable correction parameter is obtained, the storage variable correction parameter can be used to correct MTD_MAX_OOBFREE_ENTRIES, eccpos, NAND_MAX_OOBSIZE and NAND_MAX_PAGESIZE.

[0089] Optionally, the target storage variable further includes: the number of check code positions; and the storage variable correction parameter at least includes: the target number of check code positions; and step 203 can include:

[0090] In step B1, the original data size and the preset maximum error correction capability are read.

[0091] In the embodiments of the present application, the original data size refers to the unit processing data size in memory error correction, for example, 512 Byte or 1024 Byte, and the preset maximum error correction capability can be a default value (for example, 4) preset in the system or a default value (for example, 24) preset in the controller, which can be determined according to actual needs and is not limited here.

[0092] In the embodiments of the present application, after the memory obtains the number of check code positions as the target storage variable, the memory can obtain the original data size of the unit processing data size in memory error correction and the preset maximum error correction capability in the controller by default.

[0093] For example, after the memory obtains the number of check code positions as the target storage variable, the memory can obtain the original data size of the unit processing data size in memory error correction as 512 Byte and the preset maximum error correction capability in the controller by default as 4 bits.

[0094] Step B2, the product of the preset coefficient and the preset maximum error correction capability is converted into the same data type as the original data size to obtain a verification data space; the verification data space is used to store the check code.

[0095] In the embodiments of the present application, after the memory can obtain the original data size and the preset maximum error correction capability, the product of the preset coefficient and the preset maximum error correction capability can be converted into the same data type as the original data size to obtain a verification data space.

[0096] For example, after the memory can obtain the original data size 512 Byte and the preset maximum error correction capability 4, it can be determined that the target model for calculating the verification data space according to the original data size and the preset maximum error correction capability is 13*the preset maximum error correction capability, so the verification data space is 13*4=52, 52 / 8=7, and therefore a verification data space of 7B is required. In the memory, 4-bit ECC is stored according to 8B, which is for easy alignment, and the last byte can be filled with 00. According to 8-bit ECC, 13B of verification data space will be generated every 512 Byte. According to 16-bit ECC, 26B of verification data space will be generated every 512 Byte.

[0097] Step B3, determining the target number of check code positions according to the verification data space.

[0098] In the embodiments of the present application, after the verification data space is calculated, the target number of check code positions can be determined according to the verification data space.

[0099] Exemplarily, in order to be compatible with subsequent algorithm upgrades, the maximum case is considered, and the verification data space should be 26B, 26*16=416, a value greater than 416 can be selected as the target number of check code positions (for example: 512 or 640).

[0100] Optionally, step B3 can include:

[0101] Step b1, respectively calculate the verification data space required to store the check codes of different data types, and select the maximum value in the verification data space as the maximum of the verification data space.

[0102] In the embodiment of the present application, after calculating the verification data space required to store the check codes of different data types, the maximum value in the verification data space can be selected as the maximum of the verification data space.

[0103] Exemplarily, the verification data space calculated according to 4bit ECC is 7B, the verification data space calculated according to 8bit ECC is 13B, and the verification data space calculated according to 16bit ECC is 26B, so the maximum value in the verification data space is 26B, which is selected as the maximum of the verification data space.

[0104] Step b2, the product of the maximum value and the check code type corresponding to the maximum value is used as the maximum number of check code positions, and the maximum number of check code positions is used to represent the maximum number of storable check codes.

[0105] In the embodiment of the present application, after obtaining the maximum value of the verification data space, the product of the maximum value and the check code type corresponding to the maximum value can be used as the maximum number of check code positions.

[0106] Exemplarily, after obtaining the maximum value 26B of the verification data space, the maximum number of check code positions can be calculated according to the maximum value 26B and the check code type 16bit corresponding to the maximum value, which is 26*16=416.

[0107] Step b3, select a value greater than or equal to the maximum number of check code positions as the target number of check code positions, so that when the number of check code positions is modified to the target number of check code positions, the number of positions for storing check codes is increased.

[0108] In the embodiment of the present application, after calculating the maximum number of check code positions, a value greater than or equal to the maximum number of check code positions can be selected as the target number of check code positions.

[0109] Exemplarily, after the maximum number of parity positions 416 is calculated, a value greater than or equal to the maximum number of parity positions 416 (for example, 512 or 640) can be selected as the target number of parity positions.

[0110] Step B4, the number of parity positions is modified to the target number of parity positions.

[0111] In the embodiment of the present application, the target number of parity positions is greater than the number of parity positions.

[0112] In the embodiment of the present application, after the target number of parity positions is determined, the number of parity positions can be modified to the target number of parity positions.

[0113] Exemplarily, after the target number of parity positions 640 is determined, the number of parity positions eccpos is originally 64, so 64 can be modified to 640, indicating that the number of positions for storing parity codes is increased.

[0114] In the embodiment of the present application, by obtaining the original data size and the preset maximum error correction capability, the test data space can be calculated according to the original data size and the preset maximum error correction capability, so that the target number of parity positions can be determined according to the test data space, and then the number of parity positions can be modified to the target number of parity positions to increase the number of positions for storing parity codes.

[0115] Optionally, the target storage variable further includes: the free area array size; the preset parameter further includes: the free area array size; the storage variable modification parameter further includes: the target free area array size; and step 203 in the embodiment can further include:

[0116] Step C1, after reading the preset parameter, i.e., the free area array size, a value greater than or equal to the free area array size is selected as the target free area array size.

[0117] In the embodiment of the present application, after the memory obtains the free area array size as the target storage variable, the memory can select a value greater than or equal to the free area array size as the target free area array size. That is, for the free area array size, in the embodiment of the present application, the free area array size can not be modified, or the free area array size can be modified to a value greater than the original free area array size.

[0118] Exemplarily, the free area array size MTD_MAX_OOBFREE_ENTRIES is originally 8, and after the memory obtains the free area array size as the target storage variable, the memory can select a value greater than or equal to the free area array size (for example, 8 or 32) as the target free area array size.

[0119] Step C2, modifying the free area array size to the target free area array size, so as to correct the free area array size.

[0120] In the embodiment of the present application, after obtaining the target free area array size, the free area array size can be modified to the target free area array size.

[0121] For example, the original free area array size MTD_MAX_OOB_FREE_ENTRIES is 8, and the size of the free area array is mainly used to indicate how many free segments in the Nand Flash, and some valid ecc bytes in the Nand Flash are stored in segments, and here is used to specify the total number of free segments. After obtaining the target free area array size, if the target free area array size (for example: 8) is equal to the free area array size, that is, it can not be changed, if the target free area array size (for example: 32) is greater than the free area array size, then 8 can be changed to 32, and the structure is as follows:

[0122]

[0123] By selecting a value greater than or equal to the free area array size as the target free area array size, and modifying the free area array size to the target free area array size, the present application can make the memory have more free segments.

[0124] Optionally, the target storage variable further includes: a free area maximum value; the preset parameter further includes: a maximum capacity of the free area preset by the manufacturer; and the storage variable correction parameter further includes: a target free area maximum value. In the embodiment of the present application, step 203 can further include:

[0125] Step D1, reading the maximum capacity of the free area.

[0126] In the embodiment of the present application, after the memory obtains the free area maximum value as the target storage variable, the memory can obtain the maximum capacity of the free area from the storage area.

[0127] For example, the size of the free area oob is generally preset by the hardware manufacturer, and the size of the oob is generally 16 bytes per 512 bytes, so 2k is 64 bytes, but the oob of the 8k page is preset by the hardware manufacturer to be 448 bytes in size, so the maximum capacity of the free area obtained by the memory can be 448 bytes.

[0128] Step D2, selecting a value greater than or equal to the maximum capacity as the target free area maximum value.

[0129] In the embodiment of the present application, after the memory obtains the maximum capacity of the free area, a value greater than or equal to the maximum capacity can be selected as the target maximum value of the free area.

[0130] For example, after the memory obtains the maximum capacity of the free area as 448 bytes, a value greater than or equal to the maximum capacity of 448 bytes (for example, 448 bytes or 640 bytes) can be selected as the target maximum value of the free area.

[0131] Step D3, modifying the maximum value of the free area to the target maximum value of the free area.

[0132] In the embodiment of the present application, the target maximum value of the free area is greater than the maximum value of the free area.

[0133] In the embodiment of the present application, after the memory obtains the target maximum value of the free area, the maximum value of the free area can be modified to the target maximum value of the free area.

[0134] For example, after the memory obtains the target maximum value of the free area as 640 bytes, since the original NAND_MAX_OOBSIZE is 64 bytes, which indicates that the supported oob is 64 bytes. The oob size can be 448 bytes defined by the manufacturer, in order to be compatible with the oob size of other chip manufacturers, the general NAND_MAX_OOBSIZE is modified to be greater than 448, that is, modified to 640.

[0135] In the embodiment of the present application, by obtaining the maximum capacity of the free area, a value greater than or equal to the maximum capacity can be selected as the target maximum value of the free area, so that the maximum value of the free area can be modified to the target maximum value of the free area, so that the available free area can be increased, and more check codes can be stored.

[0136] Optionally, the target storage variable further includes a page maximum value; the preset parameter further includes a maximum page size of the memory; the storage variable modification parameter further includes the target page maximum value; and the step 203 in the embodiment can further include:

[0137] Step E1, reading the maximum page size of the memory.

[0138] In the embodiment of the present application, after the memory obtains the page maximum value as the target storage variable, the maximum page size of the memory can be obtained. That is, the maximum page size is the size of the page supported by the large page memory, and the page maximum value is the maximum size of the page supported by the current memory.

[0139] For example, the maximum page size of the large page memory is generally 8k, and the maximum page size of the memory is obtained as 8k.

[0140] Step E2, taking the product of the value of the maximum page size and the data type corresponding to the maximum page size as a target page maximum value.

[0141] In the embodiment of the present application, after the memory obtains the maximum page size, the product of the value of the maximum page size and the data type corresponding to the maximum page size can be taken as the target page maximum value.

[0142] For example, after the memory obtains the maximum page size 8k, the target page maximum value = 8*1024 = 8192 bytes can be calculated according to the maximum page size.

[0143] Step E3, modifying the page maximum value to the target page maximum value.

[0144] In the embodiment of the present application, the target page maximum value is greater than the page maximum value.

[0145] In the embodiment of the present application, after the memory calculates the target page maximum value, the page maximum value can be modified to the target page maximum value.

[0146] For example, the page maximum value NAND_MAX_PAGESIZE of the memory is originally 2048 bytes, which is modified to 8192 bytes.

[0147] The embodiment of the present application can take the product of the value of the maximum page size and the data type corresponding to the maximum page size as the target page maximum value by obtaining the maximum page size of the memory, so that the page maximum value can be modified to the target page maximum value, so that the capacity of the page supported by the memory is increased, and the memory can support the calling of the large page Nand Flash device.

[0148] Step 204, sending a reset instruction to a chip using the memory and waiting for a target delay duration.

[0149] In the embodiment of the present application, the chip can be a Nand Flash or a nand chip; the reset instruction is used to instruct the chip to reset; the target delay duration can be a default value (for example, 5 seconds) pre-set in the system or a default value (for example, 10 seconds) pre-set in the controller, which can be determined according to actual needs, and is not limited here.

[0150] In the embodiment of the present application, the memory sends a reset instruction to a chip using the memory, and then waits for a target delay duration to wait for the chip to complete the reset.

[0151] Exemplarily, the large-capacity Nand Flash needs to add a reset delay before reading the manufacturer identification id1 and the device identification id2, so as to ensure the reset timing by sending a reset instruction to the chip. The delay is to wait for a target delay time (for example, 3 seconds or 5 seconds) before accessing, which is usually used to wait for the Nand Flash chip to complete the reset, so that the manufacturer identification id1 and the device identification id2 can be normally read each time, and the problem of sometimes incorrect reading of the large-capacity Nand Flash can be repaired.

[0152] The embodiment of the application can ensure the reset timing by sending a reset instruction to the chip using the memory and waiting for a target delay time, so that the manufacturer identification and the device identification can be normally read each time, and the problem of sometimes incorrect reading of the large-capacity memory can be repaired.

[0153] In step 205, the device identification of the memory, the corrected target drive variable and the corrected target storage variable are associated and stored in a predetermined matching list, so that the memory stores data in large-capacity units according to the corrected target drive variable and the corrected target storage variable.

[0154] This step can refer to the detailed description of step 104, which will not be described here.

[0155] The another data storage method provided by the embodiment of the application can correct the target drive variable and the target storage variable, so that the accessible address of the memory is increased, so that the memory can store more data, and the capacity of the page supported by the memory is increased. Then, a reset instruction is sent to the chip using the memory and a target delay time is waited, so that the reset timing is ensured, the device identification can be normally read each time, the device identification of the memory can be normally read, and the device identification, the corrected target drive variable and the corrected target storage variable are associated and stored in a matching list, so that the memory can store data in large-capacity units according to the corrected target drive variable and the corrected target storage variable, so as to realize that the memory can support the calling of the large-page Nand Flash device.

[0156] Referring to Figure 3 The embodiment of the application provides a structural block diagram of a data storage device 300, which is applied to a memory. The data storage device 300 can include:

[0157] The acquisition module 301 is configured to acquire a target drive variable in a drive area of the memory and a target storage variable in a storage area of the memory.

[0158] The correction module 302 is configured to correct the target drive variable and the target storage variable, so that the capacity of the page supported by the memory is increased.

[0159] The association module 303 is configured to associate the device identification of the memory, the corrected target drive variable and the corrected target storage variable, and store them in a predetermined matching list, so that the memory stores data in large capacity units according to the corrected target drive variable and the corrected target storage variable.

[0160] Optionally, the acquisition module 301 is further configured to:

[0161] acquire the drive variable in the drive area of the memory and the data type corresponding to the drive variable; and take the drive variable with the data type of the first target byte as the target drive variable.

[0162] Optionally, the correction module 302 is further configured to:

[0163] correct the target drive variable by using a predetermined drive variable correction parameter; read the predetermined parameter, select a corresponding storage variable correction parameter according to the predetermined parameter, and correct the target storage variable by using the storage variable correction parameter.

[0164] Optionally, the target drive variable is the drive variable with the data type of the first target byte in the drive area; and the correction module 302 is further configured to:

[0165] modify the data type corresponding to the target drive variable to the second target byte; wherein the second target byte is greater than the first target byte.

[0166] Optionally, the target drive variable at least includes a target capacity variable, a target partition variable and a target on-chip address variable; and the correction module 302 is further configured to:

[0167] modify the data type corresponding to the target capacity variable, so that the modified data type occupies the second target byte; modify the data type corresponding to the target partition variable, so that the modified data type occupies the second target byte; and modify the data type corresponding to the target on-chip address variable, so that the modified data type occupies the second target byte.

[0168] Optionally, the target storage variable at least includes a number of check code positions, which is used to represent the number of positions for the error detection and correction algorithm of the memory; the predetermined parameter at least includes an original data size and a predetermined maximum error correction capability, wherein the original data size is the data size processed by the memory in error correction; and the storage variable correction parameter at least includes a target number of check code positions; and the correction module 302 is further configured to:

[0169] The product of the preset coefficient and the preset maximum error correction capability is converted into a data type same as the original data size to obtain a check data space; the check data space is used to store a check code; a target check code position quantity is determined according to the check data space; the check code position quantity is modified to the target check code position quantity; and the target check code position quantity is greater than the check code position quantity.

[0170] Optionally, the modifying module 302 is further configured to:

[0171] The check data spaces required for storing check codes of different data types are calculated respectively, the maximum value in the check data spaces is selected as a maximum value of the check data spaces, the product of the maximum value and the check code type corresponding to the maximum value is selected as a maximum check code position quantity, the maximum check code position quantity is used to represent the maximum number of the check codes that can be stored, a value greater than or equal to the maximum check code position quantity is selected as a target check code position quantity, and the check code position quantity is modified to the target check code position quantity, so that the number of the positions for storing the check codes is increased.

[0172] Optionally, the target storage variable further includes a maximum free area value used to represent the maximum value of the free area of the memory; the preset parameter further includes a maximum capacity of the free area preset by a manufacturer; the storage variable modifying parameter further includes a target maximum free area value; and the modifying module 302 is further configured to:

[0173] select a value greater than or equal to the maximum capacity as the target maximum free area value, modify the maximum free area value to the target maximum free area value, and the target maximum free area value is greater than the maximum free area value.

[0174] Optionally, the target storage variable further includes a maximum page value used to represent the maximum size of the page supported by the memory; the preset parameter further includes a maximum page size of the memory; the storage variable modifying parameter further includes a target maximum page value; and the modifying module 302 is further configured to:

[0175] select the product of the value of the maximum page size and the data type corresponding to the maximum page size as the target maximum page value, modify the maximum page value to the target maximum page value, and the target maximum page value is greater than the maximum page value.

[0176] Optionally, the target storage variable further includes a free area array size used to represent how many free segments are in the memory; the preset parameter further includes the free area array size; the storage variable modifying parameter further includes a target free area array size; and the modifying module 302 is further configured to:

[0177] select a value greater than or equal to the free area array size as the target free area array size, and modify the free area array size to the target free area array size.

[0178] Optionally, the data storage device 300 may further include:

[0179] The reset delay module 304 is used to send a reset command to the chip using the memory and wait for a target delay duration. The reset command is used to instruct the chip to reset.

[0180] This application provides a data storage device that obtains target driving variables in the driving area of ​​the memory and target storage variables in the storage area of ​​the memory. The target driving variables and target storage variables can be modified to increase the number of accessible addresses in the memory, thereby enabling the memory to store more data and increasing the page capacity supported by the memory. Then, a reset command is sent to the chip using the memory, and a target delay duration is waited for to ensure the reset timing, allowing the device identifier to be read correctly each time. The device identifier of the memory is then read correctly, and the modified target driving variables and modified target storage variables are associated and stored in a matching list. This allows the memory to perform large-capacity data storage according to the modified target driving variables and modified target storage variables, enabling the memory to support the use of large-page Nand Flash devices.

[0181] This application provides an electronic device, a memory, and a program or instruction stored in the memory and executable on a processor. When the program or instruction is executed by the processor, it implements any of the above-described data storage methods.

[0182] This application provides an electronic device that obtains target driving variables in the driving area of ​​a memory and target storage variables in the storage area of ​​the memory. The target driving variables and target storage variables can be modified to increase the number of accessible addresses in the memory, thereby enabling the memory to store more data and increasing the page capacity supported by the memory. Then, a reset command is sent to the chip using the memory, and a target delay duration is waited for to ensure the reset timing, allowing the device identifier to be read correctly each time. This allows the device identifier of the memory to be read correctly. The device identifier, along with the modified target driving variables and modified target storage variables, are then associated and stored in a matching list. This enables the memory to store large-capacity data according to the modified target driving variables and modified target storage variables, thereby enabling the memory to support the use of large-page Nand Flash devices.

[0183] This application provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, it can implement the above-described data storage method.

[0184] Embodiments of the present application provide a computer storage medium, by acquiring a target drive variable in a drive area of a memory and a target storage variable in a storage area of the memory; the target drive variable and the target storage variable can be corrected, so that the accessible address of the memory is more, so that the memory can store more data, and the capacity of the page supported by the memory is increased; then a reset instruction is sent to a chip using the memory, and a target delay time is waited, so as to ensure the reset timing, so that the device identification of the memory can be normally read each time, so that the device identification of the memory can be normally read, and the device identification, the corrected target drive variable and the corrected target storage variable are associated and stored in a matching list, so that the memory can store data in large capacity units according to the corrected target drive variable and the corrected target storage variable, so as to realize that the memory can support the calling of a large page Nand Flash device.

[0185] Those skilled in the art can understand that the execution subject of the technical solution of the present application is a developer, and the carrier attached is a combination of medical equipment, intelligent equipment and server interaction. The present application provides a data storage method and device, an electronic device and a storage medium. The evidence of infringement needs to be obtained from the server of the other party, so it is difficult to obtain the evidence of infringement.

[0186] Those skilled in the art can understand that the present application includes devices for performing one or more of the operations described in the present application. These devices can be specially designed and manufactured for the desired purpose, or can also include known devices in a general-purpose computer. These devices have computer programs stored therein, which are selectively activated or reconfigured. Such computer programs can be stored in a storage medium of a device (for example, a computer) or in any type of medium suitable for storing electronic instructions and respectively coupled to a bus, including but not limited to any type of disk (including a floppy disk, a hard disk, an optical disk, a CD-ROM and a magneto-optical disk), a ROM (Read-Only Memory), a RAM (Random Access Memory), an EPROM (Erasable Programmable Read-Only Memory), an EEPROM (Electrically Erasable Programmable Read-Only Memory), a flash memory, a magnetic card or an optical card. That is, the storage medium includes any medium that can store or transmit information in a readable form by a device (for example, a computer).

[0187] Those skilled in the art can understand that each block of these structural diagrams and / or block diagrams and / or flowcharts and combinations of blocks in these structural diagrams and / or block diagrams and / or flowcharts can be implemented by computer program instructions. Those skilled in the art can understand that these computer program instructions can be provided to a general-purpose computer, a special-purpose computer, or a processor of other programmable data processing apparatus to implement the functions specified in the blocks or multiple blocks of the structural diagrams and / or block diagrams and / or flowcharts disclosed in the present application by the computer or the processor of other programmable data processing apparatus.

[0188] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A data storage method, characterized in that, Applied to a memory, the method includes: Obtain the target driver variable in the driver region of the memory, and the target storage variable in the storage region of the memory; the target driver variable is the driver variable of the first target byte, and the target driver variable includes at least: target capacity variable, target partition variable, and target intra-chip address variable; the target storage variable includes at least: free region array size, number of checksum positions, maximum free region value, and maximum page value; the free region array size is used to indicate how many unused segments are in the memory; The target driving variable and the target storage variable are modified to increase the capacity of the pages supported by the memory; The device identifier, the modified target driver variable, and the modified target storage variable of the memory are associated and stored in a predetermined matching list so that the memory can perform large-capacity data storage according to the modified target driver variable and the modified target storage variable; the matching list is used to indicate the vendor identifier and device identifier supported by the memory, as well as the target driver variable and target storage variable corresponding to the vendor identifier and the device identifier.

2. The method according to claim 1, characterized in that, The modification of the target driving variable and the target stored variable includes: The target driving variable is corrected by a preset driving variable correction parameter; Read the preset parameters, select the corresponding storage variable correction parameters according to the preset parameters, and correct the target storage variable using the storage variable correction parameters.

3. The method according to claim 2, characterized in that, The driving variable correction parameter includes a second target byte; Then, the step of correcting the target driving variable using preset driving variable correction parameters includes: Modify the data type corresponding to the target driving variable to the second target byte; wherein the second target byte is greater than the first target byte.

4. The method according to claim 3, characterized in that, The step of modifying the data type corresponding to the target driving variable to the second target byte includes: Modify the data type corresponding to the target capacity variable so that the bytes occupied by the modified data type are the same as the second target bytes; Modify the data type corresponding to the target partition variable so that the bytes occupied by the modified data type are the same as the second target bytes; The data type corresponding to the target chip address variable is modified so that the bytes occupied by the modified data type are the same as the second target byte.

5. The method according to claim 2, characterized in that, The number of check code positions is used to represent the number of positions used in the error detection and correction algorithm of the memory; The preset parameters include at least: the original data size and the preset maximum error correction capability, wherein the original data size is the data size processed per unit when the memory performs error correction; The storage variable correction parameters include at least: the number of target check code positions; The step of selecting the corresponding storage variable correction parameter according to the preset parameter, and correcting the target storage variable using the storage variable correction parameter, includes: The product of the preset coefficient and the preset maximum error correction capability is converted into a data type with the same size as the original data to obtain the verification data space; the verification data space is used to store the check code. The number of target check code positions is determined based on the test data space; The number of check code positions is modified to the number of target check code positions; the number of target check code positions is greater than the number of check code positions.

6. The method according to claim 5, characterized in that, Determining the number of target check code positions based on the verification data space includes: Calculate the check data space required to store check codes of different data types respectively, and select the maximum value in the check data space as the maximum value of the check data space; The product of the maximum value and the check code type corresponding to the maximum value is used as the maximum number of check code positions; the maximum number of check code positions is used to represent the maximum number of check codes that can be stored. Select a value greater than or equal to the maximum number of check code positions as the target number of check code positions, so that when the number of check code positions is modified to the target number of check code positions, the number of positions for storing check codes is increased.

7. The method according to claim 2, characterized in that, The maximum value of the free area is used to represent the maximum value of the free area of ​​the memory; The preset parameters also include: the maximum capacity of the free area preset by the manufacturer; The storage variable correction parameters also include: the maximum value of the target free area; Then, the step of modifying the target stored variable using the stored variable modification parameter includes: Select a value greater than or equal to the maximum capacity as the maximum value of the target free area; The maximum value of the free area is modified to the maximum value of the target free area; the maximum value of the target free area is greater than the maximum value of the free area.

8. The method according to claim 2, characterized in that, The maximum page size is used to represent the maximum page size supported by the memory; The preset parameters also include: a preset maximum page size; The storage variable correction parameters also include: the maximum value of the target page; Then, the step of selecting the corresponding storage variable correction parameter according to the preset parameter, and correcting the target storage variable using the storage variable correction parameter, includes: The product of the maximum page size and the data type corresponding to the maximum page size is taken as the target page maximum value; The maximum page value is modified to the target page value; the target page value is greater than the maximum page value.

9. The method according to claim 2, characterized in that, The preset parameters also include: the size of the free area array; The storage variable correction parameters also include: the size of the target free region array; Then, the step of selecting the corresponding storage variable correction parameter according to the preset parameter, and correcting the target storage variable using the storage variable correction parameter, includes: Select a value greater than or equal to the size of the free area array as the target free area array size; Modify the size of the free area array to the size of the target free area array.

10. The method according to claim 1, characterized in that, The method further includes: A reset command is sent to the chip using the memory, and a target delay time is waited for. The reset command is used to instruct the chip to reset.

11. A data storage device, characterized in that, Applied to a memory, the device includes: The acquisition module is used to acquire target driving variables in the driving region of the memory and target storage variables in the storage region of the memory; the target driving variables are driving variables of the first target byte, and the target driving variables include at least: target capacity variable, target partition variable, and target intra-chip address variable; the target storage variables include at least: free region array size, number of checksum positions, maximum free region value, and maximum page value; the free region array size is used to indicate how many unused segments are in the memory; The correction module is used to correct the target driving variable and the target storage variable so as to increase the capacity of the pages supported by the memory; The association module is used to associate and store the device identifier, the modified target driver variable, and the modified target storage variable of the memory into a predetermined matching list, so that the memory can perform large-capacity unit data storage according to the modified target driver variable and the modified target storage variable; the matching list is used to indicate the vendor identifier and device identifier supported by the memory, as well as the target driver variable and target storage variable corresponding to the vendor identifier and the device identifier.

12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the data storage method according to any one of claims 1 to 10.

13. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the data storage method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • DMA (Direct Memory Access) controller access implementation method for Loongson blade large-memory address devices

    CN102331978A

  • On demand memory page size

    CN111095229A