Data storage space management method and device, security element and storage medium

By dynamically managing the storage space of secure storage applications, the storage space allocation problem under different application requirements is solved, and efficient data operation and accurate storage management are achieved.

CN119690863APending Publication Date: 2025-03-25BEIJING TSINGTENG MICROSYSTEM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411768910.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art is difficult to dynamically manage the storage space capacity and storage block capacity required by different secure storage applications, resulting in the inability to meet the changes in application scenario requirements.

Method used

By determining the total storage space capacity and storage block capacity required based on the storage installation parameters of the target application to be installed, the storage space is allocated and divided from the free storage space of the security element, the target array is created, and management records are formed to assist in the storage operation.

Benefits of technology

It realizes dynamic allocation of storage space according to the needs of different secure storage applications, meets the storage capacity and block capacity requirements of different applications, and improves the efficiency and accuracy of data operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690863A_ABST
    Figure CN119690863A_ABST
Patent Text Reader

Abstract

The invention relates to a data storage space management method and device, a security element and a storage medium, and the method comprises the steps: determining the total storage space capacity and storage block capacity required by a target application based on storage installation parameters of the target application to be installed; allocating a storage space for the target application and dividing the target application into a plurality of storage blocks based on the total storage space capacity and the storage block capacity required by the target application; based on the total storage space capacity required by the target application, determining the number of target arrays needing to be created, and creating each target array; determining a corresponding relationship between the target array and the storage block, and forming a management record corresponding to the target application; the management record is used for assisting in determining an array required to be used for accessing the storage block for storing the target data when the target data is subjected to reading, writing or erasing operation, and the requirement that the total storage space capacity required by the secure storage application and the capacity of the storage block are adjusted according to the actual situation along with the change of the application scene requirement can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of storage technology, and in particular to a data storage space management method, device, security element and storage medium. Background Art

[0002] At present, the storage space capacity allocated to different secure storage applications in the security element is the same, and the block capacity of secure storage data is also the same. However, as the application scenario requirements change, the total storage space capacity and storage block capacity required by different secure storage applications are also gradually changing, and the total storage space capacity and storage block capacity of different secure storage applications may be different. Therefore, how to dynamically allocate and manage the storage space of each secure storage application is a problem that needs to be solved urgently. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a data storage space management method, device, security element and storage medium.

[0004] In a first aspect, the present disclosure provides a data storage space management method, comprising:

[0005] Determine the total storage space capacity and storage block capacity required by the target application based on the storage installation parameters of the target application to be installed;

[0006] Based on the total storage space capacity and storage block capacity required by the target application, allocate storage space for the target application from the free storage space in the security element, and divide the allocated storage space into a plurality of storage blocks;

[0007] Based on the total storage space capacity required by the target application, determine the number of target arrays to be created, and create each of the target arrays;

[0008] Determine the correspondence between the target array and the storage block, and form a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data.

[0009] In a second aspect, the present disclosure further provides a data storage space management device, comprising:

[0010] A determination module, configured to determine the total storage space capacity and storage block capacity required by the target application based on the storage installation parameters of the target application to be installed;

[0011] an allocation module, configured to allocate storage space for the target application from free storage space in the security element based on the total storage space capacity and storage block capacity required by the target application, and divide the allocated storage space into a plurality of storage blocks;

[0012] A creation module, used to determine the number of target arrays to be created based on the total storage space capacity required by the target application, and create each of the target arrays;

[0013] An association module is used to determine the correspondence between the target array and the storage block, and to form a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data.

[0014] In a third aspect, the present disclosure further provides a security element, including: a processor and a memory;

[0015] The processor is used to execute the steps of any of the above methods by calling the program or instruction stored in the memory.

[0016] In a fourth aspect, the present disclosure further provides a computer-readable storage medium, which stores a program or instruction, and the program or instruction enables a computer to execute the steps of any of the above methods.

[0017] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0018] The technical solution provided by the embodiment of the present disclosure is as follows: the above technical solution determines the total storage space capacity and storage block capacity required by the target application by setting the storage installation parameters based on the target application to be installed; based on the total storage space capacity and storage block capacity required by the target application, allocates storage space for the target application from the free storage space in the security element, and divides the allocated storage space into multiple storage blocks; based on the total storage space capacity required by the target application, determines the number of target arrays to be created, and creates each target array; determines the correspondence between the target array and the storage block, and forms a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data. Its essence is that when different applications have different total storage space capacities and / or storage block capacities, storage space can be dynamically allocated according to the storage capacity and block capacity of each secure storage application, and a management record can be constructed for it, so as to meet the needs of adjusting the total storage space capacity and storage block capacity required by the secure storage application according to the actual situation as the application scenario requirements change. In addition, since the above technical solution finally forms a management record corresponding to the target application. When the target data is subsequently read, written or erased, the corresponding array and storage block can be quickly located without a large amount of calculation, which can improve the efficiency and accuracy of data operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0021] Figure 1 A flowchart of a data storage space management method provided by an embodiment of the present disclosure;

[0022] Figure 2 A schematic diagram of the structure of a data storage space management device provided by an embodiment of the present disclosure;

[0023] Figure 3 A schematic diagram of the hardware structure of a security element provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0025] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0026] Before introducing the embodiments of the present application, some terms or concepts involved in the embodiments of the present application are first explained. It should be understood that the present application does not specifically limit the naming of the following terms. The following terms may have other names. The renamed terms still meet the following related term explanations.

[0027] Storage space: refers to the total capacity that can be used to store data, usually composed of multiple storage blocks.

[0028] Storage block: A data unit with a fixed capacity in the storage space, which is the basic unit of data storage and management.

[0029] Array: A data structure used to manage and index storage blocks. The array can quickly locate and access specific storage blocks, thereby performing data read, write, and erase operations.

[0030] Free storage space: Unoccupied storage area that can be used to store new data. Free storage space is the portion of the total storage space in the hardware that has not yet been allocated.

[0031] Secure Element: A hardware component specifically designed to store and process sensitive data, usually with high security and tamper-proof features, and is commonly used in areas such as financial transactions, identity authentication, and encrypted communications.

[0032] Secure storage applications: Applications running on secure elements that manage and protect sensitive data and ensure data security and integrity. These applications typically include encryption, decryption, authentication, and data management functions. In this application, the applications referred to are secure storage applications.

[0033] Figure 1 This is a flow chart of a data storage space management method provided by an embodiment of the present disclosure. The method can be executed by the operating system of the security chip. Figure 1 , the data storage space management method comprises:

[0034] S110 . Determine the total storage space capacity and storage block capacity required by the target application based on the storage installation parameters of the target application to be installed.

[0035] The target application is the secure storage application to be installed.

[0036] The storage installation parameters of the target application are a set of parameters used to configure and manage the storage resources required by the target application when installing the target application. The storage installation parameters of the target application are recorded in the instance of the target application to ensure that the target application can efficiently manage and use storage resources in the best operating state. For example, in the instance of the target application, the storage installation parameters of the target application can be recorded in the following format:

[0037] C9(Tag)04(L)xxxx(capacity)xxxx(blocksize).

[0038] Where capcity represents the total storage space capacity required by the target application, in KB. blocksize represents the storage block capacity required by the target application, in B.

[0039] S120 . Allocate storage space for the target application from free storage space in the secure element based on the total storage space capacity and storage block capacity required by the target application, and divide the allocated storage space into a plurality of storage blocks.

[0040] The capacity of the storage space allocated for the target application is equal to the total storage space capacity required by the target application.

[0041] The allocated storage space is divided into a plurality of storage blocks, including: dividing the allocated storage space into a plurality of storage blocks according to the storage block capacity, so that the capacity of each storage block after division is equal to the storage block capacity required by the target application.

[0042] In some embodiments, the total storage space capacity required by the target application needs to be set to an integer multiple of the storage block capacity.

[0043] In one example, if the total storage space capacity required by the target application is totalSizeUnitB, and the storage block capacity is blocksize, the storage space allocated for the target application is divided to obtain totalBlockCount storage blocks; wherein,

[0044] totalBlockCount=totalSizeUnitB / blocksize.

[0045] Furthermore, an index value may be set for each storage block. When setting the index value, the index values ​​are numbered in an ascending manner starting from 0, and eventually the index value range of all storage blocks is from 0 to totalBlockCount-1.

[0046] S130 . Determine the number of target arrays to be created based on the total storage space capacity required by the target application, and create each target array.

[0047] There are many methods for implementing this step, which are not limited in this application. Exemplarily, the method for implementing this step may include: determining the actual capacity of the target array. Based on the total storage space capacity required by the target application and the actual capacity of the target array, determining the number of target arrays to be created, and creating each target array.

[0048] In some embodiments, in order to simplify index calculations during data storage operations, the actual capacity of the target array may be set to be an integer multiple of the storage block capacity.

[0049] Furthermore, considering that in practice, due to the hardware performance limitation of the security element, a maximum capacity may be set for the target array. Based on this, in another embodiment, optionally, determining the actual capacity of the target array includes: if the total storage space capacity required by the target application is greater than the maximum capacity of the target array, determining the actual capacity of the target array based on the storage block capacity and the maximum capacity of the target array; the actual capacity of the target array is an integer multiple of the storage block capacity, and the difference between the maximum capacity and the actual capacity of the target array is less than the storage block capacity; the maximum capacity of the target array is determined by the hardware performance of the security element; if the total storage space capacity required by the target application is less than or equal to the maximum capacity of the target array, setting the actual capacity of the target array equal to the total storage space capacity required by the target application.

[0050] Optionally, after the target arrays are created, index values ​​are set for each target array. When setting the index values, they are numbered in an ascending manner starting from 0.

[0051] For example, if the maximum number of elements that can be included in the target array created by the secure storage application is 32767, that is, the maximum capacity of the target array is 32767 (in B), it is determined whether the total storage space capacity totalSizeUnitB required by the target application is greater than 32767 (that is, the maximum capacity of the target array).

[0052] If the total storage space capacity totalSizeUnitB required by the target application is greater than 32767 (i.e., the maximum capacity of the target array), the actual capacity s of the target array is determined based on formula (1):

[0053] s = 32767 - 32767% blocksize (1)

[0054] Where blocksize is the storage block capacity in the storage installation parameters of the target application, and % represents the modulus operation. Based on formula (1), the actual capacity of the target array meets the following two conditions: the actual capacity of the target array is an integer multiple of the storage block capacity, and the difference between the maximum capacity and the actual capacity of the target array is less than the storage block capacity. Using formula (2), calculate the number of target arrays to be created, objcnt1:

[0055] objcnt1 = totalSizeUnitB / s. (2)

[0056] " / " indicates division. If objcnt1 is an integer, the number of target arrays to be created is equal to objcnt1. Create objcnt1 target arrays and set index values ​​for each storage block. When setting index values, they are numbered in ascending order starting from 0, and the index values ​​of all target arrays eventually range from 0 to objcnt1–1. If objcnt1 is not an integer, round objcnt1 down to get objcnt2, and the number of target arrays to be created is equal to objcnt2+1. Create objcnt2+1 target arrays and set index values ​​for each storage block. When setting index values, they are numbered in ascending order starting from 0, and the index values ​​of all target arrays eventually range from 0 to objcnt2.

[0057] If the total storage space capacity totalSizeUnitB required by the target application is less than or equal to 32767 (i.e., the maximum capacity of the target array), it is determined that only one target data needs to be created, and the target array is created. The actual capacity of the target array is equal to the total storage space capacity required by the target application.

[0058] S140, determining the correspondence between the target array and the storage block, and forming a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data.

