Data archiving method and electronic equipment

By configuring the archiving plan and execution time period in the data acquisition device, filtering data and rationally allocating tape storage, the problem of reduced service life caused by continuous work of the magnetic head is solved, and the flexibility of archiving operations and the reliability of data storage are improved.

CN118626439BActive Publication Date: 2024-10-29HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411095926.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-10-29
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

In the existing tape archiving solution, the continuous operation of the magnetic head reduces the service life and affects subsequent data archiving operations.

Method used

By pre-configuring the archiving planning time period and archiving execution time period of the data acquisition device, filter the data that actually needs to be archived, and check the tape usage and available space during the archiving operation, allocate data storage reasonably, and avoid overwork of the magnetic head.

Benefits of technology

It extends the service life of the magnetic head, improves the flexibility and reliability of archiving operations, and ensures stable storage of long-term data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626439B_ABST
    Figure CN118626439B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a data archiving method and an electronic device. The embodiments of the present application pre-configure the archiving plan time period and the archiving execution time period based on actual needs, so that the data actually to be archived can be screened from the data collected by the data acquisition device, the flexibility of archiving data selection can be improved, and the execution time of the archiving operation can be controlled. While improving the flexibility of archiving operation execution, the problem of affecting the service life of the magnetic head due to continuous operation of the magnetic head can also be effectively avoided. After the archiving task is completed, the information recorded in the first index area is also synchronously written to the magnetic tape. In this way, when the first index area is abnormal and unavailable, the first index area can be restored using the first index area information written to the magnetic tape, thereby avoiding the problem of affecting the archiving and query of long-period data due to the unavailability of the first index area, and improving the reliability of long-period data archiving and query.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data archiving method and an electronic device. Background Art

[0002] With the rapid development of information technology, network storage devices have been widely used in fields such as data storage, and with it comes an urgent need for long-cycle data storage; the so-called long-cycle data refers to data that requires a storage time greater than a set time (such as one year, ten years, or several decades, etc.).

[0003] In practical applications, magnetic tape has become the best choice for long-term data archiving due to its advantages such as low cost, large capacity, and long durability. Archiving refers to the process of reading data from short-term storage devices (such as hard disks) and writing it to long-term storage devices (such as magnetic tapes) for long-term preservation. However, the current magnetic tape archiving solution usually archives the data collected by data acquisition devices (such as network cameras and image capture devices) continuously, which causes the magnetic head in the tape drive to work continuously, resulting in no time for maintenance and cleaning of the magnetic head of the tape drive, thereby reducing the service life of the magnetic head. The reduced service life of the magnetic head will affect the subsequent data archiving operations. Summary of the invention

[0004] In view of this, the present application provides a data archiving method and an electronic device to effectively avoid the problem of the service life of the magnetic head being affected by continuous operation of the magnetic head, thereby avoiding the problem of the subsequent data archiving operation being affected by the reduced service life of the magnetic head.

[0005] The present application provides a data archiving method, the method comprising:

[0006] Get the current archiving task; the current archiving task is used to indicate that the target data collected by the data acquisition device associated with the current archiving task is to be archived during the set archiving execution time period; the target data is the data collected by the data acquisition device during the configured set archiving plan time period; the archiving execution time period is set after the set archiving plan time period; the target data is obtained from the data acquisition device before being archived and then stored in the designated storage space;

[0007] Checking whether the target tape has been used based on the designated first index area; the target tape is used to store the archived target data; the first index area at least records the information that the tape is occupied;

[0008] If the target tape has not been used, writing the information recorded in the first index area to the target tape;

[0009] After writing the information recorded in the first index area to the target tape, or when it is determined that the target tape has been used, checking whether the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area, if yes, writing the target data to the target tape, if not, writing the information recorded in the first index area to the target tape, and writing the target data to other available tapes;

[0010] The information that the target data occupies the magnetic tape is recorded in the first index area.

[0011] The present application also provides a data archiving device, which includes:

[0012] The acquisition module is used to obtain the current archiving task; the current archiving task is used to indicate that the target data collected by the data acquisition device associated with the current archiving task is to be archived during the set archiving execution time period; the target data is the data collected by the data acquisition device during the configured set archiving plan time period; the set archiving execution time period is after the set archiving plan time period; the target data is obtained from the data acquisition device before being archived and then stored in the designated storage space;

[0013] The checking module is used to check whether the target tape has been used based on the specified first index area; the target tape is used to store the archived target data; the first index area at least records the information that the tape is occupied;

[0014] A first archiving module, used for writing the information recorded in the first index area to the target tape if the target tape has not been used;

[0015] A second archiving module is used to check whether the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area after writing the information recorded in the first index area to the target tape or when it is determined that the target tape has been used, and if so, write the target data to the target tape; if not, write the information recorded in the first index area to the target tape and write the target data to other available tapes;

[0016] The recording module is used to record the information that the target data occupies the magnetic tape in the first index area.

[0017] The present application also provides an electronic device, the electronic device comprising:

[0018] Processor; and

[0019] A memory, in which computer program instructions are stored, and when the computer program instructions are executed by a processor, the processor executes the steps of the above method.

[0020] An embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps in the above method.

[0021] It can be seen from the above technical solutions that the embodiment of the present application pre-configures the archiving plan time period and the archiving execution time period for archiving the data collected by the data acquisition device based on actual needs, so that the data actually to be archived can be screened from the data collected by the data acquisition device based on the archiving plan time period, thereby improving the flexibility of archiving data selection; it can also control the execution time of the archiving operation, so that while improving the flexibility of the execution of the archiving operation, it can also control the working time of the magnetic head to effectively avoid the problem of reducing the service life of the magnetic head due to continuous operation of the magnetic head, thereby avoiding the problem of affecting the archiving operation of subsequent data due to the reduction of the service life of the magnetic head;

[0022] Furthermore, after the archiving task is completed, the embodiment of the present application synchronously writes the information recorded in the first index area to the tape. In this way, when the first index area becomes abnormal and unavailable, the first index area can be restored using the first index area information written to the tape, thereby avoiding the problem of long-period data archiving and querying being affected by the unavailability of the first index area, thereby improving the reliability of long-period data archiving and querying. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.

[0024] Figure 1 A flow chart of the method provided in an embodiment of the present application.

[0025] Figure 2 A schematic diagram of the system structure provided in an embodiment of the present application.

[0026] Figure 3 A schematic diagram of an implementation of a storage device provided in an embodiment of the present application.

[0027] Figure 4 A flow chart of a method for detecting the number of available tapes provided in an embodiment of the present application.

[0028] Figure 5 A flow chart of a method for generating an archiving task provided in an embodiment of the present application.

[0029] Figure 6 A flow chart of a method for deleting an archiving task provided in an embodiment of the present application.

[0030] Figure 7A flow chart of a method for executing an archiving task provided in an embodiment of the present application.

[0031] Figure 8 A flowchart of another method for executing an archiving task provided in an embodiment of the present application.

[0032] Fig. 9 A flowchart of another method for executing an archiving task provided in an embodiment of the present application.

[0033] Fig.10 A flow chart of a method for processing the first index area provided in an embodiment of the present application.

[0034] Fig.11 A flow chart of a method for data query provided in an embodiment of the present application.

[0035] Fig.12 A flow chart of a method for recovering from a failure of a first index area provided in an embodiment of the present application.

[0036] Fig.13 A device structure diagram provided for an embodiment of the present application.

[0037] Fig.14 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0039] See also Figure 1 , Figure 1 The method flow chart provided in the embodiment of the present application. The method is applied to an electronic device. In the present embodiment, the electronic device may be, for example, a microcomputer, a server, or other devices, which is not specifically limited in the present embodiment.

[0040] like Figure 1 As shown, the process may include the following steps:

[0041] Step 101, obtaining the current archiving task.

[0042] In this embodiment, the current archiving task is a task for archiving data collected by a certain data collection device, that is, the current archiving task is associated with a corresponding data collection device.

[0043] In this embodiment, an archiving execution time period (i.e., a set archiving execution time period) and an archiving plan time period (i.e., a set archiving plan time period) are configured for the above-mentioned data acquisition device. Based on this, in this embodiment, the electronic device can first store the data obtained from the above-mentioned data acquisition device in the designated storage space; thereafter, when the current archiving task associated with the above-mentioned data acquisition device is obtained, the target data can be read from the designated storage space in the above-mentioned set archiving execution time period and archiving operations can be performed; here, the target data refers to the data collected by the above-mentioned data acquisition device in the above-mentioned set archiving plan time period.

[0044] In this embodiment, the above-mentioned data acquisition device refers to a device with data acquisition and storage functions; as an embodiment, the data acquisition device may include but is not limited to a network camera, a picture capture machine, a digital video recorder, and a network video recorder.

[0045] Optionally, as an embodiment, this embodiment can pre-configure at least one set archiving plan time period and at least one set archiving execution time period for the same data acquisition device. Here, the set archiving plan time period refers to the pre-set data acquisition time period for the data to be archived; the set archiving execution time period refers to the pre-set time period for the data to be archived to be archived. The archiving execution time period is set after the archiving plan time period; for example, the archiving plan time period is set to 9:00 to 12:00 on a certain day (recorded as 9:00-12:00), and the archiving execution time period is set later than the archiving plan time period, for example, it can be 16:00-18:00 on that day.

[0046] This embodiment does not archive all data collected by the data acquisition device, but pre-configures the data acquisition device with an archiving plan time period and an archiving execution time period for data archiving, so as to selectively archive data based on actual needs, thereby improving the flexibility of data archiving.

[0047] Optionally, as an embodiment, the above-mentioned designated storage space can be a storage space pre-configured on the electronic device. As another embodiment, a storage device for storing data for a short period (such as one month, or half a year, etc.) can be separately set up. Here, the storage device can directly obtain the data collected by the data acquisition device, or receive the data collected by the data acquisition device transmitted by the electronic device, etc., which is not specifically limited in this embodiment; based on this, the above-mentioned designated storage space can be a storage space pre-configured on the storage device.

[0048] As for how to obtain the current archiving task in this step, an example will be given below and will not be described here.

[0049] Step 102 , based on the designated first index area, check whether the target tape has been used; if not, execute step 103 ; if yes, execute step 104 .

[0050] In this embodiment, the electronic device is connected to an external tape library; the tape library refers to a tape-based backup system, such as a tape library that can be composed of at least one tape drive, a mechanical arm, multiple tapes, and multiple tape slots for carrying tapes. The tape library can realize the removal and loading of tapes in the tape drive through the configured mechanical arm. Tape refers to a strip material with a magnetic layer for recording sound, images, digital or other signals. The tape drive refers to a component for reading and writing tapes, and its core component is the magnetic head. In the specific implementation, for example, the magnetic head contacts the tape to perform data reading and writing operations.

[0051] The target tape is a tape currently in use in a tape library, such as a tape currently in a tape drive. Here, the target tape is used to store the target data to be archived.

[0052] The first index area at least records the information that the tape is occupied. The specific content of the information that the tape is occupied is not limited here, for example, it may include information such as the tape identification of the occupied tape; the tape identification here may be, for example, the tape number (such as 1, 2, 3, etc.). Based on this, as an embodiment, the step 102 checks whether the target tape has been used based on the specified first index area. In specific implementation, for example, it may be: first obtain the tape identification of the tape currently located in the tape drive in the tape library as the tape identification of the target tape; then, check from the first index area whether there is a tape identification that matches the tape identification of the target tape. If so, it is determined that the target tape has been used, otherwise it is determined that the target tape has not been used.

[0053] Optionally, similar to the configuration of the above-mentioned designated storage space, the first index area in this step can be an area pre-configured on the electronic device; it can also be an area pre-configured on the above-mentioned storage device, which is not specifically limited in this embodiment. This embodiment does not need to introduce an additional hardware device such as a metadata server to record the information recorded in the first index area, but by configuring the first index area in the electronic device or the above-mentioned storage device, it can not only reduce the hardware cost, but also effectively avoid the problem of the availability of the first index area information contained therein being affected by the hardware stability and service life of the metadata server.

[0054] Step 103 , writing the information recorded in the first index area to the target magnetic tape; and continuing to step 104 .

[0055] In this embodiment, when it is determined that the target tape has not been used, the information recorded in the first index area is first written into the target tape. As an embodiment, in this step, the information recorded in the first index area is written into the target tape. In a specific implementation, for example, the information recorded in the first index area is first converted into a file, and then the file is written into the target tape. Here, there is no specific limitation on the storage location where the file is written into the target tape, for example, it can be the tape head position of the target tape.

[0056] In this embodiment, since the tapes in the tape library may have been used before entering the tape library, there may be old data remaining on them. Therefore, in order to avoid the old data remaining on the tapes affecting the data archived in this embodiment, as an embodiment, before writing the information recorded in the first index area to the target tape, it is also possible to check whether there is any old data remaining on the target tape. If so, it is necessary to delete the old data remaining on the target tape.

[0057] Step 104, check whether the available space of the target tape meets the requirement of accommodating the above-mentioned target data and the information recorded in the first index area; if so, execute step 105; otherwise, execute step 106.

[0058] In this embodiment, after the information recorded in the first index area is written to the target tape, or when it is determined that the target tape has been used, check whether the available space of the target tape meets the requirements for accommodating the target data and the information recorded in the first index area. If so, execute step 105; if not, execute step 106.

[0059] As an embodiment, after the target data in the above step 101 is stored in the designated storage space, the occupation status of the target data in the designated storage space needs to be recorded in the designated second index area; the specific content of the occupation status is not limited here, for example, the occupation status at least includes the size of the target data and the storage location of the target data, etc. As for the configuration of the second index area, it is similar to the configuration of the first index area in the above step 102, and will not be repeated here.

[0060] Based on the above description, as an embodiment, the step 104 of checking whether the available space of the target tape meets the requirement of accommodating the above-mentioned target data and the information recorded in the first index area may be specifically implemented as follows: first obtain the size of the target data from the second index area; then, check whether the size of the available space of the target tape is greater than or equal to the sum of the size of the target data and the size of the information recorded in the first index area; if so, determine that the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area; if not, determine that the available space of the target tape does not meet the requirement of accommodating the target data and the information recorded in the first index area.

[0061] Step 105 , writing the target data to the target tape; and continuing to step 107 .

[0062] In this embodiment, after determining that the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area, the target data is written to the target tape.

[0063] As an embodiment, there are many specific implementation methods for writing the target data to the target tape in step 105. For example, based on the above description, the storage position of the target data in the specified storage space can be obtained from the second index area; then, the target data can be read from the specified storage space based on the storage position and written to the target tape.

[0064] In this embodiment, for the same data acquisition device, the data type of the data to be collected can be configured in advance for the data acquisition device, such as the data type of the data to be collected configured for the network camera is a video type, the data type of the data to be collected configured for the image capture machine is a picture type, and so on. That is to say, the data type of the target data may include a video type, a picture type, and so on. Among them, since the video data is usually stored in a designated storage space in a streaming storage manner rather than in a file form; based on this, as an embodiment, in the case where the target data is video data, after reading the target data from the designated storage space based on the storage location, the target data needs to be converted into a file first, and then the file is written to the target tape.

[0065] Step 106 , writing the information recorded in the first index area to the target magnetic tape, and writing the target data to other available magnetic tapes; and continuing to execute step 107 .

