A storage optimization method and device, electronic equipment and storage medium

By determining the logical and physical block storage addresses in the logical volume manager and saving data to the metadata physical volume, the problem of slow management commands caused by multiple metadata replicas is solved, and the separation of metadata and target data is achieved, thus improving management efficiency.

CN122431601APending Publication Date: 2026-07-21BEIJING QINGYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING QINGYUN TECH CO LTD
Filing Date
2026-04-21
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In a large-scale logical volume manager cluster environment, the large number of metadata replicas leads to long response times for management commands. Existing optimization solutions cannot fundamentally reduce the number of metadata replicas, thus affecting the execution speed of management commands.

Method used

The logical block storage address is determined by receiving a data write request, the physical block storage address within the physical volume is determined based on the logical volume manager, the target data is saved, and the storage information is saved to the metadata physical volume created by the logical volume manager, thus achieving the separation of metadata and target data.

Benefits of technology

It significantly reduces the number of metadata copies, improves the efficiency of unified metadata management, and enhances the execution speed of management commands in a logical volume manager cluster environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431601A_ABST
    Figure CN122431601A_ABST
Patent Text Reader

Abstract

The application discloses a storage optimization method and device, electronic equipment and a storage medium. The method comprises the following steps: determining the logical block storage address of target data according to the received data write request; determining the physical block storage address corresponding to the logical block storage address in the physical volume based on the logical volume manager, and saving the target data according to the physical block storage address; and saving the storage information of the target data to the metadata physical volume created by the logical volume manager. The technical scheme of the embodiment of the application can realize the accurate writing of the target data by saving the target data according to the physical block storage address, complete the persistent storage of the target data, save the storage information of the target data to the metadata physical volume created by the logical volume manager, realize the separation of the metadata and the target data, and significantly improve the execution speed of the management command in the logical volume manager cluster environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer storage technology, and in particular to a storage optimization method, apparatus, electronic device, and storage medium. Background Technology

[0002] Logical Volume Manager (LVM) is a widely deployed storage manager under the Linux operating system. By virtualizing and abstracting physical storage devices, Logical Volume Manager can adjust and allocate storage capacity.

[0003] However, with the widespread adoption of large-scale data and distributed storage clusters, the number of Physical Volumes (PVs) is increasing rapidly. Existing logical volume managers require each PV to maintain a complete copy of its metadata. Each execution of a logical volume management command necessitates traversing all PVs and reading all metadata copies, resulting in long command response times. While traditional optimization schemes can cache metadata at a single point, they cannot fundamentally reduce the number of metadata copies. Therefore, how to reduce the number of metadata copies and improve the execution speed of management commands in a large-scale logical volume manager cluster environment has become a critical technical problem that urgently needs to be solved in this field. Summary of the Invention

[0004] This invention provides a storage optimization method, apparatus, electronic device, and storage medium to solve the problem of slow execution speed of management commands in a logical volume manager cluster environment.

[0005] According to one aspect of the present invention, a storage optimization method is provided, the method comprising:

[0006] Determine the logical block storage address of the target data based on the received data write request;

[0007] The logical volume manager determines the physical block storage address corresponding to the logical block storage address within the physical volume, and saves the target data according to the physical block storage address;

[0008] The storage information of the target data is saved to the metadata physical volume created by the logical volume manager.

[0009] According to another aspect of the present invention, a storage optimization apparatus is provided, the apparatus comprising:

[0010] The logical address module is used to determine the logical block storage address of the target data based on the received data write request;

[0011] The data storage module is used to determine the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager, and to save the target data according to the physical block storage address;

[0012] The metadata update module is used to save the storage information of the target data to the metadata physical volume created by the logical volume manager.

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

[0014] At least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the storage optimization method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute the storage optimization method described in any embodiment of the present invention.

[0018] The technical solution of this invention determines the logical block storage address of the target data by receiving a data write request, thereby establishing an accessible virtual storage location for the target data. By determining the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager, and saving the target data according to the physical block storage address, accurate writing of the target data can be achieved, completing the persistent storage of the target data. By saving the storage information of the target data to the metadata physical volume created by the logical volume manager, the separation of metadata and target data can be achieved, fundamentally reducing the number of metadata copies and achieving the beneficial effect of significantly improving the execution speed of management commands in a logical volume manager cluster environment.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a data flow diagram before storage optimization provided by an embodiment of the present invention;

[0022] Figure 2 This is a flowchart of a storage optimization method provided according to Embodiment 1 of the present invention;

[0023] Figure 3 This is a flowchart of a storage optimization method provided according to Embodiment 2 of the present invention;

[0024] Figure 4 This is a data flow diagram with optimized storage provided according to Embodiment 3 of the present invention;

[0025] Figure 5 This is a schematic diagram of a storage optimization device according to Embodiment 4 of the present invention;

[0026] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the storage optimization method of Embodiment 5 of the present invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] For a better explanation of the embodiments of the present invention, please refer to [reference needed]. Figure 1 , Figure 1 This is a data flow diagram before storage optimization provided by an embodiment of the present invention. Specifically: LV refers to a logical volume, which is a logical storage unit dynamically partitioned from a volume group by a logical volume manager, for direct use by the operating system or applications; VG refers to a volume group, which is a storage pool composed of one or more physical volumes, realizing unified integration and abstraction of the underlying physical storage space; PV refers to a physical volume, which is a physical hard disk initialized and managed by the logical volume manager, and physical volumes constitute the basic building blocks of the storage system; meta refers to the metadata area, which is a dedicated space on the physical volume used to store the logical volume manager's own management information; data refers to the business data area, which is the storage space on the physical volume used to store the user's actual business data. In the traditional logical volume manager architecture, each physical volume (marked as PV1, PV2, PV3 in the diagram) contains a metadata area (marked as meta in the diagram) and a business data area (marked as data in the diagram), where the metadata area is used to store the metadata information required by the logical volume manager, and the business data area is used to store the user's actual business data. Under this architecture, each physical volume stores a complete copy of the metadata. When executing commands, the logical volume manager needs to traverse all physical volumes and read each copy of metadata, causing command response time to increase linearly with the number of physical volumes. Simultaneously, since metadata and business data reside on the same physical medium, high-concurrency input and output operations of business data compete for resources with metadata access, exacerbating metadata read / write latency and impacting system availability.

[0030] Example 1

[0031] Figure 2 The flowchart illustrates a storage optimization method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where management commands execute slowly in a logical volume manager cluster environment. This method can be executed by a storage optimization device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 2 As shown, the method includes:

[0032] Figure 2 This is a flowchart of a storage optimization method provided in Embodiment 1 of the present invention. This embodiment is applicable to the scenario of metadata isolation and command acceleration in a large-scale logical volume manager cluster.

[0033] S110. Determine the logical block storage address of the target data based on the received data write request.

[0034] The target data may include data submitted via a data write request that needs to be written to the storage space managed by the logical volume manager. The logical block storage address may include address information in the logical address space used to locate the target data storage location.

[0035] Specifically, after receiving a data write request, the logical volume manager can parse the data write request and determine the logical block storage address of the target data in the logical address space based on the parsing result. The logical volume manager can receive the data write request by calling an interface or by receiving it through a network storage protocol. The parsing result can include the data write method, target data size, target data content, target data format, etc.

[0036] S120. Determine the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager, and save the target data according to the physical block storage address.

[0037] The logical volume manager can include modules or systems for managing physical storage devices and providing a mapping between logical volumes and addresses. A physical volume can be the basic physical storage unit within the logical volume manager; it can include an entire disk, a partition within a disk, etc. A physical block storage address can be an address on the physical storage medium of the physical volume, used to identify and locate the actual storage location of a data block; the physical storage medium can include hard disk drives (HDDs), solid-state drives (SSDs), etc.

[0038] Specifically, the logical volume manager can query the address mapping table of logical block storage addresses based on the logical block storage address, and then determine the physical block storage address corresponding to the logical block storage address within the physical volume. The target data can be saved to the physical storage space pointed to by the physical block storage address corresponding to the target data by calling the storage device interface, wireless transmission, or other means.