[0059] There are many specific implementation methods for "determining the correspondence between the target array and the storage block", and this application does not limit this. Exemplarily, the implementation method of this step includes: determining the number of storage blocks corresponding to a single target array based on the actual capacity of the target array and the capacity of the storage block; determining the correspondence between the target array and the storage block based on the number of storage blocks corresponding to the single target array.

[0060] For example, if the total storage space capacity totalSizeUnitB required by the target application is greater than the actual capacity of the target array, multiple target arrays are usually created, and the number of storage blocks corresponding to a single target array blockCountPerObj can be calculated based on formula (3):

[0061] blockCountPerObj = s / blocksize (3)

[0062] s is the actual capacity of the target array, and blocksize is the storage block capacity. Subsequently, in the order of increasing index values ​​of the target array, consecutive blockCountPerObj storage blocks are allocated to each target array in turn, so that a corresponding relationship is established between the target array and the storage block.

[0063] If the total storage space capacity totalSizeUnitB required by the target application is less than or equal to the maximum capacity of the target array, a target array is usually created, which corresponds to all storage blocks. The number of storage blocks corresponding to the target array, blockCountPerObj, can be calculated based on formula (4):

[0064] blockCountPerObj = totalSizeUnitB / blocksize (4)

[0065] totalSizeUnitB is the total storage space capacity required by the target application, and blocksize is the storage block capacity required by the target application.

[0066] The target data is the data that needs to be read, written or erased during the use of the target application after it is installed.

[0067] Management records are tools used to assist in determining which array is needed to access the storage block storing the target data when performing subsequent storage operations such as reading, writing or erasing the target data. Through management records, the array that can access the storage block where the target data is located can be quickly determined, improving the efficiency and accuracy of data storage operations.

[0068] In some embodiments, the management record includes the correspondence between the target array index value and the storage block index value. In this case, in the later stage, to determine which array the storage block where the target data is located needs to be accessed through, the management record can be directly queried to obtain the information.

[0069] In other embodiments, the management record includes the number of storage blocks corresponding to a single target array. In this case, in the later stage, it is necessary to determine which array the storage block where the target data is located needs to be accessed through, which needs to be obtained through certain calculations.

[0070] The above technical solution determines the total storage space capacity and storage block capacity required by the target application by setting the storage installation parameters based on the target application to be installed; based on the total storage space capacity and storage block capacity required by the target application, allocates storage space for the target application from the free storage space in the security element, and divides the allocated storage space into multiple storage blocks; based on the total storage space capacity required by the target application, determines the number of target arrays to be created, and creates each target array; determines the correspondence between the target array and the storage block, and forms a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data. Its essence is that when different applications have different total storage space capacities and / or storage block capacities, storage space can be dynamically allocated for each secure storage application according to its storage capacity and block capacity, and a management record can be constructed for it, so as to meet the needs of adjusting the total storage space capacity and storage block capacity required by the secure storage application according to actual conditions as the application scenario requirements change. In addition, since the above technical solution finally forms a management record corresponding to the target application. When the target data is subsequently read, written or erased, the corresponding array and storage block can be quickly located without a large amount of calculation, which can improve the efficiency and accuracy of data operations.

[0071] On the basis of the above technical solution, optionally, S120 may include: based on the total storage space capacity and storage block capacity required by the target application, determining whether the storage installation parameters of the target application meet the rationality conditions; the rationality conditions include: the total storage space capacity required by the target application is an integer multiple of the storage block capacity; if the storage installation parameters of the target application meet the rationality conditions, based on the total storage space capacity and storage block capacity required by the target application, storage space is allocated from the free storage space in the security element for the target application, and the allocated storage space is divided into multiple storage blocks; if the storage installation parameters of the target application do not meet the rationality conditions, based on the preset total storage space capacity and preset storage block capacity, storage space is allocated from the free storage space in the security element for the target application, and the allocated storage space is divided into multiple storage blocks; the preset total storage space capacity is an integer multiple of the preset storage block capacity.

