CN114339330A - Network hard disk video recording writing method, device, electronic device and storage medium - Google Patents

Network hard disk video recording writing method, device, electronic device and storage medium Download PDF

Info

Publication number
CN114339330A
CN114339330A CN202111417143.9A CN202111417143A CN114339330A CN 114339330 A CN114339330 A CN 114339330A CN 202111417143 A CN202111417143 A CN 202111417143A CN 114339330 A CN114339330 A CN 114339330A
Authority
CN
China
Prior art keywords
video
written
target storage
writing
hard disk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111417143.9A
Other languages
Chinese (zh)
Other versions
CN114339330B (en
Inventor
张超
葛许隆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202111417143.9A priority Critical patent/CN114339330B/en
Publication of CN114339330A publication Critical patent/CN114339330A/en
Application granted granted Critical
Publication of CN114339330B publication Critical patent/CN114339330B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)

Abstract

The application relates to a network hard disk video recording writing method, a device, an electronic device and a storage medium, wherein the network hard disk video recording writing method comprises the following steps: the method comprises the steps of obtaining the residual writing rate of a target storage device, wherein the residual writing rate is the difference between the total writing rate of the target storage device and the video code rate currently written into the target storage device, obtaining the code rate of a video channel to be written into, and writing video data transmitted by the video channel to be written into the target storage device if the residual writing rate of the target storage device is larger than or equal to the code rate of the video channel to be written into.

Description

