Capacity compensation method and device of storage equipment, terminal equipment and storage medium
By abnormal identification of storage processing units of storage particles in storage devices and capacity compensation of external storage processing units, the problem of capacity reduction of storage particles due to abnormalities is solved, effective compensation of storage capacity is achieved, and resource waste and production costs are reduced.
Patent Information
- Application Number
- CN202411986558.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-16
AI Technical Summary
During the packaging manufacturing process of storage particles, due to packaging abnormalities, manufacturing defects or other external factors, the storage processing unit cannot be accessed normally, resulting in a decrease in particle capacity. The prior art can only further reduce the storage particles to a smaller standard capacity, resulting in waste of resources and increase user production costs.
By abnormal identification of the storage processing unit of the storage particles in the storage device, capacity compensation is performed using the external storage processing unit to convert the external storage processing unit into a virtual normal storage processing unit, and the corresponding access path is updated to avoid further depreciation and resource waste.
By determining the abnormal storage unit and using the external storage processing unit for capacity compensation, the lost storage capacity can be supplemented, the storage particles can be further reduced, resource waste is reduced, user production costs can be reduced, and the supplementary external storage unit can be accessed normally.
Smart Images

Figure CN120010767A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of storage technology, and in particular, relates to a capacity compensation method, device, terminal device and storage medium for a storage device. Background Art
[0002] During the packaging and manufacturing process of storage particles, due to packaging anomalies, manufacturing defects or other external factors, various storage processing units of the storage particles (usually including channels (CH), chip enable units (CE) and logical units (LUN)) may not be accessed normally, resulting in a decrease in particle capacity. For example, for a normal storage particle, the total capacity can reach 512G. When one of the storage processing units (such as CE) is unavailable, the effective capacity of the storage particle may be significantly reduced to 384G.
[0003] In the related art, when the effective capacity of storage particles is greatly reduced due to the inability of the storage processing unit to access them normally, the storage particles can only be used normally by further reducing their capacity to a smaller standard capacity (for example, reducing the effective capacity of 384G to the standard capacity of 256G), which causes a huge waste of resources and increases the user's production costs. Summary of the invention
[0004] The embodiments of the present application provide a capacity compensation method, apparatus, terminal device and storage medium for a storage device, which can solve the problem in the related art that when storage particles cannot be normally accessed by a storage processing unit, the capacity can only be reduced to a smaller standard capacity, resulting in a waste of storage resources.
[0005] In a first aspect, an embodiment of the present application provides a capacity compensation method for a storage device, comprising:
[0006] Performing abnormal identification on storage processing units of storage particles in the storage device, and identifying abnormal storage processing units;
[0007] After the capacity of the abnormal storage processing unit is compensated by the external storage processing unit, the external storage processing unit is converted into a virtual normal storage processing unit;
[0008] The access path to the external storage processing unit is updated to the access path to the virtual normal storage processing unit.
[0009] In some implementations of the first aspect, converting the external storage processing unit into a virtual normal storage processing unit includes:
[0010] reallocating storage resources of the virtual normal storage processing unit;
[0011] Update the logical and physical mapping relationship of the virtual normal storage processing unit;
[0012] According to the reallocated storage resources and the updated logical and physical mapping relationship, the external storage processing unit is converted into a virtual normal storage processing unit.
[0013] In some implementations of the first aspect, updating the logical and physical mapping relationship of the virtual normal storage processing unit includes:
[0014] Identify the external storage processing unit and obtain the physical address of the external storage processing unit;
[0015] The correspondence between the physical address of the external storage processing unit and the logical unit of the virtual normal storage processing unit is updated.
[0016] In some implementations of the first aspect, reallocating storage resources of the virtual normal storage processing unit includes:
[0017] Allocating the external storage processing unit to the virtual normal storage processing unit;
[0018] The capacity and position of the virtual normal storage processing unit are adjusted according to the allocated external storage processing unit.
[0019] In some implementations of the first aspect, updating the access path to the external storage processing unit to the access path to the virtual normal storage processing unit includes:
[0020] Determining an access path of an external storage processing unit that needs to be updated;
[0021] Create and update access path mapping, and replace the logical address pointed to by the access path of the external storage processing unit with the logical address of the virtual normal storage processing unit;
[0022] According to the update access path mapping, the path information of the firmware in the storage device is updated.
[0023] In some implementations of the first aspect, after performing abnormality identification on the storage processing unit of the storage particle in the storage device and identifying the abnormal storage processing unit, the method further includes:
[0024] Identifying an abnormal storage processing unit location, an abnormal storage processing unit capacity, a number of abnormal storage processing units, and an abnormal storage processing unit type of the abnormal storage processing unit;
[0025] Calculating the lost storage capacity of the abnormal storage processing unit according to the abnormal storage processing unit capacity and the number of abnormal storage processing units;
[0026] Determining the external storage processing unit capacity and the external storage processing unit type of the external storage processing unit according to the lost storage capacity and the abnormal storage processing unit type;
[0027] A compensation strategy report is generated according to the abnormal storage processing unit location, the abnormal storage processing unit capacity, the number of abnormal storage processing units, the abnormal storage processing unit type, the external storage processing unit capacity, and the external storage processing unit type.
[0028] In some implementations of the first aspect, performing abnormality identification on a storage processing unit of a storage particle in a storage device to identify the abnormal storage processing unit includes:
[0029] Performing a particle scanning operation on the stored particles to obtain a particle scanning operation result;
[0030] According to the particle scanning operation result, an abnormal storage processing unit is identified;
[0031] or,
[0032] Performing erase / write / read particle operations on storage particles to obtain erase / write / read particle operation results;
[0033] According to the erase and read particle operation results, the abnormal storage processing unit is identified.
[0034] In a second aspect, an embodiment of the present application provides a capacity compensation device for a storage device, including:
[0035] An identification module, used to identify abnormal storage processing units of storage particles in the storage device, and identify abnormal storage processing units;
[0036] A conversion module, used for converting the external storage processing unit into a virtual normal storage processing unit after the abnormal storage processing unit is capacity compensated by the external storage processing unit;
[0037] The updating module is used to update the access path to the external storage processing unit to the access path to the virtual normal storage processing unit.
[0038] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the capacity compensation method of the above-mentioned storage device when executing the computer program.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the capacity compensation method of the above-mentioned storage device are implemented.
[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the capacity compensation method of the above-mentioned storage device.
[0041] The beneficial effect of the embodiment of the present application compared with the prior art is: the embodiment of the present application identifies the abnormal storage processing unit by performing abnormal identification on the storage processing unit of the storage particles in the storage device, identifies the abnormal storage processing unit, and after the abnormal storage processing unit is compensated for its capacity by the external storage processing unit, converts the external storage processing unit into a virtual normal storage processing unit, and updates the access path to the external storage processing unit to the access path to the virtual normal storage processing unit. The embodiment of the present application determines the abnormal storage unit and uses the external storage processing unit to compensate for the abnormal storage processing unit, so as to replenish the lost storage capacity, thereby avoiding further reducing the capacity of the storage particles to a smaller standard capacity, reducing resource waste, and reducing the production cost of the user. And by converting the external storage processing unit into a virtual normal storage processing unit and updating the corresponding access path, the supplemented external storage unit can be accessed normally, avoiding the waste of storage resources due to the inaccessibility of the supplemented external storage unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0043] Figure 1 It is a schematic diagram of an implementation flow of a capacity compensation method for a storage device provided in an embodiment of the present application;
[0044] Figure 2 It is a structural schematic diagram of a capacity compensation device of a storage device provided in an embodiment of the present application;
[0045] Figure 3 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.
[0047] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specification and drawings of the present application, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or order between these entities / operations / objects.
[0048] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0049] During the packaging and manufacturing process of storage particles, due to packaging anomalies, manufacturing defects or other external factors, various storage processing units of the storage particles (usually including channels (CH), chip enable units (CE) and logical units (LUN)) may not be accessed normally, resulting in a decrease in particle capacity. For example, for a normal storage particle, the total capacity can reach 512G. When one of the storage processing units (such as CE) is unavailable, the effective capacity of the storage particle may be significantly reduced to 384G.
[0050] In the related art, when the effective capacity of storage particles is greatly reduced due to the inability of the storage processing unit to access them normally, the storage particles can only be used normally by further reducing their capacity to a smaller standard capacity (for example, reducing the effective capacity of 384G to the standard capacity of 256G), which causes a huge waste of resources and increases the user's production costs.
[0051] In view of this, the embodiments of the present application can replenish the lost storage capacity by determining the abnormal storage unit and using the external storage processing unit to compensate for the capacity of the abnormal storage processing unit, thereby avoiding further reducing the capacity of the storage particles to a smaller standard capacity, reducing resource waste, and reducing the user's production cost. In addition, by converting the external storage processing unit into a virtual normal storage processing unit and updating the corresponding access path, the supplemented external storage unit can be accessed normally, avoiding the waste of storage resources caused by the inaccessibility of the supplemented external storage unit.
[0052] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0053] Figure 1 The present invention provides a schematic diagram of the implementation process of a storage device capacity compensation method provided in an embodiment of the present invention, which can be applied to a terminal device, which can be a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, etc.
[0054] In a typical application scenario, assume that a storage device contains 1 storage particle, and the storage particle type is 2CH 2CE 2LUN particle. 2CH 2CE 2LUN particle is a storage particle specification, where "2CH" means there are two channels, "2CE" means each channel has two chip enable units, and "2LUN" means each CE has two logical units (Logical Unit Number, usually refers to storage logical partitions or blocks). The total capacity of each storage particle is 512G. When a CE in a 2CH 2CE 2LUN particle cannot be accessed normally due to packaging abnormalities, manufacturing defects or other external factors, the capacity of the storage particle is only 384G. It should be understood that when a CE is inaccessible, the data related to it may not be read or written. If you try to use only the remaining CEs, a complex data reorganization and mapping mechanism is required to ensure data integrity and consistency. In this case, in order to maintain the stability and compatibility of the system, as well as to take into account the market acceptance and sales of this type of storage particles, relevant technologies will usually further reduce the capacity of the storage particles to a smaller standard capacity: 256G. At this time, the storage particles with an original storage capacity of 512G can only use 256G of storage capacity, and there are 128G (384G-256G) of normal storage capacity that cannot be used, resulting in a huge waste of storage resources.
[0055] Based on this, specifically, the capacity compensation method of the storage device may include the following steps S101 to S103.
[0056] Step S101 , performing abnormality identification on storage processing units of storage particles in a storage device, and identifying abnormal storage processing units.
[0057] Among them, storage particles are the basic building blocks of storage devices, used to store data. They usually exist in the form of chips, and contain multiple storage processing units for reading, writing and managing data.
[0058] The storage processing unit is a functional unit inside the storage particle for processing data reading and writing, which may include channels, chip enable units, and logic units, etc. These units work together to ensure the correct storage and access of data.
[0059] In the implementation manner of the present application, the terminal device may use a dedicated detection tool or software to scan and detect storage particles in the storage device. For example, a particle scanning operation may be performed on the storage particles, and a storage processing unit with an abnormality or failure may be identified according to the corresponding operation result, and an identification result may be obtained, and the identification result may be recorded in the management system of the storage device for subsequent processing.
[0060] Step S102: after the capacity of the abnormal storage processing unit is compensated by the external storage processing unit, the external storage processing unit is converted into a virtual normal storage processing unit.
[0061] The external storage processing unit refers to a storage processing unit that is additionally introduced to compensate for the capacity loss of the abnormal storage processing unit in the storage device. These external storage processing units can be independent storage devices or storage chips, which are used to replace or supplement the functions of the abnormal storage processing unit.
[0062] The virtual normal storage processing unit converts the external storage processing unit into the same logical representation as the normal storage processing unit so as to seamlessly replace the abnormal storage processing unit in the access path of the storage device.
[0063] In an embodiment of the present application, after identifying the abnormal storage processing unit, a suitable external storage processing unit can be determined for compensation. The staff can then connect the external storage processing unit to the storage device and ensure that the data transmission channel between it and the storage particles is unobstructed. Then, through programming or configuration, the external storage processing unit is bound to the abnormal storage processing unit to achieve capacity compensation. The terminal device can then assign a logical identifier (such as a LUN number) that is the same as the normal storage processing unit to the external storage processing unit in the management system of the storage device. Through programming or configuration, the logical identifier of the external storage processing unit is associated with the virtual normal storage processing unit, thereby converting the external storage processing unit into a virtual normal storage processing unit.
[0064] The implementation manner of the present application logically converts an external storage processing unit into a virtual normal storage processing unit so as to seamlessly replace the abnormal storage processing unit in the access path of the storage device, thereby ensuring the correct reading and writing of data and the normal operation of the storage device.
[0065] In some implementations, the external storage processing unit is a storage processing unit of the same level as the abnormal storage processing unit. For example, if the abnormal storage processing unit is a CE, the external storage processing unit for capacity compensation is also a CE.
[0066] In other embodiments, the external storage processing unit is a storage processing unit of a different level from the abnormal storage processing unit, specifically, the external storage processing unit is a subunit of the abnormal storage processing unit. For example, the abnormal storage processing unit is a CE, and the external storage processing unit used for capacity compensation may be a LUN. In this embodiment, the number of external storage processing units may be multiple, and the number of external storage processing units depends on the ratio of the capacity of the abnormal storage processing unit to the capacity of the external storage processing unit. For example, when one CE in a 2CH 2CE 2LUN particle is abnormal, one 2LUN CE or two 1LUN CEs may be used as an external storage processing unit to perform capacity compensation on the abnormal CE.
[0067] In some specific implementations of the present application, the storage particles are 2CH 2CE 2LUN particles, the external storage processing unit is a sub-unit of the abnormal storage processing unit, and the number of the external storage processing units is 2.
[0068] Step S103: Update the access path to the external storage processing unit to the access path to the virtual normal storage processing unit.
[0069] The access path is the logical channel or path that data passes through from the upper-layer application (such as the operating system, file system, or database, etc.) to the underlying storage medium (such as storage particles) inside the storage device.
[0070] In the implementation of the present application, the terminal device can modify the access path table or mapping table in the storage device, and replace the original access path to the abnormal storage processing unit with the access path to the virtual normal storage processing unit, thereby ensuring that the upper layer applications such as the operating system, file system or database in the storage device can correctly identify and access the virtual normal storage processing unit.
[0071] Based on the above typical application scenario, an example is given: In the above typical application scenario, one CE1 in the 2CH 2CE 2LUN particle is abnormal, causing the storage particle to lose 128G of storage capacity. The present application can identify the abnormal CE1 (abnormal storage processing unit), and then select CE2 with a capacity of 128G as the external storage processing unit, or select two LUNs with a capacity of 64G as the external storage processing unit. Then use the external storage processing unit to compensate for the capacity and connect it to the storage device. Then, the terminal device can assign a logical identifier that is the same as the normal storage processing unit to the external storage processing unit (such as treating it as a new CE2), and integrate the external storage processing unit with the internal logical structure of the storage particle through programming or configuration, so that it logically becomes a part of the storage particle, that is, a virtual normal storage processing unit. Finally, the terminal device can modify the access path table of the storage particle, replace the original access path to the abnormal CE1 with the access path to CE2 (that is, the virtual normal storage processing unit), thereby ensuring that upper-layer applications such as the operating system, file system or database can correctly identify and access the new CE2 without perceiving the changes in the underlying storage medium.
[0072] The beneficial effect of the embodiment of the present application compared with the prior art is: the embodiment of the present application identifies the abnormal storage processing unit by performing abnormal identification on the storage processing unit of the storage particles in the storage device, identifies the abnormal storage processing unit, and after the abnormal storage processing unit is compensated for its capacity by the external storage processing unit, converts the external storage processing unit into a virtual normal storage processing unit, and updates the access path to the external storage processing unit to the access path to the virtual normal storage processing unit. The embodiment of the present application determines the abnormal storage unit and uses the external storage processing unit to compensate for the abnormal storage processing unit, so as to replenish the lost storage capacity, thereby avoiding further reducing the capacity of the storage particles to a smaller standard capacity, reducing resource waste, and reducing the production cost of the user. And by converting the external storage processing unit into a virtual normal storage processing unit and updating the corresponding access path, the supplemented external storage unit can be accessed normally, avoiding the waste of storage resources due to the inaccessibility of the supplemented external storage unit.
[0073] In some implementations of the present application, the above-mentioned conversion of the external storage processing unit into a virtual normal storage processing unit may specifically include steps S401 to S403.
[0074] Step S401, reallocate storage resources of the virtual normal storage processing unit.
[0075] The storage resource may be a space or capacity in a storage device that can be used to store data.
[0076] In the implementation of the present application, the terminal device can first determine the amount of storage resources to be allocated to the virtual normal storage processing unit according to the capacity of the external storage processing unit and the current state of the storage device. Then, in the internal logical structure of the storage device, the corresponding logical address space is allocated to the virtual normal storage processing unit, and the capacity management table of the storage device is adjusted to ensure that these logical address spaces can be correctly mapped to the physical address of the external storage processing unit, so as to ensure that it can work normally and meet the storage requirements of the upper-layer application.
[0077] Step S402: updating the logical and physical mapping relationship between the virtual normal storage processing unit.
[0078] The logical-physical mapping relationship can be a mechanism used to manage storage resources within the storage device, which maps the logical address (i.e., the address used by the upper-layer application to access the storage resource) to the physical address (i.e., the address where the data is actually stored on the storage medium). This mapping relationship ensures that the upper-layer application can correctly access and manage the storage resources.
[0079] In the implementation mode of the present application, after determining the storage resources of the virtual normal storage processing unit, the terminal device can update the logical and physical mapping relationship table inside the storage device. Specifically, it can include mapping the logical address space of the virtual normal storage processing unit to the physical address of the external storage processing unit, and updating the relevant access control information to ensure that the upper layer application can correctly access these storage resources, thereby realizing the data read and write operations.
[0080] Step S403: convert the external storage processing unit into a virtual normal storage processing unit according to the reallocated storage resources and the updated logical and physical mapping relationship.
[0081] In the implementation of the present application, the terminal device can integrate the external storage processing unit with the internal logical structure of the storage device through the firmware or management system of the storage device. Specifically, it can include associating the physical address of the external storage processing unit with the logical address of the virtual normal storage processing unit, and configuring the corresponding access control policy to convert the external storage processing unit into a virtual normal storage processing unit, so that it becomes a part of the storage device logically, thereby realizing the compensation of storage capacity.
[0082] The implementation method of the present application improves the overall storage capacity utilization of the storage device by compensating for the storage capacity lost due to failures or defects. Compared with replacing the entire storage device, using an external storage processing unit for compensation can significantly reduce the cost of repair and replacement. In addition, through virtualization and remapping technology, the external storage processing unit is integrated into the logical structure of the storage device, which enhances the stability and compatibility of the system, so that the upper-layer application can seamlessly access the compensated storage capacity without being aware of the changes in the underlying storage medium, simplifying the management and maintenance of the application.
[0083] In some specific implementations of the present application, the above-mentioned updating of the logical and physical mapping relationship of the virtual normal storage processing unit may further specifically include step S501 and step S502.
[0084] Step S501, identifying the external storage processing unit, and obtaining the physical address of the external storage processing unit.
[0085] The physical address refers to the actual location or identifier of a physical storage unit in a storage device. It is a unique identifier used to locate data inside a storage device and is usually managed by a storage device controller or firmware.
[0086] In an embodiment of the present application, the terminal device can scan and identify all storage units connected to it, including the external storage processing unit, when the storage device is started or when a capacity compensation operation is performed. By reading the identification information (such as manufacturer ID, device ID, etc.) and configuration information (such as physical address range, etc.) of the external storage processing unit, the storage device can determine the identity and physical location of the external storage processing unit, and provide basic information for subsequent logical and physical mapping relationship updates. Among them, the identification information of the external storage processing unit is usually stored in the metadata or configuration register of the external storage processing unit, which can be accessed through the interface of the storage device controller.
[0087] Step S502: updating the correspondence between the physical address of the external storage processing unit and the logical unit of the virtual normal storage processing unit.
[0088] Among them, the logical unit is a basic unit in the internal logical structure of the storage device, which is used to manage the allocation and access of storage resources. It usually has a direct mapping relationship with the physical storage unit (such as sector, block, etc.) inside the storage device.
[0089] In the implementation mode of the present application, after identifying the external storage processing unit and obtaining its physical address, the terminal device may create a logical unit of a virtual normal storage processing unit in the internal logical structure of the storage device. Then, its logical-physical mapping relationship table can be updated, and the logical unit of the virtual normal storage processing unit can be associated with the physical address of the external storage processing unit, thereby realizing the conversion between logical access and physical storage of data, which helps the storage device to logically integrate the external storage processing unit so that it can be accessed and managed like an internal storage unit. Specifically, this can be achieved by modifying the internal data structure of the storage device firmware or management system to ensure that the upper-layer application or the internal logic of the storage device can correctly access the data in the external storage processing unit through the logical unit.
[0090] The implementation method of the present application updates the logical and physical mapping relationship so that the storage device can flexibly manage the external storage processing unit and integrate it into the logical structure of the storage device, thereby improving the flexibility and scalability of storage management. In addition, the upper-layer application can access the data in the external storage processing unit through the logical unit without knowing the specific implementation details of the underlying storage device, thereby simplifying the access and management of the upper-layer application.
[0091] In some specific implementations of the present application, the above-mentioned reallocation of storage resources of the virtual normal storage processing unit may specifically include step S601 and step S602.
[0092] Step S601: Allocate an external storage processing unit to a virtual normal storage processing unit.
[0093] In the implementation manner of the present application, the terminal device may allocate a logical space for the virtual normal storage processing unit in the internal logical structure of the storage device, and the logical space corresponds to the physical space of the external storage processing unit. Specifically, the information of the external storage processing unit may be registered in the firmware or management system of the storage device, and associated with the logical representation of the virtual normal storage processing unit, so as to integrate the external storage processing unit into the logical structure of the storage device, so that it can be accessed and managed as part of the virtual normal storage processing unit, so that the storage device can logically expand its storage capacity to compensate for the storage resources lost due to failure or insufficient capacity.
[0094] Step S602: adjusting the capacity and position of the virtual normal storage processing unit according to the allocated external storage processing unit.
[0095] Among them, capacity is the maximum amount of data that a storage device can store.
[0096] A location is a position or identifier of a storage resource or storage unit in the logical structure of a storage device.
[0097] In an embodiment of the present application, after the external storage processing unit is assigned to the virtual normal storage processing unit, the terminal device can adjust the capacity and position of the virtual normal storage processing unit according to the capacity and performance parameters of the external storage processing unit. Specifically, it can include updating the capacity management table of the storage device to reflect the new capacity of the virtual normal storage processing unit, and updating the logical and physical mapping relationship table to reflect the new position (identifier or address in the logical structure) of the virtual normal storage processing unit to ensure that the virtual normal storage processing unit can correctly reflect the capacity and location information of the external storage processing unit, thereby ensuring the correct storage and access of data, helping the storage device to maintain a logically consistent storage view, and optimizing the allocation and management of storage resources.
[0098] In some implementations of the present application, the above-mentioned updating of the access path to the external storage processing unit to the access path to the virtual normal storage processing unit may specifically include steps S701 to S703.
[0099] Step S701, determining the access path of the external storage processing unit that needs to be updated.
[0100] In an embodiment of the present application, when a storage device receives an access request, the terminal device can check the access path (such as a logical block address LBA) specified in the request. If the path points to an external storage processing unit that has been marked as a failure or used for capacity compensation, it can be identified that the path needs to be updated. By identifying which access paths need to be updated, it is ensured that subsequent data access can correctly point to the virtual normal storage processing unit.
[0101] Step S702: Create and update the access path mapping, and replace the logical address pointed to by the access path of the external storage processing unit with the logical address of the virtual normal storage processing unit.
[0102] In an embodiment of the present application, a terminal device may maintain an access path mapping table inside a storage device, which records all possible access paths and their corresponding logical addresses. When the access path needs to be updated, the storage device may search the table for the path to be updated and replace the logical address it points to with the logical address of the virtual normal storage processing unit. This may be achieved by modifying the entries in the mapping table to ensure that the new logical address can be correctly mapped to the physical address of the external storage processing unit. A new access path mapping is created to redirect the access path of the external storage processing unit to the virtual normal storage processing unit, thereby ensuring correct access to data.
[0103] Step S703: Update the path information of the firmware in the storage device according to the updated access path mapping.
[0104] The firmware is stored inside the storage device and is used to handle all operations related to the storage hardware, including data reading and writing, path management, etc.
[0105] In an embodiment of the present application, when the access path mapping is updated, the terminal device can modify the path information table in the firmware to reflect the new access path mapping. Specifically, this can be achieved by modifying the data structure of the firmware to ensure that the path information in the storage device firmware is consistent with the actual access path, thereby ensuring that the storage device can correctly process all storage operations.
[0106] The implementation method of the present application updates the access path of the external storage processing unit to the access path of the virtual normal storage processing unit, so that the storage device can achieve storage capacity compensation without affecting the upper layer application and data access, which helps to ensure the reliability and continuity of data. And by creating and updating the access path mapping, the storage device can more easily manage the allocation and access of storage resources, which helps to reduce the complexity of storage management and improve the maintainability of the storage device.
[0107] In some specific implementations of the present application, after abnormality identification is performed on the storage processing unit of the storage particles in the storage device and the abnormal storage processing unit is identified, the above method may further include steps S801 to S804.
[0108] Step S801, identifying the abnormal storage processing unit position, abnormal storage processing unit capacity, abnormal storage processing unit quantity and abnormal storage processing unit type of the abnormal storage processing unit.
[0109] The abnormal storage processing unit position is a position or an identifier of the abnormal storage processing unit in the internal logical or physical structure of the storage device.
[0110] The abnormal storage processing unit capacity is the maximum amount of data that the abnormal storage processing unit can store.
[0111] The number of abnormal storage processing units is the total number of abnormal storage processing units identified in the storage device.
[0112] The abnormal storage processing unit type is the type or model of the abnormal storage processing unit, which is usually related to its performance, capacity and other characteristics.
[0113] In the implementation mode of the present application, the terminal device can perform self-diagnosis or health check regularly, and identify abnormal storage processing units by reading the status information of storage particles, monitoring the read and write error rate, etc. At the same time, the terminal device can record the location (such as the logical block address range), capacity (such as the amount of data that each storage processing unit can store), quantity (such as the total number of abnormal storage processing units) and type (such as SSD, HDD, NAND flash memory, etc.) of these abnormal storage processing units for subsequent analysis and formulation of compensation strategies.
[0114] Step S802: Calculate the lost storage capacity of the abnormal storage processing unit according to the capacity of the abnormal storage processing unit and the number of abnormal storage processing units.
[0115] The lost storage capacity refers to the reduction in the overall capacity of the storage device caused by the abnormal storage processing unit.
[0116] In the implementation of the present application, the terminal device can calculate the overall storage capacity loss caused by these abnormal storage processing units based on the capacity and number of the identified abnormal storage processing units. Specifically, the capacity of each abnormal storage processing unit can be added to obtain the total loss capacity, thereby quantifying the storage capacity loss in order to determine the capacity size that needs to be compensated.
[0117] Step S803, determining the external storage processing unit capacity and the external storage processing unit type of the external storage processing unit according to the lost storage capacity and the abnormal storage processing unit type.
[0118] The external storage processing unit capacity refers to the storage capacity that the external storage processing unit can provide.
[0119] The external storage processing unit type refers to the type or model of the external storage processing unit, which is related to its performance, capacity, interface type and other characteristics.
[0120] In the implementation manner of the present application, the terminal device can select a suitable external storage processing unit to compensate for the capacity loss according to the lost storage capacity and the type of abnormal storage processing unit. Specifically, factors such as the capacity (to ensure that it can cover the lost capacity), the type (to ensure its compatibility with the storage device and performance requirements) and the cost of the external storage processing unit can be considered. By selecting a suitable external storage processing unit, it is ensured that the storage device can recover or expand its storage capacity.
[0121] Step S804, generating a compensation strategy report according to the abnormal storage processing unit position, abnormal storage processing unit capacity, abnormal storage processing unit quantity, abnormal storage processing unit type, external storage processing unit capacity and external storage processing unit type.
[0122] The compensation strategy report is a detailed report containing information about abnormal storage processing units and external storage processing units, and can be used to guide administrators or maintenance personnel on how to achieve compensation for storage capacity.
[0123] In the implementation mode of the present application, the terminal device can generate a detailed compensation strategy report based on the information collected in the above steps. The compensation strategy report can include information such as the location, capacity, quantity and type of the abnormal storage processing unit, as well as the capacity, type and recommended compensation strategy of the external storage processing unit, so as to provide a comprehensive and easy-to-understand report so that the administrator or maintenance personnel of the storage device can understand the current storage capacity status and formulate and implement compensation strategies accordingly.
[0124] By identifying and recording the information of abnormal storage processing units in detail, the implementation method of the present application enables the storage device to more accurately assess the storage capacity loss and select the appropriate external storage processing unit for compensation. This helps to avoid over-compensation or under-compensation, thereby improving the accuracy of storage capacity management. By generating a compensation strategy report, the administrator or maintenance personnel of the storage device can more clearly understand the storage capacity status and compensation requirements, thereby more reasonably configuring storage resources, helping to optimize storage performance, reduce storage costs, and improve the overall efficiency of the storage device.
[0125] In some embodiments of the present application, the above-mentioned abnormality identification of the storage processing unit of the storage particle in the storage device to identify the abnormal storage processing unit may specifically include step S901 and step S902.
[0126] Step S901, performing a particle scanning operation on stored particles to obtain a particle scanning operation result.
[0127] The particle scanning operation result is data or status information obtained after executing the particle scanning operation, which is used to evaluate the health status of storage particles and identify abnormal storage processing units.
[0128] In the implementation of the present application, the terminal device can perform a scanning operation on the storage particles periodically or on demand. During the scanning process, the device reads the status information of each storage unit in the storage particles one by one, including data integrity, error rate, etc. By comprehensively scanning the storage particles, the terminal device can obtain detailed status information of the storage particles and provide data support for identifying abnormal storage processing units.
[0129] Step S902: Identify abnormal storage processing units according to the particle scanning operation result.
[0130] In the implementation mode of the present application, the terminal device can analyze the status information of each storage unit in the storage particle according to the particle scanning operation result. If the data integrity of a storage unit or area is damaged, the error rate is abnormally high, or the data cannot be read correctly, it can be marked as an abnormal storage processing unit. By identifying abnormal storage processing units, the device can promptly discover and handle potential storage problems to avoid data loss or performance degradation.
[0131] In some other embodiments of the present application, the above-mentioned abnormality identification of the storage processing unit of the storage particle in the storage device to identify the abnormal storage processing unit may further include step S1001 and step S1002.
[0132] Step S1001, performing erase / write / read particle operations on storage particles to obtain erase / write / read particle operation results.
[0133] The erase / write / read particle operation result is data or performance indicators obtained after performing the erase / write / read particle operation, which is used to evaluate the read / write speed and error rate of the storage particle and identify abnormal storage processing units.
[0134] In the implementation of the present application, the terminal device can perform a series of erase, write and read operations on the storage particles. In the erase phase, the device will clear the data in the storage particles; in the write phase, the device will write test data to the storage particles; in the read phase, the device will read the data in the storage particles to verify its integrity and correctness. Through the erase, write and read particle operations, the terminal device can test the read and write performance and reliability of the storage particles, and provide performance indicators for identifying abnormal storage processing units.
[0135] Step S1002, identifying abnormal storage processing units according to the erase / write / read particle operation results.
[0136] In the implementation mode of the present application, the terminal device can analyze the read and write speed and error rate of the storage particles according to the results of the erase and read particle operations. If the read and write speed of a storage particle is much lower than the normal level, or the error rate is abnormally high, the corresponding storage processing unit can be marked as abnormal. By identifying abnormal storage processing units, the device can promptly discover the read and write performance problems of the storage particles and take corresponding compensation measures to ensure the overall performance and reliability of the storage device.
[0137] Figure 2 The schematic diagram of the structure of a capacity compensation device of a storage device provided in an embodiment of the present application is shown. The capacity compensation device 2 of the storage device can be configured on a terminal device. Specifically, the capacity compensation device 2 of the storage device can include:
[0138] The identification module 201 is used to identify abnormal storage processing units of storage particles in the storage device and identify abnormal storage processing units;
[0139] A conversion module 202, configured to convert the external storage processing unit into a virtual normal storage processing unit after the abnormal storage processing unit is capacity compensated by the external storage processing unit;
[0140] The updating module 203 is used to update the access path to the external storage processing unit to the access path to the virtual normal storage processing unit.
[0141] The beneficial effect of the embodiment of the present application compared with the prior art is: the embodiment of the present application identifies the abnormal storage processing unit by performing abnormal identification on the storage processing unit of the storage particles in the storage device, identifies the abnormal storage processing unit, and after the abnormal storage processing unit is compensated for its capacity by the external storage processing unit, converts the external storage processing unit into a virtual normal storage processing unit, and updates the access path to the external storage processing unit to the access path to the virtual normal storage processing unit. The embodiment of the present application determines the abnormal storage unit and uses the external storage processing unit to compensate for the abnormal storage processing unit, so as to replenish the lost storage capacity, thereby avoiding further reducing the capacity of the storage particles to a smaller standard capacity, reducing resource waste, and reducing the production cost of the user. And by converting the external storage processing unit into a virtual normal storage processing unit and updating the corresponding access path, the supplemented external storage unit can be accessed normally, avoiding the waste of storage resources due to the inaccessibility of the supplemented external storage unit.
[0142] In some implementations of the present application, the conversion module 202 may also be used to:
[0143] reallocating storage resources of the virtual normal storage processing unit;
[0144] Update the logical and physical mapping relationship of the virtual normal storage processing unit;
[0145] According to the reallocated storage resources and the updated logical and physical mapping relationship, the external storage processing unit is converted into a virtual normal storage processing unit.
[0146] In some implementations of the present application, the conversion module 202 may also be used to:
[0147] Identify the external storage processing unit and obtain the physical address of the external storage processing unit;
[0148] The correspondence between the physical address of the external storage processing unit and the logical unit of the virtual normal storage processing unit is updated.
[0149] In some implementations of the present application, the conversion module 202 may also be used to:
[0150] Allocating the external storage processing unit to the virtual normal storage processing unit;
[0151] The capacity and position of the virtual normal storage processing unit are adjusted according to the allocated external storage processing unit.
[0152] In some implementations of the present application, the updating module 203 may also be used to:
[0153] Determining an access path of an external storage processing unit that needs to be updated;
[0154] Create and update access path mapping, and replace the logical address pointed to by the access path of the external storage processing unit with the logical address of the virtual normal storage processing unit;
[0155] According to the update access path mapping, the path information of the firmware in the storage device is updated.
[0156] In some implementations of the present application, the capacity compensation device 2 of the storage device may further include a generation module for:
[0157] Identifying an abnormal storage processing unit location, an abnormal storage processing unit capacity, a number of abnormal storage processing units, and an abnormal storage processing unit type of the abnormal storage processing unit;
[0158] Calculating the lost storage capacity of the abnormal storage processing unit according to the abnormal storage processing unit capacity and the number of abnormal storage processing units;
[0159] Determining the external storage processing unit capacity and the external storage processing unit type of the external storage processing unit according to the lost storage capacity and the abnormal storage processing unit type;
[0160] A compensation strategy report is generated according to the abnormal storage processing unit location, the abnormal storage processing unit capacity, the number of abnormal storage processing units, the abnormal storage processing unit type, the external storage processing unit capacity, and the external storage processing unit type.
[0161] In some implementations of the present application, the identification module 201 is further used to:
[0162] Performing a particle scanning operation on the stored particles to obtain a particle scanning operation result;
[0163] According to the particle scanning operation result, an abnormal storage processing unit is identified;
[0164] or,
[0165] Performing erase / write / read particle operations on storage particles to obtain erase / write / read particle operation results;
[0166] According to the erase and read particle operation results, the abnormal storage processing unit is identified.
[0167] like Figure 3 FIG. 3 is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 3 may include: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301, such as a capacity compensation program for a storage device. When the processor 301 executes the computer program 303, the steps in the above-mentioned capacity compensation method embodiments of each storage device are implemented, such as Figure 1 Steps S101 to S103 are shown.
[0168] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.
[0169] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the capacity compensation method of the above-mentioned storage device can be implemented.
[0170] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal can implement the steps in the capacity compensation method of the above storage device when executing the computer program product.
[0171] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A capacity compensation method for a storage device, characterized in that: include: Performing abnormal identification on storage processing units of storage particles in the storage device, and identifying abnormal storage processing units; After the abnormal storage processing unit is capacity-compensated by the external storage processing unit, the external storage processing unit is converted into a virtual normal storage processing unit; The access path to the external storage processing unit is updated to the access path to the virtual normal storage processing unit.
2. The capacity compensation method of a storage device according to claim 1, characterized in that: The converting the external storage processing unit into a virtual normal storage processing unit comprises: reallocating storage resources of the virtual normal storage processing unit; Updating the logical and physical mapping relationship of the virtual normal storage processing unit; According to the reallocated storage resources and the updated logical and physical mapping relationship, the external storage processing unit is converted into the virtual normal storage processing unit.
3. The capacity compensation method of a storage device according to claim 2, characterized in that: The updating of the logical and physical mapping relationship of the virtual normal storage processing unit includes: Identify the external storage processing unit and obtain the physical address of the external storage processing unit; The correspondence between the physical address of the external storage processing unit and the logical unit of the virtual normal storage processing unit is updated.
4. The capacity compensation method of a storage device according to claim 2, characterized in that: The reallocating storage resources of the virtual normal storage processing unit includes: Allocating the external storage processing unit to the virtual normal storage processing unit; According to the allocated external storage processing unit, the capacity and position of the virtual normal storage processing unit are adjusted.
5. The capacity compensation method of a storage device according to claim 1, characterized in that: The updating of the access path to the external storage processing unit to the access path to the virtual normal storage processing unit includes: Determining an access path of the external storage processing unit that needs to be updated; Creating and updating an access path mapping, replacing the logical address pointed to by the access path of the external storage processing unit with the logical address of the virtual normal storage processing unit; The path information of the firmware in the storage device is updated according to the updated access path mapping.
6. The capacity compensation method of a storage device according to claim 1, characterized in that: After the abnormal storage processing unit of the storage particles in the storage device is identified as abnormal, the method further includes: Identifying an abnormal storage processing unit location, an abnormal storage processing unit capacity, an abnormal storage processing unit quantity, and an abnormal storage processing unit type of the abnormal storage processing unit; Calculating the lost storage capacity of the abnormal storage processing unit according to the abnormal storage processing unit capacity and the number of the abnormal storage processing units; Determining the external storage processing unit capacity and the external storage processing unit type of the external storage processing unit according to the lost storage capacity and the abnormal storage processing unit type; A compensation strategy report is generated according to the abnormal storage processing unit position, the abnormal storage processing unit capacity, the abnormal storage processing unit quantity, the abnormal storage processing unit type, the external storage processing unit capacity and the external storage processing unit type.
7. The capacity compensation method of a storage device according to claim 1, characterized in that: The step of identifying abnormalities in storage processing units of storage particles in the storage device and identifying abnormal storage processing units includes: Performing a particle scanning operation on the storage particles to obtain a particle scanning operation result; According to the particle scanning operation result, identifying the abnormal storage processing unit; or, Performing an erase / write / read particle operation on the storage particle to obtain an erase / write / read particle operation result; The abnormal storage processing unit is identified according to the erase / write / read particle operation result.
8. A capacity compensation device for a storage device, characterized in that: include: An identification module, used to identify abnormal storage processing units of storage particles in the storage device, and identify abnormal storage processing units; a conversion module, configured to convert the abnormal storage processing unit into a virtual normal storage processing unit after the abnormal storage processing unit is capacity compensated by the external storage processing unit; An updating module is used to update the access path to the external storage processing unit to the access path to the virtual normal storage processing unit.
9. A terminal device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the capacity compensation method of the storage device as claimed in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the capacity compensation method of the storage device as claimed in any one of claims 1 to 7 are implemented.