CN116048382A - Logical volume access method, device, equipment and medium - Google Patents

Logical volume access method, device, equipment and medium Download PDF

Info

Publication number
CN116048382A
CN116048382A CN202211311578.XA CN202211311578A CN116048382A CN 116048382 A CN116048382 A CN 116048382A CN 202211311578 A CN202211311578 A CN 202211311578A CN 116048382 A CN116048382 A CN 116048382A
Authority
CN
China
Prior art keywords
logical volume
target logical
daemon
target
volume
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.)
Pending
Application number
CN202211311578.XA
Other languages
Chinese (zh)
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.)
China Telecom Digital Intelligence Technology Co Ltd
Original Assignee
China Telecom Digital Intelligence 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 China Telecom Digital Intelligence Technology Co Ltd filed Critical China Telecom Digital Intelligence Technology Co Ltd
Priority to CN202211311578.XA priority Critical patent/CN116048382A/en
Publication of CN116048382A publication Critical patent/CN116048382A/en
Pending legal-status Critical Current

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/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0665Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes
    • 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/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • 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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • 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

Abstract

The application relates to the field of cloud computing storage, and provides a logical volume access method, a device, equipment and a medium. A logical volume access method, applied to an application layer, comprising: invoking a target logical volume activation interface of the daemon; after the target logic activation interface returns, executing the target logic volume access task; the daemon's target logical volume deactivation interface is invoked. According to the method and the device, the activation and deactivation operation of the daemon encapsulation logic volume is carried out, so that the problem that the shared logic volume is safely accessed between the multiple tasks under the condition of concurrent multiple tasks of an application layer on a host is solved, errors and anomalies are not reported when the logic volume information is used between the concurrent tasks, and the concurrent operation task of the upper-layer multiple tasks is ensured to be carried out smoothly.

Description