[0072] The total storage space required by the target application is an integer multiple of the storage block capacity, which means that the fragmentation of the storage space can be reduced, the utilization of the storage space can be improved, the index calculation can be simplified, and the complexity of managing and allocating storage blocks can be reduced. Therefore, the rationality condition is set to include: the total storage space required by the target application is an integer multiple of the storage block capacity.

[0073] In some scenarios, the preset total storage space capacity and the preset storage block capacity are not storage installation parameters set for a specific application, but are general storage installation parameters. In some examples, the preset total storage space capacity and the preset storage block capacity may be set according to the performance of the security element, and it is not required that the application runs in the best state under the preset total storage space capacity and the preset storage block capacity.

[0074] The essence of the above settings is that if the storage installation parameters of the target application meet the rationality conditions, storage space is allocated and managed for the target application based on the storage installation parameters recorded in the instance of the target application. If the storage installation parameters of the target application do not meet the rationality conditions, the storage installation parameters recorded in the instance of the target application are not used, but the pre-set total storage space capacity and storage block capacity that meet the rationality conditions are used to allocate and manage storage space for the target application. This ensures that regardless of whether the storage installation parameters of the target application are reasonable, reasonable storage space allocation and management can be performed for the target application, thereby reducing the fragmentation of storage space, improving the utilization of storage space, simplifying index calculations, and reducing the complexity of allocating and managing storage blocks.

[0075] It should be noted that the above S110 - S140 are only executed once when the target application instance is installed, that is, only executed once in the entire life cycle of the target application.

[0076] On the basis of the above-mentioned technical solutions, optionally, the method further includes: obtaining storage operation instructions for the target data, the storage operation instructions for the target data including at least one of the following: a read operation instruction, a write operation instruction and an erase operation instruction for the target data; the storage operation instruction including: the index number of the first storage block corresponding to the target data and the number of all storage blocks corresponding to the target data; based on the index number of the first storage block corresponding to the target data and the number of all storage blocks corresponding to the target data, and the management record, determining the first array and the position of the first storage block corresponding to the target data in the first array; the first array is an array corresponding to the first storage block corresponding to the target data; based on the first array and the position of the first storage block corresponding to the target data in the first array, performing a storage operation on the target data.

[0077] The target data may be, for example, data that is desired to be written into a storage space corresponding to a target application; or data that is desired to be read from a storage space corresponding to a target application; or data that is desired to be erased from a storage space corresponding to a target application.

[0078] Further, if the management record includes a correspondence between a single target array and the number of storage blocks; the target application corresponds to multiple arrays; based on the index number of the first storage block corresponding to the target data and the number of all storage blocks corresponding to the target data, and the management record, determining the first array, and the position of the first storage block corresponding to the target data in the first array, includes: determining the first array based on the index number of the first storage block corresponding to the target data and the correspondence between the single target array and the number of storage blocks; determining the position of the first storage block corresponding to the target data in the first array based on the index number of the first storage block corresponding to the target data, the correspondence between the single target array and the number of storage blocks, and the storage block capacity.

[0079] Exemplarily, if the management record includes the number of storage blocks corresponding to a single target array, optionally, the index objIndex of the first array can be determined by formula (5):

[0080] objIndex = blockIndex / / blockCountPerObj (5)

[0081] blockIndex is the index value of the first storage block corresponding to the target data. blockCountPerObj is the number of storage blocks corresponding to a single target array. “ / / ” indicates a round-down division operation, that is, the result of dividing blockIndex by blockCountPerObj is rounded down.

[0082] The position of the first storage block corresponding to the target data in the first array can be represented by an offset address offset;

[0083] offset=(blockIndex-objIndex*blockCountPerObj)*blockSize(6)

[0084] blockIndex is the index value of the first storage block corresponding to the target data, blockCountPerObj is the number of storage blocks corresponding to a single target array, and blockSize is the capacity of the storage block.

[0085] The advantage of this setting is that, on the one hand, the content of the management record is less, which can fully reduce the storage space occupied by the management record; on the other hand, the process of determining the first array and the position of the first storage block corresponding to the target data in the first array is simple to calculate and takes a short time, which can achieve the purpose of quickly reading, writing or erasing the target data. And no matter which storage blocks the target data is located in, the rate of reading, writing or erasing the target data is balanced. There will be no undesirable phenomenon that the reading, writing or erasing rates of target data located in different storage blocks are greatly different.

[0086] In the above scheme, the steps of "obtaining storage operation instructions for the target data, determining the first array and the position of the first storage block corresponding to the target data in the first array based on the index number of the first storage block corresponding to the target data and the number of all storage blocks corresponding to the target data, and the management record; the first array is an array corresponding to the first storage block corresponding to the target data; based on the first array and the position of the first storage block corresponding to the target data in the first array, performing storage operations on the target data" may be repeated multiple times during the entire life cycle of the target application.

[0087] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0088] Figure 2 A schematic diagram of a data storage space management device provided by an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the device comprises:

[0089] A determination module 210, configured to determine the total storage space capacity and storage block capacity required by the target application based on the storage installation parameters of the target application to be installed;

[0090] An allocation module 220, configured to allocate storage space for the target application from free storage space in the secure element based on the total storage space capacity and storage block capacity required by the target application, and divide the allocated storage space into a plurality of storage blocks;

[0091] A creation module 230, configured to determine the number of target arrays to be created based on the total storage space capacity required by the target application, and to create each of the target arrays;

[0092] The association module 240 is used to determine the correspondence between the target array and the storage block, and to form a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data.

[0093] Furthermore, modules are created to:

[0094] Determining the actual capacity of the target array;

[0095] Based on the total storage space capacity required by the target application and the actual capacity of the target array, the number of target arrays to be created is determined, and each target array is created.

[0096] Furthermore, modules are created to:

[0097] If the total storage space capacity required by the target application is greater than the maximum capacity of the target array, the actual capacity of the target array is determined based on the storage block capacity and the maximum capacity of the target array; the actual capacity of the target array is an integer multiple of the storage block capacity, and the difference between the maximum capacity and the actual capacity of the target array is less than the storage block capacity; the maximum capacity of the target array is determined by the hardware performance of the security element;

[0098] If the total storage space capacity required by the target application is less than or equal to the maximum capacity of the target array, the actual capacity of the target array is set to be equal to the total storage space capacity required by the target application.

[0099] Furthermore, the association module is used to:

[0100] Determine the number of storage blocks corresponding to a single target array based on the actual capacity of the target array and the capacity of the storage block;

[0101] Based on the number of storage blocks corresponding to a single target array, the corresponding relationship between the target array and the storage block is determined.

[0102] Furthermore, the allocation module is used to:

[0103] Based on the total storage space capacity and storage block capacity required by the target application, determining whether the storage installation parameters of the target application meet a rationality condition; the rationality condition includes: the total storage space capacity required by the target application is an integer multiple of the storage block capacity;

[0104] If the storage installation parameters of the target application meet the rationality condition, based on the total storage space capacity and storage block capacity required by the target application, allocate storage space for the target application from the free storage space in the security element, and divide the allocated storage space into a plurality of storage blocks;

[0105] If the storage installation parameters of the target application do not meet the rationality conditions, based on the preset total storage space capacity and the preset storage block capacity, storage space is allocated for the target application from the free storage space in the security element, and the allocated storage space is divided into multiple storage blocks; the preset total storage space capacity is an integer multiple of the preset storage block capacity.

[0106] Furthermore, the device also includes an operating module, which is used to:

[0107] Acquire a storage operation instruction for the target data, wherein the storage operation instruction for the target data includes at least one of the following: a read operation instruction, a write operation instruction, and an erase operation instruction for the target data; the storage operation instruction includes: an index number of a first storage block corresponding to the target data and the number of all storage blocks corresponding to the target data;