Network hard disk video recording writing method, device, electronic device and storage medium
Technical Field
The present application relates to the field of storage device recording, and in particular, to a method and an apparatus for writing network hard disk video, an electronic apparatus, and a storage medium.
Background
Abbreviation of Network Video Recorder (NVR). The main function of the NVR is to receive digital video code streams transmitted by cameras through a network, and store and manage the digital video code streams, so that the distributed architecture advantage brought by networking is realized, that is, a plurality of network cameras can be simultaneously viewed, browsed, played back, managed and stored through the NVR.
When the NVR accesses more cameras, the IO throughput of a single storage device is limited, if multiple paths of cameras write data into one storage device at the same time, the IO bottleneck of the storage device is easily reached, data cannot be written into the storage device, and video corresponding to real-time code streams is lost.
Disclosure of Invention
The embodiment provides a network hard disk video recording writing method, a network hard disk video recording writing device, an electronic device and a storage medium, so as to solve the problem of video loss caused by non-storage of real-time code streams in the related art.
In a first aspect, in this embodiment, a method for writing a network hard disk video is provided, including:
acquiring the residual writing rate of target storage equipment, wherein the residual writing rate is the difference between the total writing rate of the target storage equipment and the video code rate currently written into the target storage equipment;
acquiring a code rate to be written into a video channel;
and if the residual writing rate of the target storage equipment is greater than or equal to the code rate of the video channel to be written, writing the video data transmitted by the video channel to be written into the target storage equipment.
In some of these embodiments, in the case that there are a plurality of the video channels to be written, the method further comprises:
performing priority sequencing on the video channel to be written;
and preferentially writing the video data to be written into the video channel with high priority into the target storage device.
In some embodiments, when there are a plurality of target storage devices, the target storage devices are sorted according to their health degrees, and the video data to be written into the video channel with a higher priority is preferentially written into the target storage devices with a higher health degree.
In some of these embodiments, the video channels to be written are prioritized by:
acquiring the video picture change frequency corresponding to each to-be-written video channel and the computing resources required by the intelligent analysis capability corresponding to each to-be-written video channel;
and carrying out priority sequencing on the video channel to be written according to the video picture change frequency and the computing resources required by the intelligent analysis capability.
In some embodiments, the prioritizing the to-be-written video channels according to the video picture change frequency and the computing resources required by the intelligent analysis capability includes:
determining the monitoring scene change value of each to-be-written video channel according to the video picture change frequency;
determining the intelligent analysis capability value of each to-be-written video channel according to the computing resources required by the intelligent analysis capability;
adding the monitoring scene change value and the intelligent analysis capability value according to weight to obtain value scores of the video channels to be written;
and carrying out priority ordering on the video channels to be written according to the sequence of the value scores from high to low.
In some of these embodiments, the method further comprises:
and if the residual writing rate of the target storage equipment is less than the code rate of the video channel to be written, not writing the code rate of the video channel to be written into the target storage equipment, and reselecting the target storage equipment.
In some embodiments, when there are a plurality of target storage devices, the target storage devices are sorted according to their health degrees, and the video data to be written into the video channel is preferentially written into the target storage device with a high health degree.
In some of these embodiments, the storage device health is determined by at least one of:
the data reading error rate and the writing error rate of the storage equipment, the CRC error counting value of the Ultra DMA, the number of scattered bad blocks and the temperature value of the storage equipment.
In a second aspect, in this embodiment, there is provided a network hard disk video recorder writing device, including:
the first obtaining module is used for obtaining the residual writing rate of the target storage equipment, wherein the residual writing rate is the difference between the total writing rate of the target storage equipment and the video code rate currently written into the target storage equipment;
the second acquisition module is used for acquiring the code rate to be written into the video channel;
and the data storage module is used for writing the video data transmitted by the video channel to be written into the target storage device if the residual writing rate of the target storage device is greater than or equal to the code rate of the video channel to be written into.
In a third aspect, in this embodiment, an electronic apparatus is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the network hard disk video writing method according to the first aspect is implemented.
In a fourth aspect, in the present embodiment, a storage medium is provided, on which a computer program is stored, and the program, when executed by a processor, implements the network hard disk video recording writing method according to the first aspect.
Compared with the related art, in the network hard disk video recording writing method, the network hard disk video recording writing device, the electronic device and the storage medium provided in this embodiment, the code rate of the video channel to be written is obtained by obtaining the remaining writing rate of the target storage device, where the remaining writing rate is the difference between the total writing rate of the target storage device and the video code rate currently written into the target storage device, and if the remaining writing rate of the target storage device is greater than or equal to the code rate of the video channel to be written, the video data transmitted by the video channel to be written is written into the target storage device, so that the problem of video recording loss caused by non-storage of a real-time code stream is solved, and the real-time code stream is stored in the target storage device.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
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 embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a block diagram of a hardware structure of an application terminal of a network hard disk video recording writing method according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for writing network hard disk video according to an embodiment of the present application;
FIG. 3 is a flowchart of another method for writing network hard disk video according to an embodiment of the present application;
FIG. 4 is a flowchart of another network hard disk video recording writing method according to an embodiment of the present application;
fig. 5 is a block diagram of a network hard disk recording writing device according to an embodiment of the present application.
Detailed Description
For a clearer understanding of the objects, aspects and advantages of the present application, reference is made to the following description and accompanying drawings.
Unless defined otherwise, technical or scientific terms used herein shall have the same general meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of this application do not denote a limitation of quantity, either in the singular or the plural. The terms "comprises," "comprising," "has," "having," and any variations thereof, as referred to in this application, are intended to cover non-exclusive inclusions; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or modules, but may include other steps or modules (elements) not listed or inherent to such process, method, article, or apparatus. Reference throughout this application to "connected," "coupled," and the like is not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference to "a plurality" in this application means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. In general, the character "/" indicates a relationship in which the objects associated before and after are an "or". The terms "first," "second," "third," and the like in this application are used for distinguishing between similar items and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or a similar computing device. For example, the method is executed on a terminal, and fig. 1 is a block diagram of a hardware structure of an application terminal of the network hard disk video recording writing method according to the embodiment of the present application. As shown in fig. 1, the terminal may include one or more processors 102 (only one shown in fig. 1) and a memory 104 for storing data, wherein the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The terminal may further include a transmission device 106 for communication function and an input/output device 108, which in this embodiment includes a plurality of input devices, where the input devices are cameras, and the network hard disk records store data collected by multiple cameras. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely an illustration and is not intended to limit the structure of the terminal described above. For example, the terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the network hard disk video recording writing method in the embodiment, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 can store data collected by the multiple input device, and the memory 104 can further include memory remotely located from the processor 102, which can be connected to the terminal 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.
The transmission device 106 is used to receive or transmit data via a network. The network described above includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In this embodiment, a method for writing a network hard disk video is provided, and fig. 2 is a flowchart of a method for writing a network hard disk video according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
step S201, obtaining a remaining write rate of the target storage device, where the remaining write rate is a difference between a total write rate of the target storage device and a video bitrate currently written into the target storage device.
It is noted that the storage devices include hard disks, floppy disks, core memories, bubble memories, U disks, RAMs, ROMs, magneto-optical disks, CDs, and DVDs.
In this embodiment, if no video bitrate is currently written to the target storage device, the remaining write rate of the target storage device is the total write rate of the target storage device, if only one video channel writes the video code rate into the target storage device currently, taking the difference between the total write rate of the target storage device and the video code rate of the current video channel as the residual write rate of the target storage device, if a plurality of video channels write the video code rates into the target storage equipment at present, the sum of the video code rates of the plurality of video channels at present is obtained, taking the difference between the total write rate of the target storage device and the sum of the video rates as the residual write rate of the target storage device, it should be noted that the video rate written into the target storage device by each video channel may need fluctuation redundancy within a certain range, thus, there may be a range of fluctuating redundancies in the remaining write rates of the target storage device.
Step S202, obtaining the code rate of the video channel to be written.
In step S203, if the remaining write rate of the target storage device is greater than or equal to the code rate of the video channel to be written, writing the video data transmitted by the video channel to be written into the target storage device.
According to the method and the device, under the condition that the residual writing speed of the target storage device is judged to be lower than the code rate of the video channel to be written, the code rate of the video channel to be written is not written into the target storage device, so that the situation that the video code rate of the video channel to be written cannot be written into the target storage device due to the fact that the IO bottleneck of the target storage device is reached can be avoided, the problem that video is lost due to the fact that real-time code streams are not stored is solved, and the real-time code streams are stored into the target storage device.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here. For example, step S201 and step S202 may be interchanged.
In some embodiments, in the case that there are a plurality of video channels to be written, the method further comprises:
carrying out priority ordering on the video channels to be written;
and preferentially writing the video data to be written into the video channel with high priority into the target storage device.
It can be understood that, in this embodiment, the video data to be written into the video channel with the higher priority is preferentially written into the target storage device, so that the video data to be written into the video channel with the higher priority can be preferentially ensured to be written into the target storage device, the problem that the video data to be written into the video channel with the higher priority cannot be written into the target channel is solved, and the video data to be written into the video channel is hierarchically stored according to the priority.
In some embodiments, the video channels to be written are grouped according to the priority, and the priority is written into the target storage device preferentially.
In this embodiment, it is assumed that there are p video channels to be written, the p video channels to be written are prioritized, the video channel to be written with the priority ranked first s bits is taken as a first video channel, and the video channel to be written with the priority ranked from (s +1) th to p th bits is taken as a second video channel, where s < p, and video data of the first video channel is preferentially written into the target storage device.
In some embodiments, when there are a plurality of target storage devices, the target storage devices are sorted according to their health degrees, and the video data to be written into the video channel with a high priority is written into the target storage device with a high health degree preferentially.
In this embodiment, a plurality of video channels to be written are prioritized, and video data is written into a target storage device with a high health degree in an order from high priority to low priority.
Supposing that m target storage devices are arranged, sequencing the m target storage devices according to the sequence of the health degrees of the storage devices from high to low, taking the target storage device arranged at the first n bits as a first candidate disk group, and taking the target storage device arranged at the (n +1) th to m bits as a second candidate disk group, wherein n is less than m, and preferably, writing the video data to be written into the video channel with high priority into the target storage devices in the first candidate disk group;
preferably, assuming that there are p video channels to be written, the p video channels to be written are prioritized, the video channel to be written with the priority ranked first s bits is taken as a first video channel, and the video channel to be written with the priority ranked from (s +1) th to p th bits is taken as a second video channel, where s < p, the video data of the first video channel is written into the target storage device in the first candidate disk group, and the video data of the second video channel is written into the target storage device in the second candidate disk group.
It should be noted that, in this embodiment, no specific limitation is made on the number of the candidate disk groups, the number of the several video channels, and how to group the candidate disk groups, the number of the candidate disk groups and the number of the video channels may be three or more, the number of the target storage devices in each candidate disk group may be the same or different, and for example, multiple gradient grouping may be performed according to the health degree of each target storage device, for example, there are 10 target storage devices, the 10 target storage devices are prioritized according to the health degree of each target storage device, the target storage device with the top 5 bits is taken as a first candidate disk group, the target storage device with the 6 th to 8 th bits is taken as a second candidate disk group, and the target storage device with the 9 th to 10 th bits is taken as a third candidate disk group.
Illustratively, a plurality of target storage devices are sorted according to the sequence of the health degrees of the storage devices from high to low, and the target storage devices sorted according to the priorities are grouped to obtain a plurality of candidate disk groups.
It can be understood that, in this embodiment, the video data to be written into the video channel with high priority is preferentially written into the target storage device with high health degree, on one hand, the video data to be written into the video channel with high priority can be preferentially ensured to be written into the target storage device, and on the other hand, the video data with high priority is written into the target storage device according to the sequence from high health degree to low health degree of the target storage device, so that the security of the video data to be written with high priority can be ensured, the loss of the written video data due to the performance and error of the storage device is avoided, and the hierarchical storage of the video data to be written into the video channel is realized.
In some of these embodiments, the video channels to be written are prioritized by:
acquiring feature point change information in a video picture corresponding to each to-be-written video channel and computing resources required by intelligent analysis capacity corresponding to each to-be-written video channel;
and performing priority ordering on the video channels to be written according to the feature point change information in the video pictures and the computing resources required by the intelligent analysis capability.
For example, the feature point change information includes a change frequency of a video screen, a change in the number of feature points, a change in the position of a feature point, and a change in the type of a feature point.
In this embodiment, if the more feature point change information in the video picture, the higher the priority of the corresponding video channel to be written, the still picture and the dynamic picture can be distinguished according to the feature point change information in the video picture, for example, in the daytime, because there are more people and vehicles, the more the feature point information in the picture changes, in the nighttime, because there are fewer people and vehicles, the less the feature point information in the picture changes, that is, the more the still pictures at night, and if a lot of still pictures are stored, the waste of storage resources is caused, therefore, in this embodiment, the priority ranking is performed on the video channels to be written according to the feature point information in the video picture, so that it can be ensured that the video data with more feature point information changes is written into the target storage device.
The intelligent analysis capability comprises behavior analysis, video structuring and face detection, the required calculation of each intelligent analysis capability is different, the more calculation resources are required by the intelligent analysis capability, the higher the priority of a corresponding video channel to be written is, for example, the A video channel starts face detection, non-motor vehicle detection and traffic light detection, the B video channel starts face detection, the starting function of the A video channel is more than that of the B video channel, the video data of the A video channel is more important than that of the B video channel, and more intelligent analysis results can be obtained by analyzing the video data of the A video channel.
By the above mode, the video channels to be written are subjected to priority sequencing, and further, the video data of the video channels with high priority can be written into the target storage device, so that the video data of the video channels to be written with high priority can be preferentially ensured to be written into the target storage device, the problem that the video data of the video channels to be written with high priority cannot be written into the target channels is solved, and the video data of the video channels to be written can be stored in a grading mode according to the priority.
In some embodiments, prioritizing the video channels to be written to according to the video picture change frequency and the computational resources required for intelligent analysis capabilities includes:
determining a monitoring scene change value of each video channel to be written according to the video picture change frequency;
determining intelligent analysis capability values of all video channels to be written according to computing resources required by the intelligent analysis capability;
adding the monitoring scene change value and the intelligent analysis capability value according to the weight to obtain value scores of all video channels to be written;
and carrying out priority ordering on the video channels to be written according to the order of the value scores from high to low.
In this embodiment, the higher the video picture change frequency is, the larger the change value of the monitored scene of the corresponding video channel to be written is, the more computing resources are required by the intelligent analysis capability, and the larger the intelligent analysis capability value of the corresponding video channel to be written is;
preferably, the monitored scene change value and the intelligent analysis capability value can be calculated according to the following ratio of 1: the weights of 1 are added to obtain value scores of all video channels to be written;
it should be noted that, in this embodiment, no specific limitation is made on the value scoring factor affecting the video channel, for example, the weight may be set according to the geographic location of the camera and the model of the camera.
Preferably, in a scene in which the frequency of change of the video screen is emphasized, the monitoring scene change value may be given a larger weight, and in a scene in which the smart analysis capability is emphasized, the smart analysis capability value may be given a larger weight.
By the above mode, the video channels to be written are subjected to priority sequencing, and further, the video data of the video channels with high priority can be written into the target storage device, so that the video data of the video channels to be written with high priority can be preferentially ensured to be written into the target storage device, the problem that the video data of the video channels to be written with high priority cannot be written into the target channels is solved, and the video data of the video channels to be written can be stored in a grading mode according to the priority.
In some embodiments, when there are a plurality of target storage devices, the target storage devices are sorted according to their health degrees, and the video data to be written into the video channel is preferentially written into the target storage device with a high health degree.
It can be understood that, in this embodiment, the video data is written into the target storage device in the order from high health degree to low health degree of the target storage device, so that loss of the written video data due to performance and error of the storage device is avoided, and thus security of the video data to be written can be guaranteed.
In some of these embodiments, storage device health may be determined by at least one of:
the data reading error rate and the writing error rate of the storage equipment, the CRC error counting value of the Ultra DMA, the number of scattered bad blocks and the temperature value of the storage equipment.
It should be noted that DMA is a data transmission method, the conventional data transmission needs to be interrupted by a CPU, in a popular way, the CPU is suspended first, data is transmitted from a hard disk to a memory, then the CPU is recovered, the CPU is interrupted once every time data is transmitted, DMA can adopt a cycle stealing method, and data transmission can be completed only by occupying one CPU cycle;
CRC means cyclic redundancy check, and is to add a check code of several bits (the check code is calculated by modulo-2 division) to the back end of the data to be transmitted, and when the memory receives the data from the storage device, the data and the check code are compared, and then it is determined whether the transmitted data has errors;
the Ultra DMA CRC error count value indicates that a CRC error occurred with data received during a DMA transfer, i.e., the data stored on the storage device was correct, but the data received was incorrect when transferred to memory, and a warning is issued when the incorrect data reached a threshold.
Fig. 3 is a flowchart of another network hard disk video recording writing method according to an embodiment of the present application, where as shown in fig. 3, the flowchart includes the following steps:
step S301, obtaining the residual writing rate of the target storage device, wherein the residual writing rate is the difference between the total writing rate of the target storage device and the video code rate currently written into the target storage device.
Step S302, obtaining the code rates of a plurality of video channels to be written.
Step S303, the priority ordering is carried out on the video channels to be written.
Step S304, if the residual writing rate of the target storage device is greater than or equal to the code rate of the video channel to be written with high priority, the video data of the video channel to be written with high priority is written into the target storage device preferentially.
Through the steps, the video data to be written into the video channel with high level is preferentially written into the target storage device, so that the video data to be written into the video channel with high level can be preferentially ensured to be written into the target storage device, the problem that the video data to be written into the video channel with high level cannot be written into the target channel is solved, and the video data to be written into the video channel is stored in a grading mode according to the priority.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here. For example, step S301 and step S302 may be interchanged.
Fig. 4 is a flowchart of another network hard disk video recording writing method according to an embodiment of the present application, and as shown in fig. 4, the storage device in the embodiment is a hard disk, and the network hard disk video recording writing method includes the following steps:
step S401, sorting i hard disks according to the sequence of the health degree from high to low, taking the hard disk arranged at the front j position as a third candidate disk group, and taking the hard disks arranged at the (j +1) th to i position as a fourth candidate disk group, wherein j < i.
In this embodiment, health index parameters of all hard disks, such as historical values of data reading error rate, writing error rate, UltraDMACRC error count, and the like, current values of scattered bad block count, temperature, and the like, are detected, and the health index parameters are combined with a certain weight value to evaluate a specific score value of the health degree of each hard disk, and according to the specific score value of the health degree of the hard disks, all the hard disks are sequenced, and disk group numbers are sequentially assigned to the hard disks according to the sequence (thus, a disk group number of 1 represents a hard disk with the best health state of the hard disks);
it should be noted here that the disk group allocation method enables each hard disk to individually occupy a disk group number, and if a new hard disk is added or replaced, the health degree value of the hard disk may be evaluated according to the foregoing rule, and then a disk group number with the closest health degree value is determined in the sorted hard disks according to the health degree value, and the disk group number is allocated to the new or replaced hard disk.
And dividing the hard disks into a third candidate disk group and a fourth candidate disk group according to the logical disk group numbers in a certain proportion, for example, the logical disk group numbers of all the hard disks are 1-N, dividing N by 2, taking the hard disk corresponding to the front 1-N/2 logical disk group numbers as the third candidate disk group, and taking the hard disk corresponding to the rear N/2 logical disk group numbers as the fourth candidate disk group. All hard disks are thus classified into a third candidate disk group and a fourth candidate disk group, and it is clear that the third candidate disk group is better in health than the fourth candidate disk group.
Step S402, the hard disk ranked first in the third candidate disk group is taken as the preferred target hard disk, and the hard disk ranked first in the fourth candidate disk group is taken as the common target hard disk.
Preferably, a U disk group number and a common disk group number are respectively determined in the third candidate disk group and the fourth candidate disk group according to the sizes of the disk groups, and the hard disks corresponding to the U disk group number and the common disk group number respectively are the current preferred target hard disk and the common target hard disk;
if a plurality of hard disks are under one disk group number, a current U disk group number and/or a common disk group number can be selected according to the size of the slot number of the hard disk.
And step S403, judging whether the current video channel is a potential value video channel according to a preset rule.
In this embodiment, if the current video channel is a potential value video channel, step S404 is entered, otherwise, step S407 is entered.
The preset rule refers to that: and evaluating the value score of each video channel according to scene change degree detection and intelligent capability detection. The scene change degree refers to the frequency of video picture changes to distinguish dynamic pictures of static pictures (for example, videos transmitted from cameras installed beside streets have more people and cars in the daytime and have large picture changes and have small picture changes in the nighttime because of fewer people and cars). The intelligent capability detects the intelligent capability value of the video channel configuration, such as general behavior analysis, video structuring, face detection and the like. Each intelligence has a different score, the more complex the intelligence capability, the more intelligent the capability, the higher the score. According to the scene change degree and the intelligent capacity value, according to a certain weight, a score is given to each video channel, a fixed threshold value M is set in advance, if the score of the video channel is larger than M, the video channel is a potential value video channel, and otherwise, the video channel is a common value video channel.
Step S404, judging whether the size of the code stream of the current video channel is smaller than the residual writing rate of the prior target hard disk.
In this embodiment, assuming that the total write-in capability of the hard disk is X, the size of the code stream of the video channel 1 is Y, when the video channel 1 is bound to the hard disk, the remaining write-in capability of the hard disk is (Y-X), when the size of the code stream of the next video channel 2 is G, if (Y-X) > G, that is, the remaining write-in capability of the hard disk can satisfy the code stream data write-in pressure of the video channel 2, otherwise, the code stream data write-in pressure of the video channel 2 cannot be satisfied, and the video channel 2 should replace the hard disk write-in data with sufficient remaining write-in capability.
It should be noted that the relationship between the remaining writing capacity and G is not limited to the relationship being greater than, equal to, or smaller than, and the difference between the remaining writing capacity and G may also be greater than a certain threshold, so that when the written code stream data fluctuates, the fluctuating code stream data can still be written into the video channel.
In this embodiment, if the size of the code stream of the current video channel is smaller than the remaining write rate of the priority target hard disk, the process proceeds to step S405, otherwise, the process proceeds to step S406.
Step S405, writes the video data of the current video channel into the priority target hard disk.
In this embodiment, the current video channel is bound to the priority target hard disk, that is, the video data of the current video channel is written into the priority target hard disk.
In step S406, a preferred target hard disk is reselected from the third candidate disks.
In this embodiment, if the size of the code stream of the current video channel is greater than or equal to the remaining write rate of the priority target hard disk, the priority target hard disk is reselected, and after the priority target hard disk is reselected, step S404 is performed, for example, a hard disk ranked at the second position in the third candidate disk group may be used as the priority target hard disk.
Step S407, judging whether the size of the code stream of the current video channel is smaller than the residual writing rate of the common target hard disk.
In this embodiment, the same method as that in step S404 is used to determine whether the size of the code stream of the current video channel is smaller than the remaining write rate of the ordinary target hard disk, and if the size of the code stream of the current video channel is smaller than the remaining write rate of the ordinary target hard disk, step S408 is performed, otherwise, step S409 is performed.
Step S408, writing the video data of the current video channel into the common target hard disk.
In this embodiment, the video data of the current video channel and the common target hard disk, that is, the current video channel, are written into the common target hard disk.
Step S409, reselecting the normal target hard disk from the fourth candidate disks.
In this embodiment, if the size of the code stream of the current video channel is greater than or equal to the remaining write rate of the common target hard disk, the common target hard disk is reselected, and after the common target hard disk is reselected, step S407 is performed, for example, a hard disk ranked at the second position in the fourth candidate disk group may be used as the common target hard disk.
Through the steps, the code stream size of each video channel and the IO writing-in rate of each hard disk are taken as limiting conditions, value scoring is carried out on each video channel according to scene change degree and intelligent capacity detection conditions, the hard disks are graded according to the health states of the hard disks, and videos with high value scoring are stored in the hard disks with good health states of the hard disks, so that video grading storage of important channels and common channels and self-adaptive distribution of disk groups are achieved.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here. For example, step S402 and step S403 may be interchanged.
In this embodiment, a network hard disk video recording and writing device is further provided, where the device is used to implement the foregoing embodiments and preferred embodiments, and details are not repeated for what has been described. The terms "module," "unit," "subunit," and the like as used below may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a network hard disk recording writing device according to an embodiment of the present application, and as shown in fig. 5, the device includes:
the first obtaining module 51 is configured to obtain a remaining write rate of the target storage device, where the remaining write rate is a difference between a total write rate of the target storage device and a video bitrate currently written into the target storage device.
And a second obtaining module 52, configured to obtain a code rate to be written into the video channel.
And the data storage module 53 is connected to the first obtaining module 51 and the second obtaining module 52, and writes the video data transmitted by the video channel to be written into the target storage device if the remaining writing rate of the target storage device is greater than or equal to the code rate of the video channel to be written into.
In one embodiment, in a case where there are a plurality of video channels to be written, the network hard disk video recording writing apparatus further includes:
carrying out priority ordering on the video channels to be written;
and preferentially writing the video data to be written into the video channel with high priority into the target storage device.
In one embodiment, the network hard disk video recording writing device further includes: and grouping the video channels to be written according to the priorities, wherein the priorities are written into the target storage equipment preferentially.
In one embodiment, the network hard disk video recording writing device further includes: and under the condition that a plurality of target storage devices are arranged, sequencing the target storage devices according to the health degree, and preferentially writing the video data to be written into the video channel with high priority into the target storage devices with high health degree.
In one embodiment, the network hard disk video recording writing device further includes: prioritizing video channels to be written by:
acquiring the video picture change frequency corresponding to each to-be-written video channel and the computing resources required by the intelligent analysis capability corresponding to each to-be-written video channel;
and carrying out priority ordering on the video channels to be written according to the video picture change frequency and the computing resources required by the intelligent analysis capability.
In one embodiment, the network hard disk video recording writing device further includes:
determining a monitoring scene change value of each video channel to be written according to the video picture change frequency;
determining intelligent analysis capability values of all video channels to be written according to computing resources required by the intelligent analysis capability;
adding the monitoring scene change value and the intelligent analysis capability value according to the weight to obtain value scores of all video channels to be written;
and carrying out priority ordering on the video channels to be written according to the order of the value scores from high to low.
In one embodiment, the network hard disk video recording writing device further includes: and under the condition that a plurality of target storage devices are arranged, sequencing the target storage devices according to the health degree, and preferentially writing the video data to be written into the video channel into the target storage devices with high health degree.
In one embodiment, the storage device health is determined by at least one of:
the data reading error rate and the writing error rate of the storage equipment, the CRC error counting value of the Ultra DMA, the number of scattered bad blocks and the temperature value of the storage equipment.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
There is also provided in this embodiment an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
and S1, obtaining the residual writing rate of the target storage device, wherein the residual writing rate is the difference between the total writing rate of the target storage device and the video code rate currently written into the target storage device.
And S2, acquiring the code rate to be written into the video channel.
And S3, if the residual writing rate of the target storage device is greater than or equal to the code rate of the video channel to be written, writing the video data transmitted by the video channel to be written into the target storage device.
It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementations, and details are not described again in this embodiment.
In addition, in combination with the network hard disk video recording writing method provided in the foregoing embodiment, a storage medium may also be provided in this embodiment to implement the method. The storage medium having stored thereon a computer program; when executed by a processor, the computer program implements any one of the above-described network hard disk video recording and writing methods.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without any inventive step, shall fall within the scope of protection of the present application.
It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
The term "embodiment" is used herein to mean that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (11)

