CN114020212B - Hard disk adaptation method and device and electronic equipment - Google Patents

Hard disk adaptation method and device and electronic equipment Download PDF

Info

Publication number
CN114020212B
CN114020212B CN202111245442.9A CN202111245442A CN114020212B CN 114020212 B CN114020212 B CN 114020212B CN 202111245442 A CN202111245442 A CN 202111245442A CN 114020212 B CN114020212 B CN 114020212B
Authority
CN
China
Prior art keywords
storage space
zns
ssd
zone
adaptation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111245442.9A
Other languages
Chinese (zh)
Other versions
CN114020212A (en
Inventor
邓京涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111245442.9A priority Critical patent/CN114020212B/en
Publication of CN114020212A publication Critical patent/CN114020212A/en
Application granted granted Critical
Publication of CN114020212B publication Critical patent/CN114020212B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a hard disk adaptation method, a device and electronic equipment, and relates to the technical field of hard disk configuration, wherein the hard disk adaptation method comprises the following steps: acquiring the adaptation requirement of a current operating system on the ZNS SSD; determining the maximum storage space of each zone contained in the ZNS SSD; when the maximum storage space of any zone contained in the ZNS SSD does not meet the adaptation requirement of the current operating system on the ZNS SSD, the maximum storage space of the corresponding zone in the ZNS SSD is expanded according to the adaptation requirement, so that the maximum storage space of each zone in the expanded ZNS SSD meets the identification requirement of the current operating system and waste of available space in the ZNS SSD can be avoided through expansion processing.

Description

Hard disk adaptation method and device and electronic equipment
Technical Field
The present invention relates to the field of hard disk configuration technologies, and in particular, to a method and an apparatus for adapting a hard disk, and an electronic device.
Background
Along with the development of storage technology, the solid state disk is continuously upgraded, the traditional solid state disk SSD (SolidState Drive) is also gradually upgraded into a ZNS SSD, wherein the ZNS (Zonded Name Space) is a new characteristic of an NVMe protocol based on a zone size management Space, and the formed ZNSSSD is the zone Name Space solid state disk. The ZNS SSD internally comprises a plurality of storage areas zones, wherein the maximum storage space of each zone is called zone size, and the maximum actual storage space is called zone capacity. The maximum memory space of each zone in the ZNS SSD is determined according to the number of super blocks configured therein and the memory space of each super block, for example, when the memory space size of one super block is 360M, then for a zone containing 4 super blocks, the maximum memory space of one zone is 1440M.
With the continuous development and upgrading of the solid state disk, in the prior art, certain operating systems cannot identify the ZNS SSD due to the fact that the operating systems of the operating systems limit the zone size of the ZNS SSD; for example, in the linux kernel of the 5.10 and above versions, there is a limitation in the process of identifying the ZNS SSD, the size of the zone size of each zone must be 2 to the nth power, if the size is not 2 to the nth power, the disk cannot be identified, and the hard disk cannot be used, and obviously, for the ZNS SSD hard disk including the size of the zone size 1440M, it is necessary to propose a hard disk adaptation method to implement the identification of the ZNS SSD hard disk by any operating system.
Disclosure of Invention
Therefore, the technical problem to be solved by the invention is to overcome the defect that the ZNS SSD hard disk cannot be identified in the existing operating system of some versions, so as to provide a hard disk adaptation method, a device and electronic equipment.
According to a first aspect, an embodiment of the present invention discloses a hard disk adaptation method, including: acquiring the adaptation requirement of a current operating system on the ZNS SSD; determining the maximum storage space of each zone contained in the ZNS SSD; and when the maximum storage space of any zone contained in the ZNS SSD does not meet the adaptation requirement of the current operating system on the ZNS SSD, expanding the maximum storage space of the corresponding zone in the ZNS SSD according to the adaptation requirement.
Optionally, after the capacity expansion is performed on the maximum storage space of the corresponding zone in the ZNS SSD according to the adaptation requirement, the method further includes: determining a zone increased storage space for performing capacity expansion processing; the storage space increased by the zone for the capacity expansion is configured as an invalid storage space, and the original storage space before the capacity expansion is configured as an effective storage space.
Optionally, the method further comprises: when a data storage instruction of a user is received, the received data to be stored is stored in the original storage space of the current zone.
Optionally, the method further comprises: determining the size of a storage space required by the received data to be stored; when the size of the storage space required by the received data to be stored exceeds the size of the remaining storage space in the original storage space of the current zone, responding to feedback of prompt information of data writing failure to a user.
Optionally, the method further comprises: and when a space capacity query request of a user is received, feeding back the maximum storage space size of the ZNS SSD before capacity expansion to the user.
Optionally, the determining the maximum storage space of each zone included in the ZNS SSD includes: acquiring attribute data of the ZNS SSD; and determining the maximum storage space of each zone contained in the ZNS SSD according to the attribute data.
Optionally, the obtaining the adaptation requirement of the current operating system to the ZNS SSD includes: acquiring the type of a current operating system; and determining the adaptation requirement for the ZNS SSD according to the type of the current operating system.
According to a second aspect, an embodiment of the present invention further discloses a hard disk adapting device, including: the adaptation requirement acquisition module is used for acquiring the adaptation requirement of the current operating system on the ZNS SSD; the first storage space determining module is used for determining the maximum storage space of each zone contained in the ZNS SSD; and the storage space expansion module is used for expanding the maximum storage space of the corresponding zone in the ZNS SSD according to the adaptation requirement when the maximum storage space of any zone contained in the ZNS SSD does not meet the adaptation requirement of the current operating system on the ZNS SSD.
According to a third aspect, an embodiment of the present invention further discloses an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps of the hard disk adaptation method according to the first aspect or any alternative implementation of the first aspect.
According to a fourth aspect, an embodiment of the present invention also discloses a computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the steps of the hard disk adaptation method according to the first aspect or any of the alternative embodiments of the first aspect.
The technical scheme of the invention has the following advantages:
according to the hard disk adaptation method/device provided by the invention, the maximum storage space of any zone contained in the ZNS SSD which does not meet the requirement is subjected to capacity expansion processing by acquiring the adaptation requirement of the current operating system on the ZNS SSD, so that the maximum storage space of the zone contained in the ZNS SSD after capacity expansion meets the identification and the call of the current operating system; for example, if the maximum storage space of each zone in the current ZNS SSD hard disk is 1440M and the requirement of the current operating system linux on the zone size of each zone is the nth power of 2, the zone size of each zone can be expanded from 1440M to 2G or 4G by expansion, so that the identification and use of the current linux operating system on the ZNS SSD are satisfied;
in addition, the identification requirement of the linux is met by performing capacity expansion processing (such as capacity expansion to 2G or 4G) on the storage space of the zone which does not meet the adaptation requirement of the linux of the operating system, and compared with the mode of capacity reduction processing such as capacity reduction of the zone size to 1G, the method provided by the invention has the advantage that the original zone size of the corresponding zone after the capacity expansion processing is not wasted by adopting the capacity expansion processing mode; namely, if the adaptation requirement of the linux is to be met, selecting a zone size of 1G, and when the original storage space of the zone is 1440M, each zone wastes (1440M-1G) storage space although the adaptation requirement of the linux is met after the volume reduction treatment, so that a large amount of storage space in the ZNS SSD is wasted, and the invention can meet the identification requirement of the current operating system on the ZNS SSD and avoid the waste of available space in the ZNS SSD by the way of volume expansion treatment;
according to the hard disk adapting method/device provided by the invention, the increased storage space is configured as the invalid storage space, the original storage space of each zone is still configured as the effective storage space, the storage space which is expanded for matching with the system identification after upgrading the system is not influenced on the normal use of the user by fixing the available storage space of the zone before and after capacity expansion, namely the storage space which is expanded for matching with the operation system identification in the system is not perceived by the user, and the problem that the user is questioned on the change of the storage space of the existing terminal is avoided, the inherent cognition of the user on the storage space of the terminal is ensured, and the normal storage and use of the user in the terminal are ensured;
according to the hard disk adaptation method/device, the original storage space of the current zone is identified, and if the size of the storage space required by the received data to be stored exceeds the size of the remaining storage space in the original storage space of the current zone, the prompt information of the data writing failure is fed back to the user, so that the user stores the data to be stored by using other zones, and the reliable storage of the data to be stored of the user is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a specific example of a hard disk adaptation method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a specific example of a hard disk adaptation method according to an embodiment of the present invention;
FIG. 3 is a schematic block diagram of a specific example of a hard disk adapter in an embodiment of the present invention;
fig. 4 is a diagram illustrating an embodiment of an electronic device according to the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made apparent and fully in view of the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present invention, it should be noted that the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, the technical features of the different embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
The embodiment of the invention discloses a hard disk adaptation method which can be applied to ZNS SSDs, wherein the ZNS SSD can be configured in terminal equipment such as a computer, when the kernel of an operating system of the terminal equipment is changed or upgraded, the identification requirement on the ZNS SSD can be changed, the terminal operating system is not limited, and the method can be any operating system with limitation on the size of a zone in the identification of the ZNS SSD. For convenience in describing the technical solutions described in the embodiments of the present application, in the following embodiments, the current operating system uses 5.10 and above version of linux as an example, and the 5.10 and above version of linux kernel requires that the zone size of each zone must be the power of 2 n in the process of identifying the ZNS SSD. As shown in fig. 1, the method comprises the steps of:
step 101, obtaining the adaptation requirement of the current operating system to the ZNS SSD.
For example, the acquisition opportunity of the ZNS SSD to the adaptive requirement of the current operating system may be that the ZNS SSD does not write data for a certain period of time, and the reason why the ZNS SSD does not write data for a certain period of time may be that the current operating system does not recognize the ZNS SSD, where the ZNS SSD may respond to the operation of acquiring the adaptive requirement of the current operating system to itself; the acquisition time of the adaptation requirement of the ZNS SSD on the current operating system can also be the operation of the ZNS SSD on the response of the current operating system to the adaptation requirement according to the fixed preset interval duration. The embodiment of the application does not limit the certain duration, the preset interval duration and the acquisition time of the ZNS SSD for the adaptation requirement of the current operating system, and the person skilled in the art can determine the acquisition time according to actual needs. The method for acquiring the adaptation requirement of the current operating system to the ZNS SSD can be that the type of the current operating system is determined, and the adaptation requirement of the type of operating system to the ZNS SSD is acquired from a network in a networking mode according to the type of the current operating system.
As an optional embodiment of the present invention, step 101 of obtaining the adaptation requirement of the current operating system to the ZNS SSD includes: acquiring the type of a current operating system; and determining the adaptation requirement of the ZNS SSD according to the type of the current operating system. The method includes the steps of obtaining an information table for storing attribute information of a current operating system, inquiring type bit data representing the current operating system from the information table, analyzing the type bit data to obtain the type of the current operating system, and matching from a database pre-stored with corresponding type adaptation requirements according to the type to obtain the adaptation requirements of the current operating system to the ZNS SSD. If the current system is determined to be a linux operating system with the version of 5.10 and above, the identification requirement of the operating system on the ZNS SSD can be determined according to the type or the configuration condition of the operating system.
Step 102, determining the maximum storage space of each zone contained in the ZNS SSD.
Illustratively, the manner in which the ZNS SSD makes a maximum storage space for each zone itself may determine the maximum storage space for each zone by identifying and reading the number of super blocks contained in each zone and the storage space data for each super block; if the memory size of one super block is 360M, then the maximum memory size of one zone is 1440M for a zone containing 4 super blocks. The determination of the memory size of each superblock may be determined by reading the attribute data of the corresponding superblock.
As an optional embodiment of the present invention, determining the maximum storage space of each zone included in the ZNS SSD in step 102 may further include: acquiring attribute data of the ZNS SSD; and determining the maximum storage space of each zone contained in the ZNS SSD according to the attribute data. For example, the attribute data of the ZNS SSD includes attribute data of a specific maximum storage space of each zone, and the maximum storage space of each zone included in the ZNS SSD may be obtained by reading the corresponding attribute data and analyzing.
Step 103, when the maximum storage space of any zone contained in the ZNS SSD does not meet the adaptation requirement of the current operating system on the ZNS SSD, expanding the maximum storage space of the corresponding zone in the ZNS SSD according to the adaptation requirement.
For example, it may be determined whether the maximum storage space of each zone in the current ZNS SSD meets the identification requirement of the current operating system according to the obtained adaptation requirement. For example, as the linux kernel of version 5.10 and above requires that the zone size of each zone must be the size of the nth power of 2 in the process of identifying the ZNS SSD, when the maximum storage space of any zone in the ZNS SSD does not meet the requirement of the current operating system on the adaptation of the ZNS SSD, the corresponding zone in the ZNS SSD is subjected to capacity expansion processing, so that the maximum storage space of each zone in the expanded ZNS SSD meets the identification and call of the current operating system; for example, if the maximum storage space of each zone in the current ZNS SSD hard disk is 1440M and the requirement of the current operating system linux on the zone size of each zone is the nth power of 2, the zone size of the zone which does not meet the identification requirement can be expanded from 1440M to 2G or 4G by expansion, so that the identification and use of the current linux operating system on the ZNS SSD are met;
in addition, the identification requirement of the linux is met by performing capacity expansion processing (such as capacity expansion to 2G or 4G) on the storage space of the zone which does not meet the adaptation requirement of the linux of the operating system, and compared with the mode of performing capacity reduction processing, such as capacity reduction of the zone size to 1G, the method provided by the embodiment of the invention adopts the capacity expansion processing mode so that the original zone size of the corresponding zone after the capacity expansion processing is not wasted; that is, if the adaptation requirement of linux is to be met, a zone size of 1G is selected, and when the original storage space of the zone is 1440M, each zone wastes (1440M-1G) storage space although the adaptation requirement of linux is met after the volume reduction processing, so that a large amount of storage space in the ZNS SSD is wasted. Meanwhile, in order to avoid excessive capacity expansion, the maximum storage space of the corresponding zone can be expanded to the minimum capacity expansion configuration under the condition of meeting the identification requirement according to the current zone size, for example, when the zone size is 1440M, the capacity expansion is preferably carried out to 2G under a linux operating system.
As an optional embodiment of the present invention, after expanding the maximum storage space of the corresponding zone in the ZNS SSD according to the adaptation requirement in step 103, the hardware adaptation method further includes: 104, determining a zone increased storage space for capacity expansion processing; step 105, configuring the zone increased storage space subjected to the capacity expansion processing as an invalid storage space, and configuring the original storage space not subjected to the capacity expansion processing as an effective storage space.
By way of example, the storage space increased by the expanded zone may be determined by comparing the size of the storage space before and after expansion by expanding the corresponding zone. If the memory space of any zone is expanded to 2G, the increased memory space is (2G-1440M) =608M compared to the zone with 1440M as the original memory space. Configuring the increased storage space as invalid storage space, and configuring the original zone size of each zone as valid storage space; by fixing the available storage space of the zone before and after capacity expansion, the storage space which is expanded for matching with the operation system identification during the upgrading or changing of the operation system cannot influence the normal use of the user, namely the storage space which is expanded for matching with the operation system identification in the system cannot be perceived by the user, and then the problem of the user on the change of the storage space of the ZNS SSD of the existing terminal cannot be caused, so that the user keeps inherent cognition on the size of the storage space of the terminal, and the normal storage use of the user in the terminal is ensured. That is, when the operating system calls, the size of the storage space actually reported to the operating system is 2g×n, and the size of the zone capacity available to the actual user is 1440m×n, where n is the maximum zone number of the ZNS SSD.
As an optional embodiment of the invention, the hardware adaptation method further comprises: when a data storage instruction of a user is received, the received data to be stored is stored in the original storage space of the current zone.
By storing the received data to be stored in the original storage space of the current zone, the newly added storage space in the zone can not influence the historical storage cognition and habit of the user, namely, the storage space which is expanded for matching with the identification of the operating system in the system can not be perceived by the user, so that the user can not question the change of the storage space of the existing terminal, the inherent cognition of the user on the storage space of the terminal is ensured, and the normal storage and use of the user in the terminal are ensured.
As an optional embodiment of the invention, the hardware adaptation method further comprises: determining the size of a storage space required by the received data to be stored; when the size of the storage space required by the received data to be stored exceeds the size of the remaining storage space in the original storage space of the current zone, responding to feedback of prompt information of data writing failure to a user.
The method for determining the storage space required by the data to be stored can be implemented by inquiring and counting the number of bytes of the received data to be stored, and determining the storage space required by the data to be stored according to the inquiry and counting results. And identifying the original storage space of the current zone, and if the size of the storage space required by the received data to be stored exceeds the size of the remaining storage space in the original storage space of the current zone, feeding back prompt information of data writing failure to a user, so that the user stores the data to be stored by using other zones, and the reliable storage of the data to be stored of the user is ensured.
As an optional embodiment of the invention, the hardware adaptation method further comprises: and when a space capacity query request of a user is received, feeding back the maximum storage space size of the ZNS SSD before capacity expansion to the user. The maximum storage space size of the ZNS SSD before capacity expansion is fed back to the user according to the received space capacity query request of the user, so that the inherent cognition of the user on the storage space contained in the ZNS SSD configured in the terminal equipment is ensured, the data stored to the terminal is reasonably allocated, and the normal data storage process of the user is not influenced by the expanded storage space for meeting the identification requirement of the current operating system on the ZNS SSD.
The embodiment of the present invention further provides a hard disk adapting device, which is used for implementing the foregoing embodiment and the optional implementation manner, and the description is omitted herein. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated. As shown in fig. 3, the apparatus includes:
an adaptation requirement acquisition module 201, configured to acquire an adaptation requirement of a current operating system on a ZNS SSD; referring specifically to the description of step 101 in the above embodiment, no further description is provided here.
A first storage space determining module 202, configured to determine a maximum storage space of each zone included in the ZNS SSD; referring specifically to the description of step 102 in the above embodiment, no further description is provided here.
And the storage space expansion module 203 is configured to expand the maximum storage space of the corresponding zone in the ZNS SSD according to the adaptation requirement when the maximum storage space of any zone included in the ZNS SSD does not meet the adaptation requirement of the current operating system on the ZNS SSD. Referring specifically to the description of step 103 in the above embodiment, no further description is provided here.
The hard disk adapting device provided by the invention obtains the adapting requirement of the current operating system on the ZNS SSD, determines the maximum storage space of each zone contained in the ZNS SSD, and expands the maximum storage space of each zone in the ZNS SSD according to the adapting requirement when the maximum storage space of each zone in the ZNS SSD does not meet the adapting requirement of the current operating system on the ZNS SSD. Performing capacity expansion processing on the maximum storage space of each zone in the ZNS SSD which does not meet the requirement by acquiring the adaptation requirement of the current operating system on the ZNS SSD, so that the maximum storage space of each zone in the ZNS SSD after capacity expansion meets the identification and calling of the current operating system, for example, if the maximum storage space of each zone in the current ZNS SSD is 1440M and the requirement of the current operating system linux on the zone size of each zone is the power of 2, the zone size of each zone can be expanded from 1440M to 2G or 4G through capacity expansion, and then the identification and use of the ZNS SSD by the current linux operating system are met;
in addition, the identification requirement of the linux is met by performing capacity expansion processing (such as capacity expansion to 2G or 4G) on the storage space of the zone which does not meet the adaptation requirement of the linux of the operating system, and compared with the mode of performing capacity reduction processing, such as capacity reduction of the zone size to 1G, the method provided by the embodiment of the invention adopts the capacity expansion processing mode so that the original zone size of the corresponding zone after the capacity expansion processing is not wasted; that is, if the adaptation requirement of linux is to be met, a zone size of 1G is selected, and when the original storage space of the zone is 1440M, each zone wastes (1440M-1G) storage space although the adaptation requirement of linux is met after the volume reduction processing, so that a large amount of storage space in the ZNS SSD is wasted.
As an optional embodiment of the present invention, the hard disk adapting device further includes: the second storage space determining module is used for determining the storage space increased by the zone for performing capacity expansion processing; and the storage space configuration module is used for configuring the storage space increased by the zone for performing the capacity expansion processing as an invalid storage space and configuring the original storage space before the capacity expansion processing as an effective storage space. The added storage space is configured as an invalid storage space, the original storage space of each zone is still configured as an effective storage space, and the storage space which is expanded for matching with the system identification after the system is upgraded can not influence the normal use of the user by fixing the available storage space of each zone before and after the capacity expansion, namely the storage space which is expanded for matching with the operating system identification in the system can not be perceived by the user, so that the problem of the change of the storage space of the existing terminal by the user can not be caused, the inherent cognition of the user on the size of the storage space of the terminal is ensured, and the normal storage and use of the user in the terminal are ensured. Reference is specifically made to the descriptions of the foregoing corresponding embodiments, and no further description is given here.
As an optional embodiment of the present invention, the hard disk adapting device further includes: and the data storage module is used for storing the received data to be stored into the original storage space of the current zone when receiving the data storage instruction of the user. The received data to be stored is only stored in the original storage space of the current zone, so that the newly added storage space in the zone cannot influence the history storage cognition and habit of the user, namely, the storage space which is expanded for matching with the identification of the operating system in the system cannot be perceived by the user, and then the user cannot question the change of the storage space of the existing terminal, the inherent cognition of the user on the storage space of the terminal is ensured, and the normal storage and use of the user in the terminal are ensured. Reference is specifically made to the descriptions of the foregoing corresponding embodiments, and no further description is given here.
As an optional embodiment of the present invention, the hard disk adapting device further includes: the third storage space determining module is used for determining the size of the storage space required by the received data to be stored; and the prompt information feedback module is used for responding to the prompt information of feedback data writing failure to the user when the size of the storage space required by the received data to be stored exceeds the size of the residual storage space in the original storage space of the current zone. And identifying the original storage space of the current zone, and if the size of the storage space required by the received data to be stored exceeds the size of the remaining storage space in the original storage space of the current zone, feeding back prompt information of data writing failure to a user, so that the user stores the data to be stored by using other zones, and the reliable storage of the data to be stored of the user is ensured. Reference is specifically made to the descriptions of the foregoing corresponding embodiments, and no further description is given here.
As an optional embodiment of the present invention, the hard disk adapting device further includes: and the storage space query feedback module is used for feeding back the maximum storage space size of the ZNS SSD before capacity expansion to the user when receiving the space capacity query request of the user. The maximum storage space size of the ZNS SSD before capacity expansion is fed back to the user according to the received space capacity query request of the user, so that the cognition of the user on the inherent storage space contained in the ZNS SSD configured in the terminal equipment is ensured, the data stored to the terminal is reasonably allocated, and the normal data storage process of the user is not influenced by the expanded storage space for meeting the identification requirement of the current operating system on the ZNS SSD.
As an optional embodiment of the present invention, the first storage space determining module includes: the attribute data acquisition module is used for acquiring the attribute data of the ZNS SSD; and the storage space determination submodule is used for determining the maximum storage space of each zone contained in the ZNS SSD according to the attribute data. Reference is specifically made to the descriptions of the foregoing corresponding embodiments, and no further description is given here.
As an optional embodiment of the present invention, the adaptation requirement acquisition module includes: the system type acquisition sub-module is used for acquiring the type of the current operating system; and the adaptation requirement determination submodule is used for determining the adaptation requirement on the ZNS SSD according to the type of the current operating system. Reference is specifically made to the descriptions of the foregoing corresponding embodiments, and no further description is given here.
The embodiment of the present invention further provides an electronic device, as shown in fig. 4, which may include a processor 401 and a memory 402, where the processor 401 and the memory 402 may be connected by a bus or other means, and in fig. 4, the connection is exemplified by a bus.
The processor 401 may be a central processing unit (Central Processing Unit, CPU). The processor 401 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 402 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the hard disk adaptation method in the embodiments of the present invention. The processor 401 executes various functional applications of the processor and data processing, i.e. implements the hard disk adaptation method in the above-described method embodiments, by running non-transitory software programs, instructions and modules stored in the memory 402.
Memory 402 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created by the processor 401, or the like. In addition, memory 402 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 402 may optionally include memory located remotely from processor 401, such remote memory being connectable to processor 401 through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 402 and when executed by the processor 401 perform the hard disk adaptation method in the embodiment shown in fig. 1.
The specific details of the electronic device may be understood correspondingly with respect to the corresponding related descriptions and effects in the embodiment shown in fig. 1, which are not repeated herein.
It will be appreciated by those skilled in the art that implementing all or part of the above-described embodiment method may be implemented by a computer program to instruct related hardware, where the program may be stored in a computer readable storage medium, and the program may include the above-described embodiment method when executed. Wherein the storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a random access Memory (RandomAccessMemory, RAM), a flash Memory (flash Memory), a Hard Disk (HDD), or a Solid State Drive (SSD); the storage medium may also comprise a combination of memories of the kind described above.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations are within the scope of the invention as defined by the appended claims.

Claims (10)

1. A method of adapting a hard disk comprising:
acquiring the adaptation requirement of a current operating system on the ZNS SSD;
determining the maximum storage space of each zone contained in the ZNS SSD;
and when the maximum storage space of any zone contained in the ZNS SSD does not meet the adaptation requirement of the current operating system on the ZNS SSD, expanding the maximum storage space of the corresponding zone in the ZNS SSD according to the adaptation requirement.
2. The method for adapting a hard disk according to claim 1, wherein after the capacity expansion is performed on the maximum storage space of the corresponding zone in the ZNS SSD according to the adapting requirement, the method further comprises:
determining a zone increased storage space for performing capacity expansion processing;
the storage space increased by the zone for the capacity expansion is configured as an invalid storage space, and the original storage space before the capacity expansion is configured as an effective storage space.
3. The hard disk adaptation method according to claim 2, wherein the method further comprises:
when a data storage instruction of a user is received, the received data to be stored is stored in the original storage space of the current zone.
4. A method of adapting a hard disk as claimed in claim 3, further comprising:
determining the size of a storage space required by the received data to be stored;
when the size of the storage space required by the received data to be stored exceeds the size of the remaining storage space in the original storage space of the current zone, responding to feedback of prompt information of data writing failure to a user.
5. The hard disk adaptation method according to any one of claims 1-4, wherein the method further comprises:
and when a space capacity query request of a user is received, feeding back the maximum storage space size of the ZNS SSD before capacity expansion to the user.
6. The hard disk adaptation method according to claim 1, wherein the determining a maximum storage space of each zone included in the ZNS SSD includes:
acquiring attribute data of the ZNS SSD;
and determining the maximum storage space of each zone contained in the ZNS SSD according to the attribute data.
7. The method for adapting a hard disk according to claim 1, wherein the obtaining the adaptation requirement of the current operating system to the ZNS SSD includes:
acquiring the type of a current operating system;
and determining the adaptation requirement for the ZNS SSD according to the type of the current operating system.
8. A hard disk adapting device, comprising:
the adaptation requirement acquisition module is used for acquiring the adaptation requirement of the current operating system on the ZNS SSD;
the first storage space determining module is used for determining the maximum storage space of each zone contained in the ZNS SSD;
and the storage space expansion module is used for expanding the maximum storage space of the corresponding zone in the ZNS SSD according to the adaptation requirement when the maximum storage space of any zone contained in the ZNS SSD does not meet the adaptation requirement of the current operating system on the ZNS SSD.
9. An electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the steps of the hard disk adaptation method of any one of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the hard disk adaptation method according to any one of claims 1-7.
CN202111245442.9A 2021-10-25 2021-10-25 Hard disk adaptation method and device and electronic equipment Active CN114020212B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111245442.9A CN114020212B (en) 2021-10-25 2021-10-25 Hard disk adaptation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111245442.9A CN114020212B (en) 2021-10-25 2021-10-25 Hard disk adaptation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN114020212A CN114020212A (en) 2022-02-08
CN114020212B true CN114020212B (en) 2023-06-09

Family

ID=80057585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111245442.9A Active CN114020212B (en) 2021-10-25 2021-10-25 Hard disk adaptation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114020212B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104820575A (en) * 2015-04-27 2015-08-05 西北工业大学 Method for realizing thin provisioning of storage system
CN105159839A (en) * 2015-09-28 2015-12-16 联想(北京)有限公司 Configuration method and apparatus and solid-state disk
CN106843949A (en) * 2017-01-11 2017-06-13 微鲸科技有限公司 The preparation method of system image, the system installation method of electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10007458B2 (en) * 2015-12-18 2018-06-26 Microsemi Solutions (U.S.), Inc. Method of configuring memory cells in a solid state drive based on read/write activity and controller therefor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104820575A (en) * 2015-04-27 2015-08-05 西北工业大学 Method for realizing thin provisioning of storage system
CN105159839A (en) * 2015-09-28 2015-12-16 联想(北京)有限公司 Configuration method and apparatus and solid-state disk
CN106843949A (en) * 2017-01-11 2017-06-13 微鲸科技有限公司 The preparation method of system image, the system installation method of electronic equipment

Also Published As

Publication number Publication date
CN114020212A (en) 2022-02-08

Similar Documents

Publication Publication Date Title
US20200193027A1 (en) Firmware upgrade method, slave station of robot, and machine readable storage medium
CN111683114A (en) Method and device for upgrading equipment program, terminal equipment and storage medium
CN111581502A (en) Information notification method and device
CN110457114B (en) Application cluster deployment method and device
CN110392080B (en) Deployment method and device based on distributed system and distributed system
CN114020212B (en) Hard disk adaptation method and device and electronic equipment
CN112052144B (en) Information management method, device, electronic equipment and storage medium
CN117896351A (en) Slave address updating method and related device
CN110955460B (en) Service process starting method and device, electronic equipment and storage medium
CN110321590B (en) Automatic generation method and device of refrigerating system design drawing and storage medium
CN108920333B (en) Event state monitoring method and event state monitor
CN109962941B (en) Communication method, device and server
CN115981670A (en) Container cluster service deployment method, device, server and storage medium
CN116781719A (en) Container mirror image preheating method, electronic equipment and storage medium
CN105490852A (en) Upgrade detection method and device
CN109922120A (en) Improve the method and terminal of DNS availability
CN111092945B (en) Sampling data pushing and receiving party active protection method based on system resources
CN111901243B (en) Service request routing method, scheduler and service platform
CN108845845B (en) Shortcut key creation method and device, electronic equipment and storage medium
CN110209418B (en) Program updating method, device, equipment and computer readable storage medium
CN104346101A (en) Dynamic storage space allocation system and method
CN110557555B (en) Function starting method, device, equipment and system of intelligent camera
CN106528246A (en) Method and device for freezing applications
CN113504879A (en) Data storage method and intelligent household appliance
CN111581558A (en) Method, device and equipment for determining page loading duration and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant