Storage space management method and device, electronic equipment and storage medium

By using logical mapping tables on the security chip to allocate extended storage pages to the application and maintaining the order of logical addresses, the problems of complexity of storage space management and low data access efficiency in the prior art are solved, and more efficient storage space management and data access are achieved.

CN119537259APending Publication Date: 2025-02-28BEIJING TONGFANG MICROELECTRONICS
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411656453.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The storage space management method of existing security chips causes logical addresses to intersect each other, increasing management complexity and time-consuming address query, and reducing data access efficiency.

Method used

The logical mapping table allocates an extended storage page to the application, configures the mapping relationship between the physical address and the logical address, so that it is arranged in sequence with the logical address of the original storage page, and updates the logical addresses of other applications to maintain the order.

Benefits of technology

It reduces the complexity of storage space management, avoids physical address matching errors caused by logical address crossing, simplifies the search process of logical address, and improves data access efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537259A_ABST
    Figure CN119537259A_ABST
Patent Text Reader

Abstract

The invention discloses a storage space management method and device, electronic equipment and a storage medium, and relates to the technical field of chips, the method comprises the following steps: distributing an extended storage page for a first storage block of a first application according to an extended storage request; the mapping relation between the physical address and the logic address of the extended storage page is configured through a logic mapping table, so that the extended storage page and the logic address of the original storage page in the first storage block are arranged in sequence; and updating the logic addresses of other applications of which the logic address sequence is positioned behind the first application through the logic mapping table, so that the other applications and the storage page logic addresses of the first application are arranged in sequence. According to the technical scheme of the embodiment of the invention, address mapping management of each storage page is realized, the management complexity of the storage space is reduced, the problem of physical address matching errors caused by logic address crossing is avoided, in addition, the sequential arrangement mode also simplifies the lookup process of the logic addresses, and the query time consumption of the logic addresses is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip technology, and in particular to a storage space management method, device, electronic device and storage medium. Background Art

[0002] With the continuous advancement of integrated circuit technology, the chip industry has developed rapidly. With the diversification of chip types and chip functions, security chips have gradually become the focus of people's attention.

[0003] Since the security chip has the configuration function of multiple applications, multiple applications not only improve the functionality of the chip, but also put forward higher requirements on the storage space management of the security chip, especially the management of flash memory storage space; in the prior art, the security chip usually manages the storage information of each application in ascending order according to the logical address, so as to meet the storage requirements of the new storage requests.

[0004] However, such storage space management method often causes the logical addresses of multiple applications to cross each other, which leads to logical address matching errors, increasing the complexity of storage space management. At the same time, when it is necessary to find the relevant logical address, it greatly increases the time consumption of address query and reduces the data access efficiency of the security chip. Summary of the invention

[0005] The present invention provides a storage space management method, device, electronic device and storage medium to solve the problem of high management complexity of flash memory storage space.

[0006] According to one aspect of the present invention, there is provided a storage space management method, comprising:

[0007] In response to obtaining an extended storage request of a first application, allocating an extended storage page to a first storage block of the first application according to the extended storage request;

[0008] configuring a mapping relationship between a physical address and a logical address of the extended storage page through a logical mapping table so that the extended storage page and the logical addresses of the original storage page in the first storage block are arranged in sequence;

[0009] The logical addresses of other applications whose logical address sequences are located after the first application are updated through the logical mapping table, so that the storage page logical addresses of the other applications and the first application are arranged in sequence.

[0010] According to another aspect of the present invention, there is provided a storage space management device, comprising:

[0011] an extended storage acquisition module, configured to, in response to acquiring an extended storage request of a first application, allocate an extended storage page to a first storage block of the first application according to the extended storage request;

[0012] A mapping relationship configuration module, configured to configure a mapping relationship between a physical address and a logical address of the extended storage page through a logical mapping table, so that the logical addresses of the extended storage page and the original storage page in the first storage block are arranged in sequence;

[0013] The mapping relationship updating module is used to update the logical addresses of other applications whose logical address sequences are located after the first application through the logical mapping table, so that the storage page logical addresses of the other applications and the first application are arranged in sequence.