[0108] Based on the index number of the first storage block corresponding to the target data, the number of all storage blocks corresponding to the target data, and the management record, determine a first array and a position of the first storage block corresponding to the target data in the first array; the first array is an array corresponding to the first storage block corresponding to the target data;

[0109] Based on the first array and the position of a first storage block corresponding to the target data in the first array, a storage operation for the target data is performed.

[0110] Furthermore, if the management record includes a corresponding relationship between a single target array and the number of storage blocks; the target application corresponds to multiple arrays; the operation module is used to:

[0111] Determine a first array based on the index number of the first storage block corresponding to the target data and the corresponding relationship between the number of the single target array and the storage blocks;

[0112] Based on the index number of the first storage block corresponding to the target data, the correspondence between the number of single target arrays and storage blocks, and the storage block capacity, the position of the first storage block corresponding to the target data in the first array is determined.

[0113] The device disclosed in the above embodiments can implement the process of the method disclosed in the above method embodiments, and has the same or corresponding beneficial effects. To avoid repetition, it will not be described here.

[0114] Figure 3 A schematic diagram of the hardware structure of a security element provided in an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the security element includes: a processor (processor) 1001 and a memory (memory) 1002. Optionally, the device may also include a communication interface (CommunicationInterface) 1003 and a bus 1004. The processor 1001, the communication interface 1003, and the memory 1002 can communicate with each other through the bus 1004. The communication interface 1003 can be used for information transmission. The processor 1001 can call the logic instructions in the memory 1002 to execute the data storage space management method of the above embodiment.

[0115] In addition, the logic instructions in the memory 1002 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.

[0116] The memory 1002 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 1001 executes functional applications and data processing by running the program instructions / modules stored in the memory 1002, that is, implements the data storage space management method in the above embodiment.

[0117] The memory 1002 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the secure storage application, etc. In addition, the memory 1002 may include a high-speed random access memory and may also include a non-volatile memory.

[0118] The present disclosure also provides a computer-readable storage medium storing a program or instruction, which enables a computer to execute a data storage space management method when the program or instruction is executed. The method includes:

[0119] Determine the total storage space capacity and storage block capacity required by the target application based on the storage installation parameters of the target application to be installed;

[0120] Based on the total storage space capacity and storage block capacity required by the target application, allocate storage space for the target application from the free storage space in the security element, and divide the allocated storage space into a plurality of storage blocks;

[0121] Based on the total storage space capacity required by the target application, determine the number of target arrays to be created, and create each of the target arrays;

[0122] Determine the correspondence between the target array and the storage block, and form a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data.

[0123] Optionally, when executed by a computer processor, the computer executable instructions may also be used to execute the technical solution of the data storage space management method provided by any embodiment of the present disclosure.

[0124] Through the above description of the implementation methods, the technical personnel in the relevant field can clearly understand that the present disclosure can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present disclosure.

[0125] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0126] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data storage space management method, characterized in that: include: Determine the total storage space capacity and storage block capacity required by the target application based on the storage installation parameters of the target application to be installed; Based on the total storage space capacity and storage block capacity required by the target application, allocate storage space for the target application from the free storage space in the security element, and divide the allocated storage space into a plurality of storage blocks; Based on the total storage space capacity required by the target application, determine the number of target arrays to be created, and create each of the target arrays; Determine the correspondence between the target array and the storage block, and form a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data.

2. The method according to claim 1, characterized in that The determining the number of target arrays to be created based on the total storage space capacity required by the target application, and creating each of the target arrays, comprises: Determining the actual capacity of the target array; Based on the total storage space capacity required by the target application and the actual capacity of the target array, the number of target arrays to be created is determined, and each target array is created.