1. A network hard disk video recording writing method is characterized by comprising the following steps:
acquiring the residual writing rate of target storage equipment, wherein the residual writing rate is the difference between the total writing rate of the target storage equipment and the video code rate currently written into the target storage equipment;
acquiring a code rate to be written into a video channel;
and if the residual writing rate of the target storage equipment is greater than or equal to the code rate of the video channel to be written, writing the video data transmitted by the video channel to be written into the target storage equipment.
2. The network hard disk video recording writing method according to claim 1, wherein when there are a plurality of video channels to be written, the method further comprises:
performing priority sequencing on the video channel to be written;
and preferentially writing the video data to be written into the video channel with high priority into the target storage device.
3. The network hard disk video recording writing method according to claim 2, wherein when there are a plurality of target storage devices, the target storage devices are sorted according to their health degrees, and the video data to be written into the video channel with a high priority is written into the target storage device with a high health degree preferentially.
4. The network hard disk video recording writing method according to claim 2, wherein the priority ranking is performed on the video channels to be written in the following manner:
acquiring the video picture change frequency corresponding to each to-be-written video channel and the computing resources required by the intelligent analysis capability corresponding to each to-be-written video channel;
and carrying out priority sequencing on the video channel to be written according to the video picture change frequency and the computing resources required by the intelligent analysis capability.
5. The method of claim 4, wherein the prioritizing the video channels to be written according to the video frame change frequency and the computational resources required by the intelligent analysis capability comprises:
determining the monitoring scene change value of each to-be-written video channel according to the video picture change frequency;
determining the intelligent analysis capability value of each to-be-written video channel according to the computing resources required by the intelligent analysis capability;
adding the monitoring scene change value and the intelligent analysis capability value according to weight to obtain value scores of the video channels to be written;
and carrying out priority ordering on the video channels to be written according to the sequence of the value scores from high to low.
6. The method of claim 1, further comprising:
and if the residual writing rate of the target storage equipment is less than the code rate of the video channel to be written, not writing the code rate of the video channel to be written into the target storage equipment, and reselecting the target storage equipment.
7. The network hard disk video recording writing method according to claim 1, wherein when there are a plurality of target storage devices, the target storage devices are sorted according to their health degrees, and the video data to be written into the video channel is preferentially written into the target storage device with a high health degree.
8. The method of claim 7, wherein the health of the storage device is determined by at least one of:
the data reading error rate and the writing error rate of the storage equipment, the CRC error counting value of the Ultra DMA, the number of scattered bad blocks and the temperature value of the storage equipment.
9. A network hard disk video recording writing device is characterized by comprising:
the first obtaining module is used for obtaining the residual writing rate of the target storage equipment, wherein the residual writing rate is the difference between the total writing rate of the target storage equipment and the video code rate currently written into the target storage equipment;
the second acquisition module is used for acquiring the code rate to be written into the video channel;
and the data storage module is used for writing the video data transmitted by the video channel to be written into the target storage device if the residual writing rate of the target storage device is greater than or equal to the code rate of the video channel to be written into.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the network hard disk video writing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the network hard disk video recording writing method according to any one of claims 1 to 8.
CN202111417143.9A 2021-11-25 2021-11-25 Network hard disk video recording method and device, electronic device and storage medium Active CN114339330B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111417143.9A CN114339330B (en) 2021-11-25 2021-11-25 Network hard disk video recording method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111417143.9A CN114339330B (en) 2021-11-25 2021-11-25 Network hard disk video recording method and device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN114339330A true CN114339330A (en) 2022-04-12
CN114339330B CN114339330B (en) 2024-07-02