[0066] In this embodiment, after determining that the available space of the target tape does not meet the requirement of accommodating the target data and the information recorded in the first index area, the information recorded in the first index area is first written to the target tape, and then another available tape is determined from the tape library to write the target data to the other available tape. As for how to write the target data to the other available tape, it is similar to how to write the target data to the target tape in the above step 105, and will not be repeated here.

[0067] In this embodiment, based on the above description, it can be known that the information on the occupied tape in the first index area may include the tape identification of the occupied tape; based on this, as an embodiment, the method for determining other available tapes in this step 106 may include, for example: first determining the tape identification of the occupied tape based on the information on the occupied tape recorded in the first index area; then, determining a currently unoccupied tape from the tape library based on the determined tape identification of the occupied tape and the tape identifications of all tapes in the tape library, such as searching the tape library for a tape corresponding to one of the tape identifications other than the tape identification recorded in the first index area as the currently unoccupied tape, and using the unoccupied tape as another available tape.

[0068] In this embodiment, as an embodiment, after determining other available tapes as mentioned above, the other available tapes can also be updated to the tapes currently in use, such as notifying the tape library to load the other available tapes into the tape drive; thereafter, the step of writing the target data to the other available tapes is executed.

[0069] Step 107, recording the information that the target data occupies the magnetic tape in the first index area.

[0070] In this embodiment, after the target data is written into the corresponding magnetic tape, it can be considered that the archiving operation of the target data is completed. At this time, the information that the target data occupies the magnetic tape can be recorded in the first index area.

[0071] Optionally, as an embodiment, after the information recorded in the first index area in this embodiment is written to the target tape, information occupied by the information recorded in the first index area in the target tape may also be recorded in the first index area.

[0072] So far, completed Figure 1 The process shown.

[0073] pass Figure 1 It can be seen from the process shown that the embodiment of the present application pre-configures the archiving plan time period and the archiving execution time period for archiving the data collected by the data acquisition device based on actual needs, so that the data actually to be archived can be screened from the data collected by the data acquisition device based on the archiving plan time period, thereby improving the flexibility of archiving data selection; it can also control the execution time of the archiving operation, so that while improving the flexibility of the execution of the archiving operation, it can also control the working time of the magnetic head to effectively avoid the problem of reducing the service life of the magnetic head due to continuous operation of the magnetic head, thereby avoiding the problem of affecting the archiving operation of subsequent data due to the reduction of the service life of the magnetic head;

[0074] Furthermore, in the process of executing the archiving task, the embodiment of the present application synchronously writes the information recorded in the first index area to the magnetic tape. In this way, when the first index area becomes abnormal and unavailable, the first index area can be restored using the first index area information written to the magnetic tape, thereby avoiding the problem of long-period data archiving and querying being affected by the unavailability of the first index area, thereby improving the reliability of long-period data archiving and querying.

[0075] As an embodiment, the present application also provides a data archiving system. The data archiving system is described below:

[0076] See also Figure 2 As shown, the system 200 includes: a data acquisition device 201, a management device 202, a storage device 203, and a tape library 204.

[0077] The above storage devices are described below:

[0078] In this embodiment, the data acquisition device is connected to a storage device, and the storage device is used to obtain the data collected by the data acquisition device and store the obtained data for a short period of time. Figure 3 As shown, the storage device 300 at least includes a storage space 301 , a thawing space 302 , a first index area 303 , and a second index area 304 .

[0079] The storage space refers to a data storage area pre-configured in the storage device, that is, the designated storage space in the above step 101. After obtaining the data collected by the data collection device, the storage device can store the obtained data in the storage space.

[0080] A ThawSpace is another data storage area pre-configured in a storage device. A ThawSpace can be used to store data read from tapes in a tape library.

[0081] Optionally, the storage space and the thaw space configured in the storage device may be a combined data storage area, or may be two independent data storage areas, which is not specifically limited in this embodiment.

[0082] The first index area refers to another data storage area pre-configured in the storage device. The information recorded in the first index area is not specifically limited here, for example, it may include the tape identification of the occupied tape, the device identification of the data acquisition device from which each data on the occupied tape comes (such as the device name and device number, etc.), the acquisition time period, and the data identification (such as the file name corresponding to the data, etc.), etc. It can be seen that if the first index area is damaged, the information occupied by the data on the tape will be lost, making the data on the tape unqueryable.

[0083] The second index area refers to another data storage area pre-configured in the storage device. The information recorded in the second index area is not specifically limited here, for example, it may include the device identification of the data acquisition device from which each data in the storage space comes, the data acquisition timestamp, the data size, and the storage location in the storage space, etc.

[0084] Optionally, the first index area and the second index area configured in the storage device may be a data storage area that is merged together, or may be two independent data storage areas, which is not specifically limited in this embodiment.

[0085] Optionally, the above-mentioned storage space, thaw space, first index area, and second index area may be implemented, for example, by a hard disk, a flash memory chip, a solid state disk (SSD), an Internet Protocol Storage Area Network (IPSAN), and a network attached storage (NAS), etc., which is not specifically limited in this embodiment.

[0086] The above management equipment is described below:

[0087] The management device can be considered to refer to an electronic device used to execute the data archiving method provided in the above embodiment. For example, the management device can be used for access management of data acquisition devices, management of working modes of data acquisition devices, management of data writing and reading, and data archiving management, etc. Here, the working mode may include the collection of video-type data and the collection of picture-type data.

[0088] Optionally, the management device and the storage device may be combined into one electronic device, or may be two independent electronic devices, which are connected via a network, and this embodiment does not specifically limit this. Where the management device and the storage device are one electronic device, the management device may be a microprocessor or processing chip in the electronic device, and the storage device may be a storage medium such as a hard disk in the electronic device.

[0089] The following is a description of the above tape library:

[0090] The tape library can include multiple tapes; the tape library can control the tapes in and out of the tape drives in the tape library through the mechanical arm configured inside the tape library to switch the tapes currently in use. When the tape library needs to replace the tape, manual assistance is required to enter and exit the tape library.

[0091] The data archiving system provided by this embodiment is described above. Based on the system described above, the data archiving method provided by this embodiment of the application is described from the perspective of a management device:

[0092] Step 1: Initialize the configuration of the storage space, the thaw space, the first index area, and the second index area in the storage device.

[0093] In this embodiment, the initialization configuration may be automatically configured by the management device or manually configured by the management device, which is not specifically limited in this embodiment. Accordingly, the specific content of the initialization configuration is not limited here either, and may be set based on actual needs, such as including the size and location of the occupied storage space.

[0094] Step 2: configure the working mode, data collection time period, and archiving strategy for indicating data archiving of each data collection device.

[0095] In this embodiment, the corresponding data collection time period and archiving strategy can be pre-configured for each data collection device based on actual needs; the archiving strategy here may include at least one set archiving plan time period and at least one set archiving execution time period, which is not specifically limited in this embodiment.

[0096] The data collection time period refers to a pre-set collection time period when the data collection device collects data, such as including a collection start time and a collection end time; for example, it may be 8:00-20:00.

[0097] The archiving plan time period is a pre-set collection time period for the data to be archived, which may include the archiving plan start time and the archiving plan end time. The archiving plan time period may be part or all of the time period selected from the data collection time period, such as 9:00-12:00.

[0098] The archiving execution time period is a pre-set time period for archiving data, which may include an archiving execution start time and an archiving execution end time. The archiving execution time period is set after the archiving plan time period, which may be 21:00-23:00, for example.

[0099] Optionally, when the types of data collected by different data collection devices are the same, the set archiving execution time periods configured by the data collection devices can be the same or different. When the types of data collected by different data collection devices are different, the set archiving execution time periods configured by the different data collection devices do not intersect, which can avoid cross-archiving between different types of data (such as video data and image data, etc.) and improve user experience.