[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the storage space management method described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the storage space management method described in any embodiment of the present invention when executed.

[0019] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the storage space management method according to any embodiment of the present invention is implemented.

[0020] The technical solution of the embodiment of the present invention, in response to obtaining an extended storage request of a first application, allocates an extended storage page to the first storage block of the first application according to the extended storage request, and then configures the mapping relationship between the physical address and the logical address of the extended storage page through a logical mapping table, so that the extended storage page and the logical address of the original storage page in the first storage block are arranged in sequence, and finally updates the logical addresses of other applications whose logical address sequences are located after the first application through the logical mapping table, so that the logical addresses of the storage pages of other applications and the first application are arranged in sequence. In this way, the address mapping management of multiple storage pages is realized, the management complexity of the storage space is reduced, and the sequentially arranged logical addresses avoid the problem of physical address matching errors caused by the intersection of logical addresses. In addition, the sequential arrangement method also simplifies the search process of the logical address, reduces the time consumption of logical address query, and improves data access efficiency.

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

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flow chart of a storage space management method provided according to Embodiment 1 of the present invention;

[0024] Figure 2 It is a schematic diagram of a process of adding an extended storage page in a storage block according to the first embodiment of the present invention;

[0025] Figure 3 is a schematic diagram of the structure of a storage page provided according to Embodiment 1 of the present invention;

[0026] Figure 4 is a flow chart of another storage space management method provided according to Embodiment 2 of the present invention;

[0027] Figure 5 is a flowchart of another storage space management method provided according to Embodiment 3 of the present invention;

[0028] Figure 6 is a schematic diagram of a process of deleting a redundant storage page in a storage block according to Embodiment 3 of the present invention;

[0029] Figure 7is a flow chart of another storage space management method provided according to Embodiment 4 of the present invention;

[0030] Figure 8 is a structural diagram of a storage space management device provided according to Embodiment 5 of the present invention;

[0031] Fig. 9 It is a structural schematic diagram of an electronic device that implements the storage space management method according to an embodiment of the present invention. DETAILED DESCRIPTION

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

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

[0034] Embodiment 1

[0035] Figure 1 This is a flowchart of a storage space management method provided in the first embodiment of the present invention. This embodiment can be applied to manage the logical address and physical address of each storage page through a logical mapping table. The method can be executed by the storage space management device in any embodiment of the present invention. The storage space management device can be implemented in the form of hardware and / or software. The storage space management device can be configured in the flash memory of the security chip, and the security chip can be configured in the electronic device. Figure 1 As shown, the method includes:

[0036] S101 . In response to obtaining an extended storage request of a first application, allocate an extended storage page to a first storage block of the first application according to the extended storage request.

[0037] Flash memory, also known as flash memory, configures a storage block for each application when managing internal applications. The storage block provides data access space for the current application. Each storage block provides data access space for only one application, and each application can only perform data storage operations in one storage block, that is, the storage block and the application are matched one by one. According to the different storage space required by each application, each storage block may include one or more storage pages. The storage capacity of each storage page may also be pre-configured according to the storage space size of the flash memory itself. For example, the storage pages in different storage blocks are all configured to be 256 bytes.

[0038] The internal application in the embodiment of the present invention may include an application data package that has been stored in the flash memory but has not yet been installed, may include an application that has been installed, and may also include a subscription configuration (Profile) file; wherein the Profile file may include operator data related to the user, and may also include the operator's authentication credentials and a third-party SIM (Subscriber Identity Module) card-based application.

[0039] After obtaining the extended storage request of the first application, in the first storage block corresponding to the first application, according to the extended storage request, the required number of storage pages (i.e., extended storage pages) are added, so as to meet the data access demand of the first application through the extended storage pages and the original storage pages in the first storage block; for example, when application A is installed, the flash memory has configured storage block A for application A and allocated a specified number of storage pages to storage block A; after application A completes the application update, as its application function expands, it needs more storage resources to meet its own operation requirements, and at this time, application A will issue an extended storage request to the flash memory; or during the operation of application A, when application A determines that the storage resources in storage block A cannot meet its own storage requirements, it will also issue an extended storage request to the flash memory.

[0040] S102: configuring a mapping relationship between a physical address and a logical address of the extended storage page through a logical mapping table, so that the logical addresses of the extended storage page and the original storage page in the first storage block are arranged in sequence.

[0041] The logical address is the address used by the running program in the flash memory, and is also the offset relative to the code segment, data segment or stack segment of the running program. The running program uses the logical address to access the stored data in the flash memory; the physical address is the physical storage address in the flash memory, that is, the actual address, which represents the hardware location of the flash memory on the security chip where the flash memory is located.

[0042] In an embodiment of the present invention, the logical addresses of each storage page in each storage block are continuous, and the logical addresses of the storage pages between two adjacent storage blocks are also continuous, which has been pre-configured when the storage blocks are created; and the physical addresses of each storage page in each storage block may be continuous or non-continuous, and the physical addresses of the storage pages between two adjacent storage blocks may also be continuous or non-continuous.

[0043] The logical mapping table reflects the mapping relationship between the logical address and the physical address of the storage page. According to the logical address executed by the running program, the matching physical address can be obtained by querying the logical mapping table, and then the data access is completed through the physical address. In particular, the logical mapping table can be configured locally in the flash memory, and can also be stored in the random access memory (Random Access Memory, RAM); compared with storage in the flash memory, the RAM has a faster reading and writing speed, ensuring the timely update of the logical mapping table; in particular, when the logical mapping table is stored in the RAM, the RAM can reconstruct the logical mapping table according to the logical address recorded in the additional function area of ​​the storage page of each storage block and the number of storage pages in each storage block after each power-on, that is, reconstruct the mapping relationship between the logical address and the physical address of each storage page.

[0044] Since the logical addresses of each storage page in each storage block are continuous, after adding an extended storage page to the storage block, it is also necessary to ensure that the logical addresses of the extended storage page are continuous with those of the original storage page. Figure 2 For example, three applications are stored in the flash memory, namely application 0, application 1 and application 2, which correspond to storage blocks 0, storage blocks 1 and storage blocks 2 respectively; storage block 0 includes four storage pages, whose logical addresses are logical address 0, logical address 1, logical address 2 and logical address 3 respectively; storage block 1 includes four storage pages, whose logical addresses are logical address 4, logical address 5, logical address 6 and logical address 7 respectively; storage block 2 includes four storage pages, whose logical addresses are logical address 8, logical address 9, logical address 10 and logical address 11 respectively.

[0045] The logical mapping table records the mapping relationship between the logical address and the physical address in the form of "X:Y", where "X" represents the logical address and "Y" represents the physical address. If an extended storage request from application 0 (i.e., the first application) is obtained at the current moment, and it applies to add a storage page in storage block 0 (i.e., the first storage block), then an extended storage page is added to storage block 0, and according to the logical addresses of the original storage pages in storage block 0 (i.e., logical address 0, logical address 1, logical address 2, logical address 3), the logical address of the extended storage page is configured as logical address 4; at the same time, since physical addresses 0 to 11 are all occupied, the idle physical address 12 is sequentially obtained as the physical address of the above-mentioned extended storage page, and at this time, the extended storage page is configured as the mapping relationship between logical address 4 and physical address 12 in the logical mapping table.

[0046] S103: Update the logical addresses of other applications whose logical address sequences are located after the first application through the logical mapping table, so that the storage page logical addresses of the other applications and the first application are arranged in sequence.

[0047] After completing the logical address allocation of the extended storage page in the first storage block, the extended storage page is actually equivalent to occupying the storage page logical address of other applications. Then, in the logical address sequence, other storage pages located after the extended storage page, that is, the logical addresses of other applications located after the first application, all need to be postponed backward in sequence. The number of postponements is the number of extended storage pages. For example, if the number of extended storage pages is five, then the logical addresses of other applications located after the first application also need to be postponed backward in sequence by five logical addresses.

[0048] Taking the above technical solution as an example, Figure 2 As shown, in the logical mapping table, after the extended storage page is configured as the mapping relationship between logical address 4 and physical address 12, since the number of extended storage pages is one, the storage pages of other applications (i.e., application 1 and application 2) located after application 0 all need to modify the logical addresses, that is, the logical addresses of the four storage pages in storage block 1 are modified to logical address 5, logical address 6, logical address 7, and logical address 8, respectively; the logical addresses of the four storage pages in storage block 2 are modified to logical address 9, logical address 10, logical address 11, and logical address 12, respectively.

[0049] Since the physical addresses of each storage page in storage block 1 and storage block 2 have not changed, the logical mapping table is equivalent to constructing a mapping relationship between a new logical address and an original physical address for each storage page in storage block 1 and storage block 2. Therefore, the mapping relationship between the logical address and the physical address of the storage page is updated in real time through the logical mapping table, so that the standardized management of the logical addresses of multiple applications is achieved without changing the physical address of the access data of each application, that is, it is ensured that the logical addresses of the storage pages within each application are arranged in sequence, and the logical addresses of the storage pages between multiple applications are also arranged in sequence, which improves the management efficiency of the flash memory for the storage space and avoids data access errors caused by the disordered arrangement of the logical addresses.

[0050] Optionally, in an embodiment of the present invention, after configuring the mapping relationship between the physical address and the logical address of the extended storage page through a logical mapping table, it also includes: configuring the logical address in the additional function area of ​​the extended storage page; after updating the logical addresses of other applications whose logical address sequence is located after the first application through the logical mapping table, it also includes: updating the logical addresses in the additional function area of ​​the storage page of the other applications.

[0051] Specifically, when configuring a storage page for each storage block, the capacity of the storage page can be expanded based on the required capacity of the storage page. The expanded capacity serves as an additional functional area, and the original capacity is used as a data storage area. The additional functional area is not used as a data access area, but is used to store the logical address of the current storage page. In the traditional technical solution, the entire capacity of each storage page is used for data access operations, that is, the entire capacity of the storage page is the data storage area. For example, when the storage page is configured to 256 bytes, the above 256 bytes are all data access areas.

[0052] In the embodiment of the invention, Figure 3 As shown, while configuring a data storage area (for example, 256 bytes) for a storage page, a certain storage space can also be allocated for use as an additional function area (for example, 16 bytes). The additional function area is specifically used to store the logical address of the current storage page. In this way, while ensuring that the data storage space of the storage page remains unchanged, it can also ensure that the constantly changing logical address is reflected in real time in the additional function area, thereby improving the efficiency of obtaining the logical address of the flash memory.

[0053] The technical solution of the embodiment of the present invention, in response to obtaining an extended storage request of a first application, allocates an extended storage page to the first storage block of the first application according to the extended storage request, and then configures the mapping relationship between the physical address and the logical address of the extended storage page through a logical mapping table, so that the extended storage page and the logical address of the original storage page in the first storage block are arranged in sequence, and finally updates the logical addresses of other applications whose logical address sequences are located after the first application through the logical mapping table, so that the logical addresses of the storage pages of other applications and the first application are arranged in sequence. In this way, the address mapping management of multiple storage pages is realized, and the management complexity of the storage space is reduced. At the same time, the sequentially arranged logical addresses avoid the problem of physical address matching errors caused by the intersection of logical addresses. In addition, the sequential arrangement method also simplifies the search process of the logical address, reduces the time consumption of logical address query, and thus improves data access efficiency.

[0054] Embodiment 2

[0055] Figure 4 This is a flowchart of a storage space management method provided by the second embodiment of the present invention. The relationship between this embodiment and the above embodiment is that the relevant request for adding a storage block of the second application is obtained. Figure 4 As shown, the method includes:

[0056] S201. In response to obtaining a new storage request from a second application, configure a second storage block for the second application according to the new storage request; wherein the second storage block includes multiple new storage pages.

[0057] After installing a new application, the security chip needs to allocate a corresponding storage block for the newly installed application, that is, when obtaining a new storage request from a second application, a new storage block (i.e., a second storage block) is constructed for the second application, and according to the new storage request, the required number of storage pages (i.e., new storage pages) are added, so as to meet the data access needs of the second application through the new storage pages; wherein the number of new storage pages can be one or more.

[0058] S202: sequentially use the idle physical addresses in the physical address sequence as the physical addresses of the newly added storage pages, and configure continuous logical addresses for the newly added storage pages.

[0059] In the physical address space, there may be multiple discontinuous address spaces due to the deletion of stored applications or other space sorting operations. At this time, for the second storage block, the free physical addresses in the physical address sequence are sequentially allocated to each newly added storage page in the second storage block to ensure continuous use of the physical addresses.

[0060] Taking the above technical solution as an example, if application 0 and application 1 are originally stored in the flash memory, the physical addresses of the four storage pages of application 0 are physical address 0, physical address 1, physical address 2, and physical address 3 respectively; the physical addresses of the four storage pages of application 1 are physical address 4, physical address 5, physical address 6, and physical address 7 respectively; due to the functional update of application 0, it releases one storage page, retains only the first three storage pages, and no longer occupies physical address 3.

[0061] If the newly added application 2 (i.e., the second application) in the flash memory needs to configure three storage pages, i.e., storage page 21, storage page 22, and storage page 23, then according to the physical address sequence, the free physical address 3 is first allocated to storage page 21, and then the free physical address 8 is allocated to storage page 22, and the free physical address 9 is allocated to storage page 23; thereby ensuring that the physical address space is used continuously, avoiding the long-term existence of fragmented physical addresses, and reducing the complexity of physical address management.

[0062] At the same time, in the logical address space, since the logical addresses are used continuously, even if a storage page in application 0 is released, then after the release is completed, the four storage pages of application 1 will also fill the logical address in turn. Therefore, for each newly added storage page, there is no intermediate idle logical address. At this time, you only need to start from the first unused logical address and allocate logical addresses to each newly added storage page in sequence. That is, logical address 7, logical address 8 and logical address 9 are allocated to storage page 21, storage page 22 and storage page 23 in sequence. This realizes the sequential arrangement of logical addresses, avoids storage fragmentation due to the installation of the second application, and thus leads to the problem of reduced storage space utilization.

[0063] S203: configuring a mapping relationship between the physical address and the logical address of each of the newly added storage pages through a logical mapping table.

[0064] The mapping relationship between the physical address and the logical address of each storage page in the newly added second storage block is recorded through the logical mapping table.

[0065] The technical solution of the embodiment of the present invention, after obtaining the new storage request of the second application, configures the second storage block for the second application according to the new storage request, and sequentially uses the free physical addresses in the physical address sequence as the physical addresses of each new storage page, and configures a continuous logical address for each new storage page, and then configures the mapping relationship between the physical address and the logical address of each new storage page through a logical mapping table, thereby not only ensuring that the physical address space is used continuously and avoiding the long-term existence of fragmented physical addresses, but also realizing the sequential arrangement of logical addresses, reducing the management complexity of the storage space.

[0066] Embodiment 3

[0067] Figure 5 This is a flowchart of a storage space management method provided by Embodiment 3 of the present invention. The relationship between this embodiment and the above embodiment is that a request related to releasing one or more storage pages from a third application is obtained. Figure 5 As shown, the method includes:

[0068] S301 . In response to obtaining a full page release request of a third application, obtaining a redundant storage page in a third storage block of the third application.

[0069] After a function change occurs in an application in the flash memory, the application may reduce the storage space occupied, that is, release some storage space, which is usually released in the form of an integer multiple of storage pages, that is, release one or more storage pages, and when the application is deleted, all storage pages are released. Therefore, when a full-page release request from a third application is obtained, the redundant storage pages may be one or more storage pages in the storage block of the third application (that is, the third storage block), or it may be all storage pages.

[0070] S302: Delete the storage data under the physical address of the redundant storage page, and delete the mapping relationship between the physical address and the logical address of the redundant storage page in the logical mapping table.

[0071] After determining the redundant storage page, firstly, the data actually stored in the storage page, that is, the storage data under the current physical address, needs to be deleted; secondly, since the redundant storage page is no longer used, the mapping relationship between the physical address and the logical address of the redundant storage page in the logical mapping table needs to be deleted.

[0072] S303: Update the logical addresses of other applications located after the third application in the logical address sequence through the logical mapping table, so that the storage page logical addresses of all applications in the flash memory are arranged in sequence.

[0073] As the redundant storage pages are deleted, the logical addresses originally occupied by them become vacant. In order to ensure the continuity of the logical addresses, the logical addresses of other applications located after the third application in the logical address sequence need to be shifted forward in sequence. The number of shifts is the number of redundant storage pages, so that the storage page logical addresses of each application are presented in sequential order.

[0074] by Figure 6For example, when a full-page release request of application 1 (i.e., the third application) is obtained, the current full-page release request is used to release all storage pages in storage block 1. At this time, the storage data under the physical addresses of the four storage pages in storage block 1 are first deleted, that is, the storage data in physical address 4, physical address 5, physical address 6, and physical address 7 are deleted; then the mapping relationship between logical address 4, logical address 5, logical address 6, and logical address 7 and physical address 4, physical address 5, physical address 6, and physical address 7, respectively, is released.

[0075] Finally, the logical addresses of the storage pages of other applications (i.e., application 2) located after the third application are shifted forward in sequence, that is, the logical addresses of the four storage pages of application 2 are configured as logical address 4, logical address 5, logical address 6, and logical address 7 in sequence, and a mapping relationship is established between logical address 4, logical address 5, logical address 6, and logical address 7 and the original physical addresses of the four storage pages of application 2, i.e., physical address 8, physical address 9, physical address 10, and physical address 11, thereby completing the response to the entire page release request; avoiding the problem of storage fragmentation caused by the third application releasing one or more storage pages, which in turn leads to reduced storage space utilization.

[0076] The technical solution of the embodiment of the present invention is to obtain the redundant storage page in the third storage block of the third application after obtaining the full page release request of the third application; then delete the storage data under the physical address of the redundant storage page and the mapping relationship between the physical address and the logical address of the redundant storage page in the logical mapping table; finally, update the logical addresses of other applications located after the third application in the logical address sequence through the logical mapping table, so that the logical addresses of the storage pages of all applications in the flash memory are arranged in sequence. In this way, when redundant storage pages appear, the sequential arrangement of the logical addresses of each storage page is still ensured, avoiding the intersection of the logical addresses of different applications caused by the appearance of redundant storage pages, and improving the address management efficiency of each storage page.

[0077] Embodiment 4

[0078] Figure 7 This is a flowchart of a storage space management method provided by the fourth embodiment of the present invention. The relationship between this embodiment and the above embodiment is that a release request of a non-integer number of storage pages of the fourth application is obtained. Figure 7 As shown, the method includes:

[0079] S401 . In response to obtaining a non-full-page release request of a fourth application, determine whether a storage release amount in the non-full-page release request is greater than one storage page.

[0080] After obtaining the release request issued by the fourth application, if the number of storage pages it requires to be released is not an integer number of storage pages, it indicates that the current request is a non-full page release request. At this time, it is necessary to determine whether the storage release amount in the non-full page release request is greater than one storage page.

[0081] S402: If it is determined that the released storage amount is less than one storage page, defragment the fourth storage block of the fourth application so that the free physical addresses in the fourth storage block are arranged at the end position of the end storage page.

[0082] Taking the above technical solution as an example, if 0.3 storage pages are released in the storage block 0 of application 0, in the physical storage space corresponding to the storage block 0, along with the release of 0.3 storage pages, there is 0.3 storage pages of free storage space in the physical storage space. The free storage space may appear at any position of the storage block 0, for example, the starting position, the middle position or the end position, etc. At this time, the storage data located after the free storage space in the physical storage space is shifted forward in sequence to fill the free physical storage space, so that at the end position of the end storage page of the storage block 0, there is a free storage space of 0.3 storage pages, thereby realizing the defragmentation inside the fourth storage block, that is, configuring the fragmented free storage space at the end position of the end storage page, avoiding the inconvenience of management of the randomly distributed fragmented space in the storage block, and improving the management efficiency of the storage space.

[0083] S403: If it is determined that the released storage amount is greater than one storage page, use storage pages that are integer multiples of the released storage amount as redundant storage pages.

[0084] If the storage release amount is greater than one storage page, for example, storage block 0 releases 2.5 storage pages, then integer multiples of the storage pages are regarded as redundant storage pages, that is, there are 2 redundant storage pages at this time.

[0085] S404: Delete the storage data under the physical address of the redundant storage page, and delete the mapping relationship between the physical address and the logical address of the redundant storage page in the logical mapping table.

[0086] S405: Update the logical addresses of other applications located after the fourth application in the logical address sequence through the logical mapping table, so that the storage page logical addresses of all applications in the flash memory are arranged in sequence.

[0087] As described in the above scheme, for redundant storage pages, the storage data under their physical addresses are deleted, and the mapping relationship between their physical addresses and logical addresses in the logical mapping table is deleted. Then, the logical addresses of other applications located after the fourth application in the logical address sequence are shifted forward in sequence. The number of shifts is the number of redundant storage pages, so that the logical addresses of the storage pages of each application are presented in a sequential manner.

[0088] S406: Defragment the fourth storage block of the fourth application according to the storage pages that are not integer multiples in the storage release amount, so that the free physical addresses in the fourth storage block are arranged at the end position of the end storage page.

[0089] For storage pages that are not integer multiples of the storage release amount, that is, the above-mentioned 0.5 storage pages, as described in the above-mentioned technical solution, a defragmentation operation is performed, so that a free storage space of 0.5 storage pages appears at the end of the end storage page of storage block 0, thereby achieving defragmentation within the fourth storage block; avoiding the problem of storage fragmentation caused by the fourth application releasing a non-integer number of storage pages, which in turn leads to reduced storage space utilization.

[0090] The technical solution of the embodiment of the present invention, when a non-integer page release request is obtained, according to the actual size of the storage release amount, for the storage pages that are integer multiples, the storage data under the physical address and the mapping relationship between the physical address and the logical address in the logical mapping table are deleted, and then the logical addresses of other applications located after the fourth application in the logical address sequence are shifted forward in sequence, thereby ensuring the sequential arrangement of the logical addresses of each storage page, avoiding the occurrence of redundant storage pages that cause the logical addresses of different applications to overlap; for the storage pages that are non-integer multiples, the fragmented free storage space is configured at the end of the end storage page, avoiding the inconvenience of managing the randomly distributed fragmented space in the storage block, and improving the management efficiency of the storage space.

[0091] Embodiment 5

[0092] Figure 8 : is a structural block diagram of a storage space management device provided by Embodiment 5 of the present invention, and the device specifically includes:

[0093] An extended storage acquisition module 501 is configured to, in response to acquiring an extended storage request of a first application, allocate an extended storage page to a first storage block of the first application according to the extended storage request;

[0094] A mapping relationship configuration module 502, configured to configure a mapping relationship between a physical address and a logical address of the extended storage page through a logical mapping table, so that the logical addresses of the extended storage page and the original storage page in the first storage block are arranged in sequence;

[0095] The mapping relationship updating module 503 is used to update the logical addresses of other applications whose logical address sequences are located after the first application through the logical mapping table, so that the storage page logical addresses of the other applications and the first application are arranged in sequence.

[0096] The technical solution of the embodiment of the present invention, in response to obtaining an extended storage request of a first application, allocates an extended storage page to the first storage block of the first application according to the extended storage request, and then configures the mapping relationship between the physical address and the logical address of the extended storage page through a logical mapping table, so that the extended storage page and the logical address of the original storage page in the first storage block are arranged in sequence, and finally updates the logical addresses of other applications whose logical address sequences are located after the first application through the logical mapping table, so that the logical addresses of the storage pages of other applications and the first application are arranged in sequence. In this way, the address mapping management of multiple storage pages is realized, and the management complexity of the storage space is reduced. At the same time, the sequentially arranged logical addresses avoid the problem of physical address matching errors caused by the intersection of logical addresses. In addition, the sequential arrangement method also simplifies the search process of the logical address, reduces the time consumption of logical address query, and thus improves data access efficiency.

[0097] Optionally, the storage space management device is also used to configure the logical address in the additional function area of ​​the extended storage page after configuring the mapping relationship between the physical address and the logical address of the extended storage page through a logical mapping table; and update the logical address in the additional function area of ​​the storage page of other applications after updating the logical address sequence of other applications located after the first application through the logical mapping table.

[0098] Optionally, the storage space management device is also used to respond to obtaining a new storage request from a second application, and configure a second storage block for the second application according to the new storage request; wherein the second storage block includes multiple new storage pages; the free physical addresses in the physical address sequence are used in sequence as the physical addresses of each of the new storage pages, and a continuous logical address is configured for each of the new storage pages; and the mapping relationship between the physical address and the logical address of each of the new storage pages is configured through a logical mapping table.

[0099] Optionally, the storage space management device is also used to obtain a redundant storage page in the third storage block of the third application in response to a full page release request from the third application; delete the storage data under the physical address of the redundant storage page, and delete the mapping relationship between the physical address and the logical address of the redundant storage page in the logical mapping table; and update the logical addresses of other applications located after the third application in the logical address sequence through the logical mapping table, so that the storage page logical addresses of all applications in the flash memory are arranged in sequence.

[0100] Optionally, the storage space management device is also used to respond to a non-full-page release request from a fourth application and determine whether the storage release amount in the non-full-page release request is greater than one storage page; if it is determined that the storage release amount is less than one storage page, defragment the fourth storage block of the fourth application so that the free physical address in the fourth storage block is configured at the end position of the end storage page.

[0101] Optionally, the storage space management device is also used to, if it is determined that the storage release amount is greater than one storage page, use an integer multiple of the storage pages in the storage release amount as redundant storage pages; delete the storage data under the physical address of the redundant storage page, and delete the mapping relationship between the physical address and the logical address of the redundant storage page in the logical mapping table; update the logical addresses of other applications located after the fourth application in the logical address sequence through the logical mapping table, so that the storage page logical addresses of all applications in the flash memory are arranged in sequence; and defragment the fourth storage block of the fourth application according to the non-integer multiple of the storage pages in the storage release amount, so that the free physical addresses in the fourth storage block are configured at the end position of the end storage page.

[0102] The above device can execute the storage space management method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the storage space management method provided by any embodiment of the present invention.

[0103] Embodiment 6

[0104] Fig. 9 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, electronic devices, blade electronic devices, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0105] like Fig. 9As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0106] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0107] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a storage space management method.