Logical volume access method, device, equipment and medium
Technical Field
The present disclosure relates to the field of cloud computing storage, and in particular, to a method, an apparatus, a device, and a medium for accessing a logical volume.
Background
Physical Volumes (PVs) are truly Physical hard disks or partitions, and a Volume Group (VG) is formed by grouping together a plurality of Physical volumes. The physical volumes that make up the same volume group may be different partitions of the same hard disk, or may be different partitions on different hard disks. A volume group can be generally thought of as a logical hard disk. The Volume group may be a Logical hard disk that must be partitioned before it can be used, and this "partition" is commonly referred to as a Logical Volume (LV). Logical volumes may be formatted and data written.
In the prior art, clustered logical volumes are active and inactive: the activation is mainly used for acquiring the related attribute information of the logical volume, such as metadata, capacity, base and other information on the logical volume; the deactivation is performed after the use, the task is marked to be executed to be ended, no task is used, and the deactivation operation of the logic volume can be performed. Multiple application layer programs on the same host may have concurrent activation or deactivation operations, resulting in partial applications being misplaced while using the logical volume.
Disclosure of Invention
In view of this, the application provides a method, a device, equipment and a medium for accessing a logical volume, where the method for accessing a logical volume solves the problem that, in a scenario of concurrent multitasking of an application layer on a host, for activation and deactivation operations of the same logical volume, a logical volume shared by access between multitasking is implemented safely, so that when information of the logical volume is used between concurrent tasks, errors and anomalies are not reported any more, thereby ensuring that concurrent operation tasks of upper multitasking are performed smoothly.
In a typical scenario, for example, in a telecom cloud scenario, the concurrent use management of the LVM logical volumes of the virtualization platform improves the efficiency of the virtualization management, provides another new method for solving the problem of accessing the shared logical volumes by concurrent tasks, improves the efficiency of managing the virtualized storage logical volumes, and overcomes the problem of access error information of the logical volumes caused by the concurrent tasks.
Based on the above objects, an aspect of the present application provides a logical volume access method, applied to an application layer, including: invoking a target logical volume activation interface of the daemon; after the target logic activation interface returns, executing the target logic volume access task; the daemon's target logical volume deactivation interface is invoked.
Further, the daemon process is configured to receive a target logical volume activation request of an application layer, determine whether the target logical volume is activated by using a count lock of the target logical volume, if not, activate the target logical volume, and set a reference count of the target logical volume to be 1; if so, the reference count of the target logical volume is incremented by 1.
Further, the daemon is configured to receive a target logical volume deactivation request of an application layer, decrease a reference count of the target logical volume by 1, and determine whether the reference count of the target logical volume is 0, if yes, deactivate the target logical volume.
Further, the count lock is a globally unique memory lock, and/or a file lock.
Further, the application layer communicates with the daemon in a pipe or socket manner.
Further, the daemon responds to only one access request from the application layer at a time.
Further, the daemon process is provided with a log recording module and an error processing module, wherein the log recording module is used for recording a task execution log; the error processing module is used for jumping out of task execution.
Based on the same object, a second aspect of the present application further provides a logical volume access device, which is characterized by including: an application module and a daemon module;
the application module is configured to invoke a target logical volume activation interface of the daemon module,
after the target logic activation interface returns, the target logic volume access task is executed,
invoking a target logical volume deactivation interface of the daemon module;
the daemon module is configured to receive a target logical volume activation request of an application layer, judge whether the target logical volume is activated or not through a counting lock of the target logical volume, if not, activate the target logical volume, and set a reference count of the target logical volume to be 1; if yes, the reference count of the target logical volume is increased by 1, and or the reference count of the target logical volume is decreased by 1 when receiving a target logical volume deactivation request of an application layer, and whether the reference count of the target logical volume is 0 is judged, if yes, the target logical volume is deactivated.
Based on the same object, a third aspect of the present application further provides a computer device, including:
at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor performing the steps of the method described above.
For the same purpose, the fourth aspect of the present application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above method.
The application has at least the following beneficial effects: the application provides a method, a device, equipment and a medium for accessing a logical volume, which are applied to an application layer and comprise the following steps: invoking a target logical volume activation interface of the daemon; after the target logic activation interface returns, executing the target logic volume access task; invoking a target logical volume deactivation interface of a daemon, wherein the daemon is used for receiving a target logical volume activation request of an application layer, judging whether the target logical volume is activated or not through a count lock of the target logical volume, if not, activating the target logical volume, and setting a reference count of the target logical volume to be 1; if yes, the reference count of the target logical volume is increased by 1, the daemon is used for receiving a target logical volume deactivation request of an application layer, reducing the reference count of the target logical volume by 1, judging whether the reference count of the target logical volume is 0, and if yes, deactivating the target logical volume. The method can realize the upper application layer, perform concurrent multitasking operation and processing, greatly promote concurrency of upper application tasks, improve task processing efficiency, and solve error reporting scenes in the task execution process; the management efficiency of upper-layer applications such as virtualization and the like and the continuous stability of the service are improved, and the performance is obviously improved by storing the reference count in the memory.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other embodiments may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic diagram of an embodiment of a prior art logical volume access method;
FIG. 2 is a flow chart of a logical volume access method in some embodiments of the present application;
FIG. 3 is a schematic diagram of a logical volume access device in some embodiments of the present application;
FIG. 4 is a schematic diagram of an embodiment of a computer device in some embodiments of the present application;
fig. 5 is a schematic diagram of a computer-readable storage medium in some embodiments of the application.
Detailed Description
Embodiments of the present application are described below. However, it is to be understood that the disclosed embodiments are merely examples and that other embodiments may take various alternative forms.
In addition, it should be noted that, in the embodiments of the present application, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present application, and the subsequent embodiments are not described one by one. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
One or more embodiments of the present application will be described below with reference to the accompanying drawings.
FIG. 1 is a schematic diagram of an embodiment of a prior art logical volume access method.
As shown in fig. 1, when performing task a, it is first necessary to obtain access rights of a target logical volume, i.e., activate the target logical volume, and then perform an access operation. At this time, the task B also needs to obtain the access right of the target logical volume, and execute the access operation of the target logical volume. After the access operation of the task a to the target logical volume is finished, the target logical volume needs to be deactivated, and at this time, the access of the task B to the target logical volume is not finished yet, which may cause a system error or exception. In other cases, if task a and task B access the uniform resource of the target logical volume, the lack of a synchronization mechanism for accessing the resource may also cause a system error or exception.
In a typical scenario, for example, in a telecom cloud scenario, the concurrent use management of the LVM logical volumes of the virtualization platform improves the efficiency of the virtualization management, provides another new method for solving the problem of accessing the shared logical volumes by concurrent tasks, improves the efficiency of managing the virtualized storage logical volumes, and overcomes the problem of access error information of the logical volumes caused by the concurrent tasks.
In order to solve the problem that the same logical volume is activated and deactivated under the condition of concurrent multitasking of an application layer on a host, the shared logical volume is safely accessed between the multitasking, so that errors and anomalies are not reported when the information of the logical volume is used between the concurrent tasks, and the concurrent operation tasks of the upper-layer multitasking are ensured to be smoothly carried out.
Based on the above objects, in a first aspect of the embodiments of the present application, an embodiment of a logical volume access method is provided. FIG. 2 is a flow chart illustrating a method of logical volume access in some embodiments of the present application. As shown in fig. 2, a logical volume access method of the embodiment of the present application is applied to an application layer, and includes the following steps:
invoking a target logical volume activation interface of the daemon;
the daemon encapsulates operations such as activation and deactivation of the logical volume and is responsible for providing an API interface for command lines and application layer access, through which the application layer program notifies the daemon to perform specific activation and deactivation operations. In the embodiment of the present application, the application layer may have one or more daemons corresponding to the target logical volumes, and the implementation manner may be implemented in a program process manner or a system service manner, so that the meaning of "process" in the daemon in the present application is not limited to only a process understood in a narrow sense.
After the target logic activation interface returns, executing the target logic volume access task;
after the target logic activation interface returns, the application layer program obtains the access authority of the target logic volume, so that the target logic volume access task, such as reading, writing, deleting and the like, can be executed.
The daemon's target logical volume deactivation interface is invoked.
After the application layer program finishes the access of the target logical volume, the access right to the target logical volume is released by calling the target logical volume deactivation interface of the daemon. As previously described, the application layer programs are not unique, nor are the application programs accessing the target logical volume unique, and therefore, one application layer program may still be open to other application layer programs after invoking the deactivation function.
The daemon process is used for receiving a target logic volume activation request of an application layer, judging whether the target logic volume is activated or not through a counting lock of the target logic volume, if not, activating the target logic volume, and setting the reference count of the target logic volume to be 1; if so, the reference count of the target logical volume is incremented by 1.
The daemon process is used for receiving a target logical volume deactivation request of an application layer, reducing the reference count of the target logical volume by 1, judging whether the reference count of the target logical volume is 0, and if yes, deactivating the target logical volume.
The daemon provides actual activation and deactivation, access processing of use count is carried out through the memory lock of the single logical volume, and the actual activation and deactivation processing is carried out according to the count information;
the daemon process internally queries the lock corresponding to the logic volume, acquires the memory lock corresponding to the logic volume, uses a file or memory lock on the current host computer for synchronizing the access to the reference count of the logic volume, and acquires the lock corresponding to the logic volume before the access;
if the operation is the activation operation, judging whether the logic volume is activated, if not, activating the logic volume, and modifying the reference count in the memory to be 1. If the logic volume is activated, reading the memory reference count, adding 1, and modifying the data in the memory;
if the reverse activation operation is carried out, judging whether the logic volume is activated, if not, directly setting the reference count in the memory to be 0; if the reference count in the modified memory is reduced by 1, and if the reference count is reduced to 0 after the reference count is reduced by 1, performing actual deactivation processing;
and after the processing is finished, releasing the memory lock corresponding to the logic volume, and when the application layer executes the corresponding task, not holding the lock information of any logic volume.
The daemon stores the memory lock (lock) information corresponding to each logical volume, and the activation reference count information of each logical volume. For the activation or deactivation processing of the logic volume, firstly, obtaining a memory lock corresponding to the logic volume; and realizing the synchronous exclusive access to the reference count corresponding to the logical volume through the memory lock corresponding to the logical volume. And when the logical volume lock is acquired, modifying the reference count in the memory corresponding to the logical volume. And if the reference count attribute in the memory is not activated, activating the logic volume, and setting the memory reference count attribute corresponding to the logic volume to be 1. When in deactivation, the reference count used is reduced by 1, whether the use count is reduced to 0 is judged, if so, the actual deactivation operation is carried out, and otherwise, the deactivation operation is not carried out.
The application layer program of the application layer program comprises a volume group and a name of a logic volume when calling an activation or deactivation API interface, checking related information of the logic volume, transmitting the related information to a command line or the API interface, informing a daemon to carry out interface calling by the command line or the API interface, inquiring a lock corresponding to the logic volume by the daemon in response to a calling request from the application layer program, acquiring a memory lock corresponding to the logic volume by the daemon, and using a file or a memory lock on a current host for synchronizing access to the reference count of the logic volume, wherein the lock is tried to be acquired firstly; after Lock is obtained, whether the logic volume is activated is judged, if not, the logic volume is activated, and the reference count in the memory is modified to be 1. If the logical volume has been activated, the memory reference count is read and incremented by 1.
After the upper layer application program returns from the command line or the API call, the current operation task, such as the task of accessing the logical volume by the upper layer, such as accessing the logical volume, reading information, and the like, is executed.
The upper layer application program calls and releases the information processing of the logical volume, the daemon process is informed to carry out interface call through a command line or an API, the daemon process responds to a call request from the application layer program, the daemon process internally inquires lock corresponding to the logical volume, the memory lock corresponding to the logical volume is obtained, and on a current host, a file or a memory lock is used for synchronizing the access to the reference count of the logical volume, and the lock is firstly tried to be obtained; after Lock is obtained, performing inverse activation processing, judging whether the logic volume is activated, and if not, directly setting the reference count in the memory to be 0; if the reference count is activated, performing the de-activation processing, modifying the reference count in the memory to be reduced by 1, and if the reference count is reduced to 0, performing the actual de-activation processing.
The background daemon uniformly realizes the takeover processing of the logic volume, provides a single daemon, and can operate as a background service. The command line and the API communicate with the daemon in a socket or Pipe mode; accessing and modifying the reference count through the acquisition of the global unique logical volume memory Lock; the daemon completes the actual activation and deactivation process of the logical volume.
The application layer provides operational access to the logical volumes through command lines and APIs. For example, when accessing through a command line, a command line may be encapsulated, with different parameters completing the activation and deactivation processes, such as: LV_opt [ active, inactive ] vg_name/lv_name Mode, opt represents activating or reactivating alternative 1, vg_name or lv_name represents the name or identification ID of a volume group or a logical volume, mode represents activating authority, share or exclusive Mode can be selected, therefore, different application layer programs can access the logical volume simultaneously when accessing, or access the logical volume in exclusive Mode, and access conflict or abnormality of the same resource in the logical volume is avoided.
The daemon process realizes the logic volume management and synchronization algorithm in the memory in a reference counting mode, and preferentially acquires memory lock corresponding to a target logic volume, so that synchronous operation of a plurality of concurrent tasks on the logic volume is prevented; under the protection of a memory lock of the logic volume, judging the reference count corresponding to the logic volume; using the reference count determination, it is determined whether actual activation and deactivation operations are performed.
After the interface returns, the upper layer application program continues to execute respective tasks, and the design avoids the concurrent operation of the upper layer multitasking, thereby improving the processing performance and efficiency of the upper layer service.
Further, the count lock is a globally unique memory lock, and/or a file lock. The counting lock in the method can be a global unique memory lock, so that the access speed and the access efficiency of the counting lock can be improved relative to a mode of a file lock; the system can also be a file lock, so that the access count information of the target logical volume can be maintained under the condition of restarting the system; the memory lock and the file lock can be adopted simultaneously, and the counting information of the memory lock and the file lock can be synchronized in real time, so that the method has the advantages of high efficiency and persistence.
Daemon management of count locks and reference counts for logical volumes, map/dictionary: key and value are stored correspondingly, the Key value is constant, and the Key value is the identification id of the target logical volume; the value is a variable and is used for storing the reference count of the target logical volume; the map data structure is adopted so that the names or identification IDs of the logical volumes are in one-to-one correspondence, and the lock and reference count are used as values.
The data preservation of the logical volume and its memory lock may be stored via Map/dictionary, as well as the logical volume and reference count via Map/dictionary data structure.
Further, the application layer communicates with the daemon in a pipe or socket manner.
After the application layer calls the API and the command line, the application layer informs the daemon process through the RPC, and the daemon process is uniformly realized in one daemon process on the server host, and after the daemon process executes the activation or deactivation operation of the target logical volume, the application layer program is informed of the activation or deactivation result through the RPC.
Further, the daemon responds to only one access request from the application layer at a time. In this way, the access interface of the daemon can be avoided from being called in a queue manner between different programs of the application layer or between different threads of the same application program, so that errors or anomalies caused by interface call can be avoided.
Further, the daemon process is provided with a log recording module and an error processing module, wherein the log recording module is used for recording a task execution log; the error processing module is used for jumping out of task execution. The log recording module can record important information in the process of guarding and then carrying out count lock access or activation/deactivation, and meanwhile, the error processing module can process deadly exception or error in the process of auditing logs, jump out task execution, forcedly assign the count lock to 0 and close access to the target logical volume.
The application provides a new method for synchronizing the activation and the deactivation of a logic volume under a virtualization platform, so that the concurrency task of an upper-layer application can be improved on a large scale, the problem of error access of the logic volume caused by concurrency operation of the upper-layer application is avoided, and the efficiency of virtualization management and configuration is improved.
In the process of activation and deactivation, the existing processing model cannot ensure the concurrency of the use of the logical volume and ensure the safety of data. In the prior art, the Tag storage reference count of the logical volume is relied on, and IO actions exist, so that the technical scheme counting lock in the application can be realized in the memory, and the access speed is improved.
The method can realize the upper application layer, perform concurrent multitasking operation and processing, greatly promote concurrency of upper application tasks, improve task processing efficiency, and solve error reporting scenes in the task execution process; the management efficiency of upper-layer applications such as virtualization and the like and the continuous stability of the service are improved.
In a second aspect of the embodiments of the present application, a logical volume access device is provided. Fig. 3 is a schematic diagram illustrating one embodiment of a logical volume access device in some embodiments of the present application. As shown in fig. 3, a logical volume access device in some embodiments of the present application includes: an application module and a daemon module;
the application module is configured to call a target logical volume activation interface of the daemon module, execute the target logical volume access task after the target logical volume activation interface returns, and call a target logical volume deactivation interface of the daemon module;
the daemon module is configured to receive a target logical volume activation request of an application layer, judge whether the target logical volume is activated or not through a counting lock of the target logical volume, if not, activate the target logical volume, and set a reference count of the target logical volume to be 1; if yes, the reference count of the target logical volume is increased by 1, and or the reference count of the target logical volume is decreased by 1 when receiving a target logical volume deactivation request of an application layer, and whether the reference count of the target logical volume is 0 is judged, if yes, the target logical volume is deactivated.
For the same purpose, a third aspect of the embodiments of the present application proposes a computer device, and fig. 4 shows a schematic diagram of an embodiment of a computer device in some embodiments of the present application. As shown in fig. 4, an embodiment of a computer device in some embodiments of the present application includes the following modules: at least one processor 021; and a memory 022, the memory 022 storing computer instructions 023 executable on the processor 021, the computer instructions 023 implementing the steps of the method as described above when executed by the processor 021.
The present application also provides a computer-readable storage medium. Fig. 5 is a schematic diagram illustrating one embodiment of a computer-readable storage medium in some embodiments of the present application. As shown in fig. 5, the computer-readable storage medium 031 stores a computer program 032 which, when executed by a processor, performs the above method.
Finally, it should be noted that, as will be understood by those skilled in the art, implementing all or part of the above-described methods in the embodiments may be implemented by a computer program to instruct related hardware, and the program of the method for setting system parameters may be stored in a computer readable storage medium, where the program may include the flow of the embodiments of the methods described above when executed. The storage medium of the program may be a magnetic disk, an optical disk, a read-only memory (ROM), a random-access memory (RAM), or the like. The computer program embodiments described above may achieve the same or similar effects as any of the method embodiments described above.
Furthermore, the methods disclosed according to embodiments of the present application may also be implemented as a computer program executed by a processor, which may be stored in a computer readable storage medium. The above-described functions defined in the methods disclosed in the embodiments of the present application are performed when the computer program is executed by a processor.
Furthermore, the above-described method steps and system units may also be implemented using a controller and a computer-readable storage medium storing a computer program for causing the controller to implement the above-described steps or unit functions.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application's embodiments.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general purpose or special purpose computer or general purpose or special purpose processor. Further, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, D0L, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements disclosed in embodiments of the present application may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The foregoing embodiment numbers of the embodiments disclosed in the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present application, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the spirit of the embodiments of the present application, and many other variations of the different aspects of the embodiments of the present application as above exist, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, equivalents, improvements, and the like, which are within the spirit and principles of the embodiments of the present application, are intended to be included within the scope of the embodiments of the present application.

