Video storage method, video reading method, disk and electronic equipment
By storing video recordings and accompanying data in different storage blocks on the disk and recording relevant information, the problem of slow read/write speeds caused by multiple seeks in the video storage block is solved, achieving more efficient disk read/write and accompanying data retrieval.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, video recordings and their accompanying data are stored in the same disk storage block, which requires the read/write head to perform multiple seek operations, resulting in longer seek times and rotational delays, slower disk read/write speeds, and lower efficiency in reading accompanying data.
Video recordings and accompanying data are stored in different storage blocks on the disk. The disk's summary area records the time of the video storage block, the location information of the accompanying data storage block, and the index information. By skipping between different storage blocks, seek time and rotational latency are reduced, thereby improving read and write speeds.
It reduces seek time and rotational latency during disk read/write, improves disk read/write speed and the efficiency of reading accompanying data, avoids fragmentation of accompanying data storage blocks, reduces the degree of disk fragmentation, and improves disk read/write performance.
Smart Images

Figure CN121644753A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video recording and storage technology, and in particular to a video recording and storage method, a video recording and retrieval method, a disk, and an electronic device. Background Technology
[0002] The accompanying data of the video recording is the specific information of the intelligent events that occur during the accompanying video recording and are triggered within a certain period of time. Since the data source of the video recording and its accompanying data is the same, in order to ensure the consistency between the video recording and its accompanying data, the video recording and its accompanying data are usually stored together in the same disk storage block.
[0003] like Figure 1 As shown, a space is allocated within the video storage block to store accompanying data. Different types of accompanying data reside in different accompanying data areas, and one accompanying data area can store multiple pieces of the same type of accompanying data. One piece of accompanying data corresponds to only one video recording, and one video recording can correspond to different accompanying data areas.
[0004] Because a disk requires a read / write head to control data reading and writing, the head needs to move to the correct track on the disk to read or write data. Figure 1 In this storage structure, the read / write head needs to perform multiple seek operations when reading and writing data, which will result in longer seek time and disk rotational latency, slower disk read / write speed, and lower data reading efficiency. Summary of the Invention
[0005] This invention provides a video recording storage method, a video recording retrieval method, a disk, and an electronic device to address the deficiencies in the prior art.
[0006] This invention provides a video recording storage method, comprising: Obtain the video segment to be stored and the corresponding accompanying data segment to be stored; The video segment to be stored is stored in the video storage block of the disk, and the accompanying data segment to be stored is stored in the accompanying data storage block of the disk. The video storage block and the accompanying data storage block are different storage blocks on the disk.
[0007] According to a video recording storage method provided by the present invention, storing the video segment to be stored into the video recording storage block of the disk, and storing the accompanying data segment to be stored into the accompanying data storage block of the disk, further includes: In the summary area of the disk, the start time and end time of the video storage block, the location information of the accompanying data storage block, and the index information of the accompanying data segment to be stored within the accompanying data storage block are recorded.
[0008] According to a video recording storage method provided by the present invention, storing the video segment to be stored into the video recording storage block of the disk further includes: If the free storage space of the video storage block is empty, the video segment to be stored is overwritten on the already stored video segment in the video storage block, and the already stored accompanying data segment corresponding to the existing video segment in the accompanying data storage block is set to invalid.
[0009] According to a video recording storage method provided by the present invention, storing the accompanying data segment to be stored into the accompanying data storage block of the disk further includes: If all stored accompanying data segments in the accompanying data storage block are set to invalid, then the accompanying data segment to be stored is overwritten onto the stored accompanying data segments in the accompanying data storage block.
[0010] According to a video recording storage method provided by the present invention, the accompanying data segment to be stored includes various types of accompanying data of the video segment to be stored.
[0011] According to a video recording storage method provided by the present invention, the method further includes: If any type of accompanying data in any stored accompanying data segment within the video storage block is in an invalid state, then the invalid state of any type of accompanying data is recorded in the index information of any stored accompanying data segment within the video storage block.
[0012] The present invention also provides a video recording reading method, comprising: Obtain the read request for the video segment to be read; Based on the read request, a target video storage block for storing the video segment to be read and a target accompanying data storage block for storing the target accompanying data segment corresponding to the target video storage block are determined on the disk, and the video segment to be read in the target video storage block and the target accompanying data segment in the target accompanying data storage block are read respectively. The target video storage block and the target accompanying data storage block are different storage blocks of the disk.
[0013] According to a video recording reading method provided by the present invention, the reading request includes the start time and end time of the video segment to be read; Based on the read request, determining a target video storage block for storing the video segment to be read and a target accompanying data storage block for storing the target accompanying data segment corresponding to the target video storage block, and reading the video segment to be read in the target video storage block and the target accompanying data segment in the target accompanying data storage block respectively, includes: Based on the start and end times of the video segment to be read, a disk digest is determined; the disk digest includes the start and end times of the target video storage block, the location information of the target accompanying data storage block, and the target index information of the target accompanying data segment in the target accompanying data storage block; Based on the start and end times of the video segment to be read, the video segment to be read is read from the target video storage block; Based on the location information of the target-accompanying data storage block and the target index information, the target-accompanying data segment is read.
[0014] The present invention also provides a disk, comprising: a video recording storage block and an accompanying data storage block, wherein the video recording storage block and the accompanying data storage block are different storage blocks on the disk; The video storage block is used to store video segments; The accompanying data storage block is used to store the accompanying data segment of the video segment.
[0015] The present invention also provides an electronic device, including a disk, a processor, and a computer program stored on the disk and executable on the processor, wherein the processor executes the program to implement the video recording storage method or video recording retrieval method as described above.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the video recording storage method or video recording retrieval method as described above.
[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the video recording storage method or video recording retrieval method as described above.
[0018] The present invention provides a video recording storage method, a video recording retrieval method, a disk, and an electronic device. The video recording storage method first acquires the video segment to be stored and its corresponding accompanying data segment; then, it stores the video segment to be stored in a video recording storage block on the disk, and stores the accompanying data segment in an accompanying data storage block on the disk. The video recording storage block and the accompanying data storage block are different storage blocks on the disk. This video recording storage method, by storing the video segment to be stored and the accompanying data segment to be stored separately in different storage blocks on the disk, not only reduces seek time and disk rotational latency during disk read / write processes, improving disk read / write speed and accompanying data retrieval efficiency, but also avoids fragmentation within the accompanying data storage block, reducing disk fragmentation and improving disk read / write performance. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a diagram of the existing disk partitioning.
[0021] Figure 2 This is a schematic diagram of the existing disk structure.
[0022] Figure 3 This is a flowchart illustrating the video recording and storage method provided by the present invention.
[0023] Figure 4 This is one of the disk partitioning diagrams in the video recording storage method provided by the present invention.
[0024] Figure 5 This is a schematic diagram of the disk structure in the video recording storage method provided by the present invention.
[0025] Figure 6 This is the second schematic diagram of disk partitioning in the video recording storage method provided by the present invention.
[0026] Figure 7 This is a flowchart illustrating the video recording reading method provided by the present invention.
[0027] Figure 8 This is one of the structural schematic diagrams of the disk provided by the present invention.
[0028] Figure 9 This is the second schematic diagram of the disk structure provided by the present invention.
[0029] Figure 10 This is a schematic diagram of the video recording storage device provided by the present invention.
[0030] Figure 11 This is a schematic diagram of the video recording and reading device provided by the present invention.
[0031] Figure 12 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0033] like Figure 1 As shown, in existing technologies, a disk typically comprises multiple 256MB storage blocks, used as video recording storage blocks to store video recordings and their accompanying data. Each storage block contains a superblock, a video index area, multiple accompanying data areas, and a video data area. The superblock, with a size of 8KB, stores basic information about the storage block, such as its name, identification information, and the start and end times of the stored video recordings and their accompanying data. The video index area, with a size of 504KB, stores indexes of the video recordings, including names, identification information, start and end times of different video segments. Within the storage block, different types of accompanying data reside in different accompanying data areas, and one accompanying data area can store multiple pieces of the same type of accompanying data. One piece of accompanying data corresponds to only one video recording, and one video recording can correspond to different accompanying data areas. One piece of accompanying data can include the start and end times of the corresponding video recording, as well as the data content of the accompanying data; both the start and end times are 4 bytes in size.
[0034] Here, the types of accompanying data can include Point of Sale (PoS) payment information, smart mobility data, vehicle / non-motorized vehicle / pedestrian attribute information in smart scenarios, and information on prohibited items. Network Video Recorders (NVRs) can utilize this accompanying data to implement various functionalities.
[0035] Because a hard disk needs to work with a read / write head to control data reading and writing, the head needs to move to the correct track on the disk before it can read or write data. The time consumed in this process is called seek time; the larger the track span, the longer the seek time. In addition to seek time, hard disks also have rotational latency. After the head moves to the correct track, the disk needs to rotate to wait for the appropriate sector to reach the head position before data reading and writing can begin. Furthermore, the disk can only rotate in one direction and cannot rotate backward.
[0036] A sector is the smallest addressable unit on a hard disk. A 256MB storage block can contain multiple contiguous sectors, distributed across different tracks on the disk. When storing video recordings and various types of accompanying data, the video data area needs to be read and written first, and then the accompanying data areas need to be written one by one according to their types. In other words, in... Figure 1 In this storage structure, it is necessary to repeatedly read and write non-adjacent lower and upper regions on the memory block. After reading or writing the lower region, the read / write head must move to the corresponding track in the upper region before it can perform further read / write operations. Therefore, Figure 1 The storage result of storing the video recording and its accompanying data in the same storage block requires the read / write head to perform multiple seek operations when reading and writing data. This will result in longer seek time and disk rotational latency, slower disk read / write speed, and lower efficiency in reading accompanying data.
[0037] like Figure 2 As shown, assuming Figure 2 The selected area represents the sector distribution of the storage block. Sectors 1 and 2 belong to the lower sector, while sectors 3 and 4 belong to the upper sector. After reading or writing the tracks containing sectors 1 and 2, the read / write head needs to jump to the tracks containing sectors 3 and 4. If reading or writing multiple types of accompanying data, the read / write head also needs to jump to the tracks of other accompanying data areas.
[0038] Moreover, during the read / write process, after reading and writing sector 1, the disk rotates sector 2 to the head position. When sector 3 needs to be read and written next, the head first jumps to the track where sectors 3 and 4 are located. At this time, the head points to sector 4. The disk needs to rotate almost one full circle to move sector 3 to the head position.
[0039] Based on this, an embodiment of the present invention provides a video recording storage method.
[0040] Figure 3 This is a flowchart illustrating a video recording and storage method provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the video recording storage method includes: S11, Obtain the video segment to be stored and the accompanying data segment to be stored corresponding to the video segment to be stored; S12, the video segment to be stored is stored in the video storage block of the disk, and the accompanying data segment to be stored is stored in the accompanying data storage block of the disk. The video storage block and the accompanying data storage block are different storage blocks on the disk.
[0041] Specifically, the video recording and storage method provided in this embodiment of the invention is executed by a video recording and storage device, which can be configured in a computer. The computer can be a local computer or a cloud computer. The local computer can be a computer, tablet, etc., and no specific limitation is made here.
[0042] First, execute step S11 to obtain the video segment to be stored and the corresponding accompanying data segment to be stored. The video segment to be stored refers to the video recording within a target time period that requires storage. The target time period may include the start time and the end time. The accompanying data segment to be stored refers to the accompanying data segment corresponding to the video segment to be stored.
[0043] The accompanying data segment to be stored and the corresponding video segment to be stored can be associated through a video identifier, which may include a timestamp, such as the start and end times of the video segment to be stored.
[0044] Then, step S12 is executed to store the video segment to be stored in the video storage block of the disk, and to store the accompanying data segment to be stored in the accompanying data storage block of the disk.
[0045] Subsequently, when reading the video recording in the video storage block, the accompanying data segment of the same time period as the video recording will be read out for subsequent business processing, without specific limitations here.
[0046] like Figure 4 As shown, both the video recording storage block and the accompanying data storage block can be 256MB in size, and both can include a data index area and a data area. The data area of the video recording storage block can store multiple video segments, for example, n video segments. The data area of the accompanying data storage block can store multiple accompanying data segments, for example, m accompanying data segments. The video segments and their corresponding accompanying data segments have the same time, meaning they have the same start and end times. Figure 4 The video segment 1 corresponds to the accompanying data segment 1, and the two are in the same time.
[0047] Since the video recording block and the accompanying data storage block are different storage blocks on the disk—meaning the video segment to be stored and the corresponding accompanying data segment to be stored are stored in different storage blocks—the read / write head only needs to jump between corresponding tracks of the two storage blocks during the read / write process. It no longer needs to jump large distances within the same storage block, thus reducing seek time. Furthermore, it reduces disk rotational latency, improves disk read / write speed, and enhances the efficiency of reading accompanying data.
[0048] like Figure 5 As shown, assuming the selected right area represents the sector distribution of the video storage block, and the selected left area represents the sector distribution of the accompanying data storage block, after the read / write head reads / writes sectors 1 and 2, if the accompanying data storage block needs to read / write sectors 7 and 8, the read / write head only needs to jump one track. If it needs to read / write tracks 5 and 6, the read / write head does not need to jump. The head span is relatively small compared to... Figure 2 The magnetic track where the jump occurs to sectors 3 and 4 is significantly reduced.
[0049] Furthermore, after the read / write head has finished reading and writing video in the right-side area, the disk only needs to rotate the left-side area to the position of the read / write head to continue reading and writing accompanying data. The latency caused by disk rotation is significantly reduced compared to... Figure 2 Significantly reduced.
[0050] Furthermore, since the video segments to be stored and their corresponding accompanying data segments to be stored are stored in different storage blocks on the disk, when the free storage space of the video storage block is empty, that is, when the video storage block is full, the accompanying data storage block can continue to store the accompanying data segments corresponding to the video segments in other video storage blocks. This ensures that the free storage space in the accompanying data storage block is fully utilized, avoids fragmentation within the accompanying data storage block, reduces the degree of disk fragmentation, and improves disk read and write performance.
[0051] The video recording storage method provided in this embodiment of the invention first obtains the video segment to be stored and the corresponding accompanying data segment to be stored; then, the video segment to be stored is stored in the video recording storage block of the disk, and the accompanying data segment to be stored is stored in the accompanying data storage block of the disk. The video recording storage block and the accompanying data storage block are different storage blocks on the disk. This video recording storage method, by storing the video segment to be stored and the accompanying data segment to be stored separately in different storage blocks on the disk, can not only reduce the seek time and disk rotational latency during disk read and write processes, improve disk read and write speed, and enhance the reading efficiency of accompanying data, but also avoid fragmentation within the accompanying data storage block, reduce the degree of disk fragmentation, and improve disk read and write performance.
[0052] exist Figure 1 In this storage structure, the accompanying data area within a video storage block is limited. Furthermore, since each accompanying data area corresponds to one type of accompanying data, the types of accompanying data that can be stored in that video storage block are also limited. Because the size of the accompanying data is usually much smaller than the video recording size, when the free storage space in the video data area is empty (i.e., the video data area is full), there may still be a large amount of free storage space in the accompanying data area. This will lead to fragmentation within the video storage block, thus affecting disk read / write performance.
[0053] Based on this, and in accordance with the above embodiments, the accompanying data segment to be stored includes various types of accompanying data of the video segment to be stored.
[0054] Specifically, the accompanying data segment to be stored may include various types of accompanying data from the video segment to be stored. When storing the accompanying data segment to be stored in the accompanying data storage block on the disk, all types of accompanying data in the segment are stored as a single record within that block. When reading the video from the video storage block, the accompanying data segment from the same time period as the video is read out, and type filtering can be performed in memory to select the appropriate type of accompanying data for subsequent business processing; no specific limitations are specified here.
[0055] The accompanying data storage block stores various types of accompanying data within the accompanying data segment, which avoids the head jumping between different accompanying data storage blocks when multiple types of accompanying data are read and written simultaneously, further reducing seek time. Moreover, this video recording storage method requires fewer accompanying data storage blocks, which reduces the storage limitations on the types of accompanying data.
[0056] In this embodiment of the invention, the accompanying data segment to be stored includes various types of accompanying data of the video segment to be stored. This can reduce the number of storage blocks required to store the accompanying data and reduce the storage restrictions on the types of accompanying data.
[0057] In practical applications, when reading video recordings, the recording itself must be read first, followed by the accompanying data for overlay. Since the accompanying data lacks its own independent index, it must be retrieved by traversing the accompanying data within the storage block. This traversal operation is both time-consuming and resource-intensive, and can cause device lag or even timeouts when dealing with large amounts of data. In environments with large volumes of accompanying video data and numerous connected cameras, excessive hard drive read / write pressure can lead to significant device lag or even timeouts.
[0058] Based on this, and building upon the above embodiments, the step of storing the video segment to be stored in the video storage block of the disk, and storing the accompanying data segment to be stored in the accompanying data storage block of the disk, further includes: In the summary area of the disk, the start time and end time of the video storage block, the location information of the accompanying data storage block, and the index information of the accompanying data segment to be stored within the accompanying data storage block are recorded.
[0059] Specifically, a disk summary can be created in the disk summary area. This disk summary can be used to record the start time, end time, location information of the accompanying data storage block, and index information of the accompanying data segment to be stored within the accompanying data storage block.
[0060] like Figure 6 As shown, a disk may include a superblock, a digest area, multiple video storage blocks, and multiple accompanying data storage blocks. In addition, the disk may include a spare superblock and a digest area. The superblock size on the disk can be 64KB, and it can store basic disk information.
[0061] In the disk summary area, multiple summary groups can be created. Each summary group can include a summary group header and multiple disk summaries. Each disk summary can include fields such as Magic, disk format version number, occupied channel number, start time, end time, accompanying data storage block, and accompanying data storage block index, all of which are 4 bytes in size.
[0062] Since a video storage block can store multiple video segments, the start time of a video storage block can be the earliest start time of all the video segments it stores, and the end time of a video storage block can be the latest end time of all the video segments it stores.
[0063] The location information of the accompanying data storage block can be represented by the identification information of the accompanying data storage block, which can be the sequence number of the accompanying data storage block.
[0064] The index information of the accompanying data segment to be stored within the accompanying data storage block may include the sequence number, start time, and end time of the accompanying data segment to be stored, as well as the status of the accompanying data segment to be stored and the status of each type of accompanying data within it. Here, the status may include valid and invalid.
[0065] In this embodiment of the invention, the introduction of index information of the accompanying data segment to be stored in the accompanying data storage block allows the corresponding accompanying data segment to be found directly through the index information after the video is read. This avoids searching for the corresponding accompanying data through traversal operations, reduces hard disk read / write pressure, shortens read / write time, improves disk performance, and prevents the device from experiencing lag or even response timeouts.
[0066] Based on the above embodiments, storing the video segment to be stored into the video storage block of the disk further includes: If the free storage space of the video storage block is empty, the video segment to be stored is overwritten on the already stored video segment in the video storage block, and the already stored accompanying data segment corresponding to the existing video segment in the accompanying data storage block is set to invalid.
[0067] Specifically, when the free storage space of the video storage block is empty, i.e., the video storage block is full, the video segment to be stored is overwritten on the already stored video segment in the video storage block, realizing the reuse of the video storage block. At the same time, the stored accompanying data segment corresponding to the overwritten existing video segment in the accompanying data storage block is set to invalid, so as to realize the synchronous overwriting of the video and its accompanying data.
[0068] Based on the above embodiments, storing the accompanying data segment to be stored into the accompanying data storage block of the disk further includes: If all stored accompanying data segments in the accompanying data storage block are set to invalid, then the accompanying data segment to be stored is overwritten onto the stored accompanying data segments in the accompanying data storage block.
[0069] Specifically, if all stored accompanying data segments within an accompanying data storage block are set to invalid, the accompanying data storage block can be overwritten, that is, the accompanying data segment to be stored is overwritten onto the existing accompanying data segments within the accompanying data storage block, thus enabling the reuse of the storage block.
[0070] Based on the above embodiments, the method further includes: If any type of accompanying data in any stored accompanying data segment within the accompanying data storage block is in a failed state, then the failed state of any type of accompanying data is recorded in the index information of any stored accompanying data segment within the accompanying data storage block.
[0071] Specifically, after the accompanying data segment of the video segment is stored in the accompanying data storage block, the user may set one or more types of accompanying data of any stored accompanying data segment in the accompanying data storage block to an invalid state as needed. At this time, the invalid state of the stored accompanying data segment can be recorded in the index information of the stored accompanying data segment in the accompanying data storage block so as to keep track of its status when reading the accompanying data segment.
[0072] Based on the above embodiments, such as Figure 7 As shown, this embodiment of the invention also provides a video recording reading method, which includes: S21, Obtain the read request for the video segment to be read; S22, based on the read request, determine the target video storage block on the disk for storing the video segment to be read and the target accompanying data storage block for storing the target accompanying data segment corresponding to the target video storage block, and read the video segment to be read in the target video storage block and the target accompanying data segment in the target accompanying data storage block respectively; The target video storage block and the target accompanying data storage block are different storage blocks of the disk.
[0073] Specifically, the video recording reading method provided in this embodiment of the invention is executed by a video recording reading device, which can be configured in a computer. The computer can be a local computer or a cloud computer. The local computer can be a computer, tablet, etc., and no specific limitation is made here.
[0074] First, step S21 is executed to obtain a read request for the video segment to be read. The read request may include information such as the start time and end time of the video segment to be read.
[0075] Then, step S22 is executed, using the read request to determine the target video storage block on the disk used to store the video segment to be read, and the target accompanying data storage block used to store the target accompanying data segment corresponding to the target video storage block. The start time of the target video storage block is earlier than or equal to the start time of the video segment to be read, and the end time of the target video storage block is later than or equal to the end time of the video segment to be read.
[0076] The target accompanying data storage block can be determined by the correspondence between the start and end times of the pre-stored video segment to be read and the accompanying data storage block.
[0077] Subsequently, the video segment to be read in the target video storage block and the target accompanying data segment in the target accompanying data storage block can be read respectively.
[0078] It is understandable that, in this video recording reading method, corresponding to the video recording storage method described above, the target video recording storage block and the target accompanying data storage block are different storage blocks on the disk. That is, the video segment to be read and the target accompanying data segment are stored in different storage blocks on the disk, which can ensure reading efficiency.
[0079] Based on the above embodiments, the read request includes the start time and end time of the video segment to be read; Based on the read request, determining a target video storage block for storing the video segment to be read and a target accompanying data storage block for storing the target accompanying data segment corresponding to the target video storage block, and reading the video segment to be read in the target video storage block and the target accompanying data segment in the target accompanying data storage block respectively, includes: Based on the start and end times of the video segment to be read, a disk digest is determined; the disk digest includes the start and end times of the target video storage block, the location information of the target accompanying data storage block, and the target index information of the target accompanying data segment in the target accompanying data storage block; Based on the start and end times of the video segment to be read, the video segment to be read is read from the target video storage block; Based on the location information of the target-accompanying data storage block and the target index information, the target-accompanying data segment is read.
[0080] Specifically, in this embodiment of the invention, the target video block and its corresponding target accompanying data storage block can be quickly read using disk digest, and the target accompanying data segment to be read can be quickly located according to the target index information of the target accompanying data segment in the target accompanying data storage block.
[0081] In this embodiment of the invention, by applying the target index information of the target accompanying data segment in the target accompanying data storage block, the reading efficiency of the accompanying data segment of the video recording segment can be further improved.
[0082] Based on the above embodiments, such as Figure 8 As shown, this embodiment of the invention also provides a disk, including: a video recording storage block 81 and an accompanying data storage block 82, wherein the video recording storage block 81 and the accompanying data storage block 82 are different storage blocks on the disk; Video storage block 81 is used to store video segments; Accompanying data storage block 82 is used to store the accompanying data segment corresponding to the video segment.
[0083] The disk provided in this embodiment of the invention uses different storage blocks to store video segments and accompanying data of the video segments respectively. This not only reduces seek time and disk rotational latency during disk read / write processes, improving disk read / write speed and efficiency in reading accompanying data, but also avoids fragmentation within the accompanying data storage blocks, reducing disk fragmentation and improving disk read / write performance. Furthermore, it reduces the number of storage blocks required to store accompanying data, thus lessening the limitations on the types of accompanying data that can be stored.
[0084] Based on the above embodiments, the video storage block and the accompanying data storage block are disposed on different magnetic platters of the disk, or on different magnetic surfaces of the same magnetic platter of the disk.
[0085] Specifically, such as Figure 9 As shown, a disk may include four platters A, B, C, and D, an engine connected to the platters, a read / write head, and an engine connected to the read / write head.
[0086] Each disk can include two magnetic surfaces, one positive and one negative. Each magnetic surface includes cylinders, sectors, and tracks. Therefore, the video recording storage block and the accompanying data storage block can be set on different disks or on different magnetic surfaces of the same disk, thus enabling parallel read and write capabilities and improving disk throughput.
[0087] like Figure 10 As shown, based on the above embodiments, this embodiment of the invention also provides a video recording storage device, including: The first acquisition module 101 is used to acquire the video segment to be stored and the accompanying data segment to be stored corresponding to the video segment to be stored. Storage module 102 is used to store the video segment to be stored in the video storage block of the disk, and to store the accompanying data segment to be stored in the accompanying data storage block of the disk, wherein the video storage block and the accompanying data storage block are different storage blocks on the disk.
[0088] Based on the above embodiments, the video recording storage device provided in this embodiment of the invention further includes a storage module for: In the summary area of the disk, the start time and end time of the video storage block, the location information of the accompanying data storage block, and the index information of the accompanying data segment to be stored within the accompanying data storage block are recorded.
[0089] Based on the above embodiments, the video recording storage device provided in this embodiment of the invention further includes a storage module for: If the free storage space of the video storage block is empty, the video segment to be stored is overwritten on the already stored video segment in the video storage block, and the already stored accompanying data segment corresponding to the existing video segment in the accompanying data storage block is set to invalid.
[0090] Based on the above embodiments, the video recording storage device provided in this embodiment of the invention further includes a storage module for: If all stored accompanying data segments in the accompanying data storage block are set to invalid, then the accompanying data segment to be stored is overwritten onto the stored accompanying data segments in the accompanying data storage block.
[0091] Based on the above embodiments, the video recording storage device provided in this embodiment of the invention includes various types of accompanying data for the video recording segment to be stored.
[0092] Based on the above embodiments, the video recording storage device provided in this embodiment of the invention further includes a storage module for: If any type of accompanying data in any stored accompanying data segment within the video storage block is in an invalid state, then the invalid state of any type of accompanying data is recorded in the index information of any stored accompanying data segment within the video storage block.
[0093] Specifically, the functions of each module in the storage device provided in the embodiments of the present invention correspond one-to-one with the operation flow of each step in the above method embodiments, and the achieved effects are also the same. For details, please refer to the above embodiments, and this will not be repeated in the embodiments of the present invention.
[0094] like Figure 11 As shown, based on the above embodiments, this embodiment of the invention also provides a video recording reading device, including: The second acquisition module 111 is used to acquire the read request of the video segment to be read; The reading module 112 is used to determine, based on the reading request, a target video storage block on the disk for storing the video segment to be read and a target accompanying data storage block for storing the target accompanying data segment corresponding to the target video storage block, and to read the video segment to be read in the target video storage block and the target accompanying data segment in the target accompanying data storage block, respectively. The target video storage block and the target accompanying data storage block are different storage blocks of the disk.
[0095] Based on the above embodiments, the video recording reading device provided in this embodiment of the invention includes a reading request that includes the start time and end time of the video segment to be read; The reading module is specifically used for: Based on the start and end times of the video segment to be read, a disk digest is determined; the disk digest includes the start and end times of the target video storage block, the location information of the target accompanying data storage block, and the target index information of the target accompanying data segment in the target accompanying data storage block; Based on the start and end times of the video segment to be read, the video segment to be read is read from the target video storage block; Based on the location information of the target-accompanying data storage block and the target index information, the target-accompanying data segment is read.
[0096] Specifically, the functions of each module in the video recording device provided in this embodiment correspond one-to-one with the operation flow of each step in the above method embodiment, and the achieved effects are also the same. Please refer to the above embodiments for details, and this will not be repeated in this embodiment.
[0097] Figure 12 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 12 As shown, the electronic device may include a processor 121, a communications interface 122, a disk 123, and a communication bus 124, wherein the processor 121, the communications interface 122, and the disk 123 communicate with each other via the communication bus 124. The processor 121 may invoke logical instructions in the disk 123 to execute the video recording storage method or video recording retrieval method provided in the above embodiments.
[0098] Furthermore, the logical instructions in disk 123 described above can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0099] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the video recording storage method or video recording reading method provided in the above embodiments.
[0100] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the video recording storage method or video recording reading method provided in the above embodiments.
[0101] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0103] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A video recording storage method characterized by comprising: The method comprises: acquiring a to-be-stored video segment and a to-be-stored accompanying data segment corresponding to the to-be-stored video segment; storing the to-be-stored video segment into a video storage block of a disk and storing the to-be-stored accompanying data segment into an accompanying data storage block of the disk, wherein the video storage block and the accompanying data storage block are different storage blocks on the disk.
2. The video recording storage method according to claim 1, characterized by, The method further comprises: recording, in a summary area of the disk, a start time and an end time of the video storage block, position information of the accompanying data storage block, and index information of the to-be-stored accompanying data segment in the accompanying data storage block.
3. The video recording storage method of claim 1, wherein, The method further comprises: if the free storage space of the video storage block is empty, overwriting the to-be-stored video segment onto a stored video segment in the video storage block and setting a stored accompanying data segment corresponding to the stored video segment in the accompanying data storage block as invalid.
4. The video recording storage method of claim 1, wherein, The method further comprises: if all stored accompanying data segments in the accompanying data storage block are set as invalid, overwriting the to-be-stored accompanying data segment onto a stored accompanying data segment in the accompanying data storage block.
5. The video recording storage method according to any one of claims 1 to 4, characterized by, The to-be-stored accompanying data segment comprises various types of accompanying data of the to-be-stored video segment.
6. The video recording storage method according to claim 5, wherein, The method further comprises: if any type of accompanying data in any stored accompanying data segment in the video storage block is in an invalid state, recording the invalid state of the any type of accompanying data into index information of the any stored accompanying data segment in the video storage block.
7. A video recording reading method characterized by, The method comprises: acquiring a read request for a to-be-read video segment; based on the read request, determining a target video storage block on a disk for storing the to-be-read video segment and a target accompanying data storage block for storing a target accompanying data segment corresponding to the target video storage block, and reading the to-be-read video segment in the target video storage block and the target accompanying data segment in the target accompanying data storage block respectively; wherein the target video storage block and the target accompanying data storage block are different storage blocks on the disk.
8. The video playback method according to claim 7, wherein, The read request comprises a start time and an end time of the to-be-read video segment. The method further comprises: based on the read request, determining a target video storage block for storing the to-be-read video segment and a target accompanying data storage block for storing a target accompanying data segment corresponding to the target video storage block, and reading the to-be-read video segment in the target video storage block and the target accompanying data segment in the target accompanying data storage block respectively. determining a disk summary based on the start time and the end time of the to-be-read video segment; the disk summary comprising a start time and an end time of the target video storage block, location information of the target accompanying data storage block, and target index information of the target accompanying data segment in the target accompanying data storage block; reading the to-be-read video segment in the target video storage block based on the start time and the end time of the to-be-read video segment; reading the target accompanying data segment based on the location information of the target accompanying data storage block and the target index information.
9. A magnetic disc, characterized by comprising: a video storage block and an accompanying data storage block, the video storage block and the accompanying data storage block being different storage blocks on the disk; the video storage block being configured to store a video segment; the accompanying data storage block being configured to store an accompanying data segment of the video segment.
10. The magnetic disc of claim 9 wherein, the video storage block and the accompanying data storage block being arranged on different magnetic platters of the disk, or on different magnetic surfaces of the same magnetic platter of the disk.
11. An electronic device, comprising: a disk, a processor, and a computer program stored on the disk and executable on the processor, as claimed in claim 9 or 10, wherein the processor, when executing the program, implements the video storage method as claimed in any one of claims 1-6, or the video reading method as claimed in any one of claims 7-8.