[0108] In some embodiments, the storage space management method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on a heterogeneous hardware accelerator via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps of the storage space management method described above may be performed. Alternatively, in other embodiments, the processor may be configured to execute the storage space management method by any other appropriate means (e.g., by means of firmware).

[0109] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof, such as smart cards, security module units (SEs). These various embodiments may include: being implemented in one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general programmable processor, which can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0110] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or electronic device.

[0111] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0112] To provide interaction with a user, the systems and techniques described herein may be implemented on a heterogeneous hardware accelerator having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) through which a user can provide input to the heterogeneous hardware accelerator. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0113] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data electronic device), or a computing system that includes middleware components (e.g., an application electronic device), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0114] The computing system may include a client and an electronic device. The client and the electronic device are generally remote from each other and usually interact through a communication network. The relationship between the client and the electronic device is generated by computer programs running on corresponding computers and having a client-electronic device relationship with each other. The electronic device may be a cloud electronic device, also known as a cloud computing electronic device or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

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

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

Claims

1. A storage space management method, characterized in that: Applied to flash memory, including: In response to obtaining an extended storage request of a first application, allocating an extended storage page to a first storage block of the first application according to the extended storage request; configuring a mapping relationship between a physical address and a logical address of the extended storage page through a logical mapping table so that the extended storage page and the logical addresses of the original storage page in the first storage block are arranged in sequence; The logical addresses of other applications whose logical address sequences are located after the first application are updated through the logical mapping table, so that the storage page logical addresses of the other applications and the first application are arranged in sequence.