Claims (10)

1. A logical volume access method, applied to an application layer, comprising:
invoking a target logical volume activation interface of the daemon;
after the target logic activation interface returns, executing the target logic volume access task;
the daemon's target logical volume deactivation interface is invoked.
2. The method of claim 1, wherein the daemon process is configured to receive a target logical volume activation request of an application layer, determine whether the target logical volume is activated by using a count lock of the target logical volume, if not, activate the target logical volume, and set a reference count of the target logical volume to 1; if so, the reference count of the target logical volume is incremented by 1.
3. The method of claim 2, wherein the daemon is configured to receive a target logical volume deactivation request of an application layer, decrease a reference count of the target logical volume by 1, and determine whether the reference count of the target logical volume is 0, and if so, deactivate the target logical volume.
4. A method according to claim 3, wherein the count lock is a globally unique memory lock, and/or a file lock.
5. The method of claim 1, wherein the application layer communicates with the daemon by means of a pipe or socket.
6. The method of claim 5, wherein the daemon responds to only one access request from an application layer at a time.
7. A method according to claim 3, wherein the daemon has a logging module for logging task execution and an error handling module; the error processing module is used for jumping out of task execution.
8. A logical volume access device, comprising: an application module and a daemon module;
the application module is configured to invoke a target logical volume activation interface of the daemon module,
after the target logic activation interface returns, the target logic volume access task is executed,
invoking a target logical volume deactivation interface of the daemon module;
the daemon module is configured to receive a target logical volume activation request of an application layer, judge whether the target logical volume is activated or not through a counting lock of the target logical volume, if not, activate the target logical volume, and set a reference count of the target logical volume to be 1; if yes, the reference count of the target logical volume is increased by 1, and or the reference count of the target logical volume is decreased by 1 when receiving a target logical volume deactivation request of an application layer, and whether the reference count of the target logical volume is 0 is judged, if yes, the target logical volume is deactivated.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, which when executed by the processor, perform the steps of the method of any one of claims 1-7.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method of any one of claims 1-7.
CN202211311578.XA 2022-10-25 2022-10-25 Logical volume access method, device, equipment and medium Pending CN116048382A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211311578.XA CN116048382A (en) 2022-10-25 2022-10-25 Logical volume access method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211311578.XA CN116048382A (en) 2022-10-25 2022-10-25 Logical volume access method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN116048382A true CN116048382A (en) 2023-05-02