[0039] S130. Save the storage information of the target data to the metadata physical volume created by the logical volume manager.

[0040] Storage information can be information describing data related to the target data storage, and may include the storage location, size, and attributes of the target data. The metadata physical volume can be a physical volume created by a logical volume manager for storing and managing metadata.

[0041] Specifically, after completing the physical writing of the target data, the logical volume manager can obtain the storage information of the target data and save the storage information of the target data to the metadata physical volume created by the logical volume manager. The methods for obtaining the target data storage information may include obtaining it by parsing the parameters in the data write request, obtaining it through the correspondence between the target data logical block storage address and the physical block storage address, or obtaining it through the internal address mapping table of the logical volume manager.

[0042] The technical solution of this invention determines the logical block storage address of the target data by receiving a data write request, then determines the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager, and saves the target data according to the physical block storage address. Finally, the storage information of the target data is saved to the metadata physical volume created by the logical volume manager. This technical solution, by saving the storage information of the target data to the metadata physical volume created by the logical volume manager, can reduce the amount of metadata within each physical volume and improve the efficiency of unified metadata management.

[0043] Example 2

[0044] Figure 3 This is a flowchart of a storage optimization method provided in Embodiment 2 of the present invention. This embodiment further refines the above embodiment:

[0045] like Figure 3 As shown, the method includes:

[0046] S210. Determine the logical block storage address of the target data based on the received data write request.

[0047] Specifically, after receiving a data write request, the logical volume manager can parse the data write request and determine the logical block storage address of the target data in the logical address space based on the parsing result. The logical volume manager can receive the data write request by calling an interface or by receiving it through a network storage protocol. The parsing result can include the data write method, target data size, target data content, target data format, etc.

[0048] S220. Determine the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager.

[0049] The physical block storage address can be an address on the physical storage medium of the physical volume, used to identify and locate the actual storage location of the data block. The physical storage medium can include mechanical hard drives, solid-state drives, etc.

[0050] Specifically, the logical volume manager can look up the address mapping table of logical block storage addresses based on the logical block storage address, and then determine the physical block storage address corresponding to the logical block storage address within the physical volume.

[0051] S230. Locate the target physical block corresponding to the physical block storage address within the pre-created physical volume without metadata.

[0052] In this context, a metadata-free physical volume can be a physical volume created by a logical volume manager with zero metadata. A target physical block can be a basic storage unit within a metadata-free physical volume, identified by its physical block storage address, used to store the target data.

[0053] Specifically, the logical volume manager can search within a pre-created metadata-free physical volume based on the physical block storage address, thereby determining the target physical block corresponding to the physical block storage address within the metadata-free physical volume. The search methods can include traversal search, direct addressing based on the address mapping table, and search based on hash algorithms.

[0054] S240, Save target data to target physical block.

[0055] Specifically, the logical volume manager can save target data to the target physical block. The saving method can include interface transmission, wireless transmission, etc. Interface transmission can include data transmission through a computer standard bus or expansion interface, while wireless transmission can include data transmission through a wireless communication protocol to send the target data from the data source to the storage device and write it to the target physical block.

[0056] For example, the logical volume manager writes the target data to the physical storage medium space corresponding to the target physical block by calling the input / output interface provided by the operating system or storage device, thus completing the saving action of the target data.

[0057] S250. Extract at least one of the following from the target data: file size information, file data block mapping table, file timestamp, directory entry information, and inode information, as metadata.

[0058] The file size information can include parameters such as the storage space occupied by the target data, which can be represented by bytes, logical blocks, sectors, etc. The file data block mapping table can be a structured table recording the correspondence between the target data and physical blocks on the physical volume. The file timestamp can be time attribute information associated with the target data, including the creation time, last modification time, and last access time. Directory entry information can be used to locate and describe the target data, including the target data file name and file type. Inode information can be a structure used to store file metadata; each file corresponds to one inode, which can include device identifiers, user identifiers, file permissions, data block pointers, etc. Metadata can be data used to describe and locate the target data itself, but is separate from the actual content of the target data.

[0059] Specifically, after successfully saving the target data to the target physical block, the logical volume manager can extract at least one of the following as metadata from the file object associated with the target data: file size information, file data block mapping table, file timestamp, directory entry information, and inode information. The extraction method may include querying the operating system's file system interface, parsing the file mapping structure, etc.

[0060] S260. Save the metadata to the metadata physical volume.

[0061] Metadata physical volumes can be physical volumes created by logical volume managers for storing and managing metadata.

[0062] Specifically, the logical volume manager can save the metadata extracted from the target data to the metadata physical volume.

[0063] For example, the logical volume manager calls the metadata management module to encapsulate the metadata extracted from the target data according to a pre-defined structure and format, and writes the metadata to a specified storage area of ​​one or more metadata physical volumes through the input / output interface.

[0064] The technical solution of this invention determines the logical block storage address of the target data by receiving a data write request, then determines the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager, then searches for the target physical block corresponding to the physical block storage address within a pre-created physical volume without metadata, then saves the target data to the target physical block, and then extracts at least one of the target data's file size information, file data block mapping table, file timestamp, directory entry information, and inode information as metadata, and then saves the metadata to the metadata physical volume. This technical solution, by extracting at least one of the target data's file size information, file data block mapping table, file timestamp, directory entry information, and inode information as metadata, and then saving the metadata to the metadata physical volume, can achieve the separation of metadata and target data, fundamentally reducing the amount of metadata within each physical volume and improving the efficiency of unified metadata management.

[0065] Furthermore, based on the above embodiments, the invention also includes:

[0066] Create a first threshold number of physical volumes based on pre-configured storage space;

[0067] The control logic volume manager configures the metadata storage space of each physical volume with a pre-configured storage space, and each configured physical volume is used as a metadata physical volume.

[0068] The pre-configured storage space may include the storage capacity planned and set in advance for storing metadata before the creation of the metadata physical volume. The first threshold number may include the minimum number of metadata physical volumes pre-set to meet system requirements. The metadata storage space may include space dedicated to storing metadata information of the physical volume itself and its associated logical volumes.

[0069] Specifically, a first threshold number of physical volumes can be created based on the pre-configured storage space, and then the logical volume manager is controlled to configure the metadata storage space of each physical volume with the pre-configured storage space, and each configured physical volume is used as a metadata physical volume.

[0070] For example, a user, system administrator, or automated deployment tool creates a first threshold number of physical volumes on a selected physical storage device using a logical volume manager, based on pre-configured storage space. The logical volume manager then configures the pre-configured storage space according to the metadata storage space of each physical volume, ensuring that the pre-configured storage space can accommodate all metadata information. After configuration, these physical volumes are used as metadata physical volumes.

[0071] Furthermore, based on the above embodiments, the invention also includes:

[0072] The number of metadata physical volumes must be at least 3.

[0073] Metadata physical volumes can include physical volumes created by logical volume managers for storing and managing metadata.

[0074] Specifically, a logical volume manager can configure three or more metadata physical volumes. When one or a few metadata physical volumes fail or become inaccessible, the logical volume manager can still read complete metadata information from the remaining healthy metadata physical volumes. Configuring three or more metadata physical volumes ensures normal reading and access to metadata in multi-path or distributed storage environments, guaranteeing metadata consistency and command execution reliability.

[0075] Furthermore, based on the above embodiments, the invention also includes:

[0076] Create a second threshold number of physical volumes and set the metadata storage space of the physical volumes to zero to create a physical volume without metadata.

[0077] The second threshold number may include the minimum number of physical volumes used to store the target data, determined based on the storage capacity requirements of the target data. Metadata-free physical volumes may include physical volumes created by the logical volume manager with zero metadata.

[0078] Specifically, the Logical Volume Manager can create a second threshold number of physical volumes on selected physical storage devices and set the metadata storage space of the physical volumes to zero during the creation process. As a result, these physical volumes will not store any metadata and will be used by the Logical Volume Manager as metadata-free physical volumes specifically for storing target data.

[0079] Furthermore, based on the above embodiments, the invention also includes:

[0080] For a target physical volume with metadata storage space, the control logical volume manager ignores or clears the metadata copy saved by the target physical volume.

[0081] The target physical volume may include a physical volume that already existed and was in use before the application of this invention, and which stores a copy of metadata. The metadata copy may include a local copy of metadata information created and maintained by the logical volume manager.

[0082] Specifically, the logical volume manager can ignore or clear the metadata copy stored on the target physical volume that has metadata storage space.

[0083] For example, if the logical volume manager executes a metadata copy ignore command, the logical volume manager will no longer read or update the metadata copy on the target physical volume in subsequent management operations; or if the logical volume manager executes a metadata copy erase command, the logical volume manager will directly clear the metadata copy stored in the target physical volume.

[0084] Example 3

[0085] Figure 4 This is a data flow diagram with optimized storage provided for Embodiment 3 of the present invention, the specific contents of which are as follows:

[0086] First, select three independent 1GB physical hard drives with device paths / dev / xxx / mpath-a, / dev / xxx / mpath-b, and / dev / xxx / mpath-c. Execute the command `pvcreate --metadatasize 1G` to initialize these three independent 1GB physical hard drives as metadata physical volumes. Since the specified metadata size is 1GB and the physical hard drive capacity is exactly 1GB, the metadata area will fill the entire physical volume. This metadata physical volume can no longer store any business data and becomes a dedicated metadata physical volume.

[0087] Subsequently, for the existing business physical volumes, execute the `pvchange --metadataignore y` command to instruct the Logical Volume Manager (LLM) to ignore the metadata copies stored on these existing business physical volumes in subsequent operations. After executing the `pvchange --metadataignore y` command, the metadata copies on the original physical volumes still physically exist, but the LLM no longer reads or updates these metadata copies. The metadata copies only exist in the three dedicated metadata physical volumes mentioned above. If it is necessary to expand the business storage space later and add new physical hard drives, use the `pvcreate --metadatacopies 0` command to initialize the physical hard drives as physical volumes without metadata copies. These physical volumes are only used to store business data. Then, add the three dedicated metadata physical volumes and all business physical volumes to the same volume group. At this time, the metadata of the volume group is only stored on the three metadata physical volumes, and there are no valid metadata copies on the business physical volumes. After completing the above configuration, the total number of metadata copies in the LLM cluster is 3, and metadata access and business data access are completely isolated on the physical devices.

[0088] The technical solution of this invention can significantly reduce the size of metadata copies by executing the pvchange --metadataignore y command; and can achieve physical isolation between the management plane and the data plane by using the pvcreate --metadatacopies 0 command to initialize the physical hard disk as a physical volume without metadata copies.

[0089] Example 4

[0090] Figure 5 This is a schematic diagram of a storage optimization device provided in Embodiment 4 of the present invention. Figure 5 As shown, the device includes: a logical address module 310, a data storage module 320, and a metadata update module 330; wherein,

[0091] Logical address module 310 is used to determine the logical block storage address of the target data based on the received data write request;

[0092] The data storage module 320 is used to determine the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager, and to save the target data according to the physical block storage address;

[0093] The metadata update module 330 is used to save the storage information of the target data to the metadata physical volume created by the logical volume manager.

[0094] The technical solution of this invention involves a logical address module determining the logical block storage address of the target data based on a received data write request. Then, a data storage module determines the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager, and saves the target data according to the physical block storage address. Finally, a metadata update module saves the storage information of the target data to the metadata physical volume created by the logical volume manager. This technical solution establishes an accessible virtual storage location for the target data by determining the logical block storage address of the target data through the received data write request. It also achieves accurate writing of the target data and completes persistent storage by determining the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager and saving the target data according to the physical block storage address. Furthermore, saving the storage information of the target data to the metadata physical volume created by the logical volume manager separates the metadata from the target data, fundamentally reducing the number of metadata copies and significantly improving the execution speed of management commands in a logical volume manager cluster environment.

[0095] Optional, logical address module 310, specifically used for:

[0096] The logical block storage address of the target data is determined based on the received data write request.