2. The method according to claim 1, characterized in that After configuring the mapping relationship between the physical address and the logical address of the extended storage page through the logical mapping table, the method further includes: configuring a logical address in an additional function area of ​​the extended storage page; After updating the logical addresses of other applications whose logical address sequences are located after the first application through the logical mapping table, the method further includes: The logical address is updated in the additional function area of ​​the memory page of the other application.

3. The method according to claim 1, characterized in that The storage space management method further includes: In response to obtaining a new storage request of a second application, configuring a second storage block for the second application according to the new storage request; wherein the second storage block includes a plurality of new storage pages; Sequentially using the idle physical addresses in the physical address sequence as the physical addresses of the newly added storage pages, and configuring continuous logical addresses for the newly added storage pages; The mapping relationship between the physical address and the logical address of each newly added storage page is configured through a logical mapping table.

4. The method according to claim 1, characterized in that: The storage space management method further includes: In response to obtaining a full page release request of a third application, obtaining a redundant storage page in a third storage block of the third application; Deleting the storage data under the physical address of the redundant storage page, and deleting the mapping relationship between the physical address and the logical address of the redundant storage page in the logical mapping table; The logical addresses of other applications located after the third application in the logical address sequence are updated through the logical mapping table, so that the storage page logical addresses of all applications in the flash memory are arranged in sequence.

