Optical drive management method, device and equipment, medium and optical disk library system
By introducing optical drive management methods into the optical disk library, and dynamically allocating optical drives according to the frequency and duration of read and write operations, the problem of simple and insufficient flexibility in the existing optical disk library optical drive management mechanism is solved, and efficient utilization of optical disk library resources and improved user experience is achieved.
Patent Information
- Application Number
- CN202311407699.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2025-04-29
AI Technical Summary
The optical drive management mechanism of the existing CD library is relatively simple, lacks flexibility, and cannot adapt to the frequency and usage time of business operations such as reading and writing, which leads to inconvenience in use or waste of resources.
An optical drive management method is provided. By receiving an optical drive application request, it determines whether the number of optical drives used for reading operations in multiple optical drives exceeds a threshold. If it exceeds, the target optical drive will be allocated from multiple optical drives to ensure that the read operation is performed first, and the optical drive allocation strategy is adjusted by reserved an idle optical drive.
It realizes efficient utilization of optical drive resources of the CD library, ensures priority processing of reading services, improves the ease of use and user experience of the CD library, and avoids waste of resources.
Smart Images

Figure CN119905117A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to an optical drive management method, an optical drive management device, an optical disk library system, a computing device, and a computer-readable storage medium. Background Art
[0002] An optical disk library is a storage device that uses multiple optical disks to realize automatic data file backup and reading and writing. As a relatively inexpensive storage medium, optical disks are increasingly popular with government agencies, enterprises and institutions that have large file and data storage needs. In actual applications, optical disks are often required in large quantities, and the management and use of so many optical disks pose a challenge. Therefore, optical disk libraries that can automatically store and retrieve optical disks and read and write optical disks through optical drives have emerged. However, the optical drive management mechanism of existing optical disk libraries is relatively simple and lacks flexibility. It cannot adapt to the frequency and duration of various business operations such as reading and writing in actual applications, and it is also impossible to flexibly change the allocation mechanism and allocation strategy, resulting in inconvenience in use or waste of resources. Summary of the invention
[0003] To this end, the present application is dedicated to providing an optical drive management method, an optical drive management device, an optical disk library system, a computing device, and a computer-readable storage medium, which can adapt to the usage frequency and duration of read and write operations and flexibly formulate optical drive allocation strategies.
[0004] On the one hand, the present application provides an optical drive management method for managing multiple optical drives in an optical disk library, including: receiving a request for applying for an optical drive, the applied optical drive being used to perform a read operation or a write operation on an optical disk in the optical disk library; and allocating a target optical drive from the multiple optical drives under the condition that it is determined that the number of optical drives used for read operations among the multiple optical drives exceeds a first threshold, the target optical drive being used to perform a read operation or a write operation.
[0005] According to this aspect, before allocating optical drives, it is determined that there are a certain number of optical drives for read operations, which can ensure that read operations are executed preferentially, thereby adapting to actual application needs. In actual applications, read operation needs are often more urgent, but take less time, while write operation needs take longer time, but are not urgent. Based on this feature, when allocating optical drives, optical drives for read operations that are above a threshold can be given priority, so that read operation services can be processed as soon as possible, improving the usability and user experience of the optical disk library.
[0006] In a particular embodiment of the present application, the number of optical drives in a read state among the multiple optical drives is a first number; determining that the number of optical drives used for read operations among the multiple optical drives exceeds a first threshold includes: determining that the first number exceeds the first threshold; or when the first number does not exceed the first threshold, reserving a second number of optical drives from the optical drives in an idle state among the multiple optical drives, so that the sum of the first number and the second number exceeds the first threshold.
[0007] According to this embodiment, the optical drives used for the read operation include the optical drives currently performing the read operation and the optical drives prepared for the read operation, so that no matter whether there are optical drives currently performing the read operation, it is ensured that there are a certain number of optical drives available for the read operation. In this way, when the user applies for the read operation, there will always be an optical drive available, and by adjusting the first threshold, more or fewer optical drives can be prepared for the read operation according to the actual usage, so as to achieve full utilization of resources and meet the user's needs in a timely manner.
[0008] In a particular embodiment of the present application, the applied optical drive is used to perform a read operation on an optical disc in an optical disc library; under the condition that it is determined that the number of optical drives used for read operations among a plurality of optical drives exceeds a first threshold, a target optical drive is allocated from the plurality of optical drives, including: when a first number of optical drives in a read state among the plurality of optical drives exceeds a first threshold, one of the optical drives other than the optical drive in a read state among the plurality of optical drives is determined as the target optical drive.
[0009] According to this embodiment, when a user applies for an optical drive for a read operation, it can first be determined whether the number of optical drives currently performing a read operation exceeds a first threshold. If so, it means that there is no optical drive reserved for the read operation at this time, and an optical drive can be selected from the optical drives that are not currently performing a read operation for allocation. In this way, even if there are already many optical drives currently performing a read operation, other optical drives can continue to be allocated for the read operation, so as to ensure that more urgent read operations are executed first.
[0010] In a particular embodiment of the present application, before determining one of the optical drives other than the optical drive in the read state from the plurality of optical drives as the target optical drive, the method further includes: determining that the first number does not exceed the read operation limit ratio.
[0011] According to this embodiment, before allocating an optical drive for a read operation, it can be determined that the number of optical drives that are performing a read operation does not exceed a limit ratio. The limit ratio is set for the optical drives for read operations because the write operation requires a long time and a certain proportion of optical drives need to be used for write operations for a long time. If all optical drives are occupied by read operations, write operations cannot be performed, which will affect the availability of the entire optical disk library. Therefore, setting a read operation limit ratio can improve the user experience of the optical disk library and ensure that read and write operations are performed efficiently.
[0012] In a particular embodiment of the present application, the method further includes: when it is determined that the first number exceeds the read operation limit ratio, returning a response indicating a failure in allocating the optical drive.
[0013] According to this embodiment, after determining that the optical drives performing read operations exceed the read operation limit ratio, optical drives may not be allocated to read operations. The purpose is to ensure that a certain number of optical drives are available for write operations that take a long time, so that read and write operations are performed in a balanced manner.
[0014] In a particular embodiment of the present application, under the condition that it is determined that the number of optical drives used for read operations among a plurality of optical drives exceeds a first threshold, a target optical drive is allocated from a plurality of optical drives, and further includes: when the first number does not exceed the first threshold, an optical drive is allocated from an idle optical drive among the plurality of optical drives as the target optical drive.
[0015] According to this embodiment, when it is determined that the number of optical drives performing read operations does not exceed the first threshold, it can be known that there are optical drives reserved for read operations, and these optical drives reserved for read operations are in an idle state. Therefore, optical drives can be allocated from the idle optical drives for read operations, thereby achieving the purpose of reserving optical drives, that is, meeting the demand for read operations as promptly as possible and reducing the waiting time for read operations.
[0016] In a particular embodiment of the present application, one of the optical drives other than the optical drive in the read state from the multiple optical drives is determined as the target optical drive, including: if there is an optical drive in the idle state, selecting an optical drive from the optical drives in the idle state as the target optical drive.
[0017] According to this embodiment, when the number of optical drives that are performing read operations exceeds the first threshold, it means that there are no optical drives reserved for read operations. Therefore, if there are optical drives in an idle state at this time, optical drives can be allocated to read operations from the idle optical drives first. In this way, idle optical drives can be used as much as possible to meet user needs, avoiding waste of resources caused by idle optical drives.
[0018] In a particular embodiment of the present application, one of the optical drives other than an optical drive in a read state from among a plurality of optical drives is determined as a target optical drive, including: if there is no optical drive in an idle state and there is at least one optical drive in a write state, selecting a first optical drive from the at least one optical drive in a write state as the target optical drive.
[0019] According to this embodiment, when the number of optical drives that are performing read operations exceeds the first threshold, it means that there are no optical drives reserved for read operations at this time. Therefore, if there are no idle optical drives at this time, and all optical drives are either performing read operations or performing write operations, then optical drives that are performing write operations can be allocated for read operations. The advantage of this is that since the read operation takes a short time and the demand is urgent, after the write operation is interrupted for the read operation, the write operation can be continued during the idle time when the user does not use the optical disk library, so that the time characteristics of the read and write operations can be fully utilized, the optical drive status can be reasonably arranged, and long waiting time can be avoided.
[0020] In a particular embodiment of the present application, selecting a first optical drive as a target optical drive from at least one optical drive in a write state includes: pausing the write operation of the first optical drive, using the first optical drive as the target optical drive, and changing the first optical drive from a write state to a read state.
[0021] According to this embodiment, the optical drive that is performing a write operation is assigned to a read operation request, the write operation task can be suspended, and its working state can be changed, so that the working state of the optical drive can be efficiently converted and a read operation priority allocation strategy can be implemented.
[0022] In a particular embodiment of the present application, the applied optical drive is used to perform a write operation on an optical disc in an optical disc library; under the condition that it is determined that the number of optical drives used for read operations among a plurality of optical drives exceeds a first threshold, a target optical drive is allocated from the plurality of optical drives, including: when a first number of optical drives in a read state among the plurality of optical drives exceeds a first threshold, if there is an optical drive in an idle state among the plurality of optical drives, an optical drive is selected from the optical drives in the idle state as the target optical drive.
[0023] According to this embodiment, when a user applies for an optical drive for a write operation, it is still necessary to determine whether the optical drives currently performing a read operation exceed a certain number to ensure that the read operation is performed preferentially. If the number of optical drives currently performing a read operation exceeds a first threshold, it means that there are no optical drives reserved for the read operation. At this time, one optical drive in an idle state can be allocated for the write operation, so that the idle optical drives can be fully utilized to avoid resource waste caused by idle resources.
[0024] In a particular embodiment of the present application, under the condition that it is determined that the number of optical drives used for read operations among a plurality of optical drives exceeds a first threshold, a target optical drive is allocated from a plurality of optical drives, and the method further includes: when the first number does not exceed the first threshold, reserving a second number of optical drives from the optical drives in an idle state among the plurality of optical drives so that the sum of the first number and the second number exceeds the first threshold, and selecting an optical drive from the optical drives in an idle state except for the reserved second number of optical drives as the target optical drive.
[0025] According to this embodiment, when the number of optical drives performing read operations is less than the first threshold, it means that there are optical drives reserved for read operations. Although these optical drives are idle, they cannot be allocated to write operations due to the urgency of the read operation. Therefore, it is necessary to find an optical drive other than these reserved optical drives to allocate to the write operation. This can ensure the priority of the read operation and avoid the write operation from occupying too many resources.
[0026] On the other hand, the present application provides an optical drive management device for managing multiple optical drives in an optical disk library, including: a receiving module for receiving a request for applying for an optical drive, the applied optical drive being used to perform a read operation or a write operation on an optical disk in the optical disk library; an allocation module for allocating a target optical drive from the multiple optical drives under the condition that it is determined that the number of optical drives used for read operations among the multiple optical drives exceeds a first threshold, the target optical drive being used to perform a read operation or a write operation.
[0027] In a particular embodiment of the present application, the number of optical drives in a reading state among the multiple optical drives is a first number; the allocation module is further configured to: determine that the first number exceeds a first threshold; or when the first number does not exceed the first threshold, reserve a second number of optical drives from the optical drives in an idle state among the multiple optical drives, so that the sum of the first number and the second number exceeds the first threshold.
[0028] In a particular embodiment of the present application, the applied optical drive is used to perform a read operation on an optical disc in an optical disc library; the allocation module is further configured to: when a first number of optical drives in a read state among a plurality of optical drives exceeds a first threshold, determine one of the optical drives other than the optical drive in the read state from among the plurality of optical drives as a target optical drive.
[0029] In a particular embodiment of the present application, the device further includes: a determination module, configured to determine that the first quantity does not exceed a limit ratio of read operations.
[0030] In a particular embodiment of the present application, the device further includes: a return module, configured to return a response indicating a failure in allocating the optical drive when it is determined that the first number exceeds the read operation limit ratio.
[0031] In a particular embodiment of the present application, the allocation module is further configured to: when the first number does not exceed a first threshold, allocate an optical drive from the optical drives in an idle state among the multiple optical drives as the target optical drive.
[0032] In a particular embodiment of the present application, the allocation module is further configured to: if there is an optical drive in an idle state, select an optical drive from the optical drives in the idle state as the target optical drive.
[0033] In a particular embodiment of the present application, the allocation module is further configured to: if there is no optical drive in an idle state and there is at least one optical drive in a write state, select a first optical drive from the at least one optical drive in a write state as the target optical drive.
[0034] In a particular embodiment of the present application, the allocation module is further configured to: suspend the write operation of the first optical drive, use the first optical drive as the target optical drive, and change the first optical drive from a write state to a read state.
[0035] In a particular embodiment of the present application, the applied optical drive is used to perform a write operation on an optical disc in an optical disc library; the allocation module is further configured to: when a first number of optical drives in a read state among a plurality of optical drives exceeds a first threshold, if there is an optical drive in an idle state among the plurality of optical drives, then select an optical drive from the optical drives in the idle state as the target optical drive.
[0036] In a particular embodiment of the present application, the allocation module is further configured to: when the first number does not exceed the first threshold, reserve a second number of optical drives from the idle optical drives among the multiple optical drives so that the sum of the first number and the second number exceeds the first threshold, and select an optical drive from the idle optical drives except the reserved second number of optical drives as the target optical drive.
[0037] On the other hand, the present application provides an optical disc library system, including: an optical disc library; an optical drive management module for managing multiple optical drives in the optical disc library; the optical drive management module receives a request for applying for an optical drive, the applied optical drive is used to perform a read operation or a write operation on an optical disc in the optical disc library, and when it is determined that the number of optical drives used for read operations among the multiple optical drives exceeds a first threshold, a target optical drive is allocated from the multiple optical drives, and the target optical drive is used to perform a read operation or a write operation.
[0038] On the other hand, the present application provides a computing device, the computing device comprising a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the above optical drive management method.
[0039] On the other hand, the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and the computer program is used to execute the above-mentioned optical drive management method.
[0040] On the other hand, the present application provides a computer program product, including program code, which enables a computer to implement the above optical drive management method when the computer runs the computer program product.
[0041] Any of the optical drive management devices, optical disk library systems, computing devices, computer-readable storage media, and computer program products provided above are used to execute the optical drive management method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding schemes in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The specific implementation of the present application is described in detail below with reference to the accompanying drawings, wherein:
[0043] Figure 1 A schematic diagram showing an application scenario of an optical drive management method according to an embodiment of the present application;
[0044] Figure 2 A schematic diagram showing a flow chart of an optical drive management method according to an embodiment of the present application;
[0045] Figure 3 A schematic diagram showing a flow chart of an optical drive management method according to another embodiment of the present application;
[0046] Figure 4 A schematic diagram showing a flow chart of an optical drive management method according to another embodiment of the present application;
[0047] Figure 5 A schematic diagram showing the structure of an optical drive management device according to an embodiment of the present application is shown;
[0048] Figure 6 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] In order to make those skilled in the art understand the concept and idea of the present application more clearly, the present application is described in detail below in conjunction with specific embodiments. It should be understood that the embodiments provided herein are only a part of all embodiments that the present application may have. After reading the specification of the present application, those skilled in the art have the ability to make improvements, modifications or replacements to part or all of the following embodiments, and these improvements, modifications or replacements are also included in the scope of protection claimed in the present application.
[0050] In this document, the terms "one", "an" and other similar words are not intended to indicate that there is only one of the things described, but rather that the relevant description is only for one of the things described, and the things described may have one or more. In this document, the terms "comprises", "includes" and other similar words are intended to indicate logical relationships, and cannot be regarded as indicating spatial structural relationships. For example, "A includes B" is intended to indicate that B logically belongs to A, but does not mean that B is spatially located inside A. In addition, the meanings of the terms "comprises", "includes" and other similar words should be regarded as open, rather than closed. For example, "A includes B" is intended to indicate that B belongs to A, but B does not necessarily constitute the whole of A, and A may also include other elements such as C, D, and E.
[0051] In this document, the terms "first", "second" and other similar words are not intended to imply any order, quantity and importance, but are only used to distinguish different elements. In this document, the terms "embodiment", "present embodiment", "one embodiment" and "an embodiment" do not mean that the relevant description is only applicable to a specific embodiment, but that these descriptions may also be applicable to one or more other embodiments. It should be understood by those skilled in the art that in this document, any description made for a certain embodiment can be replaced, combined or otherwise combined with the relevant description in one or more other embodiments, and the new embodiment produced by the replacement, combination or other combination is easily conceivable by those skilled in the art and belongs to the scope of protection of this application.
[0052] In each embodiment of the present application, the optical disc library may refer to an optical disc reading and writing device with an automatic disc changing mechanism. For example, the optical disc library may be composed of an optical disc box for placing optical discs, an automatic disc changing mechanism (mechanical arm), and an optical drive. For example, as a high-tech professional equipment for scientific and intelligent management of optical discs, the optical disc library can be applied to the long-term safe storage, rapid access and query, professional archiving management, and intelligent offline management of massive information data. For example, the optical disc library can achieve long-term safe storage of data for the storage and management of a large amount of information data in various industries, because the medium used is an optical disc, which has the characteristics of being non-erasable, the data is not tampered with, and is not afraid of hacker or virus invasion, etc., which is particularly suitable for the safe storage of archival materials and important documents, and long-term backup; the optical disc library has a low cost of use, the storage medium is an optical disc, which is cheap, and the optical disc has no special requirements for the storage environment and occupies a small space; the optical disc library can achieve both long-term safe storage of information data and rapid retrieval and query of information data.
[0053] In each embodiment of the present application, optical drive is short for optical disc drive, which is a machine used to read and write the contents of an optical disc. For example, a carrier that carries data information is called an optical disc, and a device that reads or writes data to an optical disc is called an optical drive. For example, an optical drive is a product that combines optical, mechanical and electronic technologies; in terms of the combination of optics and electronics, the laser light source comes from a laser diode, which can generate a light beam with a certain wavelength. After processing, the light beam is more concentrated and can be precisely controlled. The light beam first hits the optical disc, and then is reflected back by the optical disc, and the signal is captured by a light detector; there are two states on the optical disc, namely pits and blanks, and their reflected signals are opposite, which can be easily identified by a light detector. Optical drives can be divided into types such as CD drives, DVD drives, Blu-ray drives and burners.
[0054] In some technologies in the field, a fixed optical drive is set for reading and writing during installation and deployment. The problem is that in actual usage scenarios (such as Blu-ray storage scenarios), the write operation takes longer time than the read operation, which causes the optical drive used for write operations to be used more frequently than the read operation, and the read operation optical drive resources cannot be effectively utilized.
[0055] In other technologies in the field, a fixed number of optical drives (for example, 6) are set as a group, and each group is used for read or write operations as a whole. The problem is that in actual use, read and write scenarios usually only require a small number of optical drive resources, for example, only one optical drive is needed. If 6 optical drives are used as a group for reading or writing as a whole, it will cause a waste of optical drive resources and a low overall optical drive utilization rate.
[0056] Some embodiments of the present application are aimed at solving the above-mentioned problems, ensuring that read and write operations fully utilize optical drive resources while giving priority to read services, improving optical drive utilization by dynamically allocating optical drives, and ensuring that read services are given priority, thereby improving read and write efficiency.
[0057] Figure 1 A schematic diagram of an application scenario of an optical drive management method according to an embodiment of the present application is shown.
[0058] like Figure 1 As shown, when the user 110 requests to perform a read operation or a write operation on the optical disc 132 in the optical disc library 130, so as to read data from the optical disc 132 or store data in the optical disc 132, the optical drive management module 120 can directly or indirectly receive the user request, and formulate a corresponding optical drive 131 allocation strategy according to the usage of the optical drive 131 at this time. The optical disc library 130 receives the allocation strategy of the optical drive management device 120 and executes the strategy, that is, determines which optical drives 131 can perform which operations on which optical discs 132. In general, if the usage of the optical drive 131 at this time allows the execution of the corresponding request of the user, a successful application response can be fed back, otherwise a failed application response can be fed back.
[0059] In this embodiment, the optical drive management device 120 may refer to a device for managing the application and allocation of the optical drive 131, which pre-stores certain computer programs, which specify under what circumstances the optical drive 131 can be allocated for reading or writing operations, and under what circumstances it cannot be allocated. In addition to allocating the optical drive 131, the optical drive management device 120 can also receive information from the optical drive 131 and the optical disc 132 in real time, determine which optical drives 131 are being used to read and write which optical discs 132, and which optical drives 131 and optical discs 132 are idle, thereby providing a judgment basis for the formulation of a strategy for allocating optical drives 131 for reading and writing optical discs 132. The functions of the optical drive management device 120 can be implemented by a management device independent of the optical disc library 130 (set outside the optical disc library 130), or by a management control device of the optical disc library 130 itself. In this embodiment, the optical drive management device 120 can have a variety of settings. It can be independently set outside the optical disk library 130, or it can be set in the optical disk library 130 as a part of the optical disk library 130, for example, it can be set in the management control module of the optical disk library 130. In addition, the optical drive management device 120 can be divided into a part set outside the optical disk library 130 and a part set in the optical disk library 130. In this case, there can be multiple optical disk libraries 130, forming an optical disk library system 101 composed of an operation and maintenance management module and multiple optical disk libraries 130. In such an optical disk library system 101, a part of the optical drive management device 120 can be set in an operation and maintenance management module independent of the multiple optical disk libraries 130, and the other part can be set in the management control module of each optical disk library 132. Other settings of the optical drive management device 120 are also conceivable.
[0060] In this embodiment, the optical disk library 130 may have multiple optical drives 131 and multiple optical disks 132, wherein the number of optical disks 132 may be much larger than the number of optical drives 131. Most of the optical disks 132 in the optical disk library 130 are usually stored in the optical disk tray, which is only used for storing, archiving or backing up data, and is not used for any operation. In some cases, it is necessary to read the optical disk 132, and one or more optical drives 131 can be determined from the multiple optical drives 131 to perform the read operation on the corresponding optical disk 132. In other cases, it is necessary to write the optical disk 132, and one or more optical drives 131 can be determined from the multiple optical drives 131 to perform the write operation on the corresponding optical disk 132. Reading operations and writing operations have different time and frequency characteristics in actual applications. Specifically, due to the characteristics of the optical disk 132, the speed of writing data is slow, for example, it takes tens of minutes to several hours to write a full optical disk 132, while the speed of reading data from the optical disk 132 is fast. On the other hand, when the user 110 needs to read the optical disc 132, it is usually necessary to immediately obtain the data stored in the optical disc 132 for the corresponding work, but when the user 110 needs to write data to the optical disc 132, it is only necessary to back up the data in the computer or other devices in the optical disc 132, and it is not necessary to write it immediately. Based on such characteristics, giving priority to the read operation and ensuring that there are a certain number of optical drives 131 used for the read operation can adapt to the different usage frequencies and usage durations of the read and write operations, and reasonably allocating the optical drive resources to avoid waste.
[0061] In this embodiment, the optical drive management device 120 and the optical disk library 130 can constitute an optical disk library system 101. In such an optical disk library system 101, the optical drive management device 120 is used as a part of the system to manage the optical drives 131 and optical disks 132 in the optical disk library 130, formulate a suitable allocation strategy for the optical drive 131 for performing corresponding read and write operations on the optical disk 132, and interact with the user 110, such as receiving the request of the user 110, and feeding back the allocation result of the optical drive 131. In the optical disk library system 101, there can be one or more optical disk libraries 130; accordingly, there can also be one or more optical drive management devices 120. For example, the optical drive management device 120 can be uniformly set in an independent module to manage multiple optical disk libraries 130 at the same time; or it can be separately set in each optical disk library 130, as a part of the management control unit of each optical disk library 130, to manage the corresponding optical disk library 130 separately.
[0062] Figure 2 A schematic diagram showing a flow chart of an optical drive management method according to an embodiment of the present application is shown.
[0063] According to this embodiment, the optical drive management method is used to manage multiple optical drives in an optical disk library, and includes steps S210 to S220. Each step is described in detail below.
[0064] S210: Receive a request for applying for an optical drive, where the applied optical drive is used to perform a read operation or a write operation on an optical disc in an optical disc library.
[0065] In this embodiment, the request for applying for an optical drive may refer to a request for reading data on an optical disc or writing data on an optical disc issued by a user through an operation interface. The request for applying for an optical drive may include a read / write request for a specific optical disc or optical drive, or may not include specific optical disc or optical drive information, and may only involve a read / write request for corresponding data. The request for applying for an optical drive may be transmitted to the optical drive management device through various interfaces, such as through the operation interface of an optical disc library, or through the operation interface of an electronic device connected to the optical disc library. Other forms of requests for applying for an optical drive are also conceivable.
[0066] In this embodiment, performing a read operation on an optical disc may refer to placing the optical disc in an optical drive and reading the data stored on the optical disc; performing a write operation on an optical disc may refer to placing the optical disc in an optical drive or a burner and burning the data on the optical disc. In this embodiment, the optical drive has the function of reading and writing the optical disc at the same time, that is, the optical drive in this application has the function of both burning data on the optical disc and reading the data burned on the optical disc. In some embodiments, the optical drive or part of the optical drive may have only one of the reading and writing functions. An optical drive with only a reading function and an optical drive with only a writing function can be used as a group of optical drives, and such a group of optical drives can also be applicable to the optical drive allocation method provided in this application.
[0067] S220: Under the condition that it is determined that the number of optical drives used for read operations among the multiple optical drives exceeds a first threshold, a target optical drive is allocated from the multiple optical drives, and the target optical drive is used to perform a read operation or a write operation.
[0068] In this embodiment, the optical drive used for the read operation may refer to an optical drive that can be used for the read operation. In some embodiments, the optical drive that can be used for the read operation includes an optical drive that is currently being used for the read operation and an optical drive that can be used for the read operation later (i.e., an optical drive reserved for the read operation). The number of optical drives used for the read operation may include the number of optical drives that are currently being used for the read operation and the number of optical drives reserved for the read operation.
[0069] In this embodiment, the first threshold is the minimum threshold of the number of optical drives used for read operations. The purpose of setting the first threshold is to ensure that there are enough optical drives available for read operations and that they are not occupied by write operations. Since write operations take a long time, if the first threshold is not set, all optical drives will gradually be assigned to write drives. When a user needs to read data, no optical drive can be used for read operations, or a period of time must be waited before a read operation can be performed, which is not conducive to the user's experience. Therefore, ensuring that a certain number of optical drives are being used or prepared for read operations can ensure that read operation requirements are met first and improve operational efficiency. In some embodiments, the first threshold may be between 1 and 3. In some embodiments, the first threshold may be 1.
[0070] In this embodiment, the target optical drive may refer to an optical drive that meets the current needs of the user. If the current need of the user is to perform a read operation, the target optical drive is an optical drive that meets the read operation needs; if the current need of the user is to perform a write operation, the target optical drive is an optical drive that is used for write operations. If not specifically limited, the target optical drive may be one optical drive, may be multiple optical drives, or may be a group of optical drives.
[0071] As an example, the number of optical drives in a read state among the multiple optical drives is a first number. In order to determine that the number of optical drives used for read operations among the multiple optical drives exceeds a first threshold, it may be determined that the first number exceeds the first threshold, or when the first number does not exceed the first threshold, a second number of optical drives may be reserved from the optical drives in an idle state among the multiple optical drives, so that the sum of the first number and the second number exceeds the first threshold.
[0072] In this example, an optical drive in a read state may refer to an optical drive that is performing a read operation. An optical drive in an idle state may refer to an optical drive that is currently in an idle state and is neither used for a read operation nor for a write operation. In some embodiments, an optical drive in an idle state includes an optical drive that is reserved for a read operation or a write operation, even if no optical disc is currently being read or written therein. In this embodiment, an optical drive may be in a read state, a write state, or an idle state, to respectively represent an optical drive that is performing a read operation, an optical drive that is performing a write operation, and an optical drive that is in an idle state and is not performing any operation.
[0073] In this example, the first number may refer to the number of optical drives that are performing read operations (i.e., in a read state) among all the optical drives in the optical disk library, and the second number may refer to the number of optical drives that are reserved for read operations (i.e., in an idle state) among all the optical drives in the optical disk library. The second number of optical drives are not performing read operations or write operations at this time, but because they are reserved for read operations, if an application for a write operation is received, they cannot be allocated to a write operation, but can only be allocated to a read operation. The first number plus the second number equals the number of optical drives used for read operations. As described above, the optical drives used for read operations include optical drives that are in a read state and optical drives that are not in a read state but are reserved for read operations, and the sum of the two constitutes the number of optical drives used for read operations.
[0074] Figure 3 A schematic diagram showing a flow chart of an optical drive management method according to an embodiment of the present application is shown.
[0075] According to this embodiment, the optical drive management method is used to manage multiple optical drives in an optical disk library, including steps S310 to S332, and each step is described in detail below.
[0076] S310: Receive a request for applying for an optical drive, where the applied optical drive is used to perform a read operation on an optical disc in an optical disc library.
[0077] In this embodiment, applying for an optical drive to perform a read operation may refer to a user initiating a read operation request, and the optical drive management device sending a request to apply for the optical drive based on the user's read operation request, and checking the operating conditions of multiple optical drives in the optical disk library for allocation; it may also refer to a user initiating a read operation request for a specific optical drive, and the optical drive management device directly determining whether the corresponding optical drive can be used for a read operation; other forms of read operation requests are also conceivable.
[0078] S320: Determine that a first number of optical drives in a read state among the plurality of optical drives does not exceed a read operation limit ratio.
[0079] In this embodiment, the read operation limit ratio may refer to the maximum ratio of the number of optical drives used to limit the read operation to the number of all optical drives. The purpose of setting the read operation limit ratio is that since the actual time occupied by the write operation is relatively large, it is necessary to ensure that a part of the optical drives are performing the write operation. Otherwise, if there is no limit on the ratio of the read operation, it is very likely that all optical drives will be allocated to the read operation, and the write operation will not be performed for a long time, resulting in the failure to complete the backup and archiving of the file in time. In some embodiments, the read operation limit ratio may be between 70% and 90%. In some embodiments, the read operation limit ratio may be, for example, 80%.
[0080] As an example, when it is determined that the first number exceeds the read operation limit ratio, a response indicating a failure in allocating the optical drive is returned.
[0081] In this example, if the number of optical drives that are performing a read operation (in a read state) exceeds the read operation limit ratio, that is, exceeds the maximum ratio of the number of optical drives that can be allocated to the read operation, then the request to apply for an optical drive for the read operation will not be satisfied because the remaining optical drives must be guaranteed to be available for the write operation. At this time, the optical drive management device can feedback to the user a response that the allocation of the optical drive failed.
[0082] In this example, the response for indicating the failure of allocating the optical drive may be to prompt the user that the optical drive cannot be allocated at present; or to prompt the user to enter a waiting state and inform the user of the waiting time; or to prompt the user that the current resources cannot meet the user's needs and inform the user that other (remote or backup) resources can be used to perform corresponding operations. Other types of responses are also conceivable and will not be described in detail here.
[0083] S331: When the first number exceeds a first threshold, determine one of the optical drives except the optical drive in the read state from among the multiple optical drives as a target optical drive, and the target optical drive is used to perform the read operation.
[0084] In this embodiment, after determining that the number of optical drives in the read state (i.e., the first number) does not exceed the read operation limit ratio, it is further necessary to determine whether the first number exceeds the first threshold value. If it exceeds the first threshold value, it can be determined that there are no second number of optical drives reserved for the read operation, and an optical drive can only be selected from optical drives other than the optical drives in the read state (which may include optical drives in the idle state and optical drives in the write state) to meet the read operation requested by the user.
[0085] As an example, determining one of the optical drives other than the optical drive in the read state from the multiple optical drives as the target optical drive can be divided into two cases: if there is an optical drive in the idle state, then an optical drive is selected from the optical drives in the idle state as the target optical drive; if there is no optical drive in the idle state and there is at least one optical drive in the write state, then the first optical drive is selected from the at least one optical drive in the write state as the target optical drive.
[0086] In this example, the optical drive other than the optical drive in the read state may be an optical drive in the idle state or an optical drive in the write state. At this time, if there is an optical drive in the idle state, and the number of optical drives in the read state does not exceed the read operation limit ratio at this time, it means that the optical drive can continue to be allocated from the idle optical drives for the read operation. If there is an idle optical drive at this time, but the optical drive in the read state has exceeded the read operation limit ratio, the corresponding allocation failure should be fed back, and the optical drive is not allocated to the read operation. On the other hand, if there is no optical drive in the idle state at this time, only an optical drive in the write state exists, and the number of optical drives in the read state does not exceed the read operation limit ratio at this time, it means that the optical drive can be allocated from the optical drive in the write operation for the read operation. This is because the read operation is more urgent than the write operation. If the user needs to read the data in the optical disc at this time, it means that the write operation can be interrupted to free up the optical drive for the read operation. The write operation is generally not so urgent, and the write operation can be continued after the user has finished using the optical drive. Such an arrangement takes into account the respective characteristics of the read and write operations and improves the user experience.
[0087] As an example, in order to select a first optical drive as a target optical drive from at least one optical drive in a write state, the write operation of the first optical drive may be suspended, the first optical drive may be used as a target optical drive, and the first optical drive may be changed from a write state to a read state.
[0088] In this example, to convert an optical drive that is currently performing a write operation into an optical drive for a read operation, it is necessary to suspend the write operation of the optical drive, eject the optical disc to be written, assign the optical drive to the read operation, insert the optical disc for the read operation, and start the operation of reading data from the optical disc. In some embodiments, after the current read operation task is completed, the first optical drive can be converted back into an optical drive for a write operation, and the optical disc previously removed for a write operation can be put back into the first optical drive to continue the previous write operation.
[0089] S332: When the first number does not exceed a first threshold, allocate an optical drive from the optical drives in an idle state among the multiple optical drives as a target optical drive.
[0090] In this embodiment, after determining that the number of optical drives in the read state (i.e., the first number) does not exceed the read operation limit ratio, it is further necessary to determine whether the first number exceeds the first threshold. If it does not exceed the first threshold, it means that the sum of the first number and the second number (the number of optical drives reserved for the read operation) exceeds the first threshold, and at this time there must be a second number of idle optical drives, so an optical drive can be selected from these idle optical drives to meet the read operation requested by the user.
[0091] Figure 4 A schematic diagram showing a flow chart of an optical drive management method according to an embodiment of the present application is shown.
[0092] According to this embodiment, the optical drive management method is used to manage multiple optical drives in an optical disk library, including steps S410 to S422. Each step is described in detail below.
[0093] S410: Receive a request for applying for an optical drive, where the applied optical drive is used to perform a write operation on an optical disc in an optical disc library.
[0094] In this embodiment, applying for an optical drive to perform a write operation may refer to a user initiating a write operation request, and the optical drive management device sending a request to apply for the optical drive based on the user's write operation request, and checking the operating conditions of multiple optical drives in the optical disk library for allocation; it may also refer to a user initiating a write operation request for a specific optical drive, and the optical drive management device directly determining whether the corresponding optical drive can be used for the write operation; other forms of write operation requests are also conceivable.
[0095] S421. When a first number of optical drives in a read state among the multiple optical drives exceeds a first threshold, if there is an optical drive in an idle state among the multiple optical drives, select an optical drive from the optical drives in the idle state as a target optical drive, and the target optical drive is used to perform a write operation.
[0096] In this embodiment, if the first number of optical drives in the read state exceeds the first threshold, it means that there is no idle optical drive reserved for the read operation at this time, and the remaining optical drives are either in the idle state or in the write state. If there is an optical drive in the idle state at this time, an optical drive can be allocated to the write operation from these idle optical drives. If there is no optical drive in the idle state at this time, it means that the current write operation request cannot be satisfied, and the optical drive that is currently performing the read operation or the write operation can only be allocated after the task is completed.
[0097] S422. When the first number does not exceed the first threshold, reserve a second number of optical drives from the idle optical drives among the plurality of optical drives so that the sum of the first number and the second number exceeds the first threshold, and select one optical drive from the idle optical drives except the reserved second number of optical drives as the target optical drive.
[0098] In this embodiment, if the first number of optical drives in the read state does not exceed the first threshold, and the sum of the first number and the second number exceeds the first threshold, it means that there is at least one optical drive reserved for the read operation. Since these optical drives have been reserved for the read operation, they cannot be allocated to the write operation even if they are currently in the idle state. This is determined by the allocation mechanism that prioritizes the read operation. In this embodiment, the write operation can only be applied to the idle optical drives other than the second number of optical drives reserved for the read operation. If there are other idle optical drives in the idle optical drives other than the second number of optical drives reserved for the read operation, these idle optical drives can be allocated to the write operation; if there are no other idle optical drives, the request for the write operation cannot be satisfied, and a response of failure to allocate the optical drive is given, and the operation is executed again after the current operation is completed.
[0099] Based on the aforementioned Figure 2 The method embodiment described above, the present application embodiment also provides an optical drive management device, the structural diagram of which is as follows Figure 5 The device is used to perform the above Figure 2 The various steps in .
[0100] According to this embodiment, the optical drive management device 500 is used to manage multiple optical drives in the optical disk library, and includes a receiving module 510 and an allocation module 520. The receiving module 510 is used to receive a request for applying for an optical drive, and the applied optical drive is used to perform a read operation or a write operation on an optical disk in the optical disk library. The allocation module 520 is used to allocate a target optical drive from the multiple optical drives under the condition that the number of optical drives used for the read operation among the multiple optical drives exceeds a first threshold, and the target optical drive is used to perform the read operation or the write operation.
[0101] It should be noted that Figure 5 The optical drive management device 500 provided in the embodiment shown in the figure only uses the division of the above-mentioned functional modules as an example when executing the method. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Figure 2 The optical drive management method embodiments shown belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0102] Figure 6 It is a schematic diagram of the hardware structure of a computing device 600 provided in an embodiment of the present application.
[0103] See also Figure 6The computing device 600 includes a processor 610, a memory 620, a communication interface 630, and a bus 640, wherein the processor 610, the memory 620, and the communication interface 630 are connected to each other via the bus 640. The processor 610, the memory 620, and the communication interface 630 may also be connected in other connection modes besides the bus 640.
[0104] Among them, the memory 620 can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, hard disk, etc.
[0105] The processor 610 may be a general-purpose processor, which may be a processor that performs specific steps and / or operations by reading and executing the contents stored in a memory (e.g., the memory 620). For example, the general-purpose processor may be a central processing unit (CPU). The processor 610 may include at least one circuit to perform Figure 2 The illustrated embodiment provides all or part of the steps of the optical drive management method.
[0106] Among them, the communication interface 630 includes input / output (I / O) interfaces, physical interfaces, and logical interfaces for interconnecting devices within the computing device 600, as well as interfaces for interconnecting the computing device 600 with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc. The communication interface 630 can be connected to an external input device and an output device. For example, the input device can be a microphone or a microphone array for capturing voice input signals; it can be a communication network connector for receiving collected input signals from the cloud or other devices; it can also include, for example, a keyboard, a mouse, etc. The output device can output various information to the outside, including determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.
[0107] The bus 640 may be any type of communication bus for interconnecting the processor 610 , the memory 620 , and the communication interface 630 , such as a system bus.
[0108] The above devices may be arranged on independent chips, or at least partially or completely on the same chip. Whether to arrange each device independently on different chips or to integrate them on one or more chips often depends on the needs of product design. The embodiments of the present application do not limit the specific implementation form of the above devices.
[0109] Figure 6 The computing device 600 shown is merely exemplary. During implementation, the computing device 600 may further include other components, which are not listed one by one herein.
[0110] An embodiment of the present application may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps of the optical drive management method according to various embodiments of the present application described above in this specification.
[0111] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0112] The concepts, principles and ideas of the present application are described in detail above in conjunction with specific implementation methods (including embodiments and examples). Those skilled in the art should understand that the implementation methods of the present application are more than the several forms given above. After reading the application documents, those skilled in the art can make any possible improvements, replacements and equivalent forms to the steps, methods, devices and components in the above-mentioned implementation methods, and these improvements, replacements and equivalent forms should be deemed to fall within the scope of the present application. The scope of protection of the present application shall be subject only to the claims.
Claims
1. A method for managing optical drives, for managing multiple optical drives in an optical disk library, characterized in that: The method comprises: receiving a request for applying for an optical drive, wherein the optical drive applied for is used to perform a read operation or a write operation on an optical disc in the optical disc library; Under the condition that it is determined that the number of optical drives used for the read operation among the multiple optical drives exceeds a first threshold, a target optical drive is allocated from the multiple optical drives, and the target optical drive is used to perform the read operation or the write operation.
2. The method according to claim 1, characterized in that: The number of the optical drives in the read state among the multiple optical drives is a first number; and determining that the number of the optical drives used for read operations among the multiple optical drives exceeds a first threshold includes: determining that the first number exceeds the first threshold; or When the first number does not exceed the first threshold, a second number of optical drives is reserved from the idle optical drives among the plurality of optical drives, so that the sum of the first number and the second number exceeds the first threshold.
3. The method according to claim 1 or 2, characterized in that: The optical drive of the application is used to perform a read operation on an optical disc in the optical disc library; the method of allocating a target optical disc drive from the multiple optical disc drives under the condition that the number of optical disc drives used for the read operation among the multiple optical disc drives exceeds a first threshold value comprises: In a case where a first number of optical drives in a read state among the plurality of optical drives exceeds the first threshold, one of the optical drives other than the optical drive in a read state among the plurality of optical drives is determined as the target optical drive.
4. The method according to claim 3, characterized in that: Before determining one of the optical drives other than the optical drive in the read state from among the plurality of optical drives as the target optical drive, the method further comprises: It is determined that the first number does not exceed the read operation limit ratio.
5. The method according to claim 4, characterized in that The method further comprises: In the case where it is determined that the first number exceeds the read operation limit ratio, a response indicating a failure in allocating the optical drive is returned.
6. The method according to claim 3, characterized in that: The allocating a target optical drive from the plurality of optical drives under the condition that the number of optical drives used for read operations among the plurality of optical drives exceeds a first threshold value further includes: When the first number does not exceed the first threshold, an optical drive is allocated from the optical drives in the idle state among the multiple optical drives as the target optical drive.
7. The method according to claim 3, characterized in that The step of determining one of the optical drives except the optical drive in the read state from the plurality of optical drives as the target optical drive comprises: If there are optical drives in an idle state, an optical drive is selected from the optical drives in the idle state as the target optical drive.
8. The method according to claim 3, characterized in that The step of determining one of the optical drives except the optical drive in the read state from the plurality of optical drives as the target optical drive comprises: If there is no optical drive in the idle state and there is at least one optical drive in the write state, a first optical drive is selected from the at least one optical drive in the write state as the target optical drive.
9. The method according to claim 8, characterized in that The step of selecting a first optical drive from the at least one optical drive in a write state as the target optical drive comprises: The write operation of the first optical drive is suspended, the first optical drive is used as the target optical drive, and the first optical drive is changed from a write state to a read state.
10. The method according to claim 1 or 2, characterized in that: The optical drive of the application is used to perform a write operation on an optical disc in the optical disc library; the method of allocating a target optical disc drive from the multiple optical disc drives under the condition that the number of optical disc drives used for read operations among the multiple optical disc drives exceeds a first threshold value comprises: When a first number of optical drives in a read state among the multiple optical drives exceeds the first threshold, if there is an optical drive in an idle state among the multiple optical drives, an optical drive is selected from the optical drives in the idle state as the target optical drive.
11. The method according to claim 10, characterized in that The allocating a target optical drive from the plurality of optical drives under the condition that the number of optical drives used for read operations among the plurality of optical drives exceeds a first threshold value further includes: When the first number does not exceed the first threshold, a second number of optical drives are reserved from the idle optical drives among the multiple optical drives, so that the sum of the first number and the second number exceeds the first threshold, and an optical drive is selected from the idle optical drives except the second number of optical drives reserved as the target optical drive.
12. An optical drive management device for managing multiple optical drives in an optical disk library, characterized in that: The device comprises: A receiving module, used for receiving a request for applying for an optical drive, wherein the optical drive applied for is used for performing a read operation or a write operation on an optical disc in the optical disc library; The allocation module is used to allocate a target optical drive from the multiple optical drives when it is determined that the number of optical drives used for the read operation among the multiple optical drives exceeds a first threshold, wherein the target optical drive is used to perform the read operation or the write operation.
13. An optical disk library system, characterized in that: The system comprises: CD library; An optical drive management module for managing multiple optical drives of the optical disk library; The optical drive management module receives a request for applying for an optical drive, and the applied optical drive is used to perform a read operation or a write operation on an optical disc in the optical disc library. Under the condition of determining that the number of optical drives used for read operations among the multiple optical drives exceeds a first threshold, a target optical drive is allocated from the multiple optical drives, and the target optical drive is used to perform the read operation or the write operation.
14. A computing device, characterized in that The computing device comprises a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the optical drive management method according to any one of claims 1 to 11.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to execute the optical drive management method according to any one of claims 1 to 11.