[0097] Optional, the data storage module 320 is specifically used for:

[0098] The logical volume manager determines the physical block storage address corresponding to the logical block storage address within the physical volume, and saves the target data according to the physical block storage address.

[0099] Optionally, the target data can be saved according to the physical block storage address, including:

[0100] Locate the target physical block corresponding to the physical block storage address within a pre-created physical volume without metadata;

[0101] Save the target data to the target physical block.

[0102] Optional, metadata update module 330, specifically used for:

[0103] Save the storage information of the target data to the metadata physical volume created by the logical volume manager.

[0104] Optionally, the storage information of the target data can be saved to the metadata physical volume created by the logical volume manager, including:

[0105] Extract at least one of the following from the target data: file size information, file data block mapping table, file timestamp, directory entry information, and inode information, as metadata;

[0106] Save the metadata to the metadata physical volume.

[0107] Optionally, based on the above embodiments of the invention, it further includes:

[0108] Create a first threshold number of physical volumes based on pre-configured storage space;

[0109] The control logic volume manager configures the metadata storage space of each physical volume with a pre-configured storage space, and each configured physical volume is used as a metadata physical volume.

[0110] Optionally, based on the above embodiments of the invention, it further includes:

[0111] The number of metadata physical volumes must be at least 3.

[0112] Optionally, based on the above embodiments of the invention, it further includes:

[0113] Create a second threshold number of physical volumes and set the metadata storage space of the physical volumes to zero to create a physical volume without metadata.

[0114] Optionally, based on the above embodiments of the invention, it further includes:

[0115] For a target physical volume with metadata storage space, the control logical volume manager ignores or clears the metadata copy saved by the target physical volume.

[0116] The storage optimization apparatus provided in the embodiments of the present invention can execute the storage optimization method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0117] Example 5

[0118] Figure 6 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0119] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

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

[0121] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as memory optimization methods.

[0122] In some embodiments, the storage optimization method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the storage optimization method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the storage optimization method by any other suitable means (e.g., by means of firmware).

[0123] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0124] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0125] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

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

[0127] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0128] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0129] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A storage optimization method, characterized in that, The method includes: Determine the logical block storage address of the target data based on the received data write request; The logical volume manager determines the physical block storage address corresponding to the logical block storage address within the physical volume, and saves the target data according to the physical block storage address; The storage information of the target data is saved to the metadata physical volume created by the logical volume manager.

2. The method according to claim 1, characterized in that, Also includes: Create a first threshold number of physical volumes based on pre-configured storage space; The logical volume manager controls the metadata storage space of each physical volume to be configured with the pre-configured storage space, and the configured physical volumes are used as the metadata physical volumes.

3. The method according to claim 1 or 2, characterized in that, The number of physical volumes containing the metadata is at least three.

4. The method according to claim 1, characterized in that, Saving the target data according to the physical block storage address includes: Locate the target physical block corresponding to the physical block storage address within the pre-created metadata-free physical volume; Save the target data to the target physical block.

5. The method according to claim 1, characterized in that, Saving the storage information of the target data to the metadata physical volume created by the logical volume manager includes: Extract at least one of the following from the target data: file size information, file data block mapping table, file timestamp, directory entry information, and inode information, as metadata; Save the metadata to the metadata physical volume.

6. The method according to claim 1 or 5, characterized in that, Also includes: Create a second threshold number of physical volumes, and set the metadata storage space of the physical volumes to zero to create the metadata-free physical volumes.

7. The method according to claim 1, characterized in that, Also includes: For a target physical volume with metadata storage space, the logical volume manager is controlled to ignore or clear the metadata copy stored in the target physical volume.

8. A storage optimization device, characterized in that, The device includes: The logical address module is used to determine the logical block storage address of the target data based on the received data write request; The data storage module is used to determine the physical block storage address corresponding to the logical block storage address within the physical volume based on the logical volume manager, and to save the target data according to the physical block storage address; The metadata update module is used to save the storage information of the target data to the metadata physical volume created by the logical volume manager.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the storage optimization method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to perform the storage optimization method according to any one of claims 1-7.