5. The method according to claim 1, characterized in that: The storage space management method further includes: In response to obtaining a non-full-page release request of a fourth application, determining whether a storage release amount in the non-full-page release request is greater than one storage page; If it is determined that the storage release amount is less than one storage page, the fourth storage block of the fourth application is defragmented so that the free physical addresses in the fourth storage block are arranged at the end position of the end storage page.

6. The method according to claim 5, characterized in that After determining whether the storage release amount in the non-full page release request is greater than one storage page, the method further includes: If it is determined that the storage release amount is greater than one storage page, storage pages that are integer multiples of the storage release amount are used as redundant storage pages; Deleting the storage data under the physical address of the redundant storage page, and deleting the mapping relationship between the physical address and the logical address of the redundant storage page in the logical mapping table; updating the logical addresses of other applications located after the fourth application in the logical address sequence through the logical mapping table, so that the storage page logical addresses of all applications in the flash memory are arranged in sequence; According to the storage pages that are not integer multiples in the storage release amount, the fourth storage block of the fourth application is defragmented so that the free physical addresses in the fourth storage block are arranged at the end position of the end storage page.

7. A storage space management device, characterized in that: Applied to flash memory, including: an extended storage acquisition module, configured to, in response to acquiring an extended storage request of a first application, allocate an extended storage page to a first storage block of the first application according to the extended storage request; A mapping relationship configuration module, configured to configure a mapping relationship between a physical address and a logical address of the extended storage page through a logical mapping table, so that the logical addresses of the extended storage page and the original storage page in the first storage block are arranged in sequence; The mapping relationship updating module is used to update the logical addresses of other applications whose logical address sequences are located after the first application through the logical mapping table, so that the storage page logical addresses of the other applications and the first application are arranged in sequence.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the storage space management method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the storage space management method according to any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the storage space management method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Storage data writing method, storage data recovery method and storage host

    CN122111884A

  • Data writing methods, data reclamation methods, and storage host

    CN122111884B