3. The method according to claim 2, characterized in that Determining the actual capacity of the target array includes: If the total storage space capacity required by the target application is greater than the maximum capacity of the target array, the actual capacity of the target array is determined based on the storage block capacity and the maximum capacity of the target array; the actual capacity of the target array is an integer multiple of the storage block capacity, and the difference between the maximum capacity and the actual capacity of the target array is less than the storage block capacity; the maximum capacity of the target array is determined by the hardware performance of the security element; If the total storage space capacity required by the target application is less than or equal to the maximum capacity of the target array, the actual capacity of the target array is set to be equal to the total storage space capacity required by the target application.

4. The method according to claim 2, characterized in that: The determining the corresponding relationship between the target array and the storage block includes: Determine the number of storage blocks corresponding to a single target array based on the actual capacity of the target array and the capacity of the storage block; Based on the number of storage blocks corresponding to a single target array, the corresponding relationship between the target array and the storage block is determined.

5. The method according to claim 1, characterized in that The method of allocating storage space for the target application from free storage space in the security element based on the total storage space capacity and storage block capacity required by the target application, and dividing the allocated storage space into a plurality of storage blocks, further includes: Based on the total storage space capacity and storage block capacity required by the target application, determining whether the storage installation parameters of the target application meet a rationality condition; the rationality condition includes: the total storage space capacity required by the target application is an integer multiple of the storage block capacity; If the storage installation parameters of the target application meet the rationality condition, based on the total storage space capacity and storage block capacity required by the target application, allocate storage space for the target application from the free storage space in the security element, and divide the allocated storage space into a plurality of storage blocks; If the storage installation parameters of the target application do not meet the rationality conditions, based on the preset total storage space capacity and the preset storage block capacity, storage space is allocated for the target application from the free storage space in the security element, and the allocated storage space is divided into multiple storage blocks; the preset total storage space capacity is an integer multiple of the preset storage block capacity.

6. The method according to claim 1, characterized in that Also includes: Acquire a storage operation instruction for the target data, wherein the storage operation instruction for the target data includes at least one of the following: a read operation instruction, a write operation instruction, and an erase operation instruction for the target data; The storage operation instruction includes: the index number of the first storage block corresponding to the target data and the number of all storage blocks corresponding to the target data; Based on the index number of the first storage block corresponding to the target data, the number of all storage blocks corresponding to the target data, and the management record, determine a first array and a position of the first storage block corresponding to the target data in the first array; the first array is an array corresponding to the first storage block corresponding to the target data; Based on the first array and the position of a first storage block corresponding to the target data in the first array, a storage operation for the target data is performed.

7. The method according to claim 6, characterized in that If the management record includes a correspondence between a single target array and the number of storage blocks; the target application corresponds to multiple arrays; the determining the first array and the position of the first storage block corresponding to the target data in the first array based on the index number of the first storage block corresponding to the target data and the number of all storage blocks corresponding to the target data, and the management record, includes: Determine a first array based on the index number of the first storage block corresponding to the target data and the corresponding relationship between the number of the single target array and the storage block; Based on the index number of the first storage block corresponding to the target data, the correspondence between the number of single target arrays and storage blocks, and the storage block capacity, the position of the first storage block corresponding to the target data in the first array is determined.

8. A data storage space management device, characterized in that: include: A determination module, used to determine the total storage space capacity and storage block capacity required by the target application based on the storage installation parameters of the target application to be installed; an allocation module, configured to allocate storage space for the target application from free storage space in the security element based on the total storage space capacity and storage block capacity required by the target application, and divide the allocated storage space into a plurality of storage blocks; A creation module, used to determine the number of target arrays to be created based on the total storage space capacity required by the target application, and create each of the target arrays; An association module is used to determine the correspondence between the target array and the storage block, and to form a management record corresponding to the target application; the management record is used to assist in determining the array required to access the storage block storing the target data when reading, writing or erasing the target data.

9. A safety element, characterized in that: include: Processor and memory; The processor is used to execute the steps of the method according to any one of claims 1 to 7 by calling the program or instruction stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute the steps of the method according to any one of claims 1 to 7.