Family

ID=86116969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211311578.XA Pending CN116048382A (en) 2022-10-25 2022-10-25 Logical volume access method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116048382A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024051468A1 (en) * 2022-09-09 2024-03-14 中电信数智科技有限公司 New method for solving concurrent activation and deactivation of cluster logic volume

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024051468A1 (en) * 2022-09-09 2024-03-14 中电信数智科技有限公司 New method for solving concurrent activation and deactivation of cluster logic volume

Similar Documents

Publication Publication Date Title
CN103544319B (en) A kind of method of many tenants shared data bank and multi-tenant database i.e. service system
CN110865888B (en) Resource loading method and device, server and storage medium
US9542235B2 (en) Process-safe read/write locks
CA3137857A1 (en) Multi-language fusion query method and multi-model database system
US11288287B2 (en) Methods and apparatus to partition a database
US11811839B2 (en) Managed distribution of data stream contents
US20150112934A1 (en) Parallel scanners for log based replication
US20180039628A1 (en) System and method for providing dynamic relocation of tenants in a multi-tenant database environment
US10262024B1 (en) Providing consistent access to data objects transcending storage limitations in a non-relational data store
US9128962B2 (en) View based table replacement for applications
CN112905630A (en) Data manipulation method, server, and computer-readable medium
CN116048382A (en) Logical volume access method, device, equipment and medium
US20130311659A1 (en) Controlling access to a shared storage system
US11290540B2 (en) System and method for use of server-side connection pool tagging in a multi-tenant environment
WO2024051468A1 (en) New method for solving concurrent activation and deactivation of cluster logic volume
CN113051038A (en) Data access method and device under cloud service multi-tenant environment
US9135457B1 (en) System and method for recording and applying access privileges in a virtualized environment
US11080299B2 (en) Methods and apparatus to partition a database
CN112000971A (en) File permission recording method, system and related device
CN114003203B (en) Maintenance method, device and equipment for activity counting variable and readable medium
CN112905617B (en) Data writing method, server and computer readable storage medium
CN112487010B (en) Block chain user data table updating method, equipment and storage medium
US8103827B2 (en) Managing processing systems access to control blocks providing information on storage resources
CN111427519B (en) Distributed storage data migration method and device
US11635920B2 (en) Enabling multiple storage tiers in a hyperconverged infrastructure (HCI) cluster

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