Video storage scheduling method and device, computer device and storage medium
By determining the load balancing pressure based on the remaining disk capacity and write capability of the storage workgroup in the video storage device, and evenly distributing the video channel bitstream, the reliability problem of the video storage device when the video channel bitstream is too large is solved, and the stability of video storage is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2026-03-24
AI Technical Summary
Existing video storage devices are prone to buffer space filling up and video loss when the video channel bit rate is much greater than the recording write capacity of a single disk or work area, resulting in low video storage reliability.
By determining the load balancing pressure of the video storage device based on the remaining disk capacity and remaining write capacity of the storage workgroup, the newly connected video channel streams are evenly distributed to each storage workgroup based on either the video write capacity or the disk capacity.
It effectively improves the reliability of video storage, while taking into account the load balancing of the remaining disk capacity and write capability of the storage workgroup, thus avoiding video loss.
Smart Images

Figure CN115766732B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data storage, in particular to a video storage scheduling method and device, computer equipment and computer readable storage medium. BACKGROUND
[0002] With the development of network technology, the service traffic is getting larger and larger and the service logic is getting more and more complex, which puts forward higher stability and reliability requirements for data storage. As a great part of data storage, video storage plays a key role in subsequent verification and use, so the reliability of video storage is crucial.
[0003] In the prior art, the video storage device switches to another work area to continue writing video after filling up a disk or work area. However, when the code stream of the accessed video channel is much larger than the video write-in capacity of a single disk or work area, the cache space will be full, which is easy to cause video loss, resulting in the problem of low video storage reliability in the prior art. SUMMARY
[0004] Therefore, it is necessary to provide a video storage scheduling method and device, computer equipment and computer readable storage medium to solve the problem of low video storage reliability in the related art.
[0005] In a first aspect, the embodiments of the present application implement a video storage scheduling method for scheduling the video storage work of a video storage device, wherein the video storage device includes at least two storage work groups, and the method includes the following steps:
[0006] When a new video channel is accessed to the video storage device, it is determined whether the load balancing pressure of the video storage device is the video write-in capacity or the disk capacity based on the residual disk capacity and the residual write-in capacity of each storage work group;
[0007] If the load balancing pressure is the video write-in capacity, the code stream of each newly accessed video channel is evenly distributed to each storage work group based on the size of the residual write-in capacity of each storage work group and the size of the code stream of each newly accessed video channel;
[0008] If the load balancing pressure is the disk capacity, the code stream of each newly accessed video channel is evenly distributed to each storage work group based on the size of the residual disk capacity of each storage work group and the size of the code stream of each newly accessed video channel.
[0009] In some embodiments, the step of determining whether the load balancing pressure of the video recording storage device is the video recording write capacity or the disk capacity based on the residual disk capacity and the residual write capacity of each of the storage working groups comprises the steps of:
[0010] calculating the variance of the residual disk capacity based on the residual disk capacity of each of the storage working groups, and calculating the variance of the residual write capacity based on the residual write capacity of each of the storage working groups;
[0011] determining whether the load balancing pressure of the video recording storage device is the video recording write capacity or the disk capacity according to the size of the variance of the residual disk capacity and the variance of the residual write capacity.
[0012] In some embodiments, the step of balancing distributing the code stream of each of the newly accessed video recording channels to each of the storage working groups based on the size of the residual write capacity of each of the storage working groups and the size of the code stream of each of the newly accessed video recording channels comprises the steps of:
[0013] determining the size of the code stream that each of the storage working groups needs to share based on the size of the code stream of each of the newly accessed video recording channels;
[0014] accumulating the code stream of each of the newly accessed video recording channels in the order from small to large, and dividing the video recording channels whose accumulated value does not exceed the shared size of the code stream into a video recording channel group;
[0015] sorting the video recording channel group according to the size of the code stream from small to large, and sorting each of the storage working groups according to the residual write capacity from small to large, and distributing the code stream of each of the newly accessed video recording channels to each of the storage working groups according to the order correspondence between the video recording channel group and the storage working group.
[0016] In some embodiments, the step of balancing distributing the code stream of each of the newly accessed video recording channels to each of the storage working groups based on the size of the residual disk capacity of each of the storage working groups and the size of the code stream of each of the newly accessed video recording channels comprises the steps of:
[0017] grouping the code stream of each of the newly accessed video recording channels according to the disk capacity ratio, and taking the video recording channels belonging to the same group as a video recording channel group; the disk capacity ratio is the size ratio of the residual disk capacity of each of the storage working groups;
[0018] sorting the video recording channel group according to the size of the code stream from small to large, and sorting each of the storage working groups according to the residual disk capacity from small to large.
[0019] According to the order correspondence between the video channel groups and the storage work groups, the code streams of the newly accessed video channels are allocated to the storage work groups.
[0020] In some embodiments, the method further comprises:
[0021] When a video channel is disconnected from the video storage device, the video channel whose code stream value is closest to that of the disconnected video channel is connected to the video storage device as a newly connected video channel.
[0022] In some embodiments, before determining the code stream size that each storage work group needs to share according to the code stream size of each newly connected video channel, the method further comprises:
[0023] The storage work group whose remaining disk capacity is insufficient is determined as an invalid storage work group.
[0024] In some embodiments, after sorting the video channel groups according to their code stream sizes from small to large, and sorting the storage work groups according to their remaining disk capacities from small to large, before allocating the code streams of the newly accessed video channels to the storage work groups according to the order correspondence between the video channel groups and the storage work groups, the method further comprises:
[0025] It is determined whether the code stream size of the video channel group corresponding to the sorting order of the current storage work group exceeds the remaining write capacity of the current storage work group;
[0026] If so, some of the video channels in the video channel group corresponding to the sorting order of the current storage work group are adjusted to the video channel group corresponding to the sorting order of the storage work group with stronger remaining write capacity.
[0027] In a second aspect, the embodiments of the present application implement a video storage scheduling device for scheduling video storage work of a video storage device, wherein the video storage device comprises at least two storage work groups, and the device comprises an access module, a write balancing module and a capacity balancing module.
[0028] The access module is configured to, when a video channel is newly connected to the video storage device, determine whether the load balancing pressure of the video storage device is video write capacity or disk capacity based on the remaining disk capacity and the remaining write capacity of each current storage work group.
[0029] The write balancing module is configured to, if the load balancing pressure is the video recording write capability, distribute the code streams of the newly accessed video recording channels to the storage work groups according to the sizes of the residual write capabilities of the storage work groups and the sizes of the code streams of the newly accessed video recording channels.
[0030] The capacity balancing module is configured to, if the load balancing pressure is the disk capacity, distribute the code streams of the newly accessed video recording channels to the storage work groups according to the sizes of the residual disk capacities of the storage work groups and the sizes of the code streams of the newly accessed video recording channels.
[0031] In a third aspect, a computer device is provided in the present embodiment, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method in the first aspect when executing the computer program.
[0032] In a fourth aspect, a computer readable storage medium is provided in the present embodiment, which stores a computer program, and the computer program implements the steps of the method in the first aspect when executed by a processor.
[0033] The video recording storage scheduling method, device, computer device, and computer readable storage medium are used for scheduling video recording storage work of a video recording storage device, the video recording storage device includes at least two storage work groups, and when a video recording channel is newly accessed to the video recording storage device, the load balancing pressure of the video recording storage device is determined to be the video recording write capability or the disk capacity based on residual disk capacities and residual write capabilities of the current storage work groups. If the load balancing pressure is the video recording write capability, the code streams of the newly accessed video recording channels are distributed to the storage work groups according to the sizes of the residual write capabilities of the storage work groups and the sizes of the code streams of the newly accessed video recording channels. If the load balancing pressure is the disk capacity, the code streams of the newly accessed video recording channels are distributed to the storage work groups according to the sizes of the residual disk capacities of the storage work groups and the sizes of the code streams of the newly accessed video recording channels. The present application first determines the load balancing pressure of the video recording storage device according to the residual disk capacities and the residual write capabilities of the current storage work groups, and then distributes the load balancing pressure to the storage work groups according to the sizes of the code streams of the newly accessed video recording channels, so as to effectively balance the load balancing of the residual disk capacities and the residual write capabilities of the storage work groups, thereby effectively improving the reliability of video recording. BRIEF DESCRIPTION OF DRAWINGS
[0034] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0035] Figure 1 is an application scenario of a video recording storage scheduling method provided by an embodiment of the application;
[0036] Figure 2 is a flowchart of a video recording storage scheduling method provided by an embodiment of the application;
[0037] Figure 3 is a structural schematic diagram of a video recording storage scheduling device provided by an embodiment of the application;
[0038] Figure 4 is a structural schematic diagram of a computer device provided by an embodiment of the application. DETAILED DESCRIPTION
[0039] In order to make the objects, technical solutions and advantages of the application clearer, the application is described and illustrated below in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the application and should not be used to limit the application. Based on the embodiments provided by the application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the application.
[0040] Obviously, the drawings in the following description are only some examples or embodiments of the application, and for those of ordinary skill in the art, the application can be applied to other similar scenarios without creative labor on the basis of these drawings. In addition, it can be understood that although the efforts made in this development process can be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the application, some design, manufacture or production changes based on the technical content disclosed in the application are only routine technical means and should not be understood as insufficient disclosure of the application.
[0041] In the present application, "embodiment" means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the application. The phrase appears at various places in the specification does not necessarily refer to the same embodiment, nor is it independent or alternative to other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in the application can be combined with other embodiments without conflict.
[0042] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.
[0043] Figure 1 This is an application scenario diagram of a video recording storage scheduling method provided in one embodiment of this application. For example... Figure 1 As shown, server 101 can transmit data with video storage device 102 and camera 103 via the network. There can be one or more cameras 103, each including at least one recording channel. Video storage device 102 is used to access the recording channels of camera 103. Furthermore, video storage device 102 includes at least two storage workgroups. When server 101 determines that a new recording channel has been added to video storage device 102, it determines whether the load balancing pressure on video storage device 102 is the recording write capacity or the disk capacity, based on the remaining disk capacity and write capacity of each storage workgroup. If the load balancing pressure is the recording write capacity, server 101 evenly distributes the bitstream of the newly added recording channel to each storage workgroup based on the remaining write capacity of each storage workgroup and the bitstream size of each newly added recording channel. If the load balancing pressure is the disk capacity, server 101 evenly distributes the bitstream of the newly added recording channel to each storage workgroup based on the remaining disk capacity of each storage workgroup and the bitstream size of each newly added recording channel. The server 101 can be implemented by a standalone server or a server cluster consisting of multiple servers, and the video recording storage device 103 can be implemented by a back-end storage device.
[0044] This embodiment provides a video recording storage scheduling method for scheduling the video recording storage work of a video recording storage device, wherein the video recording storage device includes at least two storage workgroups, such as... Figure 2 As shown, the method includes the following steps:
[0045] Step S210: When a new recording channel is connected to the recording storage device, based on the remaining disk capacity and remaining write capacity of each storage workgroup, determine whether the load balancing pressure of the recording storage device is the recording write capacity or the disk capacity.
[0046] Specifically, since a video recording storage device includes at least two storage workgroups, both workgroups can be used for video recording. One workgroup can correspond to multiple disks of the same type. If a disk in the current workgroup fails, the file system of the video recording storage device can use the physical address of the healthy disk in the current workgroup as the mapping address of the current workgroup to cope with sudden disk failures and improve the reliability of video recording storage. When a new recording channel is connected to the video recording storage device, it means that the newly connected channel has recordings that need to be written to the video recording storage device. The reliability of video recording storage mainly depends on two indicators: the remaining disk capacity and the remaining write capability of the video recording storage device. The remaining disk capacity refers to the remaining space on the disk, such as whether the disk has 50GB or 100GB remaining. The remaining write capability refers to the disk's writing efficiency, such as the number of bits written per second. For a video recording storage device, there may be situations where the remaining disk capacity is sufficient but the remaining write capability is insufficient, or vice versa. Therefore, in this implementation, when a new recording channel is connected to the recording storage device, the load balancing pressure of the recording storage device is determined based on the remaining disk capacity and remaining write capacity of each storage workgroup, so as to facilitate different responses to different situations.
[0047] Variance is used to calculate the difference between each variable and the overall mean. Therefore, variance can be used to calculate the load balancing of video recording storage devices. One implementation method is to calculate the variance of remaining disk capacity based on the remaining disk capacity of each storage workgroup, and the variance of remaining write capacity based on the remaining write capacity of each storage workgroup. Based on the magnitude of the variances of remaining disk capacity and remaining write capacity, it can be determined whether the load balancing pressure on the video recording storage device is due to recording write capacity or disk capacity. Specifically, assuming the variance of remaining disk capacity is M and the variance of remaining write capacity is N, the load balancing pressure on the video recording storage device can be determined by whether the ratio of M to N exceeds a set threshold. This threshold can be set according to the actual usage scenario.
[0048] In addition, based on the remaining disk capacity of each storage workgroup, the sum of the deviations between the remaining disk capacity of each storage workgroup and the average remaining disk capacity can be calculated. For example, assuming there are 3 storage workgroups with remaining disk capacities of 10GB, 20GB, and 30GB, then the average remaining disk capacity of the 3 storage workgroups is 20GB, and the sum of the deviations between the remaining disk capacity of the 3 storage workgroups and the average remaining disk capacity is 10 + 0 + 10 = 20. Furthermore, based on the remaining write capacity of each storage workgroup, the sum of the deviations between the remaining disk capacity of each storage workgroup and the average remaining disk capacity can be calculated. The sum of the deviations between the remaining write capacity and the average remaining write capacity is used to determine whether the load balancing pressure of the video storage device is based on the video write capacity or the disk capacity. For example, assuming there are 3 storage workgroups with remaining write capacities of 15Mb / s, 20Mb / s, and 25Mb / s, the average remaining write capacity of the 3 storage workgroups is 20Mb / s, and the sum of the deviations between the remaining write capacity and the average remaining write capacity is 5 + 0 + 5 = 10.
[0049] Step S220: If the load balancing pressure is the recording write capacity, then based on the remaining write capacity of each storage workgroup and the bitstream size of each newly connected recording channel, the bitstream of each newly connected recording channel is evenly distributed to each storage workgroup.
[0050] If the load balancing pressure is the recording write capacity, it indicates that the remaining write capacity of the current recording storage device is unbalanced relative to the remaining storage capacity. Therefore, based on the remaining write capacity of each storage workgroup and the bitrate of each newly connected recording channel, the bitrate of each newly connected recording channel is evenly distributed among the storage workgroups, thereby evenly distributing the load balancing pressure of the recording storage device across the various storage workgroups. Specifically, the bitrate of each newly connected recording channel can be sampled and statistically analyzed using a sliding window method, and the average bitrate of the current recording channel during the sampling period is taken as the bitrate of the current recording channel.
[0051] Step S230: If the load balancing pressure is the disk capacity, then based on the remaining disk capacity of each storage workgroup and the bit rate of each newly connected recording channel, the bit rate of each newly connected recording channel is evenly distributed to each storage workgroup.
[0052] If the load balancing pressure is disk capacity, it means that the remaining disk capacity of the current video storage device is unbalanced relative to the remaining write capacity. Therefore, based on the remaining disk capacity of each storage workgroup and the bit rate of each newly connected video channel, the bit rate of each newly connected video channel is evenly distributed to each storage workgroup, thereby evenly distributing the load balancing pressure of the video storage device to each storage workgroup.
[0053] In existing technologies, video storage devices switch to another work area to continue writing video after one disk or work area is full. However, when the bit rate of the connected video channel is much greater than the video writing capacity of a single disk or work area, the cache space will be full, which can easily lead to video loss. This results in the problem of low reliability of video storage in existing technologies.
[0054] To address the aforementioned issues, this application proposes a video recording storage scheduling method. When a new video recording channel is connected to the video recording storage device, based on the remaining disk capacity and remaining write capability of each storage workgroup, it determines whether the load balancing pressure of the video recording storage device is the video recording write capability or the disk capacity. If the load balancing pressure is the video recording write capability, the bitstream of the newly connected video recording channel is evenly distributed among the storage workgroups based on the remaining write capability of each storage workgroup and the bitstream size of each newly connected video recording channel. If the load balancing pressure is the disk capacity, the bitstream of the newly connected video recording channel is evenly distributed among the storage workgroups based on the remaining disk capacity of each storage workgroup and the bitstream size of each newly connected video recording channel. This application first determines the load balancing pressure of the video recording storage device based on the remaining disk capacity and remaining write capability of each storage workgroup, and then evenly distributes the pre-determined load balancing pressure among the storage workgroups based on the bitstream size of each newly connected video recording channel. This effectively balances the load of the remaining disk capacity and remaining write capability of each storage workgroup, thereby effectively improving the reliability of video recording storage.
[0055] In one embodiment, step S220 above, based on the remaining write capacity of each storage workgroup and the bitstream size of each newly accessed recording channel, evenly distributes the bitstream of each newly accessed recording channel to each storage workgroup, including the following steps:
[0056] Step S221: Based on the bitstream size of each newly accessed recording channel, determine the bitstream size that each storage workgroup needs to share.
[0057] Assuming there are 4 newly connected recording channels with bitrates of 5Mb / s, 10Mb / s, 15Mb / s and 30Mb / s respectively, and assuming the recording storage device has 3 storage workgroups, then each storage workgroup needs to share a bitrate of (5+10+15+30)÷3=20Mb / s.
[0058] Step S222: The bitstreams of the newly connected recording channels are accumulated in ascending order, and the recording channels whose accumulated value does not exceed the average bitstream size are divided into a recording channel group.
[0059] Using the above example, the bitrates of the recording channels, in ascending order, are 5Mb / s, 10Mb / s, 15Mb / s, and 30Mb / s. Since 5 + 10 + 15 > 20, the recording channels with bitrates of 5Mb / s and 10Mb / s are grouped into one recording channel group. Since 15 + 30 > 20, the recording channels with bitrates of 15Mb / s are grouped into one recording channel group, and the remaining 30Mb / s channels are grouped into another. It should be noted that in actual implementation, if the number of recording channel groups obtained by dividing the recording channels in ascending order is one less than the number of storage workgroups, even if the total bitrate of the remaining undivided recording channels is greater than the average bitrate size, the remaining undivided recording channels will still be grouped into one recording channel group.
[0060] Step S223: Sort the recording channel groups according to their bitstream size from smallest to largest, and sort each storage work group according to its remaining write capacity from smallest to largest. Based on the sequential correspondence between the recording channel groups and the storage work groups, allocate the bitstreams of each newly connected recording channel to each storage work group.
[0061] Taking the above as an example, the 5Mb / s and 10Mb / s recording channels are divided into one recording channel group, the 15Mb / s recording channel into another, and the 30Mb / s recording channel into yet another. Sorting these recording channel groups by their bitrate size from smallest to largest yields (5+10) = 15Mb / s, 15Mb / s, and 30Mb / s. Then, the storage workgroups are sorted by their remaining write capacity from smallest to largest. Assuming the three storage workgroups are sorted by their remaining write capacity from smallest to largest as 280Mb / s, 300Mb / s, and 330Mb / s, respectively. Based on the sequential correspondence between the recording channel groups and the storage work groups, the bitstreams of the newly connected recording channels are allocated to the respective storage work groups. Specifically, the bitstreams of the recording channels with bitstreams of 5Mb / s and 10Mb / s are allocated to the storage work group with a write capacity of 280Mb / s, the bitstream of the recording channel with a bitstream of 15Mb / s is allocated to the storage work group with a write capacity of 300Mb / s, and the bitstream of the recording channel with a bitstream of 30Mb / s is allocated to the storage work group with a write capacity of 330Mb / s.
[0062] Through the above steps S221 to S223, based on the remaining write capacity of each storage workgroup and the bitstream size of each newly connected recording channel, the load balancing pressure is effectively distributed evenly to each storage workgroup.
[0063] In one embodiment, step S230 above, based on the remaining disk capacity of each storage workgroup and the bitrate of each newly accessed recording channel, evenly distributes the bitrate of each newly accessed recording channel to each storage workgroup, including the following steps:
[0064] Step S231: Group the bitstreams of the newly connected recording channels according to the disk capacity ratio, and group the recording channels belonging to the same group as a recording channel group; the disk capacity ratio is the ratio of the remaining disk capacity of each storage work group.
[0065] Assuming there are three storage workgroups with remaining disk capacities of 100GB, 200GB, and 300GB respectively, the disk capacity ratio is 1:2:3. Assuming four new recording channels are added with bitrates of 5Mb / s, 10Mb / s, 15Mb / s, and 30Mb / s respectively, the bitrates of these new recording channels are grouped according to their disk capacity ratio, resulting in three recording channel groups: one group with a bitrate of 10Mb / s, another group with bitrates of 5Mb / s and 15Mb / s, and a third group with a bitrate of 30Mb / s. It should be noted that in actual implementation, if the bitrates of the recording channels do not meet the disk capacity ratio requirement, the bitrates of the newly added recording channels can be grouped according to an approximate value of the disk capacity ratio.
[0066] Step S232: Sort the recording channel groups according to their bitrate size from smallest to largest, and sort each storage workgroup according to its remaining disk capacity from smallest to largest.
[0067] Step S233: Based on the sequential correspondence between the recording channel group and the storage work group, the bitstreams of each newly connected recording channel are allocated to each storage work group.
[0068] Taking the above as an example, sorting the recording channel groups by their bitrate from smallest to largest yields 10Mb / s, (5+15) = 20Mb / s, and 30Mb / s. Sorting each storage workgroup by its remaining disk capacity from smallest to largest yields 100GB, 200GB, and 300GB. Based on the sequential correspondence between the recording channel groups and storage workgroups, the bitrates of newly connected recording channels are allocated to the respective storage workgroups. Specifically, the bitrate of the 10Mb / s recording channel is allocated to the storage workgroup with 100GB of remaining disk capacity, the bitrates of the 5Mb / s and 15Mb / s recording channels are allocated to the storage workgroup with 200GB of remaining disk capacity, and the bitrate of the 30Mb / s recording channel is allocated to the storage workgroup with 300GB of remaining disk capacity.
[0069] Through the above steps S231 to S233, based on the remaining disk capacity of each storage workgroup and the bit rate of each newly connected recording channel, the load balancing pressure is effectively distributed evenly to each storage workgroup.
[0070] As one implementation method, before determining whether the load balancing pressure of the video storage device is the video writing capacity or the disk capacity based on the remaining disk capacity and remaining write capacity of each storage workgroup in step S210, a video channel storage allocation table can be established for the video storage device. The storage workgroup information that can be used to access the video channel and the corresponding video index information of each storage workgroup are stored in the video channel storage allocation table to quickly determine the storage workgroup that can be accessed by the video channel, and the location where the video data of each video channel is stored can be quickly determined according to the video index information.
[0071] Furthermore, in one embodiment, the video recording storage scheduling method further includes the following steps:
[0072] Step S240: When a recording channel is disconnected from the recording storage device, the recording channel that is already connected to the recording storage device and whose bitstream value is closest to that of the recording channel that was disconnected from the recording storage device is taken as the new recording channel to be connected to the recording storage device.
[0073] Specifically, if a recording channel is disconnected from the recording storage device, the original load balancing of the recording storage device will be disrupted. In this case, the recording channel already connected to the recording storage device whose bitstream value is closest to the disconnected recording channel will be designated as the new recording channel to be connected. The bitstream of this new recording channel will be redistributed according to steps S210 to S230 above, thereby ensuring that the load balancing pressure of the recording storage device is evenly distributed among the various storage workgroups. Preferably, when a recording channel is disconnected from the recording storage device, the recording channel already connected to the recording storage device whose bitstream value is smaller than the disconnected recording channel's bitstream value and is closest to the disconnected recording channel's bitstream value will be designated as the new recording channel to be connected, thereby minimizing load fluctuations on the recording storage device.
[0074] Additionally, a reassignment flag can be added to the video channel already connected to the video storage device that has the closest bitrate value to the video channel disconnected from the video storage device, indicating that a new storage workgroup needs to be assigned to this video channel. After the storage workgroup for this video channel is reassigned, the corresponding reassignment flag is removed.
[0075] In one embodiment, before step S221 determines the bitstream size that each storage workgroup needs to share based on the bitstream size of each newly accessed recording channel, the recording storage scheduling method further includes:
[0076] Storage workgroups with insufficient remaining disk capacity are identified as invalid storage workgroups.
[0077] Specifically, if the remaining disk capacity of a storage workgroup is insufficient, it will be designated as an invalid storage workgroup. No recording data from any recording channel will be allocated to this storage workgroup, preventing recording storage failures due to insufficient remaining disk capacity. Furthermore, if the read / write capabilities of the remaining storage workgroup are insufficient, this invalid storage workgroup can be reclassified as a valid storage workgroup. However, the full-coverage mode for recording data in this storage workgroup must be enabled to improve the reliability of recording storage.
[0078] Furthermore, in one embodiment, after sorting the recording channel groups according to their bitstream size in ascending order in step S232, and sorting each storage workgroup according to its remaining disk capacity in ascending order, before allocating the bitstreams of newly accessed recording channels to each storage workgroup according to the sequential correspondence between the recording channel groups and the storage workgroups in step S233, the recording storage scheduling method further includes:
[0079] Determine if there is a video channel group whose bitstream size exceeds the remaining write capacity of the current storage workgroup, corresponding to the sorting order of the current storage workgroup;
[0080] If present, some recording channels in the recording channel group corresponding to the current storage workgroup's sorting order will be adjusted to the recording channel group corresponding to the remaining storage workgroup with stronger write capabilities.
[0081] Suppose that sorting the recording channel groups by their bitrates from smallest to largest yields 10Mb / s, (5+15) = 20Mb / s, and 30Mb / s. Sorting the storage workgroups by their remaining disk capacity from smallest to largest yields 100GB, 200GB, and 300GB. However, the storage workgroup with 200GB of remaining disk capacity has a remaining write capacity of 18Mb / s. This means that the bitrate of the recording channel group corresponding to the current storage workgroup's sorted order (20Mb / s) exceeds its remaining write capacity (18Mb / s). Therefore, some recording channels in the recording channel group consisting of recording channels with bitrates of 5Mb / s and 15Mb / s will be moved to the recording channel group corresponding to the storage workgroup with the stronger remaining write capacity. Assuming that the storage workgroup with 100GB of remaining disk capacity has stronger remaining write capability, some recording channels in the recording channel group consisting of recording channels with bitrates of 5Mb / s and 15Mb / s will be adjusted to the recording channel group corresponding to the sorting order of the storage workgroup with 100GB of remaining disk capacity, that is, the recording channel group with a bitrate of 10Mb / s, in order to ensure the recording storage reliability of the recording storage device.
[0082] Figure 3 A schematic diagram of a video recording storage scheduling device 30 according to an embodiment of the present invention is provided. The video recording storage scheduling device 30 is used to schedule the video recording storage work of a video recording storage device, which includes at least two storage workgroups, such as... Figure 3 The video recording storage scheduling device 30 includes an access module 31, a write balancing module 32, and a capacity balancing module 33.
[0083] The access module 31 is used to determine whether the load balancing pressure of the recording storage device is the recording write capacity or the disk capacity, based on the remaining disk capacity and remaining write capacity of each storage workgroup when a new recording channel is connected to the recording storage device.
[0084] The write balancing module 32 is used to evenly distribute the bitstream of each newly connected recording channel to each storage workgroup based on the remaining write capacity of each storage workgroup and the bitstream size of each newly connected recording channel if the load balancing pressure is the recording write capacity.
[0085] The capacity balancing module 33 is used to evenly distribute the bitstream of each newly connected recording channel to each storage workgroup based on the remaining disk capacity of each storage workgroup and the bitstream size of each newly connected recording channel if the load balancing pressure is the disk capacity.
[0086] The aforementioned video storage scheduling device 30, when a new video channel is connected to the video storage device, determines whether the load balancing pressure of the video storage device is the video write capacity or the disk capacity based on the remaining disk capacity and remaining write capacity of each storage workgroup. If the load balancing pressure is the video write capacity, the bitstream of the newly connected video channel is evenly distributed among the storage workgroups based on the remaining write capacity of each storage workgroup and the bitstream size of each newly connected video channel. If the load balancing pressure is the disk capacity, the bitstream of the newly connected video channel is evenly distributed among the storage workgroups based on the remaining disk capacity of each storage workgroup and the bitstream size of each newly connected video channel. This application first determines the load balancing pressure of the video storage device based on the remaining disk capacity and remaining write capacity of each storage workgroup, and then evenly distributes the pre-determined load balancing pressure among the storage workgroups based on the bitstream size of each newly connected video channel, effectively balancing the load of the remaining disk capacity and remaining write capacity of each storage workgroup, thereby effectively improving the reliability of video storage.
[0087] In one embodiment, the access module 31 is further configured to calculate the variance of the remaining disk capacity based on the remaining disk capacity of each current storage workgroup; and calculate the variance of the remaining write capacity based on the remaining write capacity of each current storage workgroup; and determine whether the load balancing pressure of the video recording storage device is the video recording write capacity or the disk capacity based on the magnitude of the variance of the remaining disk capacity and the variance of the remaining write capacity.
[0088] In one embodiment, the write balancing module 32 is further configured to determine the bitstream size to be shared by each storage workgroup based on the bitstream size of each newly accessed recording channel; accumulate the bitstreams of each newly accessed recording channel in ascending order, and divide the recording channels whose accumulated value does not exceed the shared bitstream size into a recording channel group; sort the recording channel groups according to their bitstream size in ascending order, and sort each storage workgroup according to their remaining write capacity in ascending order, and allocate the bitstreams of each newly accessed recording channel to each storage workgroup according to the sequential correspondence between the recording channel groups and the storage workgroups.
[0089] In one embodiment, the capacity balancing module 33 is further configured to group the bitstreams of the newly accessed recording channels according to the disk capacity ratio, and group the recording channels belonging to the same group as a recording channel group; the disk capacity ratio is the ratio of the remaining disk capacity of each storage workgroup; sort the recording channel groups according to their bitstream size from smallest to largest, and sort each storage workgroup according to its remaining disk capacity from smallest to largest; and allocate the bitstreams of the newly accessed recording channels to each storage workgroup according to the sequential correspondence between the recording channel groups and the storage workgroups.
[0090] In one embodiment, the video storage scheduling device 30 further includes a determining module, which, when a video channel is disconnected from the video storage device, determines the video channel that is already connected to the video storage device and whose bitstream value is closest to that of the video channel disconnected from the video storage device as the newly connected video channel to the video storage device.
[0091] In one embodiment, the write balancing module 32 is further configured to identify storage workgroups with insufficient remaining disk capacity as invalid storage workgroups before determining the bitstream size to be shared by each storage workgroup based on the bitstream size of each newly accessed recording channel.
[0092] In one embodiment, the capacity balancing module 33 is further configured to, after sorting the recording channel groups according to their bitstream size from smallest to largest and sorting each storage workgroup according to its remaining disk capacity from smallest to largest, before allocating the bitstream of each newly connected recording channel to each storage workgroup according to the order correspondence between the recording channel groups and the storage workgroups, determine whether there is a recording channel group whose bitstream size corresponds to the current storage workgroup's sorting order and exceeds the remaining write capacity of the current storage workgroup; if so, adjust some recording channels in the recording channel group corresponding to the current storage workgroup's sorting order to the recording channel group corresponding to the sorting order of the storage workgroup with stronger remaining write capacity.
[0093] It should be noted that the above modules can be functional modules or program modules, and can be implemented in software or hardware. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or they can be stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0094] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores a set of preset configuration information. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a video recording and storage scheduling method.
[0095] In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, memory, a network interface, a display screen, and an input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a video recording and storage scheduling method. The display screen may be a liquid crystal display (LCD) or an electronic ink display. The input device may be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0096] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0097] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0098] When a new recording channel is connected to the recording storage device, the load balancing pressure of the recording storage device is determined based on the remaining disk capacity and remaining write capacity of each storage workgroup.
[0099] If the load balancing pressure is the recording write capacity, then based on the remaining write capacity of each storage workgroup and the bit rate of each newly connected recording channel, the bit rate of each newly connected recording channel will be evenly distributed to each storage workgroup.
[0100] If the load balancing pressure is disk capacity, then based on the remaining disk capacity of each storage workgroup and the bitrate of each newly connected recording channel, the bitrate of each newly connected recording channel will be evenly distributed to each storage workgroup.
[0101] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0102] Calculate the variance of the remaining disk capacity based on the remaining disk capacity of each storage workgroup; and calculate the variance of the remaining write capacity based on the remaining write capacity of each storage workgroup.
[0103] Based on the variance of remaining disk capacity and the variance of remaining write capacity, determine whether the load balancing pressure of the video storage device is the video write capacity or the disk capacity.
[0104] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0105] Based on the bitrate of each newly accessed recording channel, determine the bitrate that each storage workgroup needs to share.
[0106] The bitstreams of each newly connected recording channel are accumulated in ascending order, and the recording channels whose accumulated value does not exceed the average bitstream size are divided into a recording channel group.
[0107] The recording channel groups are sorted in ascending order of their bitrate size, and the storage workgroups are sorted in ascending order of their remaining write capacity. Based on the order correspondence between the recording channel groups and the storage workgroups, the bitrates of the newly connected recording channels are allocated to the respective storage workgroups.
[0108] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0109] The bitstreams of the newly connected recording channels are grouped according to the disk capacity ratio, and the recording channels belonging to the same group are combined into a recording channel group; the disk capacity ratio is the ratio of the remaining disk capacity of each storage workgroup.
[0110] Sort the video channel groups by their bitrate size from smallest to largest, and sort the storage workgroups by their remaining disk capacity from smallest to largest;
[0111] Based on the sequential correspondence between the recording channel groups and the storage work groups, the bitstreams of each newly connected recording channel are allocated to each storage work group.
[0112] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0113] When a recording channel is disconnected from the recording storage device, the recording channel that is already connected to the recording storage device and has the closest bitstream value to the recording channel that was disconnected from the recording storage device will be the new recording channel connected to the recording storage device.
[0114] In one embodiment, before determining the share of bitstream size to be allocated to each storage workgroup based on the bitstream size of each newly accessed recording channel, the processor executes the following steps when running the computer program:
[0115] Storage workgroups with insufficient remaining disk capacity are identified as invalid storage workgroups.
[0116] In one embodiment, after sorting the video channel groups by their bitstream size in ascending order and sorting the storage workgroups by their remaining disk capacity in ascending order, before allocating the bitstreams of newly accessed video channels to the respective storage workgroups according to the sequential correspondence between the video channel groups and the storage workgroups, the processor, when executing the computer program, further performs the following steps:
[0117] Determine if there is a video channel group whose bitstream size exceeds the remaining write capacity of the current storage workgroup, corresponding to the sorting order of the current storage workgroup;
[0118] If present, some recording channels in the recording channel group corresponding to the current storage workgroup's sorting order will be adjusted to the recording channel group corresponding to the remaining storage workgroup with stronger write capabilities.
[0119] When a new recording channel is connected to the aforementioned storage medium, the load balancing pressure of the recording storage device is determined based on the remaining disk capacity and remaining write capability of each storage workgroup. If the load balancing pressure is the recording write capability, the bitstream of the newly connected recording channel is evenly distributed among the storage workgroups based on the remaining write capability of each workgroup and the bitstream size of each newly connected recording channel. If the load balancing pressure is the disk capacity, the bitstream of the newly connected recording channel is evenly distributed among the storage workgroups based on the remaining disk capacity of each workgroup and the bitstream size of each newly connected recording channel. This application first determines the load balancing pressure of the recording storage device based on the remaining disk capacity and remaining write capability of each storage workgroup, and then evenly distributes the pre-determined load balancing pressure among the storage workgroups based on the bitstream size of each newly connected recording channel. This effectively balances the load of the remaining disk capacity and remaining write capability of each storage workgroup, thereby effectively improving the reliability of the recording storage.
[0120] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0122] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0123] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.
[0124] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0125] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.
Claims
1. A video recording storage scheduling method for scheduling video recording storage tasks of a video recording storage device, wherein the video recording storage device comprises at least two storage workgroups, characterized in that, The method includes the following steps: When a new recording channel is connected to the recording storage device, the load balancing pressure of the recording storage device is determined based on the remaining disk capacity and remaining write capacity of each of the current storage work groups, whether it is the recording write capacity or the disk capacity. If the load balancing pressure is the recording write capacity, then based on the bitstream size of each newly connected recording channel, the bitstream size to be shared by each storage workgroup is determined; the bitstreams of each newly connected recording channel are accumulated in ascending order, and the recording channels whose accumulated value does not exceed the shared bitstream size are divided into a recording channel group; the recording channel groups are sorted in ascending order of their bitstream size, and each storage workgroup is sorted in ascending order of its remaining write capacity; according to the sequential correspondence between the recording channel groups and the storage workgroups, the bitstreams of each newly connected recording channel are evenly distributed to each storage workgroup; If the load balancing pressure is equal to the disk capacity, then based on the remaining disk capacity of each of the storage workgroups and the bitrate of each newly connected recording channel, the bitrate of each newly connected recording channel is evenly distributed to each of the storage workgroups.
2. The video recording storage scheduling method according to claim 1, characterized in that, The process of determining whether the load balancing pressure of the video recording storage device is based on the remaining disk capacity and remaining write capability of each of the current storage workgroups includes the following steps: Based on the remaining disk capacity of each of the current storage workgroups, calculate the variance of the remaining disk capacity; and based on the remaining write capacity of each of the current storage workgroups, calculate the variance of the remaining write capacity. Based on the variance of the remaining disk capacity and the variance of the remaining write capacity, it is determined whether the load balancing pressure of the video storage device is the video write capacity or the disk capacity.
3. The video recording storage scheduling method according to claim 1, characterized in that, The step of evenly distributing the bitstreams of newly accessed recording channels to each of the storage workgroups based on the remaining disk capacity of each of the storage workgroups and the bitstream size of each of the newly accessed recording channels includes the following steps: The bitstreams of the newly connected recording channels are grouped according to the disk capacity ratio, and the recording channels belonging to the same group are formed as a recording channel group; the disk capacity ratio is the ratio of the remaining disk capacity of each storage work group; The video channel groups are sorted in ascending order of their bitrate size, and the storage work groups are sorted in ascending order of their remaining disk capacity. Based on the sequential correspondence between the recording channel group and the storage work group, the bitstreams of each newly connected recording channel are allocated to each of the storage work groups.
4. The video recording storage scheduling method according to claim 1, characterized in that, The method further includes: When a recording channel is disconnected from the recording storage device, the recording channel that is already connected to the recording storage device and whose bitstream value is closest to that of the recording channel that was disconnected from the recording storage device is designated as the new recording channel to be connected to the recording storage device.
5. The video recording storage scheduling method according to claim 1, characterized in that, Before determining the share of bitstream size for each storage workgroup based on the bitstream size of each newly accessed recording channel, the method further includes: The storage workgroup with insufficient remaining disk capacity is identified as an invalid storage workgroup.
6. The video recording storage scheduling method according to claim 3, characterized in that, After sorting the recording channel groups according to their bitstream size in ascending order, and after sorting each storage workgroup according to its remaining disk capacity in ascending order, before allocating the bitstreams of newly accessed recording channels to each storage workgroup according to the sequential correspondence between the recording channel groups and the storage workgroups, the method further includes: Determine whether there exists a video channel group whose bitstream size corresponds to the current sorting order of the storage workgroup and exceeds the remaining write capacity of the current storage workgroup; If present, some of the recording channels in the recording channel group corresponding to the current sorting order of the storage workgroup will be adjusted to the recording channel group corresponding to the sorting order of the storage workgroup with stronger remaining write capability.
7. A video recording storage scheduling device for scheduling the video recording storage work of a video recording storage device, wherein the video recording storage device comprises at least two storage workgroups, characterized in that, The device includes an access module, a write balancing module, and a capacity balancing module; The access module is used to determine, when a new recording channel is connected to the recording storage device, whether the load balancing pressure of the recording storage device is the recording write capacity or the disk capacity, based on the remaining disk capacity and remaining write capacity of each of the current storage work groups. The write balancing module is configured to, if the load balancing pressure is equal to the recording write capacity, determine the bitstream size to be shared by each storage workgroup based on the bitstream size of each newly connected recording channel; accumulate the bitstreams of each newly connected recording channel in ascending order, and divide the recording channels whose accumulated value does not exceed the shared bitstream size into a recording channel group; sort the recording channel groups according to their bitstream size in ascending order, and sort each storage workgroup according to its remaining write capacity in ascending order; and, according to the sequential correspondence between the recording channel groups and the storage workgroups, evenly distribute the bitstreams of each newly connected recording channel to each storage workgroup. The capacity balancing module is used to, if the load balancing pressure is the disk capacity, distribute the bitstream of each newly connected recording channel evenly to each of the storage workgroups based on the remaining disk capacity of each of the storage workgroups and the bitstream size of each newly connected recording channel.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Video file storage and playback device and method
CN111859016A