[0100] Step three, controlling the storage device to obtain the data collected by each data collection device based on the data collection time period configured by each data collection device, and storing the obtained data in the storage space.

[0101] Here, after the acquired data is stored in the storage space, the information recorded in the second index area is synchronously updated.

[0102] Exemplarily, the working mode configured by the management device for the data acquisition device A is the acquisition mode of video type data, the configured data acquisition time period is 8:00-20:00, the archiving plan time period is set to 9:00-12:00, and the archiving execution time period is set to 21:00-23:00. That is to say, the storage device obtains video data from the data acquisition device A for 12 hours from 8:00 to 20:00 every day, and saves all the obtained video data into the storage space; wherein, the video data collected by the data acquisition device A in the three hours from 9:00 to 12:00 is used as the data to be archived (that is, the above-mentioned target data), and the data to be archived will be executed from the storage space to the tape of the tape library for archiving at 21:00, and the archiving operation will end at 23:00.

[0103] In another exemplary embodiment, the management device configures the working mode of the data acquisition device B as a data acquisition mode of the image type, the configured data acquisition time period is 10:00-18:00, the archiving plan time period is set to 10:00-15:00, and the archiving execution time period is set to 23:10-23:30. That is to say, the storage device obtains the captured image data from the data acquisition device B for 8 hours every day from 10:00 to 18:00, and saves the obtained image data to the storage space; wherein, the image data collected by the data acquisition device B in the 5 hours from 10:00 to 15:00 is used as the data to be archived. For example, if the data acquisition device B captures 1,000 images within these 5 hours, these 1,000 images will be used as the data to be archived and the archiving operation of writing them from the storage space to the tape of the tape library will be executed at 23:10, and the archiving operation will end at 23:30.

[0104] Step 4: Detection process of the number of remaining available tapes in the tape library.

[0105] In this embodiment, see Figure 4 As shown, taking the tape identifier of each tape in the tape library as the tape number as an example, the above method flow for detecting the number of remaining available tapes in the tape library may include the following steps:

[0106] Step 401, determine the tape number of the occupied tape based on the information recorded in the first index area, and determine the number of unoccupied tapes in the tape library according to the tape number of the occupied tape and the tape numbers of all tapes in the tape library.

[0107] In this embodiment, the number of unoccupied tapes in the tape library is determined based on the tape number of the occupied tape and the tape numbers of all tapes in the tape library. In a specific implementation, for example, the tapes in the tape library with tape numbers different from the tape number of the occupied tape are determined as unoccupied tapes, and based on this, the number of unoccupied tapes in the tape library can be determined. The unoccupied tapes here can be considered to refer to the remaining available tapes.

[0108] Step 402, determine whether the number of unoccupied tapes is less than a preset value; if so, execute step 403; if not, return to execute step 401.

[0109] The preset value here can be flexibly set based on actual needs, for example, it can be 0, 1 or 2.

[0110] Step 403, a warning is issued to prompt that the tape library is running low on tapes and needs to be replaced, and after the replacement is completed, the process returns to step 401.

[0111] Here, after the early warning is issued, it is necessary to manually replace and replenish the tape library with new tapes, and return to execute step 401 after the replenishment is completed.

[0112] Exemplarily, the management device detects the tape numbers 001, 002, 003, and 004 of all the tapes in the tape library through the storage device, and retrieves the tape numbers of all the tapes in the first index area; if the three tapes with numbers 001, 002, and 003 are occupied, it can be calculated that there is one tape 004 left in the tape library that is not occupied. At this time, the number of remaining available tapes (i.e., 1) is greater than the preset value 0, and no warning prompt is required. If the four tapes with numbers 001, 002, 003, and 004 are occupied, it can be calculated that there are 0 tapes left in the tape library that are not occupied. At this time, the number of remaining available tapes (i.e., 0) is equal to the preset value 0. At this time, the management device issues a warning to prompt that the tape library is insufficient and needs to be replaced.

[0113] Step 5: Archive the execution time period detection process.

[0114] As an embodiment, an archiving task can be generated based on the start time of the archiving execution time period. In a specific implementation, for example, the following can be done: for each data acquisition device, check whether the start time of the archiving execution time period configured for the data acquisition device matches the current time; if it matches, check whether there is an archiving task associated with the data acquisition device in the archiving task list; if not, generate the archiving task associated with the data acquisition device and add it to the archiving task list; if so, return to the step of checking whether the start time of the archiving execution time period configured for the data acquisition device matches the current time for each data acquisition device. If it does not match, skip the data acquisition device.

[0115] For example, see Figure 5 As shown, the above method flow for generating an archiving task based on setting the start time of the archiving execution time period may include the following steps:

[0116] Step 501 , for each data acquisition device, check whether the start time of the archiving execution time period configured for the data acquisition device matches the current time. If so, execute step 502 .

[0117] Here, if there is no match, the data acquisition device can be skipped.

[0118] Step 502 , determining whether the archiving task list contains the archiving task associated with the data acquisition device, if not, executing step 503 ; if yes, returning to executing step 501 .

[0119] Here, the archiving task associated with the data acquisition device refers to the archiving task including the device identification of the data acquisition device and a set archiving execution time period.

[0120] Step 503 , generating an archiving task associated with the data acquisition device and adding it to the archiving task list, and returning to execute step 501 .

[0121] In this embodiment, there is no limitation on the number and specific content of the generated archiving tasks associated with the data acquisition device; for example, when the data acquisition device is configured with multiple set archiving execution time periods and multiple set archiving plan time periods, the generated archiving tasks associated with the data acquisition device may be multiple, each of which may include the device identification of the data acquisition device, a set archiving execution time period of the data acquisition device, and one or more set archiving plan time periods.

[0122] For another example, when the data acquisition device is configured with one set archiving execution time period and multiple set archiving plan time periods, the archiving task generated and associated with the data acquisition device may be one, and the archiving task may include the device identification of the data acquisition device, one set archiving execution time period of the data acquisition device, and all set archiving plan time periods of the data acquisition device; and so on.

[0123] Optionally, since there is a situation where different data acquisition devices have the same set archiving execution time period, therefore, in the above process of checking whether the start time of the set archiving execution time period configured for each data acquisition device matches the current time, if it is found that the start time of the set archiving execution time period of multiple data acquisition devices matches the current time, the archiving tasks generated by each data acquisition device can be added to the archiving task list in sequence according to the set rules. The set rules here, for example, can be the order of the device numbers of the data acquisition devices, or the priority of the preset data acquisition devices, etc., which are not specifically limited in this embodiment.

[0124] Based on the above description, as an embodiment, there are many specific implementation methods for obtaining the current archiving task in the above step 101. For example, an archiving task can be obtained from the archiving task list in the order of the time of being added to the archiving task list as the current archiving task. Specifically, for example, an archiving task that was added to the archiving task list the earliest can be selected from the archiving task list as the current archiving task.

[0125] As an embodiment, the archiving tasks in the archiving task list can be deleted based on the end time of the set archiving execution time period. In the specific implementation, for example, it can be as follows: first check whether there is an archiving task in the archiving task list. If there is an archiving task in the archiving task list, obtain the archiving task that is added to the archiving task list the earliest from the archiving task list as the target archiving task; then, check whether the end time of the set archiving execution time period indicated by the target archiving task matches the current time. If it matches, check whether the execution status of the target archiving task is the first state used to indicate that it is in execution. If so, stop executing the target archiving task and delete the target archiving task from the archiving task list. If not, delete the target archiving task from the archiving task list. If it does not match, or after deleting the target archiving task from the archiving task list, return to the step of checking whether there is an archiving task in the archiving task list.

