Storage system and method
By adopting a combined architecture of a pure write optical drive and a read-write hybrid optical drive in the optical disk storage system, it is possible to shorten the waiting time for read operations without affecting data writing performance, and improve the efficiency and cost-effectiveness of the storage system.
Patent Information
- Application Number
- CN202310266936.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2024-09-10
AI Technical Summary
The waiting time for read operations in optical disk storage systems is long because the optical drive needs to fill the entire optical disk with data before it can perform a read operation, which affects data access efficiency.
Adopting a multi-optical drive architecture, one part of the optical drive (pure write optical drive) is used to write data once, and the other part of the optical drive (read-write hybrid optical drive) writes data in segments and performs read operations immediately after the segmented writing is completed. , the controller schedules the read and write optical drive according to the read request to shorten the waiting time.
This effectively shortens the waiting time for reading data from the optical disk, improves the read and write performance of the storage system, and reduces deployment costs.
Smart Images

Figure CN118629438A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computing technology, and in particular to a storage system and method. Background Art
[0002] Optical disk arrays have the advantage of low cost when storing data, and optical disk storage technology is widely used in cold storage fields such as archiving. However, with the development of big data technology (especially data mining technology) in recent years, cold data stored in optical disks may also be accessed, and the possibility of access will gradually increase.
[0003] However, in optical disc storage technology, the optical drive needs to write data to the entire optical disc before it can be released. For example, when the controller receives a read request, if it determines that the optical drive is writing data to the optical disc, then based on the limitations of existing optical disc storage technology, the controller can only wait for the optical drive to finish writing the entire disc before further controlling the optical drive to read data from other optical discs. As a result, there is a problem of long waiting time for read operations in optical disc storage systems. Summary of the invention
[0004] The present application provides a storage system and method for shortening the waiting time for reading data from an optical disk.
[0005] In a first aspect, the present application provides a storage system, which includes: a first optical drive, a second optical drive and a controller, wherein the number of the first optical drive and the number of the second optical drive are determined based on the read bandwidth and the write bandwidth in the storage system. The first optical drive is used to write data to the first optical disc through a one-time writing process, and the length of the data written in the one-time writing process is equal to the capacity of the first optical disc. The second optical drive is used to write data to the second optical disc through multiple segmented writing processes, and the sum of the lengths of the data written in the multiple segmented writing processes is equal to the capacity of the second optical disc. The controller is used to receive a read request from a front-end host, and after determining that the second optical drive has completed the current one-time segmented writing process, control the second optical drive to read the data to be read from the third optical disc according to the read request, and send the read data to the front-end host. The first optical drive is specifically a pure write optical drive, and the second optical drive is specifically a read-write hybrid optical drive.
[0006] In the above technical solution, the second optical drive can implement segmented writing in the optical disc. After each segment is written, the second optical drive can perform the action of reading data, that is, it is not necessary to finish writing the entire disc before reading data. In this way, the waiting time for reading data from the optical disc can be shortened. The action of the first optical drive writing data to the optical disc is not affected by the read operation, which helps to ensure the performance of writing data to the optical disc. Furthermore, the number of the first optical drive and the second optical drive is determined based on the write bandwidth and the read bandwidth, which helps to improve the read and write performance of the storage system and reduce the deployment cost of the storage system.
[0007] In a possible implementation, before controlling the second optical drive to read the data to be read from the third optical disc according to the read request, the controller is further used to: determine whether the data to be read is stored in the third optical disc according to an identifier of the data to be read in the read request and a data index corresponding to the third optical disc.
[0008] In a possible implementation, it also includes: a first mechanical arm and a second mechanical arm; before the controller controls the second optical drive to read the to-be-read data from the third optical disc according to the read request, it is also used to: determine the target time according to the writing progress of the second optical drive in the current segmented writing process and the time it takes for the first mechanical arm to grab the third optical disc from the optical disc array; control the first mechanical arm to grab the third optical disc from the optical disc array at the target time; when it is determined that the second optical drive has completed the current segmented writing process, control the second mechanical arm to take the second optical disc out of the second optical drive, and control the first mechanical arm to place the third optical disc in the second optical drive. In this technical solution, since the first mechanical arm has already grabbed the target optical disc during the current segmented writing process of the second optical drive, the time for the first mechanical arm to grab the target optical disc is saved, further shortening the waiting time for reading data from the optical disc.
[0009] In a possible implementation, the controller is further configured to: determine the number of first optical drives and the number of second optical drives according to the ratio of the read bandwidth to the write bandwidth and the total number of optical drives in the storage system; wherein the sum of the number of first optical drives and the number of second optical drives is equal to the total number of optical drives. This helps to improve the read and write performance of the storage system and reduce the deployment cost of the storage system.
[0010] In a possible implementation, the controller is further used to: select multiple first-type data from the cache, the sum of the lengths of the multiple first-type data is less than or equal to the capacity of the first optical disc; control the first optical drive to write the multiple first-type data to the first optical disc; and generate a data index corresponding to the first optical disc based on the multiple first-type data. This helps to ensure the continuity of the first-type data.
[0011] In a possible implementation, the controller is also used to: in each segmented writing process: select multiple second-type data from the cache, the sum of the lengths of the multiple second-type data is less than or equal to the preset length; control the second optical drive to write the multiple second-type data to the second optical disc; generate a data index corresponding to the segmented writing process based on the multiple second-type data. In a possible implementation, the controller is also used to: after determining that the multiple segmented writing processes are completed, generate a data index corresponding to the second optical disc based on the data indexes corresponding to the multiple segmented writing processes. This helps to reduce the impact on data continuity.
[0012] In a second aspect, the present application provides a storage method, which is executed by a controller or a module (or chip) in the controller. The following is an example of execution by the controller.
[0013] The storage method includes: a controller controls a first optical drive to write data to a first optical disc through a one-time writing process, and the length of the data written in the one-time writing process is equal to the capacity of the first optical disc; the controller controls a second optical drive to write data to a second optical disc through multiple segmented writing processes, and the sum of the lengths of the data written in the multiple segmented writing processes is equal to the capacity of the second optical disc; the controller receives a read request, and after determining that the second optical drive has completed the current one-time segmented writing process, controls the second optical drive to read the data to be read from the third optical disc according to the read request; wherein the number of first optical drives and the number of second optical drives are determined based on the read bandwidth and the write bandwidth in the storage method.
[0014] In a possible implementation, before the controller controls the second optical drive to read the data to be read from the third optical disc according to the read request, the controller also determines that the data to be read is stored in the third optical disc according to the identifier of the data to be read in the read request and the data index corresponding to the third optical disc.
[0015] In a possible implementation, before the controller controls the second optical drive to read the to-be-read data from the third optical disc according to the read request, the controller also determines the target time according to the writing progress of the second optical drive in the current segmented writing process and the time it takes for the first mechanical arm to grab the third optical disc from the optical disc array. At the target time, the first mechanical arm is controlled to grab the third optical disc from the optical disc array. When it is determined that the second optical drive has completed the current segmented writing process, the second mechanical arm is controlled to take the second optical disc out of the second optical drive, and the first mechanical arm is controlled to place the third optical disc in the second optical drive.
[0016] In one possible implementation, the controller also determines the number of first optical drives and the number of second optical drives based on the ratio of the read bandwidth to the write bandwidth and the total number of optical drives in the storage method; wherein the sum of the number of first optical drives and the number of second optical drives is equal to the total number of optical drives.
[0017] In one possible implementation, when the controller controls the first optical drive to write data to the first optical disc through a write process, specifically, the controller may select multiple first-type data from the cache, wherein the sum of the lengths of the multiple first-type data is less than or equal to the capacity of the first optical disc; the controller controls the first optical drive to write the multiple first-type data to the first optical disc; and, based on the multiple first-type data, generate a data index corresponding to the first optical disc.
[0018] In one possible implementation, when the controller controls the second optical drive to write data to the second optical disc through multiple segmented writing processes, specifically, in each segmented writing process: the controller selects multiple second-type data from the cache, wherein the sum of the lengths of the multiple second-type data is less than or equal to a preset length; the controller controls the second optical drive to write the multiple second-type data to the second optical disc; and, based on the multiple second-type data, generates a data index corresponding to the segmented writing process; in a possible implementation, the controller also generates a data index corresponding to the second optical disc based on the data indexes corresponding to the multiple segmented writing processes after determining that the multiple segmented writing processes are completed.
[0019] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are executed by a computing device, the method in the above-mentioned second aspect or any possible implementation of the second aspect is implemented.
[0020] In a fourth aspect, the present application provides a computing device, including a processor, the processor being connected to a memory, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory, so that the computing device implements the method in the above-mentioned second aspect or any possible implementation of the second aspect.
[0021] In a fifth aspect, the present application provides a processor, the processor comprising a logic circuit and a power supply circuit, the power supply circuit being used to supply power to the logic circuit, and the logic circuit being used to implement the method in the above-mentioned second aspect or any possible implementation manner of the second aspect.
[0022] In a sixth aspect, the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a computing device, the method in the above-mentioned second aspect or any possible implementation of the second aspect is implemented.
[0023] The technical effects that can be achieved in any of the second to sixth aspects mentioned above can refer to the description of the beneficial effects in the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of the structure of an optical disk storage system provided by the present application;
[0025] Figure 2 A schematic diagram of the structure of another optical disc storage system provided by the present application;
[0026] Figure 3 A flowchart of a method for writing data to a storage system provided in the present application;
[0027] Figure 4 A flowchart of a method for reading data from a storage system provided in the present application;
[0028] Figure 5 A schematic diagram of the structure of a storage device provided in this application. DETAILED DESCRIPTION
[0029] The optical disk storage system can be applied to the field of optical disk archive storage, that is, using optical disks to store some data that is less frequently accessed, such as archival data, medical images, scientific materials, film and television, etc. For example, in an enterprise, an enterprise can use an optical disk storage system to store financial statement data, business data, company employee information, etc. from a few years ago.
[0030] The optical disk storage system generally includes a front-end host, an optical disk, an optical drive, a mechanical arm, and a controller, wherein the controller is connected to the front-end host, the optical drive, and the mechanical arm respectively.
[0031] The front-end host is used to provide an interactive interface for users. For example, users can perform operations to access data in the interactive interface. Accordingly, the front-end host generates an access request based on the user's operations on the interactive interface. The access request can specifically be a read request or a write request. The front-end host then sends the access request to the controller. For another example, the front-end host is also used to receive an access response from the controller and display the data in the access response to the user through the interactive interface.
[0032] The controller is used to interact with the front-end host, such as receiving access requests from the front-end host, sending access responses to the front-end host, etc.; controlling the optical drive to access the optical disc; controlling the robotic arm to grab the optical disc, etc.
[0033] Under the control of the controller, the mechanical arm can grab an optical disc from the optical disc array and place the grabbed optical disc in the optical disc drive, or grab an optical disc from the optical disc drive and place the grabbed optical disc in the optical disc array.
[0034] The optical drive is used to access data in the optical disc. Specifically, the optical drive can read the data in the optical disc through the read head in the optical drive according to the control signal from the controller, and transmit the read data to the controller; or the optical drive can receive data from the controller and write the received data to the optical disc through the write head in the optical drive.
[0035] Optical discs are used to store data such as text, sound, graphics, images and animations. For example, when an optical drive writes data to an optical disc, the optical drive can focus the laser into a laser beam and irradiate the recording medium of the optical disc to melt it, forming a small pit, thereby changing the optical properties; when the optical drive reads data from the optical disc, the photoelectric detection circuit in the optical drive can read the data stored in the optical disc according to the different reflectivity of the recording medium burned by the laser and the recording medium not burned by the laser. Examples of optical discs are compact disc read-only memory (CD-ROM), digital video disc-read only memory (DVD-ROM), compact disk rewritable (CD-RW), digital versatile disc-random access memory (DVD-RAM), etc.
[0036] Furthermore, each of the front-end host, optical disk, optical drive, mechanical arm, and controller may be one or more. Multiple optical disks may be placed in an optical disk array (or optical disk library), and the capacities of the multiple optical disks may be the same or different.
[0037] Figure 1 The schematic diagram of the structure of an optical disk storage system provided by the present application includes 1 front-end host, 1 controller, 6 optical disk drives (i.e., optical disk drive 1 to optical disk drive 6), 2 mechanical arms (i.e., mechanical arm 1 and mechanical arm 2), and 100 optical disks. It can be understood that Figure 1 This is only a schematic diagram of the structure of the optical disk storage system shown as an example, wherein the number of the front-end host, optical disk, optical drive, mechanical arm, and controller may be other. Figure 1 It does not constitute a limitation of this application.
[0038] Optical drives can be divided into two types: write-only optical drives and read-write hybrid optical drives. A write-only optical drive only has a write head (or the read head of a write-only optical drive is not working), that is, a write-only optical drive has the ability to write data to the optical disc, but not the ability to read data from the optical disc; a read-write hybrid optical drive has a write head and a read head, that is, a read-write hybrid optical drive not only has the ability to write data to the optical disc, but also has the ability to read data from the optical disc.
[0039] Furthermore, when the write-only optical drive writes data to the optical disc, specifically, the write-only optical drive writes data to the optical disc located in the write-only optical drive through a one-time writing process. Normally, the data length of the data written by the write-only optical drive to the optical disc during the one-time writing process can be equal to the maximum length of the data that the optical disc can store (that is, equal to the capacity of the optical disc). For example, the capacity of the optical disc is 512G, and the write-only optical drive can write all 512G of data to the optical disc at one time. It can be understood that in order to protect the optical disc from damage, the data will only be written to the optical disc once, that is, even if the optical disc is not fully written during a one-time writing process (for example, a 512G optical disc is only written with 400G of data), it will no longer be written to data a second time. In the present application, the capacity of the optical disc can be recorded as the first preset length.
[0040] When the read-write hybrid optical drive writes data to the optical disc, the data may be written to the optical disc in the read-write hybrid optical drive through multiple segmented writing processes, and the sum of the lengths of the data written in the multiple segmented writing processes may be equal to the capacity of the optical disc. The lengths of the data written in any two segmented writing processes may be the same or different.
[0041] For example, if the capacity of an optical disc is 512G, the read-write hybrid optical drive can write data to the optical disc through 16 segmented writing processes, wherein the length of the data written in each segmented writing process is 32G, that is, the read-write hybrid optical drive writes data from 1G to 32G to the optical disc in the first segmented writing process, writes data from 33G to 64G to the optical disc in the second segmented writing process, ..., and the read-write hybrid optical drive writes data from 480G to 512G to the optical disc in the 16th segmented writing process. For another example, if the capacity of an optical disc is 512G, the read-write hybrid optical drive writes data from 1G to 32G to the optical disc in the first segmented writing process, writes data from 33G to 96G to the optical disc in the second segmented writing process, writes data from 97G to 160G to the optical disc in the third segmented writing process, and so on, until the optical disc is full by the 10th segmented writing process.
[0042] Further, at the end of each segmented writing process (or between two segmented writing processes), the read-write hybrid optical drive can perform other access operations under the control of the controller, such as the read-write hybrid optical drive writing data to other optical discs, or the read-write hybrid optical drive reading data from the optical disc currently in the read-write hybrid optical drive or other optical discs. In the present application, the data length of the data written in each writing process is recorded as the second preset length.
[0043] The number N1 of write-only optical drives and the number N2 of read-write hybrid optical drives can be determined based on the write bandwidth and the read bandwidth in the entire optical disk storage system, wherein N1 and N2 are both positive integers.
[0044] In one possible implementation, the controller can count the bandwidth occupied by reading data in the entire optical disk storage system within a preset period (i.e., the read bandwidth), and count the bandwidth occupied by writing data in the entire optical disk storage system within the same preset period (i.e., the write bandwidth). The controller determines the number N1 of pure write optical drives and the number N2 of read-write hybrid optical drives based on the ratio between the write bandwidth and the read bandwidth, and the total number N of optical drives that can be placed in the entire optical disk storage system, where N is a positive integer. Further, the controller can send the number N1 of pure write optical drives and the number N2 of read-write hybrid optical drives it determines to the front-end host, and accordingly, the front-end host displays the number N1 of pure write optical drives and the number N2 of read-write hybrid optical drives to the user through the interactive interface, and the user installs N1 pure write optical drives and N2 read-write hybrid optical drives in the optical disk storage system according to the display of the front-end host on the interactive interface.
[0045] In another possible implementation, the user can set the read bandwidth and write bandwidth based on business needs, and then calculate the number of pure write optical drives N1 and the number of read-write hybrid optical drives N2 based on the set read bandwidth and write bandwidth, as well as the total number of optical drives N that can be placed in the entire optical disk storage system. Subsequently, the user installs N1 pure write optical drives and N2 read-write hybrid optical drives in the optical disk storage system. Optionally, the user can also set the read bandwidth and write bandwidth in the interactive interface of the front-end host. Accordingly, the front-end host sends the read bandwidth and write bandwidth set by the user to the controller, and the controller controls the read-write hybrid optical drive to read data from the optical disk according to the read bandwidth, and controls the read-write hybrid optical drive or the pure write optical drive to write data to the optical disk according to the write bandwidth.
[0046] For example, the ratio between the write bandwidth and the read bandwidth is represented by a, and the number N1 of write-only optical drives can be represented by or Accordingly, the number N2 of read-write hybrid optical drives can be expressed as N2=N-N1. Figure 1 In the example, the total number of optical drives N is 6, and the controller determines that the ratio of write bandwidth to read bandwidth is 1.9. Determine that the number of write-only optical drives N1 is 4, and the number of read-write hybrid optical drives N2 is 2. Figure 1 In this example, you can set optical drives 1 to 4 as write-only optical drives, and optical drives 5 and 6 as read-write hybrid optical drives. For details, see Figure 2 A schematic diagram of the structure of another optical disc storage system is shown as an example.
[0047] Furthermore, based on the above classification of optical drives, the optical discs in the optical disc array can also be divided into two categories, one category of optical discs are optical discs that need to be fully written at one time. If they are written multiple times, there is a great possibility of being damaged. The controller needs to control the robotic arm to place this category of optical discs in a write-only optical drive; the other category of optical discs are optical discs that can be written multiple times by partitions. The controller needs to control the robotic arm to place this category of optical discs in a read-write hybrid optical drive. It can be understood that this type of optical disc supports multiple writing of data in partitions without being damaged.
[0048] Optionally, the number of different types of optical discs in the optical disc array can be determined based on the number N1 of pure write optical disc drives and the number N2 of read-write hybrid optical disc drives, or the number of different types of optical discs in the optical disc array can be determined based on the ratio a of the write bandwidth to the read bandwidth. Exemplarily, the number n1 of optical discs that need to be fully written at one time can be expressed as or Correspondingly, the number n2 of read-write hybrid optical drives can be expressed as n2=n-n1, where n is the total number of optical disks that can be placed in the optical disk array. Figure 2 For example, 100 optical discs include 66 optical discs that need to be fully written at one time, and 34 optical discs that support multiple writing in segments. Of course, in this application, the number of optical discs of different categories in the optical disc array can also be determined based on other methods, which is not limited in this application.
[0049] In combination with the above explanations of the write-only optical drive and the read-write hybrid optical drive, the present application exemplarily provides a method for writing data applicable to the storage system, which can be specifically referred to in Figure 3 An exemplary flowchart is shown:
[0050] Step 301: The controller receives a write request from a front-end host, the write request including data to be written to the optical disc, and the controller stores the data in a cache.
[0051] The controller includes a cache, or the cache and the controller are two independent devices, and the cache is connected to the controller (in this case, the cache is a buffer). It can be understood that the cache can cache a large amount of data to be written to the optical disc, and the large amount of data to be written to the optical disc can be obtained by the controller from multiple write requests from the front-end host. Optionally, the cache also records the identification of each data. Exemplarily, the identification of the data includes the target address where the data needs to be written to the optical disc. Exemplarily, when the data is a file, the identification of the data also includes the file name of the file.
[0052] For example, the front-end host sends a write request 1 to the controller, and the write request 1 includes data 1 and target address 1. Accordingly, after receiving the write request 1 from the front-end host, the controller stores the data 1 and target address 1 in the write request 1 in the cache; then, the front-end host sends a write request 2 to the controller, and the write request 2 includes data 2 and target address 2, as well as data 3 and target address 3. Accordingly, after receiving the write request 2 from the front-end host, the controller stores the data 2 and target address 2 in the write request 2, as well as data 3 and target address 3 in the cache; and so on, the controller can store data 1 to data m, and the target addresses corresponding to data 1 to data m in the cache, where m is a positive integer.
[0053] It is understandable that the controller is able to obtain the working status of all optical drives in the storage system, and when it is determined that a certain optical drive among all the optical drives is in an idle state, it controls the mechanical arm to grab the optical disc from the optical disc array and place it in the optical drive in the idle state. The controller then obtains the data of a preset length corresponding to the optical drive category from the cache, and controls the optical drive to write the data of the preset length to the optical disc. Among them, steps 302 to 304 are the processes of controlling the pure write optical drive to write data to the optical disc when the controller determines that the pure write optical drive is in an idle state, and steps 305 to 309 are the processes of controlling the read-write hybrid optical drive to write data to the optical disc when the controller determines that the read-write hybrid optical drive is in an idle state.
[0054] Step 302: The controller selects a plurality of data of the first type from the cache, and controls the write-only optical drive to write the plurality of data of the first type into an optical disc located inside the write-only optical drive.
[0055] It can be understood that the controller records the writing status of all optical discs in the optical disc array. Exemplarily, the writing status of the optical disc includes whether data has been written into the optical disc, wherein an optical disc that has not been written into data is a blank optical disc.
[0056] Furthermore, when data is written to a CD, the writing status of the CD may include the progress of the data being written to the CD. Specifically, when the CD is written with data in one go by a write-only optical drive, the progress of the data being written to the CD is that the entire CD is full; when the CD is written with data in multiple write processes by a read-write hybrid optical drive, the progress of the data being written to the CD may specifically be that the entire CD is full or that the entire CD has not yet been full.
[0057] Among them, when the progress of data writing to the optical disc is not yet full, the writing status of the optical disc may also include one or more of the following: the length of data already written in the optical disc, the remaining length of data not yet written, the ratio of the length of data already written in the optical disc to the entire optical disc capacity (i.e. the ratio of the written length), the ratio of the remaining length of data not yet written in the optical disc to the entire optical disc capacity (i.e. the ratio of the remaining length), the number of times the optical disc has been written in segments (for example, the capacity of the optical disc is 512G, and the length of data written in each segment writing process is 32G, that is, the optical disc requires 16 segment writing processes to be fully written, and the optical disc has been written 12 times), and the number of segment writing processes remaining to fill the optical disc (for example, the capacity of the optical disc is 512G, and the length of data written in each segment writing process is 32G, that is, the optical disc requires 16 segment writing processes to be fully written, and the optical disc has been written 12 times).
[0058] Furthermore, the controller can also record the categories of all optical discs in the optical disc array to indicate whether the optical disc requires one-time writing (i.e., a optical disc that requires data to be written by a pure write optical drive) or a optical disc that supports multiple writing of partitions (i.e., a optical disc that requires data to be written by a read-write hybrid optical drive).
[0059] When the controller determines that a write-only optical drive is in an idle state, the controller may select a blank optical disc from the optical disc array according to the writing status of all the optical discs in the optical disc array. Optionally, the controller may also select a blank optical disc that needs to be written once from the optical disc array in combination with the categories of all the optical discs in the optical disc array. Optionally, when selecting a blank optical disc from the optical disc array, the controller may specifically determine an identifier of the selected blank optical disc, wherein the identifier of the blank optical disc is, for example, the number of the blank optical disc in the optical disc array (for example, number 1), the position of the blank optical disc in the optical disc array (for example, the first row and second column in the optical disc array), etc.
[0060] Then, the controller controls the mechanical arm to grab the selected blank optical disc from the optical disc array and place it in the write-only optical drive in the idle state. Optionally, the controller sends a grabbing instruction to the mechanical arm, and the grabbing instruction includes the identifier of the selected blank optical disc and the identifier of the write-only optical drive, wherein the identifier of the write-only optical drive is, for example, the serial number of the write-only optical drive. Accordingly, the mechanical arm grabs the blank optical disc from the optical disc array according to the identifier of the blank optical disc, and then places the grabbed blank optical disc in the write-only optical drive according to the identifier of the write-only optical drive.
[0061] The controller then obtains multiple first-type data from the cache, and controls the write-only optical drive to write the multiple first-type data into the optical disc. In one example, the controller sends a write instruction to the write-only optical drive, and the write instruction includes the multiple first-type data. Accordingly, the write-only optical drive writes the multiple first-type data into the blank optical disc. In another example, the controller sends a write instruction to the write-only optical drive, and the write instruction includes the addresses of the multiple first-type data in the cache. Accordingly, the write-only optical drive reads the multiple first-type data from the cache according to the addresses of the multiple first-type data in the cache, and writes the read multiple first-type data into the blank optical disc.
[0062] In the present application, the data in the cache can be divided into a first type of data and a second type of data. In one example, the first type of data and the second type of data can be divided based on the data length, that is, a third preset length is set, and the data with a data length greater than (or greater than or equal to) the third preset length is the first type of data, and the data with a data length less than or equal to (or less than) the third preset length is the second type of data. In another example, the first type of data and the second type of data can be divided based on the data type, such as video data, audio data, and game data as the first type of data, and picture data and text data as the second type of data. In another example, the first type of data and the second type of data can be divided based on the data's requirements for continuity, such as data with high requirements for continuity as the first type of data, and data with low requirements for continuity as the second type of data. Of course, there are other ways of division, and I will not give examples one by one.
[0063] Furthermore, when the controller determines that a write-only optical drive is in an idle state, the controller can select multiple first-type data to form data of a first preset length, and then the controller controls the write-only optical drive to write the multiple first-type data to the corresponding optical disc. Here, when the sum of the lengths of the multiple first-type data selected by the controller is less than the first preset length, and the sum of the lengths will exceed the first preset length if new first-type data is added, the controller can select one or more second-type data until the sum of the lengths of the total data is equal to the first preset length. For example, the capacity of the optical disc is 512G, that is, the first preset length is 512G, the controller selects 51 10G of the first-type data and 2 1G of the second-type data from the cache, and then controls the write-only optical drive to write these data to the optical disc.
[0064] In addition, when the controller cannot select data that is exactly equal to the first preset length, it can control the write-only optical drive to write fill bits in the remaining space. Combined with the above example, for example, the sum of the lengths of multiple data selected by the controller from the cache differs by 10 bits from 512G, then the controller controls the write-only optical drive to fill the remaining 10 bits with the preset value after writing all the selected data (the 10 preset values are the 10 fill bits).
[0065] Step 303: The controller generates a data index of the optical disc according to the plurality of first-type data written into the optical disc. Exemplarily, the data index includes identifiers of the plurality of first-type data.
[0066] Optionally, when the controller also controls the write-only optical drive to write one or more second-type data to the optical disc, the controller may generate a data index for the optical disc according to the multiple first-type data written to the optical disc and the one or more second-type data. Exemplarily, the data index includes identifiers of the multiple first-type data and the one or more second-type data.
[0067] The data index of the optical disc can be used for determining in which optical disc of the optical disc array the data to be read is stored when the controller needs to read data from the optical disc array.
[0068] Step 304: The controller deletes the plurality of first-type data that have been written to the optical disc (or, the plurality of first-type data that have been written to the optical disc and one or more second-type data) in the cache.
[0069] It can be understood that the data written to the optical disc has been successfully written to the disc, and the controller can delete the data in the cache.
[0070] Step 305 : The controller selects a plurality of second-type data from the cache, and controls the read-write hybrid optical drive to write the plurality of second-type data into an optical disc located inside the read-write hybrid optical drive.
[0071] Specifically, when the controller determines that a read-write hybrid optical drive is in an idle state, the controller may select a blank optical disc from the optical disc array according to the writing status of all the optical discs in the optical disc array. Optionally, the controller may also select a blank optical disc that supports multiple writing of partition segments from the optical disc array in combination with the categories of all the optical discs in the optical disc array. Optionally, when selecting the blank optical disc from the optical disc array, the controller may specifically determine the identification of the selected blank optical disc, and the identification of the blank optical disc may refer to the description in the above step 302.
[0072] Then, the controller controls the mechanical arm to grab the selected blank optical disc from the optical disc array and place it in the read-write hybrid optical drive in the idle state. Optionally, the controller sends a grabbing instruction to the mechanical arm, and the grabbing instruction includes the identifier of the selected blank optical disc and the identifier of the read-write hybrid optical drive, wherein the identifier of the read-write hybrid optical drive is, for example, the serial number of the read-write hybrid optical drive (such as serial number b). Accordingly, the mechanical arm grabs the blank optical disc from the optical disc array according to the identifier of the blank optical disc, and then places the grabbed blank optical disc in the read-write hybrid optical drive according to the identifier of the read-write hybrid optical drive.
[0073] The controller then obtains multiple second-type data from the cache (wherein, the explanation of the second-type data can be found in the description of the above step 302), and controls the read-write hybrid optical drive to write the multiple second-type data into the blank optical disc. In one example, the controller can send a write instruction to the read-write hybrid optical drive, and the write instruction includes the multiple second-type data. Accordingly, the read-write hybrid optical drive writes the multiple second-type data into the blank optical disc. In another example, the controller can send a write instruction to the read-write hybrid optical drive, and the write instruction includes the addresses of the multiple second-type data in the cache. Accordingly, the read-write hybrid optical drive reads the multiple second-type data from the cache according to the addresses of the multiple second-type data in the cache, and writes the multiple second-type data read into the blank optical disc.
[0074] In addition, the controller can also select an optical disc that has not been fully written from the optical disc array according to the writing status of all optical discs in the optical disc array, or according to the writing status of all optical discs in the optical disc array and the categories of all optical discs in the optical disc array. Then the controller controls the mechanical arm to grab the optical disc that has not been fully written from the optical disc array to the read-write hybrid optical drive in the idle state, and controls the read-write hybrid optical drive to write data to the optical disc that has not been fully written. The specific implementation method is similar to the blank optical disc mentioned above and will not be repeated.
[0075] It can be understood that since the read-write hybrid optical drive can write data to the same optical disc in multiple writing processes, the optical disc may not be fully written after the read-write hybrid optical drive completes a writing process. However, when the controller needs to control the read-write hybrid optical drive to read data from other optical discs, the controller needs to first control the mechanical arm to take out the optical disc that has not been fully written from the read-write hybrid optical drive and place it in the optical disc array. Furthermore, when the controller determines that the read-write hybrid optical drive is in an idle state again, the controller can control the mechanical arm to take out the optical disc that has not been fully written from the optical disc array and place it in the read-write hybrid optical drive, and continue to control the read-write hybrid optical drive to write data to the optical disc that has not been fully written.
[0076] For example, the controller controls the read-write hybrid optical drive 1 to write data to the optical disc 1, and after a certain writing process is completed, the controller controls the mechanical arm to place the optical disc 1 in the optical disc array, and controls the mechanical arm to take out the optical disc 2 from the optical disc array and place it in the read-write hybrid optical drive 1, and controls the read-write hybrid optical drive 1 to read the data in the optical disc 2. Subsequently, after the controller determines that the read-write hybrid optical drive 1 has completed reading the data in the optical disc 2, the controller controls the mechanical arm to take out the optical disc 2 from the read-write hybrid optical drive 1 and place it in the optical disc array, and controls the mechanical arm to take out the optical disc 1 from the optical disc array and place it in the read-write hybrid optical drive 1, and then controls the read-write hybrid optical drive 1 to continue writing data to the optical disc 1.
[0077] Of course, in other implementations, when the controller determines that other read-write hybrid optical drives are in an idle state, it can control the robotic arm to place the optical disc in the other read-write hybrid optical drive that is in an idle state, and the other read-write hybrid optical drive that is in an idle state will write data to the optical disc that has not yet been fully written.
[0078] For example, the controller controls the read-write hybrid optical drive 1 to write data to the optical disc 1, and after a writing process is completed, the controller controls the mechanical arm to place the optical disc 1 in the optical disc array, and controls the mechanical arm to take out the optical disc 2 from the optical disc array and place it in the read-write hybrid optical drive 1, and controls the read-write hybrid optical drive 1 to read the data in the optical disc 2. Subsequently, the controller further determines that the read-write hybrid optical drive 2 is in an idle state (for example, it is in an idle state after the optical disc 3 is fully written), so the controller controls the mechanical arm to take out the optical disc 1 from the optical disc array and place it in the read-write hybrid optical drive 2, and controls the read-write hybrid optical drive 2 to continue writing data to the optical disc 1.
[0079] The controller can select multiple second-type data to form data of the second preset length, and then the controller controls the read-write hybrid optical drive to write the multiple second-type data to the corresponding optical disc. In addition, when the controller cannot select data that is exactly equal to the second preset length, the read-write hybrid optical drive can be controlled to write fill bits in the remaining space. For example, if the second preset length is 32G, and the total amount of data selected by the controller from the cache differs by 10 bits from 32G, then the controller controls the read-write hybrid optical drive to fill the remaining 10 bits with the preset value after writing all the selected data (the 10 preset values are 10 fill bits).
[0080] Step 306: The controller generates a data index of the plurality of second-type data (ie, a data index corresponding to the current segment writing process) according to the plurality of second-type data written to the optical disc. Exemplarily, the data index includes identifiers of the plurality of second-type data.
[0081] Step 307: The controller deletes the plurality of second-type data in the cache that have been written to the optical disc.
[0082] It can be understood that the data written to the optical disc has been successfully written to the disc, and the controller can delete the data in the cache.
[0083] In step 308, the controller determines whether the optical disc is full. If it is determined that the optical disc is not full, the controller controls the read-write hybrid optical drive to continue writing to the optical disc (i.e., continue to execute the segmented writing process: steps 305 to 307); if it is determined that the optical disc is full, a data index for the optical disc is generated (i.e., execute step 309).
[0084] The optical disc can be filled by one read-write hybrid optical drive or by multiple read-write hybrid optical drives. For example, a certain optical disc needs to be filled after being written in segments 16 times. The controller controls the read-write hybrid optical drive to write to the optical disc 16 times to fill the optical disc; or, the controller controls the read-write hybrid optical drive 1 to write to the optical disc 8 times, and after writing the 8th time, controls the read-write hybrid optical drive 1 to read data from other optical discs, and then controls the read-write hybrid optical drive 2 to write to the optical disc 8 times to fill the optical disc. Among them, the data length written by the hybrid optical drive 1 in each segment writing (i.e., the second preset length) is the same as or different from the data length written by the hybrid optical drive 2 in each segment writing (i.e., the second preset length).
[0085] Step 309: The controller generates a data index for the optical disc.
[0086] It can be understood that when the controller controls the read-write hybrid optical drive to write data to the optical disc in multiple writing processes, each writing process can correspond to a data index. Accordingly, after the controller determines that the optical disc is full, it can form the data indexes corresponding to the multiple writing processes into the data index of the optical disc.
[0087] In the present application, the controller controls the write-only optical drive to write multiple first-type data to the optical disc (i.e., writing the entire disc at one time), which helps to ensure the continuity of the first-type data; the controller controls the read-write hybrid optical drive to write multiple second-type data to the optical disc (i.e., writing in segments), which has less impact on data continuity.
[0088] Combined with the above Figure 3 The process of writing data to the storage system, such as Figure 4 A schematic diagram of a process for reading data in a storage system provided for this application:
[0089] Step 401: The controller receives a read request from a front-end host, wherein the read request includes an identifier of the data to be read. Exemplarily, the identifier of the data to be read may be a storage address where the data to be read is stored in an optical disk; or, when the data to be read is a file, the identifier of the data to be read may be a file name of the file.
[0090] Step 402 : The controller determines a target optical disc storing the data to be read from the multiple optical discs according to the identifier of the data to be read and the data indexes respectively corresponding to the multiple optical discs in the optical disc array.
[0091] Optionally, the data index corresponding to the target optical disc includes an identifier of the data to be read.
[0092] Optionally, the controller determines whether the data to be read is stored in the cache. If the controller determines that the data to be read is stored in the cache, the data to be read can be read from the cache (without controlling the target read-write hybrid optical drive to read from the target optical disc); if the controller determines that the data to be read is not stored in the cache, the target optical disc is further determined. In one possible manner, the controller can traverse the identifiers of the data stored in the cache, and if it is determined that the cache includes the identifier of the data to be read, it is determined that the data to be read is stored in the cache.
[0093] Step 403 : after determining that the target read-write hybrid optical drive has completed the current segmented writing process, the controller controls the target read-write hybrid optical drive to read the to-be-read data from the target optical disc.
[0094] It can be understood that when the controller receives a read request, each of the N1 pure-write optical drives is writing data to the optical disc located in the pure-write optical drive at one time, and each of the N2 read-write hybrid optical drives is writing data to the optical disc located in the read-write hybrid optical drive in multiple writing processes. Further, the controller can monitor the writing progress of each of the N2 read-write hybrid optical drives, and select a target read-write hybrid optical drive from the N2 read-write hybrid optical drives according to the writing progress of the N2 read-write hybrid optical drives. Specifically, the writing progress of the N2 read-write hybrid optical drives is slow or fast, and the target read-write hybrid optical drive is the read-write hybrid optical drive that first completes its current segmented writing process among the N2 read-write hybrid optical drives. Furthermore, after determining that the target read-write hybrid optical drive has completed its current segmented writing process, the controller can control the target read-write hybrid optical drive to read the data to be read from the target optical disc.
[0095] In one possible implementation, after determining that the target read-write hybrid optical drive has completed the current segmented write process, the controller controls the robotic arm to grab the optical disc in the current target read-write hybrid optical drive and place it in the optical disc array; then, the controller controls the robotic arm to grab the target optical disc from the optical disc array and place it in the target read-write hybrid optical drive.
[0096] Optionally, the controller sends a first grabbing instruction to the robotic arm, the first grabbing instruction includes an identification of the target read-write hybrid optical drive and a target position, wherein the target position can be used to indicate the robotic arm to grab the optical disc from the target hybrid optical drive and place it at a position in the optical disc array. Accordingly, the robotic arm can grab the optical disc from the target read-write hybrid optical drive according to the identification of the target read-write hybrid optical drive, and then place the optical disc in the optical disc array according to the target position. Further, the controller sends a second grabbing instruction to the robotic arm, the second grabbing instruction includes an identification of the target read-write hybrid optical drive and an identification of the target optical disc, and accordingly, the robotic arm can grab the target optical disc from the optical disc array according to the identification of the target optical disc, and then place the target optical disc in the target read-write hybrid optical drive according to the identification of the target read-write hybrid optical drive.
[0097] Or in other examples, the controller sends a grabbing instruction to the robotic arm, which grabbing instruction includes an identification of a target read-write hybrid optical drive, a target position, and an identification of a target optical disc. Accordingly, the robotic arm can grab the optical disc from the target read-write hybrid optical drive according to the identification of the target read-write hybrid optical drive, place the optical disc in the optical disc array according to the target position, and grab the target optical disc from the optical disc array according to the identification of the target optical disc, and place the target optical disc in the target read-write hybrid optical drive according to the identification of the target read-write hybrid optical drive.
[0098] In order to further improve the speed at which the controller reads the data to be read, the controller can first grab the target optical disc from the optical disc array, and then immediately place the target optical disc in the target read-write hybrid optical disc drive after the target read-write hybrid optical disc drive completes its current segmented writing process. In a possible implementation, the controller can also predict the moment (i.e., the end moment) when the target read-write hybrid optical disc drive completes its current segmented writing process according to the writing progress of the target read-write hybrid optical disc drive, and then determine the target moment according to the end moment and the grabbing time of the controller controlling the first mechanical arm to grab the target optical disc from the optical disc array. It can be understood that the target moment is equal to the difference between the end moment and the grabbing time, or the target moment is earlier than the difference between the end moment and the grabbing time. Subsequently, after determining that the target read-write hybrid optical disc drive has completed its current segmented writing process, the controller controls the second mechanical arm to grab the optical disc in the current target read-write hybrid optical disc drive, and controls the first mechanical arm to place the target optical disc in the target read-write hybrid optical disc drive. In this technical solution, since the first mechanical arm has already grabbed the target optical disc in advance, the time for the first mechanical arm to grab the target optical disc is saved, thereby improving the speed at which the controller reads the data to be read.
[0099] In one possible implementation, the controller sends a second grabbing instruction to the first robotic arm, and sends a first grabbing instruction to the second robotic arm, wherein the description of the first grabbing instruction and the second grabbing instruction can be found in the description in the above embodiment.
[0100] In addition, the controller can also control the second robotic arm to wait for the target read-write hybrid optical drive to complete reading the target optical disc, and then continue to place the optical disc in the target read-write hybrid optical drive, and control the target read-write hybrid optical drive to continue writing data to the optical disc. That is, the first grabbing instruction sent by the controller to the second robotic arm includes the identification and instruction information of the target read-write hybrid optical drive, and the instruction information is used to instruct the second robotic arm to temporarily take out the optical disc in the target read-write hybrid optical drive (i.e., not put it into the optical disc array). Further, the controller sends a put-back instruction to the second robotic arm, and accordingly, the second robotic arm responds to the put-back instruction and puts the optical disc it is currently grabbing back into the target read-write hybrid optical drive.
[0101] The following is an example of a specific implementation scenario:
[0102] The storage system includes two read-write hybrid optical drives, namely, read-write hybrid optical drive 1 and read-write hybrid optical drive 2, wherein read-write hybrid optical drive 1 is writing data to optical disc 1 and it will take 10 seconds to complete the current segmented writing process, and read-write hybrid optical drive 2 is writing data to optical disc 2 and it will take 30 seconds to complete the current segmented writing process, then the controller can select read-write hybrid optical drive 1 as the target read-write hybrid optical drive. Further, the controller determines that the grabbing time required for the first mechanical arm to grab the target optical disc from the optical disc array is 1 second, then the controller can control the first mechanical arm to grab the target optical disc from the optical disc array 1 second or 2 seconds before the end time of the current segmented writing process completed by the read-write hybrid optical drive 1. When the controller determines that the read-write hybrid optical drive 1 has completed the current segmented writing process, it controls the second mechanical arm to take out the optical disc 1 from the read-write hybrid optical drive 1, and controls the first mechanical arm to place the target optical disc in the read-write hybrid optical drive 1. The controller then controls the read-write hybrid optical drive 1 to read the target data in the target optical disc.
[0103] Step 404: The controller sends an access response to the front-end host, the access response including the read data. Specifically, the controller obtains the data read by the target read-write hybrid optical drive, then packs the read data into the access response and sends the access response to the front-end host.
[0104] In this application, the read-write hybrid optical drive can implement segmented writing in the optical disc. The read-write hybrid optical drive can perform the action of reading data after writing each segment, that is, it is not necessary to finish writing the entire disc before reading the data. In this way, the waiting time for the read operation can be shortened. The action of the write optical drive writing data to the optical disc is not affected by the read operation, which helps to ensure the performance of writing data to the optical disc. Furthermore, the number of pure write optical drives and read-write hybrid optical drives is determined based on the write bandwidth and the read bandwidth, which helps to improve the read and write performance of the storage system and reduce the deployment cost of the storage system.
[0105] In the present application, the write-only optical drive may be referred to as the first optical drive, the read-write hybrid optical drive may be referred to as the second optical drive, the optical disc placed in the write-only optical drive for writing data may be referred to as the first optical disc, the optical disc placed in the read-write hybrid optical drive for writing data may be referred to as the second optical disc, and the target optical disc placed in the target read-write hybrid optical drive for reading data may be referred to as the third optical disc.
[0106] Based on the above content and the same idea, Figure 5 A schematic diagram of the structure of a possible storage device provided by the present application. The storage device can be used to implement the function of the controller in the above method embodiment, and thus can also achieve the beneficial effects possessed by the above method embodiment.
[0107] In the present application, the storage device may be Figure 1 or Figure 2 The controller shown in the figure may also be a module (such as a chip) applied to the controller to implement the above Figure 3 or Figure 4 The functions of the controller in the method embodiment shown in FIG.
[0108] like Figure 5 As shown, the storage device 500 includes a control module 501 and a transceiver module 502 .
[0109] The control module 501 is used to control the first optical drive to write data to the first optical disc through a one-time writing process, and the length of the data written in the one-time writing process is equal to the capacity of the first optical disc; and control the second optical drive to write data to the second optical disc through multiple segmented writing processes, and the sum of the lengths of the data written in the multiple segmented writing processes is equal to the capacity of the second optical disc;
[0110] The transceiver module 502 is used to receive a read request;
[0111] The control module 501 is further configured to control the second optical drive to read the to-be-read data from the third optical disc according to the read request after determining that the second optical drive has completed the current one-segment write process;
[0112] The number of the first optical drives and the number of the second optical drives are determined based on the read bandwidth and the write bandwidth in the storage method.
[0113] In a possible implementation, before controlling the second optical drive to read the data to be read from the third optical disc according to the read request, the control module 501 is further used to: determine whether the data to be read is stored in the third optical disc according to the identifier of the data to be read in the read request and the data index corresponding to the third optical disc.
[0114] In one possible implementation, before controlling the second optical drive to read the to-be-read data from the third optical disc according to a read request, the control module 501 is also used to: determine a target time according to the writing progress of the second optical drive in a current segmented writing process and the time it takes the first robotic arm to grab the third optical disc from the optical disc array; control the first robotic arm to grab the third optical disc from the optical disc array at the target time; control the second robotic arm to take the second optical disc out of the second optical drive, and control the first robotic arm to place the third optical disc in the second optical disc.
[0115] In a possible implementation, the control module 501 is further used to: determine the number of first optical drives and the number of second optical drives based on the ratio of the read bandwidth to the write bandwidth and the total number of optical drives in the storage method; wherein the sum of the number of first optical drives and the number of second optical drives is equal to the total number of optical drives.
[0116] In a possible implementation, when the control module 501 controls the first optical drive to write data to the first optical disc through a write process, it is specifically used to: select multiple first-type data from the cache, and the sum of the lengths of the multiple first-type data is less than or equal to the capacity of the first optical disc; control the first optical drive to write the multiple first-type data to the first optical disc; and generate a data index corresponding to the first optical disc based on the multiple first-type data.
[0117] In one possible implementation, when controlling the second optical drive to write data to the second optical disc through multiple segmented writing processes, the control module 501 is specifically used to: in each segmented writing process: select multiple second type data from the cache, the sum of the lengths of the multiple second type data is less than or equal to a preset length; control the second optical drive to write the multiple second type data to the second optical disc; and generate a data index corresponding to the segmented writing process based on the multiple second type data.
[0118] In a possible implementation, the control module 501 is further configured to: after determining that the multiple segment writing processes are finished, generate a data index corresponding to the second optical disc according to the data indexes respectively corresponding to the multiple segment writing processes.
[0119] The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0120] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a terminal device (which can be a personal computer, mobile phone, or network device, etc.) or a processor (processor) to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0121] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes computer program instructions, and when the computer program instructions are loaded and executed on a computer, all or part of the embodiments of the present application are generated. Figure 3 and Figure 4 The process or function in the relevant method embodiment.
[0122] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line, or wireless (e.g., infrared, wireless, microwave, etc.) method. Computer-readable storage media may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. Available media may be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), or semiconductor media (e.g., SSDs).
[0123] It is understood that the various numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.
[0124] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of protection of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A storage system, characterized in that: include: a first optical drive, a second optical drive, and a controller, wherein the number of the first optical drives and the number of the second optical drives are determined based on a read bandwidth and a write bandwidth in the storage system; The first optical drive is used to write data to the first optical disc through a write-once process, and the length of the data written in the write-once process is equal to the capacity of the first optical disc; The second optical drive is used to write data to the second optical disc through multiple segmented writing processes, and the sum of the lengths of the data written in the multiple segmented writing processes is equal to the capacity of the second optical disc; The controller is used to receive a read request, and after determining that the second optical drive has completed a current segmented write process, control the second optical drive to read the to-be-read data from the third optical disc according to the read request.
2. The system according to claim 1, characterized in that Before the controller controls the second optical drive to read the to-be-read data from the third optical disc according to the read request, the controller is further used to: According to the identifier of the data to be read in the read request and the data index corresponding to the third optical disc, it is determined that the data to be read is stored in the third optical disc.
3. The system according to claim 1 or 2, characterized in that: Also includes: a first robotic arm and a second robotic arm; Before the controller controls the second optical drive to read the to-be-read data from the third optical disc according to the read request, the controller is further used to: determining a target time according to the writing progress of the second optical drive in the current one-segment writing process and the time taken by the first mechanical arm to grab the third optical disc from the optical disc array; Controlling the first mechanical arm to grab the third optical disc from the optical disc array at the target time; The second mechanical arm is controlled to take the second optical disc out of the second optical drive, and the first mechanical arm is controlled to place the third optical disc in the second optical drive.
4. The system according to any one of claims 1 to 3, characterized in that: The controller is also used for: Determining the number of the first optical drives and the number of the second optical drives according to the ratio of the read bandwidth to the write bandwidth and the total number of optical drives in the storage system; The sum of the number of the first optical drives and the number of the second optical drives is equal to the total number of the optical drives.
5. The system according to any one of claims 1 to 4, characterized in that: The controller is also used for: Selecting a plurality of first-type data from the cache, wherein a sum of lengths of the plurality of first-type data is less than or equal to a capacity of the first optical disc; Controlling the first optical drive to write the plurality of first-type data into the first optical disc; A data index corresponding to the first optical disc is generated according to the plurality of first-type data.
6. The system according to any one of claims 1 to 5, characterized in that: The controller is also used for: During each segment write process: Selecting a plurality of data of the second type from the cache, wherein a sum of lengths of the plurality of data of the second type is less than or equal to a preset length; Controlling the second optical drive to write the plurality of second-type data into the second optical disc; A data index corresponding to the segmented writing process is generated according to the plurality of second type data.
7. The system according to claim 6, characterized in that The controller is also used for: After determining that the multiple segment writing processes are finished, a data index corresponding to the second optical disc is generated according to the data indexes respectively corresponding to the multiple segment writing processes.
8. A storage method, characterized in that: include: Controlling the first optical drive to write data to the first optical disc through a write-once process, wherein the length of the data written in the write-once process is equal to the capacity of the first optical disc; Controlling the second optical drive to write data to the second optical disc through multiple segmented writing processes, wherein the sum of the lengths of the data written in the multiple segmented writing processes is equal to the capacity of the second optical disc; receiving a read request, and after determining that the second optical drive has completed the current segmented writing process, controlling the second optical drive to read the to-be-read data from the third optical disc according to the read request; The number of the first optical drives and the number of the second optical drives are determined based on a read bandwidth and a write bandwidth in a storage method.
9. The method according to claim 8, characterized in that Before controlling the second optical drive to read the to-be-read data from the third optical disc according to the read request, the method further includes: According to the identifier of the data to be read in the read request and the data index corresponding to the third optical disc, it is determined that the data to be read is stored in the third optical disc.
10. The method according to claim 8 or 9, characterized in that Before controlling the second optical drive to read the to-be-read data from the third optical disc according to the read request, the method further includes: determining the target time according to the writing progress of the second optical drive in the current one-segment writing process and the time taken by the first mechanical arm to grab the third optical disc from the optical disc array; Controlling the first mechanical arm to grab the third optical disc from the optical disc array at the target time; The second mechanical arm is controlled to take the second optical disc out of the second optical drive, and the first mechanical arm is controlled to place the third optical disc in the second optical drive.
11. The method according to any one of claims 8 to 10, characterized in that: Also includes: Determining the number of the first optical drives and the number of the second optical drives according to the ratio of the read bandwidth to the write bandwidth and the total number of optical drives in the storage method; The sum of the number of the first optical drives and the number of the second optical drives is equal to the total number of the optical drives.
12. The method according to any one of claims 8 to 11, characterized in that The controlling the first optical drive to write data to the first optical disc through a write-once process comprises: Selecting a plurality of first-type data from the cache, wherein a sum of lengths of the plurality of first-type data is less than or equal to a capacity of the first optical disc; Controlling the first optical drive to write the plurality of first-type data into the first optical disc; A data index corresponding to the first optical disc is generated according to the plurality of first-type data.
13. The method according to any one of claims 8 to 12, characterized in that The controlling the second optical drive to write data to the second optical disc through multiple segmented writing processes includes: During each segment write process: Selecting a plurality of data of the second type from the cache, wherein a sum of lengths of the plurality of data of the second type is less than or equal to a preset length; Controlling the second optical drive to write the plurality of second-type data into the second optical disc; A data index corresponding to the segmented writing process is generated according to the plurality of second type data.
14. The method according to claim 13, characterized in that Also includes: After determining that the multiple segment writing processes are finished, a data index corresponding to the second optical disc is generated according to the data indexes respectively corresponding to the multiple segment writing processes.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed by a computing device, the method according to any one of claims 8 to 14 is implemented.
16. A computing device, characterized in that: The computer comprises a processor connected to a memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the computing device executes the method according to any one of claims 8 to 14.
17. A processor, characterized in that: The processor comprises a logic circuit and a power supply circuit, wherein the power supply circuit is used to supply power to the logic circuit, and the logic circuit is used to execute the method according to any one of claims 8 to 14.
