A video recording retrieval method and device, computer equipment and storage medium
Patent Information
- Application Number
- CN202111618989.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2041-12-27
AI Technical Summary
[0003]现有技术中的录像回迁方式,通常为保证常规录像的存储,为回迁任务设置较低的优先级,导致回迁速度较慢
[0025]本发明实施例通过获取备用设备根据时间优先级和录像设备优先级依次进行发送的待回迁录像,确定可回迁硬盘列表,以及可回迁硬盘列表的各硬盘中各录像设备的已存储录像分布表,根据已存储录像分布表确定回迁硬盘,从而将待回迁录像存储到回迁硬盘上。解决了现有技术中回迁速度较慢,以及回迁录像分布不均导致单一硬盘存储压力过大的问题,实现了待回迁录像的合理布局,便于后续录像的平滑覆盖,提高了回迁效率。
Smart Images

Figure CN116366898B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to data transmission technology, and more particularly to a video recording recovery method, apparatus, computer equipment, and storage medium. Background Technology
[0002] In large and medium-sized surveillance systems with multiple NVRs (Network Video Recorders), the NVRs receive digital video streams transmitted from IPCs (Internet Protocol Cameras) over the network and store and manage them. To enhance the security of recorded data, one or more idle NVRs, i.e., backup units, are typically configured. When one or more NVRs (i.e., the main unit) malfunctions, the backup unit takes over from the malfunctioning main unit and continues recording. Once the main unit recovers, the recordings from the period of malfunction are transferred from the backup unit back to the main unit; this process is called recording migration.
[0003] Existing video migration methods typically prioritize migration tasks to ensure the storage of regular recordings, resulting in slow migration speeds. Furthermore, during migration, there's a possibility that the migrated recordings are stored contiguously on a single hard drive. When subsequent recordings are overwritten, all channels' recordings are concentrated on that one hard drive, leading to excessive storage pressure on that single drive and impacting the stability of the monitoring system. Summary of the Invention
[0004] This invention provides a video recording migration method, apparatus, computer equipment, and storage medium to achieve a reasonable layout of the video recordings to be migrated, thereby improving migration efficiency.
[0005] In a first aspect, embodiments of the present invention provide a video rewind method, the method comprising:
[0006] Acquire the backup device's video recordings to be relocated, wherein the backup device sends the video recordings sequentially according to time priority and / or recording device priority;
[0007] Determine the list of retrievable hard drives, and the distribution table of stored recordings of each recording device in each hard drive of the retrievable hard drive list;
[0008] Based on the stored video recording distribution table, determine the returnable hard drives from among the hard drives in the list of returnable hard drives;
[0009] On the hard disk to be migrated, a video migration task is performed on the video recordings to be migrated.
[0010] Secondly, embodiments of the present invention also provide a video playback method, the method comprising:
[0011] Determine the video recording retention period and migration time threshold of the main equipment, and determine the time priority of each video recording to be migrated based on the video recording retention period and migration time threshold;
[0012] The priority of the recording device for each video to be relocated is determined based on the sequence identifier of the recording device that matches each video to be relocated.
[0013] Based on the time priority and recording device priority of each video recording to be relocated, each video recording to be relocated is sent to the main device for relocation in sequence.
[0014] Thirdly, embodiments of the present invention also provide a video playback device, the device comprising:
[0015] The module for acquiring relocation video recordings is used to acquire relocation video recordings sent by the backup device. The relocation video recordings are sent by the backup device in sequence according to time priority and recording device priority.
[0016] The module for determining the stored video recording distribution table is used to determine the list of retrievable hard disks and the stored video recording distribution table of each recording device in each hard disk of the retrievable hard disk list.
[0017] The hard drive to be migrated module is used to determine the hard drive to be migrated from each hard drive in the list of available hard drives based on the stored video recording distribution table.
[0018] The video recording recovery module is used to perform video recording recovery tasks on the video recordings to be recovered on the recovery hard disk.
[0019] Fourthly, embodiments of the present invention also provide a video playback device, the device comprising:
[0020] The time priority determination module is used to determine the video recording retention period and migration time threshold of the main device, and to determine the time priority of each video recording to be migrated based on the video recording retention period and migration time threshold.
[0021] The video recording device priority determination module is used to determine the priority of each video recording device to be relocated based on the sequence identifier of the video recording device that matches each video recording to be relocated.
[0022] The module for sending back recorded videos is used to send each video to be back to the main device for backing up in sequence according to the time priority and recording device priority.
[0023] In a sixth aspect, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the video rewinding method as described in any of the embodiments of the present invention.
[0024] Sixthly, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the video rewinding method as described in any of the embodiments of the present invention.
[0025] This invention, through its embodiments, obtains the recorded videos to be migrated from backup devices according to time priority and recording device priority, determines a list of migrateable hard drives, and a distribution table of stored videos from each recording device on each hard drive in the migrateable hard drive list. Based on the distribution table of stored videos, the migration hard drive is determined, and the recorded videos to be migrated are stored on the migration hard drive. This solves the problems of slow migration speed and excessive storage pressure on a single hard drive due to uneven distribution of migration videos in existing technologies. It achieves a reasonable layout of the recorded videos to be migrated, facilitates smooth overlay of subsequent videos, and improves migration efficiency. Attached Figure Description
[0026] Figure 1 This is a flowchart of a video playback method according to Embodiment 1 of the present invention;
[0027] Figure 2 This is a flowchart of another video playback method in Embodiment 2 of the present invention;
[0028] Figure 3 This is a flowchart of a video playback method according to Embodiment 3 of the present invention;
[0029] Figure 4 This is a flowchart of another video playback method in Embodiment 4 of the present invention;
[0030] Figure 5 This is a schematic diagram of the structure of a video playback device according to Embodiment 5 of the present invention;
[0031] Figure 6 This is a schematic diagram of the structure of a video playback device according to Embodiment Six of the present invention;
[0032] Figure 7 This is a schematic diagram of the structure of a computer device according to Embodiment Seven of the present invention. Detailed Implementation
[0033] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0034] Example 1
[0035] Figure 1This is a flowchart of a video recording migration method provided in Embodiment 1 of the present invention. This embodiment is applicable to the storage of video recordings to be migrated sent by a backup device. The method can be executed by a video recording migration device, which can be implemented by software and / or hardware, and is generally integrated in the main device and used in conjunction with the backup device.
[0036] like Figure 1 As shown, the technical solution of this embodiment of the invention specifically includes the following steps:
[0037] S110. Obtain the video recordings to be relocated sent by the backup equipment.
[0038] In a monitoring system, when the primary device malfunctions, the backup device takes over and continues storing the recorded footage. Once the primary device recovers, it resumes storing the recorded footage. Furthermore, when the primary device detects a normal network connection with the backup device, it triggers a recording migration task, allowing the backup device to migrate the recorded footage from the period of malfunction back to the primary device.
[0039] The video recordings to be migrated are sent sequentially by the backup device according to time priority and / or recording device priority. Specifically, the backup device can sort the video recordings to be migrated according to both time priority and recording device priority, or it can sort them only according to time priority or only according to recording device priority. This embodiment does not limit the specific method by which the backup device sorts the video recordings to be migrated. The backup device sends the sorted video recordings to be migrated sequentially to the main device, which can improve migration efficiency.
[0040] In this embodiment of the invention, after the master device triggers the video recording migration, the standby device sorts the videos to be migrated according to time priority and / or video recording device priority, and sends the videos to be migrated to the master device in sequence according to the order of each video to be migrated.
[0041] S120. Determine the list of retrievable hard disks and the distribution table of stored recordings of each recording device in each hard disk of the retrievable hard disk list.
[0042] The list of revertible hard drives is determined by the master device based on the number of current video storage tasks and the number of current video reversion tasks on each hard drive. The number of current video storage tasks is the number of IPCs currently stored on that hard drive at the same time, and the number of current video reversion tasks is the number of IPCs currently reverted on that hard drive at the same time.
[0043] Specifically, if the number of current recording storage tasks on a hard drive is less than a preset threshold for the number of recording storage tasks on that hard drive, and the number of current recording migration tasks is less than a preset threshold for the number of recording migration tasks on that hard drive, then that hard drive is added to the list of reversible hard drives. Alternatively, if the ratio of the number of current recording storage tasks on a hard drive to its preset threshold for the number of recording storage tasks is less than a preset first ratio, and the ratio of the number of current recording migration tasks to its preset threshold for the number of recording migration tasks is less than a preset second ratio, then that hard drive is added to the list of reversible hard drives. This embodiment does not limit the method for determining reversible hard drives among the hard drives.
[0044] The stored video distribution table is used to represent the distribution of recordings from each recording device on each portable hard drive. For example, the stored video distribution table may include which IPC recordings are stored on each portable hard drive, and the size of each recording. The stored video distribution table can also divide the recordings of each IPC stored on each portable hard drive according to storage time periods. For example, starting from 00:00:00 on the date of the earliest recorded video in the main device, time intervals can be set to record how many recordings from each recording device are stored on each hard drive within each preset time interval, and the size of each stored recording. Constructing the stored video distribution table by time and hard drive location allows for further recording of the distribution of stored videos on each hard drive within each time period. This embodiment does not limit the construction method of the stored video distribution table.
[0045] In this embodiment of the invention, after the master device receives the video to be migrated, it determines the available migrateable hard disks. Based on the distribution of the videos already stored in each migrateable hard disk, it can not only maximize the use of hard disks with free space in the current video storage task and improve migration efficiency, but also take into account the distribution of the stored videos in each hard disk, which facilitates the smooth overlay of subsequent videos.
[0046] S130. Based on the stored video recording distribution table, determine the returnable hard disk from each hard disk in the list of returnable hard disks.
[0047] Based on the distribution of stored recordings on each available hard drive, select a backup hard drive from the list of available hard drives. In a specific example, prioritize hard drives that have stored some recordings from the recording device to be backed up within the time period corresponding to the recording time of the recording to be backed up. For example, if we use xx / xx / xx / 00:00 as the starting point and 4-hour intervals as the time, construct a distribution table of stored recordings by time and hard drive location, and the recording device to be backed up is recording device A, with a recording time of xx / xx / xx / 06:00:00, if hard drive B has stored some recordings from recording device A within the time period from 4:00:00 to 8:00:00, then hard drive B will be selected as the backup hard drive.
[0048] In another specific example, the backup hard drive can be selected based on the number of current video storage tasks and / or the number of current video migration tasks for each hard drive in the backup hard drive list. Preferably, to ensure the normal operation of regular video storage tasks on each hard drive, the hard drive with the fewest current video storage tasks in the backup hard drive list can be selected as the backup hard drive, or the hard drive with the smallest sum of the number of current video storage tasks and the number of current video migration tasks in the backup hard drive list can be selected as the backup hard drive.
[0049] In another specific example, based on the distribution of stored recordings on each hard drive within each time period, the hard drive with the smallest storage capacity within the time period corresponding to the recording time of the recording to be migrated can be selected as the migration hard drive.
[0050] The above are merely specific examples of selecting a backup hard drive from the list of available backup hard drives. All three methods described above can be used to select the backup hard drive. Alternatively, hard drives that have already stored some recordings within the time period corresponding to the recording time of the video to be backed up can be prioritized as backup hard drives. If no such hard drive exists, the backup hard drive is determined based on the number of current recording storage tasks and / or the number of current recording backup tasks for each hard drive. If multiple hard drives are determined based on the number of current recording storage tasks and / or the number of current recording backup tasks for each hard drive, the hard drive with the smallest stored recording capacity within the time period corresponding to the recording time of the video to be backed up is prioritized. This embodiment does not restrict the method of selecting a backup hard drive from the list of available backup hard drives.
[0051] S140. On the hard disk to be migrated, a video migration task is performed on the video to be migrated.
[0052] In this embodiment of the invention, when a migration hard disk is selected to perform a video migration task on the video to be migrated, the number of current video migration tasks on the migration hard disk is updated. Similarly, after the video migration task of the video to be migrated is completed, the number of current video migration tasks is also updated. This setting facilitates the migration of subsequent videos to be migrated.
[0053] In this embodiment of the invention, the backup device sequentially sends recordings to be migrated according to time priority and recording device priority, and the recording migration task is executed using steps S110-S140 until a limiting condition is triggered. After the limiting condition is triggered, the master device suspends the creation of new recording migration tasks.
[0054] The limiting condition can refer to the fact that all recording devices in the backup equipment have performed recording migration, or it can refer to the fact that the number of current recording migration tasks on each hard drive in the main equipment has reached a certain proportion of the total number of tasks on each hard drive. This embodiment does not limit the specific content of the limiting condition.
[0055] The technical solution of this embodiment obtains the recordings to be migrated from the backup device according to time priority and recording device priority, determines the list of revertible hard drives, and the distribution table of stored recordings of each recording device on each hard drive in the list of revertible hard drives. Based on the distribution table of stored recordings, the migration hard drive is determined, and the recordings to be migrated are stored on the migration hard drive. This solves the problems of slow migration speed and excessive storage pressure on a single hard drive due to uneven distribution of migration recordings in the prior art, achieving a reasonable layout of the recordings to be migrated, facilitating smooth overlay of subsequent recordings, and improving migration efficiency.
[0056] Example 2
[0057] Figure 2 This is a flowchart of a video recording migration method provided in Embodiment 2 of the present invention. Based on the above embodiments, the present invention further specifies the process of determining the migration disk from each disk in the migration disk list, and adds the steps of pausing the video recording migration task and migrating by multiples.
[0058] Correspondingly, such as Figure 2 As shown, the technical solution of this embodiment of the invention specifically includes the following steps:
[0059] S210. Obtain the video recordings to be relocated sent by the backup equipment.
[0060] The recordings to be relocated are sent to the main device in sequence according to time priority and recording device priority, as backup devices.
[0061] S220. Determine the list of retrievable hard disks and the distribution table of stored recordings of each recording device in each hard disk of the retrievable hard disk list.
[0062] The specific methods for constructing the list of reversible hard disks and the distribution table of stored video recordings for each hard disk in the list of reversible hard disks have been explained above, and will not be repeated here in this embodiment.
[0063] S230. Determine the recording time and recording equipment for the video to be relocated.
[0064] The recording time refers to the storage time of the recordings to be migrated in the backup equipment, also known as the IPC. Based on the distribution of stored recordings on each hard drive and each recording device within each time period, as well as the recording time and recording device of the recordings to be migrated, the hard drive to be migrated can be selected from the stored recording distribution table.
[0065] S240. Determine the target time period corresponding to the recording time based on the stored video distribution table.
[0066] In this embodiment of the invention, determining the target time period corresponding to the recording time aims to determine whether the recording device to be migrated has already stored some recordings on a hard drive of the main device within the target time period. If the recording device to be migrated has already performed a recording storage task on a hard drive of the main device within the target time period, the recordings to be migrated can be migrated back to that hard drive.
[0067] S250: Match the recording devices corresponding to each hard drive in the list of revertible hard drives within the target time period with the recording devices to be reverted.
[0068] In this embodiment of the invention, each recording device in the candidate hard disk within the target time period is matched with the recording device of the video to be migrated. That is, within the target time period, each recording device corresponding to each hard disk in the stored video distribution table includes the recording device of the video to be migrated.
[0069] S260. Determine if a matching hard drive exists. If so, proceed to S270; otherwise, proceed to S280. When a matching hard drive exists in the list of available hard drives for migration, it means that the recording device to be migrated has already stored some recordings on the candidate hard drive within the target time period. Therefore, the matching hard drive is selected as the migration hard drive.
[0070] S270. The matched hard drive is confirmed to be a reset hard drive.
[0071] S280. Determine the return disks based on the number of video storage tasks and video return tasks of each hard disk in the returnable hard disk list, and / or the capacity occupied by the videos already stored in each hard disk in the returnable hard disk list during the target time period.
[0072] If the recording devices corresponding to each hard drive in the list of revertible hard drives do not match the recording devices to be reverted within the target time period, in order to ensure the normal progress of the recording storage task, the revertible hard drives can be determined based on the number of recording storage tasks and the number of recording reversion tasks of each hard drive in the list of revertible hard drives, and / or the capacity occupied by the recordings already stored within the target time period in each hard drive in the list of revertible hard drives.
[0073] In a specific example, among the hard drives in the list of revertible hard drives, the hard drive with the number of recording storage tasks less than a first preset value can be identified. If there is only one hard drive with the number of recording storage tasks less than the first preset value, that hard drive is selected as the revertible hard drive. If there are multiple hard drives with the number of recording storage tasks less than the first preset value, the hard drive with the smallest number of recording migration tasks is selected as the revertible hard drive.
[0074] In another specific example, when there are multiple hard drives with a number of recording storage tasks less than the first preset value, the hard drive with the smallest occupied capacity of the recorded videos within the target time period can be selected as the migration hard drive.
[0075] In another specific example, the hard drive with the smallest storage capacity of the recorded videos stored during the target time period can be selected from the list of revertible hard drives as the revertible hard drive.
[0076] In this embodiment of the invention, selecting hard drives with fewer recording storage tasks and fewer recording migration tasks for recording migration has the advantage of enabling a reasonable layout of tasks on each hard drive. Selecting the hard drive with the smallest available capacity for recording migration facilitates smooth overwriting of subsequent recordings.
[0077] S290. On the hard disk to be migrated, a video migration task is performed on the video to be migrated.
[0078] S2100: Determine if there is a new video storage task on the return hard disk. If yes, execute S2110; otherwise, execute S2130.
[0079] In this embodiment of the invention, since the priority of video migration tasks is lower than that of video storage tasks, the master device requests storage space on each hard drive when performing video storage tasks, unaffected by the video migration tasks. Therefore, if there are new video storage tasks on the migration hard drive, and the number of video migration tasks is too large, it can easily affect the normally running video storage tasks. In this case, it is necessary to pause some of the ongoing video migration tasks to reduce interference with the video storage tasks.
[0080] S2110. Determine whether the hard disk to be migrated meets the conditions for pausing the video migration task. If yes, execute S2120; otherwise, execute S2130.
[0081] Optionally, the conditions for pausing the video migration task on the reset disk may include: if the sum of the number of video storage tasks and the number of video migration tasks on the reset disk is greater than the threshold of the total number of tasks on the reset disk, then the reset disk is determined to meet the conditions for pausing the video migration task.
[0082] S2120. From the recordings that are performing recording migration tasks on the migration hard disk, determine the recordings whose bitrate matches the newly added recording storage task and suspend the recording migration task.
[0083] In this embodiment of the invention, a video recording to be migrated can be selected with a bitrate comparable to that of the newly added video storage task, and its video migration task can be suspended to reduce the interference of migration on the main device's video storage task.
[0084] Optionally, if after pausing some video migration tasks on the migration hard drive, the number of recording devices corresponding to ongoing video migration tasks on the migration hard drive decreases to a preset number, the video migration tasks can be stopped. For example, when the number of recording devices corresponding to ongoing video migration tasks on the migration hard drive decreases to two, the video migration tasks can be stopped, as the impact on hard drive performance is relatively small for two recording devices.
[0085] Optionally, a paused video migration task can be resumed after the ongoing video migration task on the migration hard drive is completed.
[0086] S2130. Determine whether the ratio of the number of video migration tasks on the migration hard disk to the threshold number of video migration tasks is less than or equal to a preset ratio. If yes, execute S2140; otherwise, execute S2150.
[0087] In this embodiment of the invention, when the master device has sufficient idle resources, a multiple migration can be performed to improve the migration speed.
[0088] In this embodiment of the invention, if the number of video migration tasks on the migration hard disk is relatively small compared to the threshold number of video migration tasks, it can be considered that the idle resources of the migration hard disk are sufficient.
[0089] In this embodiment of the invention, the multiplier migration condition for each migration hard drive can be determined either after all the backup device's recorded videos are sent to the main device and the video migration task is executed, i.e., the ratio of the number of video migration tasks to the threshold number of video migration tasks for each migration hard drive can be determined. Alternatively, the multiplier migration condition can be determined after the recorded videos are allocated to the migration hard drives and the video migration task is executed. This embodiment does not impose a restriction on either method.
[0090] S2140. Based on the ratio of the number of video migration tasks to the threshold number of video migration tasks, determine the target video migration task from the video migration tasks on the migration hard disk and perform a multiplier migration.
[0091] When the ratio of the number of video migration tasks to the threshold number of video migration tasks is less than or equal to a preset ratio, the target video migration task to be migrated by multiple can be determined based on the ratio of the number of video migration tasks to the threshold number of video migration tasks.
[0092] For example, when the ratio of the number of video migration tasks to the threshold number of video migration tasks is less than or equal to 1 / 4, all video migration tasks can be migrated by a multiple. When the ratio of the number of video migration tasks to the threshold number of video migration tasks is greater than 1 / 4 but less than or equal to 1 / 3, some video migration tasks can be selected for multiple migration.
[0093] Optionally, after determining the target video migration task to be migrated by multiple, you can first set each target video migration task to a multiple of 2 according to its priority. If the ratio of the number of video migration tasks to the threshold of the number of video migration tasks is still less than the preset threshold after setting all target video migration tasks to a multiple of 2, then you can increase each target video migration task to a multiple of 4.
[0094] S2150: Determine whether the ratio of the total bitrate of the video migration task on the migration hard disk to the total base bitrate of the migration hard disk is less than or equal to the preset bitrate ratio. If yes, execute S2160; otherwise, return to execute S210.
[0095] The total base bitrate is the product of the total number of tasks threshold on the migration hard drive and the base bitrate value. If the total bitrate of the video migration tasks on the migration hard drive is smaller than the total base bitrate of the migration hard drive, it can also be considered that the migration hard drive has sufficient idle resources.
[0096] S2160. Based on the ratio of the total bitrate of the video migration task to the total base bitrate of the migration hard disk, determine the target video migration task in the video migration tasks on the migration hard disk and perform multiplier migration.
[0097] Similarly, when the ratio of the total bitrate of the video migration task to the total base bitrate of the migration hard drive is less than or equal to 1 / 4, all video migration tasks can be migrated by a multiple. When the ratio of the total bitrate of the video migration task to the total base bitrate of the migration hard drive is greater than 1 / 4 but less than or equal to 1 / 3, some video migration tasks can be selected for multiple migration.
[0098] Optionally, after all the video recordings to be migrated from the backup equipment have been migrated, the list of migrateable hard drives and the distribution table of stored video recordings can be deleted to reduce the consumption of computing resources.
[0099] Example 3
[0100] Figure 3 This is a flowchart of a video recording migration method provided in Embodiment 3 of the present invention. This embodiment can be applied to situations where the video recordings to be migrated are sent to the main device in sequence according to priority for migration. This method can be executed by a video recording migration device, which can be implemented by software and / or hardware, and is generally integrated in a backup device for use in conjunction with the main device.
[0101] like Figure 3 As shown, the technical solution of this embodiment of the invention specifically includes the following steps:
[0102] S310. Determine the video recording retention period and migration time threshold of the main equipment, and determine the time priority of each video recording to be migrated based on the video recording retention period and migration time threshold.
[0103] The video retention period can be calculated by dividing the total capacity of each hard drive and the total storage bitrate of the main device. Optionally, after the main device triggers the video migration, the main device can calculate the video retention period and send it to the backup device.
[0104] Optionally, determining the migration time threshold for the main device may include: determining the total number of tasks for the main device's hard drives, the number of hard drives, and the total number of storage recording tasks for the main device; taking the difference between the product of the total number of tasks for the main device's hard drives and the number of hard drives and the total number of storage recording tasks as the maximum number of recording migration tasks; taking the minimum average bitrate of the recording devices matched with each recording to be migrated as the minimum migration speed; and taking the ratio of the maximum number of recording migration tasks to the minimum migration speed as the migration time threshold.
[0105] Optionally, the time interval can be set starting from 00:00:00 on the date of the earliest recorded video in the backup device, and the time interval can be recorded to determine whether a video is stored within each preset time interval from the time start point, and the recording device corresponding to the stored video. It should be noted that the time interval in this embodiment can be consistent with the time interval when the main device constructs the stored video distribution table in the above embodiment.
[0106] In this embodiment of the invention, a distribution table of videos to be relocated is constructed based on the recording devices and time. This distribution table can be used to represent the distribution of videos to be relocated from each recording device in different time periods. The distribution table can also store the time priority and recording device priority of the videos to be relocated.
[0107] Time priority can be determined based on the device's recording retention period and migration time threshold. Specifically, if the recording retention period is greater than or equal to the migration time threshold, then for all recordings to be migrated, time priority is set sequentially according to their recording time. If the recording retention period is less than the migration time threshold, it means that when all recordings to be migrated are migrated, the earliest migrated recordings are invalid and have been overwritten by the latest storage recording task. Therefore, based on the recording retention period and migration time threshold, the recordings with the closest recording time can be selected from the recordings to be migrated, and their time priorities can be set sequentially.
[0108] S320. Determine the priority of the recording device for each video recording to be relocated based on the sequence identifier of the recording device that matches each video recording to be relocated.
[0109] In this embodiment of the invention, when each recording device is performing normal recording and storage services on the main device, the main device sets a sequence identifier for each recording device. The sequence identifier of each recording device indicates the loading order of each recording device in the main device. In this embodiment of the invention, the priority of each recording device matching each recording to be migrated can be set sequentially according to the sequence identifier.
[0110] S330: Based on the time priority and recording device priority of each video recording to be relocated, send each video recording to be relocated to the main device for relocation in sequence.
[0111] In this embodiment of the invention, the backup device sends the recordings to be returned to the recording devices with higher priority in sequence according to the priority of the recording devices. For the recordings to be returned to the same recording device, they are sorted according to time priority and sent in sequence.
[0112] The technical solution of this embodiment determines the time priority of each video recording to be migrated based on the recording retention period and migration time threshold, and determines the recording device priority based on the sequence identifier of the matched recording device. Each video recording to be migrated is then sent to the main device sequentially according to its time priority and recording device priority for migration. This solves the problem of slow migration speed in existing technologies, realizes the migration of video recordings according to priority, and improves migration efficiency.
[0113] Example 4
[0114] Figure 4 This is a flowchart of a video recording migration method provided in Embodiment 4 of the present invention. Based on the above embodiments, the present invention further specifies the process of determining the time priority of each video recording to be migrated.
[0115] Correspondingly, such as Figure 4 As shown, the technical solution of this embodiment of the invention specifically includes the following steps:
[0116] S410. Determine the video recording retention period and migration time threshold of the main equipment.
[0117] The methods for determining the video retention period and the migration time threshold have been described in the above embodiments, and will not be repeated here.
[0118] S420. Determine whether the video recording retention period is greater than or equal to the reset time threshold. If yes, execute S430; otherwise, execute S440.
[0119] When the video retention period is greater than or equal to the migration time threshold, it means that after the migration is completed, the validity period of each video to be migrated is still within the video retention period. Otherwise, it means that after all the videos are migrated, the earliest migrated video is no longer within the video retention period, has been deleted or overwritten by the latest video. Migrating these earliest migrated videos is meaningless and a waste of computing resources.
[0120] S430. Set the priority of each video recording to be relocated in descending order of time.
[0121] When the video recording retention period is greater than or equal to the migration time threshold, the time priority of each video recording to be migrated is set from high to low according to the time sequence.
[0122] S440. Calculate the priority setting start time based on the earliest recording time of each video to be migrated, the difference between the migration time threshold and the video retention period.
[0123] When the video recording retention period is less than the migration time threshold, the earliest videos to be migrated can be given the lowest priority to reduce resource waste.
[0124] In this embodiment of the invention, the priority setting start time is calculated based on the earliest recording time of each video to be migrated, the difference between the migration time threshold and the video retention period, and the lowest priority is set for each video to be migrated between the earliest recording time and the priority setting start time.
[0125] S450. For each recording to be transferred after the priority setting start time, the priority is set from high to low according to the time sequence.
[0126] In this embodiment of the invention, for each video recording to be migrated whose recording time is after the priority setting start time, priorities are set sequentially from high to low according to the time sequence. However, it should be noted that among the video recordings to be migrated whose recording time is after the priority setting start time, the lowest priority is higher than the time priority of each video recording to be migrated whose recording time is between the earliest recording time and the priority setting start time.
[0127] S460. For each recording to be migrated between the earliest recording time and the priority setting start time, set the priority from low to high according to the time sequence.
[0128] Among them, the highest priority of each video recording to be migrated whose recording time is between the earliest recording time and the priority setting start time is lower than the lowest priority of each video recording to be migrated whose recording time is after the priority setting start time.
[0129] S470. Determine the priority of the recording device for each video recording to be relocated based on the sequence identifier of the recording device that matches each video recording to be relocated.
[0130] The method for setting the priority of the recording device has been described in the above embodiments, and will not be repeated here.
[0131] S480: Based on the time priority and recording device priority of each video recording to be relocated, send each video recording to be relocated to the main device for relocation in sequence.
[0132] It should be noted that determining the time priority of each video to be returned based on the video retention period and the return time threshold, and determining the priority of the recording device based on the sequence identifier of the recording device, are only one priority determination method in this embodiment. Alternatively, each video to be returned can be sent sequentially based on the time priority or the recording device priority, or the priority of the video to be returned can be set according to the user's priority setting instruction, so as to realize the customization of the priority of sending the video to be returned.
[0133] Example 5
[0134] Figure 5 This is a schematic diagram of a video recording migration device provided in Embodiment 5 of the present invention. This device can be integrated into a master device and used in conjunction with a slave device. The device includes: a video recording acquisition module 510 to be migrated, a stored video recording distribution table determination module 520, a migration hard disk determination module 530, and a video recording migration module 540. Wherein:
[0135] The relocation video acquisition module 510 is used to acquire the relocation video sent by the backup device, wherein the relocation video is sent by the backup device in sequence according to time priority and / or recording device priority.
[0136] The stored video recording distribution table determination module 520 is used to determine the list of retrievable hard disks and the stored video recording distribution table of each recording device in each hard disk of the retrievable hard disk list.
[0137] The hard disk to be migrated module 530 is used to determine the hard disk to be migrated from each hard disk in the list of hard disks to be migrated based on the stored video recording distribution table.
[0138] The video recording recovery module 540 is used to perform a video recording recovery task on the video recording to be recovered on the recovery hard disk.
[0139] The technical solution of this embodiment obtains the recordings to be migrated from the backup device according to time priority and recording device priority, determines the list of revertible hard drives, and the distribution table of stored recordings of each recording device on each hard drive in the list of revertible hard drives. Based on the distribution table of stored recordings, the migration hard drive is determined, and the recordings to be migrated are stored on the migration hard drive. This solves the problems of slow migration speed and excessive storage pressure on a single hard drive due to uneven distribution of migration recordings in the prior art, achieving a reasonable layout of the recordings to be migrated, facilitating smooth overlay of subsequent recordings, and improving migration efficiency.
[0140] Based on the above embodiments, the hard disk migration determination module 530 includes:
[0141] The recording time and recording device determination unit is used to determine the recording time and recording device of the recording to be transferred back;
[0142] The first hard disk determination unit is used to determine the candidate hard disk as the hard disk if, according to the stored video distribution table, the recording devices in the candidate hard disk match the recording devices to be migrated within the time period corresponding to the recording time.
[0143] The second resettable hard disk determination unit is used otherwise, if it is determined that the hard disk with the smallest number of video storage tasks in the list of resettable hard disks is one, then the hard disk with the smallest number of video storage tasks will be used as the resettable hard disk.
[0144] The third reset disk determination unit is used to determine, otherwise, among the disks with the fewest video storage tasks, the disk with the smallest occupied capacity within the time period corresponding to the recorded video time according to the already stored video distribution table, and use it as the reset disk.
[0145] Based on the above embodiments, the device further includes:
[0146] The video migration task pause module is used to determine, if it is determined that there is a new video storage task on the migration hard disk and the migration hard disk meets the conditions for pausing the video migration task, then from the videos that are executing the video migration task on the migration hard disk, the video with the bitrate that matches the new video storage task will be paused to stop the execution of the video migration task.
[0147] The video replay task pause module includes:
[0148] The video migration task pause condition judgment unit is used to determine if the sum of the number of video storage tasks on the migration hard disk and the number of video migration tasks is greater than the total number of tasks threshold of the migration hard disk, and then determine that the migration hard disk meets the video migration task pause condition.
[0149] Based on the above embodiments, the device further includes:
[0150] The first multiplier migration unit is used to determine the target video migration task from the video migration tasks on the migration hard disk for multiplier migration if the ratio of the number of video migration tasks on the migration hard disk to the threshold number of video migration tasks is less than or equal to a preset ratio; or,
[0151] The second multiple migration unit is used to determine the target video migration task on the migration hard disk for multiple migration if the ratio of the total bitrate of the video migration task on the migration hard disk to the total base bitrate of the migration hard disk is less than or equal to a preset bitrate ratio.
[0152] The video rewinding device provided in the embodiments of the present invention can execute the video rewinding method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0153] Example 6
[0154] Figure 6 This is a schematic diagram of a video recording recovery device provided in Embodiment Six of the present invention. This device can be integrated into a backup device and used in conjunction with a slave device. The device includes: a time priority determination module 610, a video recording device priority determination module 620, and a video recording to be recovered transmission module 630. Wherein:
[0155] The time priority determination module 610 is used to determine the video recording retention period and migration time threshold of the main device, and to determine the time priority of each video recording to be migrated based on the video recording retention period and migration time threshold.
[0156] The video recording device priority determination module 620 is used to determine the priority of each video recording device to be relocated based on the sequence identifier of the video recording device that matches each video recording to be relocated.
[0157] The video recording to be relocated module 630 is used to send each video recording to be relocated to the main device for relocation in sequence according to the time priority and the recording device priority.
[0158] The technical solution of this embodiment determines the time priority of each video recording to be migrated based on the recording retention period and migration time threshold, and determines the recording device priority based on the sequence identifier of the matched recording device. Each video recording to be migrated is then sent to the main device sequentially according to its time priority and recording device priority for migration. This solves the problem of slow migration speed in existing technologies, realizes the migration of video recordings according to priority, and improves migration efficiency.
[0159] Based on the above embodiments, the time priority determination module 610 includes:
[0160] The first priority determination unit is used to set the priority of each video to be transferred in descending order according to the time sequence if the video retention period is determined to be greater than or equal to the transfer time threshold.
[0161] The priority setting start time calculation unit is used to calculate the priority setting start time based on the earliest recording time of each video to be migrated, and the difference between the migration time threshold and the video retention period if the video retention period is determined to be less than the migration time threshold.
[0162] The second time priority determination unit is used to set the priority from high to low for each recording to be transferred after the priority setting start time, according to the time sequence.
[0163] The third time priority determination unit is used to set the priority of each video recording to be transferred between the earliest recording time and the priority setting start time in ascending order according to the time sequence, and each priority is lower than the lowest priority of each video recording to be transferred after the priority setting start time.
[0164] The video rewinding device provided in the embodiments of the present invention can execute the video rewinding method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0165] Example 7
[0166] Figure 7 This is a schematic diagram of the structure of a computer device provided in Embodiment Seven of the present invention, as shown below. Figure 7 As shown, the computer device includes a processor 70, a memory 71, an input device 72, and an output device 73; the number of processors 70 in the computer device can be one or more. Figure 7 Taking a processor 70 as an example; the processor 70, memory 71, input device 72, and output device 73 in a computer device can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.
[0167] The memory 71, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the modules corresponding to the video playback method in this embodiment of the invention (e.g., the video playback acquisition module 510, the stored video distribution table determination module 520, the playback hard disk determination module 530, and the video playback module 540 in the video playback device of the main device; or the time priority determination module 610, the recording device priority determination module 620, and the video playback transmission module 630 in the video playback device of the backup device). The processor 70 executes various functional applications and data processing of the computer device by running the software programs, instructions, and modules stored in the memory 71, thereby implementing the above-described video playback method. The method includes:
[0168] Acquire the backup device's video recordings to be relocated, wherein the backup device sends the video recordings sequentially according to time priority and / or recording device priority;
[0169] Determine the list of retrievable hard drives, and the distribution table of stored recordings of each recording device in each hard drive of the retrievable hard drive list;
[0170] Based on the stored video recording distribution table, determine the returnable hard drives from among the hard drives in the list of returnable hard drives;
[0171] On the hard disk to be migrated, a video migration task is performed on the video recordings to be migrated.
[0172] Alternatively, another video rewinding method described above can be implemented, which includes:
[0173] Determine the video recording retention period and migration time threshold of the main equipment, and determine the time priority of each video recording to be migrated based on the video recording retention period and migration time threshold;
[0174] The priority of the recording device for each video to be relocated is determined based on the sequence identifier of the recording device that matches each video to be relocated.
[0175] Based on the time priority and recording device priority of each video recording to be relocated, each video recording to be relocated is sent to the main device for relocation in sequence.
[0176] The memory 71 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 71 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 71 may further include memory remotely located relative to the processor 70, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0177] Input device 72 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the computer device. Output device 73 may include display devices such as a display screen.
[0178] Example 8
[0179] Embodiment 8 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a video playback method, the method comprising:
[0180] Acquire the backup device's video recordings to be relocated, wherein the backup device sends the video recordings sequentially according to time priority and / or recording device priority;
[0181] Determine the list of retrievable hard drives, and the distribution table of stored recordings of each recording device in each hard drive of the retrievable hard drive list;
[0182] Based on the stored video recording distribution table, determine the returnable hard drives from among the hard drives in the list of returnable hard drives;
[0183] On the hard disk to be migrated, a video migration task is performed on the video recordings to be migrated.
[0184] Alternatively, another video rewinding method may be implemented, which includes:
[0185] Determine the video recording retention period and migration time threshold of the main equipment, and determine the time priority of each video recording to be migrated based on the video recording retention period and migration time threshold;
[0186] The priority of the recording device for each video to be relocated is determined based on the sequence identifier of the recording device that matches each video to be relocated.
[0187] Based on the time priority and recording device priority of each video recording to be relocated, each video recording to be relocated is sent to the main device for relocation in sequence.
[0188] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also perform related operations in the video playback method provided in any embodiment of the present invention.
[0189] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, 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 a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including 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 of the present invention.
[0190] It is worth noting that in the above-described embodiments of the video playback device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0191] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A video rewinding method, characterized in that, Performed by the master device, the method includes: Acquire the backup device's video recordings to be relocated, wherein the backup device sends the video recordings sequentially according to time priority and / or recording device priority; Determine the list of retrievable hard drives, and the distribution table of stored recordings of each recording device in each hard drive of the retrievable hard drive list; Based on the stored video recording distribution table, determine the returnable hard drives from the list of returnable hard drives, including: Determine the recording time and recording equipment for the videos to be relocated; Determine the target time period corresponding to the recorded time based on the stored video distribution table; Match the recording devices corresponding to each hard drive in the list of recoverable hard drives within the target time period with the recording devices to be recovered, and determine the matched hard drives as the recovery hard drives; or... Based on the number of video storage tasks and video migration tasks of each hard drive in the list of revertible hard drives, and / or the capacity occupied by the videos stored within the target time period in each hard drive in the list of revertible hard drives, the revertible hard drives are determined, including: among the hard drives in the list of revertible hard drives, determining the hard drives with fewer than a first preset value for the number of video storage tasks; if there is only one hard drive with fewer than the first preset value for the number of video storage tasks, that hard drive is designated as the revertible hard drive; if there are multiple hard drives with fewer than the first preset value for the number of video storage tasks, then among the hard drives with fewer than the first preset value for the number of video storage tasks, the hard drive with the smallest number of video migration tasks is designated as the revertible hard drive, or the hard drive with the smallest capacity occupied by the videos stored within the target time period is designated as the revertible hard drive; or, among the hard drives in the list of revertible hard drives, the hard drive with the smallest capacity occupied by the videos stored within the target time period is designated as the revertible hard drive. On the hard disk to be migrated, a video migration task is performed on the video recordings to be migrated.
2. The method according to claim 1, characterized in that, After performing the video migration task on the video to be migrated on the migration hard disk, the process further includes: If it is determined that there is a new video storage task on the migration hard drive, and the migration hard drive meets the conditions for pausing the video migration task, then from the videos that are executing the video migration task on the migration hard drive, determine the videos whose bitrate matches that of the new video storage task and pause the execution of the video migration task. The reset disk meets the conditions for pausing the video reset task, including: If the sum of the number of video storage tasks on the migration hard drive and the number of video migration tasks is greater than the threshold for the total number of tasks on the migration hard drive, then the migration hard drive meets the conditions for pausing video migration tasks.
3. The method according to claim 1, characterized in that, After performing the video migration task on the video to be migrated on the migration hard disk, the process further includes: If the ratio of the number of video migration tasks on the migration hard drive to the threshold number of video migration tasks is less than or equal to a preset ratio, then based on the ratio of the number of video migration tasks to the threshold number of video migration tasks, a target video migration task is selected from the video migration tasks on the migration hard drive for multiplier migration; or, If the ratio of the total bitrate of the video migration task on the migration hard drive to the total base bitrate of the migration hard drive is less than or equal to the preset bitrate ratio, then the target video migration task is determined from the video migration tasks on the migration hard drive and migrated by a multiple based on the ratio of the total bitrate of the video migration task to the total base bitrate of the migration hard drive.
4. A video rewinding method, characterized in that, Performed by a backup device, the method includes: Determine the video recording retention period and migration time threshold for the main equipment, and based on the video recording retention period and migration time threshold, determine the time priority of each video recording to be migrated, including: If it is determined that the video recording retention period is greater than or equal to the migration time threshold, then each video recording to be migrated will be assigned a priority from high to low according to the chronological order. If it is determined that the video retention period is less than the migration time threshold, the priority setting start time is calculated based on the earliest recording time of each video to be migrated, and the difference between the migration time threshold and the video retention period. For each recording to be transferred whose recording time is after the priority setting start time, the priority is set from high to low according to the time sequence. For each video recording to be migrated whose recording time falls between the earliest recording time and the priority setting start time, priority is set sequentially from low to high according to the time sequence; among them, the highest priority of each video recording to be migrated whose recording time falls between the earliest recording time and the priority setting start time is lower than the lowest priority of each video recording to be migrated whose recording time falls after the priority setting start time. The priority of the recording device for each video to be relocated is determined based on the sequence identifier of the recording device that matches each video to be relocated. Based on the time priority and recording device priority of each video recording to be relocated, each video recording to be relocated is sent to the main device for relocation in sequence.
5. A video playback device, characterized in that, Deployed in the main device, the device includes: The module for acquiring relocation video recordings is used to acquire relocation video recordings sent by the backup device. The relocation video recordings are sent by the backup device in sequence according to time priority and / or recording device priority. The module for determining the stored video recording distribution table is used to determine the list of retrievable hard disks and the stored video recording distribution table of each recording device in each hard disk of the retrievable hard disk list. The hard drive to be migrated module is used to determine the hard drive to be migrated from each hard drive in the list of available hard drives based on the stored video recording distribution table. The hard drive migration determination module is used for: Determine the recording time and recording equipment for the videos to be relocated; Determine the target time period corresponding to the recorded time based on the stored video distribution table; Match the recording devices corresponding to each hard drive in the list of recoverable hard drives within the target time period with the recording devices to be recovered, and determine the matched hard drives as the recovery hard drives; or... Based on the number of video storage tasks and video migration tasks of each hard drive in the list of revertible hard drives, and / or the capacity occupied by the videos stored within the target time period in each hard drive in the list of revertible hard drives, the revertible hard drives are determined, including: among the hard drives in the list of revertible hard drives, determining the hard drives with fewer than a first preset value for the number of video storage tasks; if there is only one hard drive with fewer than the first preset value for the number of video storage tasks, that hard drive is designated as the revertible hard drive; if there are multiple hard drives with fewer than the first preset value for the number of video storage tasks, then among the hard drives with fewer than the first preset value for the number of video storage tasks, the hard drive with the smallest number of video migration tasks is designated as the revertible hard drive, or the hard drive with the smallest capacity occupied by the videos stored within the target time period is designated as the revertible hard drive; or, among the hard drives in the list of revertible hard drives, the hard drive with the smallest capacity occupied by the videos stored within the target time period is designated as the revertible hard drive. The video recording recovery module is used to perform video recording recovery tasks on the video recordings to be recovered on the recovery hard disk.
6. A video playback device, characterized in that, Deployed in a backup device, the device includes: The time priority determination module is used to determine the video recording retention period and migration time threshold of the main device, and to determine the time priority of each video recording to be migrated based on the video recording retention period and migration time threshold. The time priority determination module includes: The first priority determination unit is used to set the priority of each video to be transferred in descending order according to the time sequence if the video retention period is determined to be greater than or equal to the transfer time threshold. The priority setting start time calculation unit is used to calculate the priority setting start time based on the earliest recording time of each video to be migrated, and the difference between the migration time threshold and the video retention period if the video retention period is determined to be less than the migration time threshold. The second time priority determination unit is used to set the priority from high to low for each recording to be transferred after the priority setting start time, according to the time sequence. The third time priority determination unit is used to set the priority of each video recording to be transferred between the earliest recording time and the priority setting start time in order of time, from low to high, and each priority is lower than the lowest priority of each video recording to be transferred after the priority setting start time. The video recording device priority determination module is used to determine the priority of each video recording device to be relocated based on the sequence identifier of the video recording device that matches each video recording to be relocated. The module for sending back recorded videos is used to send each video to be back to the main device for backing up in sequence according to the time priority and recording device priority.
7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the video rewinding method as described in any one of claims 1-3 or 4.
8. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the video rewinding method as described in any one of claims 1-3 or 4.
Citation Information
Patent Citations
Processing method and device for video relevant information transfer
CN105072494A
Hierarchical storage and migration method of industrial real-time data
CN105653591A
Platform backup protection method and device
CN112954264A