[0126] For example, see Figure 6 As shown, the above method flow for deleting the archiving tasks in the archiving task list based on the end time of the archiving execution time period may include the following steps:

[0127] Step 601 , check whether there is an archiving task in the archiving task list; if so, execute step 602 ; if not, continue to execute this step 601 .

[0128] Step 602, obtain the earliest archiving task added to the archiving task list from the archiving task list as the target archiving task, and check whether the end time of the set archiving execution time period indicated by the target archiving task matches the current time; if so, execute step 603; if not, return to execute step 601.

[0129] Step 603 , checking whether the execution status of the target archiving task is the first status indicating that it is being executed; if so, executing step 604 ; if not, executing step 605 .

[0130] Step 604 , stop executing the target archiving task, and continue to execute step 605 .

[0131] Step 605 , deleting the target archiving task from the archiving task list, and returning to step 601 .

[0132] Step 6: Archive task execution process.

[0133] In this embodiment, it should be noted that the archiving tasks in the archiving task list are executed in the order of the time when they are added to the archiving task list, and usually the execution of the next archiving task is triggered only after the execution of one archiving task is completed.

[0134] Archiving tasks can be divided into the following two categories according to the data type of the data to be archived (i.e., target data): archiving tasks for video data types and archiving tasks for image data types. Different types of archiving tasks correspond to different archiving task execution processes.

[0135] As an example, see Figure 7 As shown, the method flow for executing the archiving task in step six includes the following steps:

[0136] Step 701, determine whether there is an archiving task in the archiving task list; if yes, execute step 702; if no, continue to execute this step 701.

[0137] Step 702: Obtain the current archiving task from the archiving task list in the order of time when the task was added to the archiving task list.

[0138] Step 703, if the current archiving task is an archiving task of the video data type, obtain the corresponding video data from the storage space as the target data according to the set archiving plan time period of the current archiving task, write the target data to the tape, and continue to execute step 705.

[0139] Step 704, if the current archiving task is an archiving task of the picture data type, obtain the corresponding picture from the storage space as the target data according to the set archiving plan time period of the current archiving task, write the target data into the tape, and continue to execute step 705.

[0140] Step 705 , after the current archiving task is executed, the current archiving task is deleted from the archiving task list, and the process returns to step 701 .

[0141] In this embodiment, as an embodiment, when the target data is archived, if the target data has a large amount of data, the target data can be divided into multiple batches to obtain multiple sub-target data, and then each sub-target data is archived accordingly, so as to avoid the situation where the resource usage rate is too high and the device performance is reduced due to the large amount of data to be archived at one time. The sub-target data under each batch can be archived in the order of the collection time period.

[0142] Based on the above description, the specific implementation process of the above step 703 is described below:

[0143] As an example, take the case where the target data is divided into multiple batches and then archived. Figure 8 As shown, the specific implementation process of the above step 703 is as follows:

[0144] Step 801, for the sub-target data in the current batch, obtain the storage location and size of the sub-target data in the current batch in the storage space from the second index area.

[0145] Step 802, query in the first index area whether the sub-target data under the current batch has completed the archiving operation, if yes, execute step 803; if not, execute step 804.

[0146] Here, if the index information corresponding to the sub-target data in the current batch can be queried in the first index area, it can be determined that the sub-target data in the current batch has completed the archiving operation, otherwise, it is determined that the sub-target data in the current batch has not completed the archiving operation.

[0147] Step 803 , when the current batch is not the last batch, one of the batches that have not been archived is used as the current batch, and the process returns to step 801 .

[0148] Step 804 , writing the information recorded in the first index area to the target tape in the form of a file; and continuing to execute step 805 .

[0149] As for how to write the information recorded in the first index area into the target magnetic tape in the form of a file, an example will be given below to describe it, and no further details will be given here.

[0150] Step 805, after reading the sub-target data of the current batch from the storage space, the read data is written into the target tape in the form of a file.

[0151] Here, the name of the file may be determined based on the device identification of the data acquisition device (such as the device name and device number, etc.) and the data acquisition time period (such as including the start time and the end time) of the data.

[0152] Step 806 , updating the information recorded in the first index area, and when the current batch is not the last batch, taking one of the batches that have not been archived as the current batch, and returning to step 801 .

[0153] When the current batch is the last batch, it means that the target data corresponding to the current archiving task has completed the archiving operation. At this time, it can be considered that the current archiving task has been completed.

[0154] Here, there is no specific limitation on how to update the information recorded in the first index area; for example, as shown in Table 1, the first index area may record the corresponding archiving order of the sub-target data under the current batch, the set archiving plan time period (such as including the start time and end time of the sub-target data), the file name (such as including the device identification of the data acquisition device and the set archiving plan time period), and the correspondence between the tape numbers of the occupied tapes.

[0155] Table 1: First index area

[0156]

[0157] For example, data acquisition device A records video from 8:00 to 20:00 every day, and the storage device obtains video data from data acquisition device A for 12 hours from 8:00 to 20:00 every day, and saves all the obtained video data in the storage space. The management device configures the archiving plan time period for the data acquisition device A to be 9:00-12:00, and the archiving execution time period to be 21:00-23:00. Afterwards, when executing the corresponding archiving task, the management device reads 1 hour of data each time from the video data collected by data acquisition device A during the three hours from 9:00 to 12:00, so that the video data can be divided into three batches and then written to the tape in the form of files after reading from the storage space; the archiving task is executed until 23:00.

[0158] The specific implementation process of the above step 704 is described below:

[0159] As an example, take the case where the target data is divided into multiple batches (such as one picture as one batch) and then archived. Fig. 9 As shown, the specific implementation process of the above step 704 is as follows:

[0160] Step 901: For a current picture, obtain the storage position and size of the current picture in the storage space from the second index area.

[0161] Step 902, query in the first index area whether the current picture has completed the archiving operation, if yes, execute step 903; if not, execute step 904.

[0162] Here, the current image can be understood as the sub-target data under the current batch.

[0163] In the first index area, it is queried whether the current image has completed the archiving operation. In the specific implementation, for example, if the index information corresponding to the current image can be queried in the first index area, it can be determined that the current image has completed the archiving operation; otherwise, it is determined that the current image has not completed the archiving operation.

[0164] Step 903 , when the current picture is not the last unarchived picture in the target data, one of the unarchived pictures in the target data is used as the current picture, and the process returns to step 901 .

[0165] Step 904: Write the information recorded in the first index area to the target tape in the form of a file.

[0166] Step 905, after reading the current picture from the storage space, write the current picture to the target tape.

[0167] Here, since the image itself is stored in the storage space in the form of a file, that is, the image itself is a file, there is no need to convert it into a file. The name of the image can be determined based on the device identification of the data acquisition device (such as the device name and device number, etc.) and the acquisition timestamp of the image, which is not specifically limited here.

[0168] Step 906, updating the information recorded in the first index area, and when the current picture is not the last unarchived picture in the target data, taking one of the unarchived pictures in the target data as the current picture, and returning to step 901.

[0169] When the current image is the last unarchived image in the target data, it means that the target data corresponding to the current archiving task has completed the archiving operation. At this time, it can be considered that the current archiving task has been completed.

[0170] Here, there is no specific limitation on how to update the information recorded in the first index area; for example, as shown in Table 2, the corresponding relationship between the filing order corresponding to the current picture, the acquisition timestamp of the picture, the file name, and the tape number of the occupied tape can be recorded in the first index area.

[0171] Table 2: First index area

[0172]

[0173] For example, data acquisition device B captures pictures from 10:00 to 18:00 every day, and the storage device obtains captured picture data from data acquisition device B for 8 hours from 10:00 to 18:00 every day, and saves all the obtained picture data in the storage space. The management device configures the archiving plan time period for the data acquisition device B to be 10:00-15:00, and the archiving execution time period to be 23:10-23:30. If data acquisition device B captures 1,000 pictures within the 5 hours from 10:00 to 15:00, these 1,000 pictures will be archived from the storage space to the tapes in the tape library starting at 23:10.

[0174] Afterwards, when the management device executes the corresponding archiving task, it reads the 1000 pictures collected by the data acquisition device B in the five hours from 10:00 to 15:00, one picture at a time from the storage space in the order of collection time and writes them to the tape in the tape library. After repeating this 1000 times, the archiving task is completed; the archiving task is executed until 23:30.

[0175] The following describes how to write the information recorded in the second index area to the target tape in the form of a file:

[0176] As an example, see Fig.10 As shown, the above-mentioned writing of the information recorded in the second index area into the target magnetic tape in the form of a file may include the following steps in specific implementation:

[0177] Step 1001, query in the first index area whether the target tape has been used; if not, execute step 1002; if yes, execute step 1005.

[0178] Step 1002, check whether there is any old data remaining on the target tape; if so, execute step 1003; if not, execute step 1004.

[0179] Step 1003, delete the old data remaining in the target tape; and continue to execute step 1004.

[0180] Step 1004 , write the information recorded in the first index area into the header of the target tape in the form of a file; and continue to execute step 1005 .

[0181] Step 1005, check whether the available space size of the target tape is greater than or equal to the sum of the size of the sub-target data under the current batch and the size of the information recorded in the first index area; if so, execute step 1006; if not, execute step 1007.

[0182] Step 1006, exit this process.

[0183] Step 1007 , write the information recorded in the first index area to the end of the target tape in the form of a file; and proceed to step 1008 .

[0184] Here, if the available space size of the target tape is greater than or equal to the sum of the size of the sub-target data under the current batch and the size of the information recorded in the first index area, it means that the available space of the target tape is sufficient to accommodate the sub-target data under the current batch and the information recorded in the first index area. At this time, you can exit this process and return to execute the above step of writing the sub-target data under the current batch to the target tape (that is, the above step 804 or step 904).

[0185] If the available space size of the target tape is smaller than the sum of the size of the sub-target data in the current batch and the size of the information recorded in the first index area, it means that the target tape cannot accommodate the sub-target data in the current batch and the information recorded in the first index area. At this time, the information recorded in the first index area can be written to the tail of the target tape in the form of a file, and then another available tape can be determined from the tape library to store the sub-target data in the current batch.

[0186] Step 1008 , determine other available tapes from the tape library, and use the other available tapes as target tapes, and return to step 1001 .

[0187] As for how to determine other available tapes from the tape library, please refer to the relevant description in the above step 106, which will not be repeated here.

[0188] In this embodiment, in order to avoid the problem of being unable to query archived data due to damage to the first index area in the storage device, this embodiment will back up the information recorded in the first index area on the tape after the archiving task is completed. This can ensure that when the first index area is abnormally damaged, the first index area information backed up on the tape can be used to restore data in the first index area in the storage device.

[0189] Step 7: Data query process.

[0190] In this embodiment, as an embodiment, when receiving an external data query instruction, first check whether there is an archiving task in the current archiving task list; wherein the data query instruction at least indicates the device identification of the data acquisition device from which the query data to be queried comes, and the query time period in which the query data is located;

[0191] Afterwards, if there is no archiving task in the current archiving task list, check whether there is query data corresponding to the data query instruction in the specified storage space according to the data query instruction and the second index area; if yes, obtain the storage location corresponding to the query data from the second index area based on the query time period and the device identification indicated by the data query instruction, obtain the query data based on the storage location and output it; if not, obtain the magnetic tape occupied by the query data and the data identification corresponding to the query data from the first index area based on the query time period and the device identification indicated by the data query instruction, obtain the query data from the magnetic tape occupied by the query data based on the data identification corresponding to the query data and output it;

[0192] If there is an archiving task in the current archiving task list, an indication message indicating that the data query failed is output.

[0193] In this embodiment, as an embodiment, the query data is obtained and outputted from the tape occupied by the query data based on the data identifier corresponding to the query data. In a specific implementation, for example, it can be: first, based on the tape identifiers of all tapes in the tape library, check whether there is a tape occupied by the query data in the tape library; then, if there is a tape occupied by the query data in the tape library, check whether the available space size of the designated thawspace (that is, the above-mentioned thawspace) is greater than or equal to a preset threshold value, if so, read the query data from the tape occupied by the query data based on the data identifier corresponding to the query data and write it to the designated thawspace, if not, clear the earliest data written to the designated thawspace in the designated thawspace, and return to the step of checking whether the available space size of the designated thawspace is greater than or equal to the preset threshold value; finally, obtain the query data from the designated thawspace based on the data identifier corresponding to the query data and output it. The data identifier here can be a file name, etc.

[0194] For example, see Fig.11 As shown, the data query method flow in step seven may include the following steps:

[0195] Step 1101, receiving an external data query instruction.

[0196] Here, the data query instruction at least indicates the device identification of the data acquisition device from which the query data to be queried comes, and the query time period in which the query data is located. For example, the data query instruction may be "search for data collected by data acquisition device A between 8:00 and 10:00 on April 29, 2024"; based on this, the device identification may be "data acquisition device A" and the query time period may be "8:00 to 10:00 on April 29, 2024".

[0197] Step 1102 , check whether there is an archiving task in the current archiving task list; if so, execute step 1103 ; if not, execute step 1104 .

[0198] Step 1103, returning information indicating that the data query failed.

[0199] Here, in order to avoid mutual influence between data query and archiving task execution, when there is an archiving task in the current archiving task list, the archiving task is executed first.

[0200] Step 1104 , query whether the storage space in the second index area contains the query data to be queried; if so, execute step 1105 ; if not, execute step 1106 .

[0201] Step 1105, based on the query time period indicated by the data query instruction and the device identification, obtain the storage location corresponding to the query data from the second index area, obtain the query data based on the storage location and output it.

[0202] Step 1106, based on the query time period indicated by the data query instruction and the device identification, obtain from the first index area the tape occupied by the query data, the number of files corresponding to the query data, the file name, and the file size as the query result; and continue to execute step 1107.

[0203] Step 1107, when it is found that the tape indicated by the above query result exists in the tape library, determine whether the available space size of the thaw space is greater than or equal to the preset threshold; if so, execute step 1108; if not, execute step 1109.

[0204] Here, for each tape indicated by the above query result, if it is found that the tape does not exist in the tape library, a prompt needs to be issued to indicate that the tape does not exist in the tape library. At this time, the tape needs to be manually placed in the tape library, and then continue to execute the following steps.

[0205] Step 1108 , reading the query data from the tape indicated by the query result based on the data identifier corresponding to the query data, and writing the read query data into the ThawSpace; then proceed to step 1110 .

[0206] Step 1109 , clear the earliest file written to the ThawSpace in the ThawSpace, and return to step 1107 .

[0207] Step 1110: Based on the file name indicated by the query result, a file matching the file name is read from the ThawSpace and output as query data.

[0208] Step 7: Failure recovery process of the first index area.

[0209] As an embodiment, when an abnormality is found in the first index area, first check whether there is at least one candidate data in each tape of the tape library based on the data identifier corresponding to the data recorded in each tape of the tape library; here, the candidate data refers to the data indicating the information of the first index area; then, if there is at least one candidate data, then determine the reference data from each tape of the tape library based on the time when the data recorded in each tape of the tape library is written to the tape and clear the first index area, read the reference data from the tape library and write it to the first index area, so as to realize the recovery of the information of the first index area. Here, the reference data refers to the candidate data with the latest time of being written to the tape.

[0210] As for how to check whether there is an abnormality in the first index area, an example will be given below and will not be described here.

[0211] For example, see Fig.12 As shown, the failure recovery process of the first index area in step seven may include the following steps:

[0212] Step 1201, check whether the first index area of ​​the storage device is abnormal; if so, execute step 1202; if not, continue to execute this step 1201.

[0213] In this embodiment, there are many specific implementations for checking whether the first index area of ​​the storage device is abnormal, such as: when it is found that the first index area is inaccessible, or when it is found that the number of inaccessible times of the first index area is greater than a set value, it is determined that the first index area is abnormal. The inaccessible situation here may be, for example, the inability to write and / or read data from the first index area, which is not specifically limited here.

[0214] Step 1202 , based on the file names corresponding to the files recorded in the tapes of the tape library and the file writing time, check whether there are candidate files in the tapes of the tape library; if so, execute step 1203 .

[0215] Here, the file writing time refers to the time when the file is written to the tape. The candidate file refers to the file that records the information of the first index area (that is, the candidate data mentioned above). If the candidate file does not exist in the tapes of the tape library, it is necessary to manually select the tape that has been archived most recently from the tapes outside the tape library and put it into the tape library, and then continue to execute this step.

[0216] Step 1203, select the candidate file with the latest file writing time from each candidate file as the reference file, clear the first index area, read the reference data from the tape library and write it into the first index area.

[0217] Here, the reference document refers to the reference data mentioned above.

[0218] This embodiment backs up the information recorded in the first index area to a magnetic tape after the archiving task is completed. In this way, when an abnormality occurs in the first index area in the storage device, the first index area can be rebuilt again using the first index area information recorded in the magnetic tape, so that the first index area can continue to be used to record information about the tape occupied by archived data, and the data in the magnetic tape can be retrieved again based on the restored first index area, thereby improving the reliability of data archiving and query.

[0219] It should be noted that this embodiment does not specifically limit the order of execution of the various steps of the above data archiving method.

[0220] At this point, the description of the method provided in this embodiment is completed. The following describes the device provided in this embodiment of the application:

[0221] As an embodiment, this embodiment also provides a data archiving device. Fig.13 , Fig.13 This is a schematic diagram of the device structure provided in the embodiment of the present application. Fig.13 As shown, the device 1300 includes:

[0222] The acquisition module 1301 is used to obtain the current archiving task; the current archiving task is used to indicate that the target data collected by the data acquisition device associated with the current archiving task is archived in the set archiving execution time period; the target data is the data collected by the data acquisition device in the configured set archiving plan time period; the set archiving execution time period is after the set archiving plan time period; the target data is obtained from the data acquisition device before being archived and then stored in the designated storage space;

[0223] The checking module 1302 is used to check whether the target tape has been used based on the specified first index area; the target tape is used to store the archived target data; the first index area at least records the information that the tape is occupied;

[0224] The first archiving module 1303 is used to write the information recorded in the first index area to the target tape if the target tape has not been used;

[0225] The second archiving module 1304 is used to check whether the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area after writing the information recorded in the first index area to the target tape or when it is determined that the target tape has been used, and if so, write the target data to the target tape; if not, write the information recorded in the first index area to the target tape and write the target data to other available tapes;

[0226] The recording module 1305 is used to record the information that the target data occupies the magnetic tape in the first index area.

[0227] As an embodiment, the apparatus further includes: a generation module, which is used to check, for each data acquisition device, whether the start time of the set archiving execution time period configured for the data acquisition device matches the current time; if so, check whether there is an archiving task associated with the data acquisition device in the archiving task list; if not, generate the archiving task associated with the data acquisition device and add it to the archiving task list; if so, return to the step of checking, for each data acquisition device, whether the start time of the set archiving execution time period configured for the data acquisition device matches the current time;

[0228] The current archive tasks are obtained from the archive task list in the order of time when they were added to the archive task list.

[0229] As an embodiment, the recording module 1305 is further used to: after the target data is stored in the designated storage space, record the occupation status of the target data in the designated storage space to the designated second index area; the occupation status at least includes the size of the target data and the storage location of the target data;

[0230] Checking whether the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area, including: obtaining the size of the target data from the second index area; checking whether the size of the available space of the target tape is greater than or equal to the sum of the size of the target data and the size of the information recorded in the first index area, if yes, determining that the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area, if no, determining that the available space of the target tape does not meet the requirement of accommodating the target data and the information recorded in the first index area;

[0231] Writing the target data to the target tape or other available tapes includes: obtaining the storage location of the target data from the second index area, reading the target data from the designated storage space based on the storage location, and writing the target data to the target tape or other available tapes.

[0232] As an embodiment, the information about the target data occupying the magnetic tape recorded in the first index area at least includes: a magnetic tape identifier of the occupied magnetic tape;

[0233] The other available tapes are determined by the following steps: determining the tape identification of the occupied tape based on the information recorded in the first index area; determining a currently unoccupied tape from the tape library according to the determined tape identification of the occupied tape and the tape identifications of all tapes in the tape library, and using the unoccupied tape as the other available tape;

[0234] The target data is video data; writing the target data to the target tape or other available tapes includes: converting the target data into a file, and writing the file to the target tape or other available tapes.

[0235] As an embodiment, the occupation of the target data in the designated storage space recorded in the second index area also includes: the device identification of the data acquisition device, and the set filing plan time period of the target data; the information of the target data occupying the magnetic tape recorded in the first index area also includes: the device identification of the data acquisition device, the set filing plan time period, and the data identification corresponding to the target data;

[0236] The device also includes: a query module, which is used to check whether there is query data corresponding to the data query instruction in the specified storage space based on the data query instruction and the second index area when receiving an external data query instruction, if there is no archiving task in the current archiving task list; the data query instruction at least indicates the device identification of the data acquisition device from which the query data comes, and the query time period; if yes, based on the query time period and the device identification indicated by the data query instruction, obtain the storage location corresponding to the query data from the second index area, obtain the query data based on the storage location and output it; if not, based on the query time period and the device identification indicated by the data query instruction, obtain the magnetic tape occupied by the query data and the data identification corresponding to the query data from the first index area, obtain the query data from the magnetic tape occupied by the query data based on the data identification corresponding to the query data and output it.

[0237] As an embodiment, query data is obtained from a magnetic tape occupied by the query data based on a data identifier corresponding to the query data and outputted, including: based on the tape identifiers of all tapes in the tape library, checking whether there is a magnetic tape occupied by the query data in the tape library; if there is a magnetic tape occupied by the query data in the tape library, checking whether the size of the available space in a designated thaw space is greater than or equal to a preset threshold value; if so, reading the query data from the magnetic tape occupied by the query data based on the data identifier corresponding to the query data and writing it to the designated thaw space; if not, clearing the earliest data written to the designated thaw space in the designated thaw space, and returning to the step of checking whether the size of the available space in the designated thaw space is greater than or equal to the preset threshold value; obtaining query data from the designated thaw space based on the data identifier corresponding to the query data and outputting it.

[0238] As an embodiment, the device also includes: an exception handling module, which is used to check whether there is at least one candidate data in each tape of the tape library based on the data identifier corresponding to the data recorded in each tape of the tape library when an exception is found in the first index area; the candidate data refers to the data indicating the information of the first index area; if there is at least one candidate data, based on the time corresponding to the data recorded in each tape of the tape library being written to the tape, the reference data is determined from each tape of the tape library and the first index area is cleared, and the reference data is read from the tape library and written to the first index area; the reference data refers to the candidate data with the latest time of being written to the tape.

[0239] As an embodiment, the device also includes: a deletion module, used to check whether there is an archiving task in the archiving task list. If there is an archiving task in the archiving task list, obtain the archiving task that is added to the archiving task list the earliest from the archiving task list as the target archiving task; check whether the end time of the set archiving execution time period indicated by the target archiving task matches the current time; if it matches, check whether the execution status of the target archiving task is the first state used to indicate execution, if so, stop executing the target archiving task and delete the target archiving task from the archiving task list, if not, delete the target archiving task from the archiving task list; if it does not match, or after deleting the target archiving task from the archiving task list, return to the step of checking whether there is an archiving task in the archiving task list.

[0240] As an embodiment, when different data collection devices collect data of different types, the different data collection devices are configured to have non-overlapping archiving execution time periods.

[0241] So far, completed Fig.13 The implementation process of the functions and effects of each module in the above device is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.

[0242] See also Fig.14 , is a schematic diagram of the hardware structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device may include a processor 1401, a communication interface 1402, a memory 1403 and a communication bus 1404. The processor 1401, the communication interface 1402 and the memory 1403 communicate with each other through the communication bus 1404. Among them, the memory 1403 stores computer program instructions; the processor 1401 can execute the steps of the method described in the above embodiment by executing the computer program instructions stored in the memory 1403. The electronic device may also include other hardware according to the actual function of the electronic device, which will not be described in detail.

[0243] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, on which a number of computer program instructions are stored. When the computer program instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.

[0244] Exemplarily, the computer-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the computer-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof. The processor and memory may be supplemented by or incorporated into a dedicated logic circuit.

[0245] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A data archiving method, characterized in that: The method includes: Obtaining a current archiving task; the current archiving task is used to instruct to perform an archiving operation on target data collected by a data acquisition device associated with the current archiving task during a set archiving execution time period; the target data is data collected by the data acquisition device during a configured set archiving plan time period; the archiving execution time period is set after the set archiving plan time period; the target data is obtained from the data acquisition device before being archived and then stored in a designated storage space; Checking whether the target tape has been used based on the designated first index area; the target tape is used to store the archived target data; the first index area at least records the information that the tape is occupied; If the target tape has not been used, writing the information recorded in the first index area to the target tape; After writing the information recorded in the first index area to the target tape, or when it is determined that the target tape has been used, checking whether the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area, if yes, writing the target data to the target tape, if not, writing the information recorded in the first index area to the target tape, and writing the target data to other available tapes; The information that the target data occupies the magnetic tape is recorded in the first index area; the information that the target data occupies the magnetic tape recorded in the first index area at least includes: a data identifier corresponding to the target data; When an abnormality is found in the first index area, based on the data identifier corresponding to the data recorded in each tape of the tape library, check whether there is at least one candidate data in each tape of the tape library; the candidate data refers to data indicating the information of the first index area; if there is at least one candidate data, based on the time corresponding to the data recorded in each tape of the tape library being written to the tape, reference data is determined from each tape of the tape library and the first index area is cleared, and the reference data is read from the tape library and written to the first index area; the reference data refers to the candidate data with the latest time of being written to the tape.

2. The method according to claim 1, characterized in that The method further comprises: For each data collection device, check whether the start time of the archive execution time period configured for the data collection device matches the current time; If there is a match, check whether there is an archiving task associated with the data acquisition device in the archiving task list; if not, generate the archiving task associated with the data acquisition device and add it to the archiving task list; if yes, return to the step of checking for each data acquisition device whether the start time of the archiving execution time period configured for the data acquisition device matches the current time; The current archiving task is obtained from the archiving task list in the order of time in which it is added to the archiving task list.

3. The method according to claim 1, characterized in that: After the target data is stored in the designated storage space, the method further comprises: recording the occupation status of the target data in the designated storage space to the designated second index area; the occupation status at least includes the size of the target data and the storage location of the target data; The checking whether the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area includes: obtaining the size of the target data from the second index area; checking whether the size of the available space of the target tape is greater than or equal to the sum of the size of the target data and the size of the information recorded in the first index area, if yes, determining that the available space of the target tape meets the requirement of accommodating the target data and the information recorded in the first index area, if no, determining that the available space of the target tape does not meet the requirement of accommodating the target data and the information recorded in the first index area; Writing the target data to the target tape or other available tapes includes: obtaining the storage location of the target data from the second index area, reading the target data from the designated storage space based on the storage location, and writing the target data to the target tape or other available tapes.

4. The method according to claim 3, characterized in that The information about the target data occupying the magnetic tape recorded in the first index area further includes: a magnetic tape identifier of the occupied magnetic tape; The other available tapes are determined by the following steps: determining the tape identification of the occupied tape based on the information recorded in the first index area; determining a currently unoccupied tape from the tape library according to the determined tape identification of the occupied tape and the tape identifications of all tapes in the tape library, and using the unoccupied tape as the other available tape; The target data is video data; writing the target data to a target tape or other available tapes includes: converting the target data into a file, and writing the file to the target tape or other available tapes.

5. The method according to claim 4, characterized in that The occupation of the target data in the designated storage space recorded in the second index area also includes: the device identification of the data acquisition device, and the set filing plan time period of the target data; The information of the target data occupying the magnetic tape recorded in the first index area also includes: the device identification of the data acquisition device, and the set filing plan time period; The method further comprises: upon receiving an external data query instruction, if there is no archiving task in the current archiving task list, checking whether there is query data corresponding to the data query instruction in the designated storage space according to the data query instruction and the second index area; the data query instruction at least indicates the device identification of the data acquisition device from which the query data comes, and the query time period; If yes, then based on the query time period and the device identifier indicated by the data query instruction, obtain the storage location corresponding to the query data from the second index area, obtain the query data based on the storage location and output it; If not, based on the query time period indicated by the data query instruction and the device identifier, the magnetic tape occupied by the query data and the data identifier corresponding to the query data are obtained from the first index area, and based on the data identifier corresponding to the query data, the query data is obtained from the magnetic tape occupied by the query data and output.

6. The method according to claim 5, characterized in that The step of obtaining and outputting the query data from a magnetic tape occupied by the query data based on the data identifier corresponding to the query data includes: Check whether there is a tape occupied by the query data in the tape library based on the tape IDs of all tapes in the tape library; If the tape occupied by the query data exists in the tape library, then checking whether the size of the available space of the designated thawspace is greater than or equal to a preset threshold value; if so, reading the query data from the tape occupied by the query data based on the data identifier corresponding to the query data and writing it into the designated thawspace; if not, clearing the earliest data written into the designated thawspace in the designated thawspace, and returning to the step of checking whether the size of the available space of the designated thawspace is greater than or equal to the preset threshold value; The query data is obtained from the designated thawspace based on the data identifier corresponding to the query data and outputted.

7. The method according to claim 2, characterized in that The method further comprises: Check whether there is an archiving task in the archiving task list. If there is an archiving task in the archiving task list, obtain the archiving task that was added to the archiving task list the earliest from the archiving task list as the target archiving task; Check whether the end time of the set archiving execution time period indicated by the target archiving task matches the current time; If it matches, check whether the execution state of the target archiving task is the first state indicating that it is in execution; if it is, stop executing the target archiving task and delete the target archiving task from the archiving task list; if not, delete the target archiving task from the archiving task list; If there is no match, or after the target archiving task is deleted from the archiving task list, the process returns to the step of checking whether there is an archiving task in the archiving task list.

8. The method according to claim 1, characterized in that When different data collection devices collect data of different types, the different data collection devices are configured with non-overlapping archiving execution time periods.

9. An electronic device, characterized in that: The electronic device includes: Processor; and A memory, wherein computer program instructions are stored in the memory, and when the computer program instructions are executed by the processor, the processor is caused to perform the steps in any one of the methods of claims 1 to 8.

Citation Information

Patent Citations

  • Method convenient for remote sensing satellite data archiving and recovery performance test

    CN114860558A

  • Tape library data processing method and system, electronic equipment and storage medium

    CN117539392A