Family

ID=81046113

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111417143.9A Active CN114339330B (en) 2021-11-25 2021-11-25 Network hard disk video recording method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114339330B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116405620A (en) * 2023-06-06 2023-07-07 深圳市拓阔科技有限公司 Video picture switching method, terminal equipment and readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1266332A (en) * 1999-02-17 2000-09-13 索尼公司 Video frequency recording equipment and method and central monitoring-recording system
JP2004228852A (en) * 2003-01-22 2004-08-12 Toshiba Corp Evaluation supporting method of vehicle detection processing
CN1791205A (en) * 2004-11-02 2006-06-21 株式会社日立制作所 Data recording controller, method of controlling data recording controller, program, data recording system, and data recording device
CN101500115A (en) * 2008-01-30 2009-08-05 Lg电子株式会社 Apparatus and method for adjusting bit rate in security device connected to external storage
JP2011199737A (en) * 2010-03-23 2011-10-06 Hitachi Ltd Apparatus and method for recording of monitor video, and program
CN107077514A (en) * 2016-05-23 2017-08-18 深圳市大疆创新科技有限公司 A kind of method and apparatus of data storage
US20190228625A1 (en) * 2016-09-09 2019-07-25 Canon Kabushiki Kaisha Prioritization of video sources
CN110996056A (en) * 2019-12-02 2020-04-10 浙江大华技术股份有限公司 Video storage method and device of cascade monitoring system
CN111381769A (en) * 2018-12-29 2020-07-07 深圳市茁壮网络股份有限公司 Distributed data storage method and system
CN113630619A (en) * 2021-08-12 2021-11-09 三星电子(中国)研发中心 Program recording method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1266332A (en) * 1999-02-17 2000-09-13 索尼公司 Video frequency recording equipment and method and central monitoring-recording system
JP2004228852A (en) * 2003-01-22 2004-08-12 Toshiba Corp Evaluation supporting method of vehicle detection processing
CN1791205A (en) * 2004-11-02 2006-06-21 株式会社日立制作所 Data recording controller, method of controlling data recording controller, program, data recording system, and data recording device
CN101500115A (en) * 2008-01-30 2009-08-05 Lg电子株式会社 Apparatus and method for adjusting bit rate in security device connected to external storage
JP2011199737A (en) * 2010-03-23 2011-10-06 Hitachi Ltd Apparatus and method for recording of monitor video, and program
CN107077514A (en) * 2016-05-23 2017-08-18 深圳市大疆创新科技有限公司 A kind of method and apparatus of data storage
US20190228625A1 (en) * 2016-09-09 2019-07-25 Canon Kabushiki Kaisha Prioritization of video sources
CN111381769A (en) * 2018-12-29 2020-07-07 深圳市茁壮网络股份有限公司 Distributed data storage method and system
CN110996056A (en) * 2019-12-02 2020-04-10 浙江大华技术股份有限公司 Video storage method and device of cascade monitoring system
CN113630619A (en) * 2021-08-12 2021-11-09 三星电子(中国)研发中心 Program recording method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116405620A (en) * 2023-06-06 2023-07-07 深圳市拓阔科技有限公司 Video picture switching method, terminal equipment and readable storage medium
CN116405620B (en) * 2023-06-06 2023-08-22 深圳市拓阔科技有限公司 Video picture switching method, terminal equipment and readable storage medium

Also Published As

Publication number Publication date
CN114339330B (en) 2024-07-02

Similar Documents

Publication Publication Date Title
CN107968802B (en) Resource scheduling method and device and filtering type scheduler
CN109934265A (en) A kind of determination method and apparatus of resident address
CN111159436A (en) Method and device for recommending multimedia content and computing equipment
CN111507479B (en) Feature binning method, device, equipment and computer-readable storage medium
CN113138802B (en) Command distribution device, method, chip, computer device and storage medium
CN110381151A (en) A kind of warping apparatus detection method and device
CN109657879A (en) Predict route acquisition methods, device, computer equipment and storage medium
CN114339330A (en) Network hard disk video recording writing method, device, electronic device and storage medium
CN102264109A (en) Method of distributing bandwidth for service and for terminal service execution, and equipment thereof
CN108874324A (en) A kind of access request processing method, device, equipment and readable storage medium storing program for executing
CN118331513B (en) Data intelligent dynamic scheduling method and device and computer equipment
CN115038088A (en) Intelligent network security detection early warning system and method
CN107659982B (en) Wireless network access point classification method and device
CN103761194B (en) A kind of EMS memory management process and device
CN115811483A (en) Network state monitoring method and device, electronic equipment and storage medium
CN114760240B (en) Data transmission method and device, electronic equipment and computer readable storage medium
CN116048422A (en) Data processing method, electronic device and storage medium
CN112584525B (en) Uplink data segmentation method and device based on multi-user access
CN101605253B (en) Control method and apparatus for video storage
CN110569102B (en) Method and device for deploying container instances
CN112085282A (en) Cell flow prediction method and server
CN112201047A (en) Suspected vehicle foothold analysis method and device based on Flink framework
CN112601050A (en) Smart city video monitoring method and device
KR101780144B1 (en) METHOD OF LOAD BALANCING AND ROUTING IN WIRELESS SENSOR NETWORKS BASED ON IoT
CN115190181B (en) Resource management method and system based on cloud management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant