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

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

Info

Publication number
CN114339330B
CN114339330B CN202111417143.9A CN202111417143A CN114339330B CN 114339330 B CN114339330 B CN 114339330B CN 202111417143 A CN202111417143 A CN 202111417143A CN 114339330 B CN114339330 B CN 114339330B
Authority
CN
China
Prior art keywords
video
written
target storage
storage device
writing
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.)
Active
Application number
CN202111417143.9A
Other languages
Chinese (zh)
Other versions
CN114339330A (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

Landscapes

  • Television Signal Processing For Recording (AREA)

Abstract

The application relates to a network hard disk video writing method, a device, an electronic device and a storage medium, wherein the network hard disk video writing method comprises the following steps: the method comprises the steps of 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 of the current writing target storage device, obtaining the code rate of the video channel to be written, and 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.

Description

Network hard disk video recording method and device, electronic device and storage medium
Technical Field
The present application relates to the field of storage device recording, and in particular, to a network hard disk video recording method, device, electronic apparatus, and storage medium.
Background
Abbreviations for network hard disk video (Network Video Recorder, NVR). The most important function of NVR is to receive the digital video code stream transmitted by the video camera through the network, store and manage the digital video code stream, thereby realizing the advantage of the distributed architecture brought by networking, namely, a plurality of network video cameras can be watched, browsed, played back, managed and stored simultaneously through the NVR.
When NVR accesses more cameras, the IO throughput of a single storage device is limited, if multiple cameras write data into one storage device at the same time, the IO bottleneck of the storage device can be easily achieved, the data cannot be written in, and video corresponding to the real-time code stream is lost.
Disclosure of Invention
In this embodiment, a method, an apparatus, an electronic device, and a storage medium for writing network hard disk video are provided, 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 network hard disk video writing method is provided, including:
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 of the current writing target storage device;
acquiring the code rate of a video channel to be written;
And 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.
In some of these embodiments, in the case where the video channels to be written are plural, the method further includes:
the video channels to be written are subjected to priority ranking;
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 the target storage devices are plural, the target storage devices are ordered according to the health degree, and 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.
In some of these embodiments, the video channels to be written are prioritized by:
Acquiring video picture change frequency corresponding to each video channel to be written and computing resources required by intelligent analysis capability corresponding to each video channel to be written;
And according to the video picture change frequency and the computing resources required by the intelligent analysis capability, the video channels to be written are subjected to priority ordering.
In some of these embodiments, the prioritizing the video channels to be written according to the video picture change frequency and the computing resources required for the intelligent analysis capability 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 the video channels to be written 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 weights to obtain value scores of the video channels to be written;
and prioritizing the video channels to be written according to the order 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 device is smaller 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 device, and reselecting the target storage device.
In some embodiments, in the case that the target storage devices are plural, the target storage devices are ordered according to the health degree, and the video data to be written into the video channel is preferentially written into the target storage device with high health degree.
In some of these embodiments, the storage device health is determined by at least one of:
Data read error rate, write error rate, ultra DMA CRC error count value, number of bad blocks in a sector, and memory device temperature value of the memory device.
In a second aspect, in this embodiment, there is provided a network hard disk video recording device, including:
The first acquisition module is used for acquiring 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 of the current writing target storage device;
The second acquisition module is used for acquiring the code rate of the video channel to be written;
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 device is provided, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the network hard disk video recording method according to the first aspect when executing the computer program.
In a fourth aspect, in this embodiment, there is provided a storage medium having a computer program stored thereon, where the program when executed by a processor implements the network hard disk video recording method according to the first aspect.
Compared with the related art, the network hard disk video recording writing method, device, electronic apparatus and storage medium provided in this embodiment solve the problem of video recording loss caused by real-time code stream non-storage 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, obtaining the code rate of the video channel to be written, 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, writing the video data transmitted by the video channel to be written into the target storage device, thereby realizing the storage of the real-time code stream to 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 other features, objects, and advantages 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 specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
Fig. 1 is a hardware configuration block diagram 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 network hard disk video writing method according to an embodiment of the present application;
FIG. 3 is a flowchart of another network hard disk video recording method according to an embodiment of the present application;
FIG. 4 is a flowchart of a network hard disk video writing method according to an embodiment of the present application;
Fig. 5 is a block diagram of a network hard disk video recording device according to an embodiment of the present application.
Detailed Description
The present application will be described and illustrated with reference to the accompanying drawings and examples for a clearer understanding of the objects, technical solutions and advantages of the present application.
Unless defined otherwise, technical or scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terms "a," "an," "the," "these" and similar terms in this application are not intended to be limiting in number, but may be singular or plural. The terms "comprising," "including," "having," and any variations thereof, as used herein, are intended to encompass non-exclusive inclusion; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (units) is not limited to the list of steps or modules (units), but may include other steps or modules (units) not listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in this disclosure are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. "and/or" describes an association relationship of an association object, meaning that there may be three relationships, e.g., "a and/or B" may mean: a exists alone, A and B exist together, and B exists alone. Typically, the character "/" indicates that the associated object is an "or" relationship. The terms "first," "second," "third," and the like, as referred to in this disclosure, merely distinguish similar objects and do not represent a particular ordering for objects.
The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or similar computing device. For example, the network hard disk video writing method is operated on a terminal, and fig. 1 is a hardware structure block diagram of an application terminal of the network hard disk video writing method according to an embodiment of the present application. As shown in fig. 1, the terminal may include one or more (only one is shown in fig. 1) processors 102 and a memory 104 for storing data, wherein the processors 102 may include, but are not limited to, a microprocessor MCU, a programmable logic device FPGA, or the like. The terminal may further include a transmission device 106 for a 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 video stores data collected by multiple cameras. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and is not intended to limit the structure of the terminal. 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 a computer program, for example, a software program of application software and a module, such as a computer program corresponding to the network hard disk video recording method in the present embodiment, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the above-mentioned method. 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 is capable of storing data collected by multiple input devices, and the memory 104 may further include memory remotely located with respect to the processor 102, which may 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 includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as a NIC) that can connect 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 configured to communicate with the internet wirelessly.
In this embodiment, a network hard disk video writing method is provided, fig. 2 is a flowchart of a network hard disk video writing method according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
step S201, obtaining a remaining writing rate of the target storage device, where the remaining writing rate is a difference between a total writing rate of the target storage device and a video code rate of the current writing target storage device.
The storage device includes a hard disk, a floppy disk, a magnetic core memory, a bubble memory, a U disk, a RAM, a ROM, a magneto-optical disk, a CD, and a DVD.
In this embodiment, if there is no video code rate written into the target storage device currently, the remaining writing rate of the target storage device is the total writing rate of the target storage device, if there is only one video channel currently writing the video code rate into the target storage device, the difference between the total writing rate of the target storage device and the video code rate of this video channel currently is taken as the remaining writing rate of the target storage device, if there are multiple video channels currently writing the video code rate into the target storage device, the sum of the video code rates of the multiple video channels currently is obtained, and the difference between the total writing rate of the target storage device and the sum of the video code rates is taken as the remaining writing rate of the target storage device.
Step S202, obtaining the code rate of the video channel to be written.
In step S203, 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.
It can be understood that under the condition that the residual writing speed of the target storage device is less 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 IO bottleneck reaching the target storage device can be avoided, the video code rate of the video channel to be written cannot be written into the target storage device, the problem of video loss caused by non-storage of the real-time code stream is solved, and the storage of the real-time code stream to the target storage device is realized.
It should be noted that the steps illustrated in the above-described flow or 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 other than that illustrated herein. For example, step S201 and step S202 may be interchanged.
In some of these embodiments, in the case where there are multiple video channels to be written, the method further includes:
the video channels to be written are subjected to priority ordering;
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, video data of a video channel to be written with a high level is preferentially written into the target storage device, so that it can be preferentially ensured that video data of a video channel to be written with a high level is written into the target storage device, the problem that video data of a video channel to be written with a high level cannot be written into the target channel is solved, and hierarchical storage of video data of a video channel to be written according to the priority is realized.
In some embodiments, the video channels to be written are grouped according to priority, and the priority group is written into the target storage device preferentially.
In this embodiment, it is assumed that p video channels to be written are provided, priority ordering is performed on the p video channels to be written, the video channel to be written with the priority ranked in the first s bits is used as a first video channel, the video channel to be written with the priority ranked in the (s+1) th to p bits is used as a second video channel, where s < p, video data of the first video channel is preferentially written in the target storage device.
In some embodiments, in the case that the target storage devices are plural, the target storage devices are ordered according to the health degree, and video data to be written into the video channel with high priority is preferentially written into the target storage device with high health degree.
In this embodiment, the priority ordering is performed on the plurality of video channels to be written, and the video data is written into the target storage device with high health degree according to the order of the priority from high to low.
The method comprises the steps that on the premise that m target storage devices are arranged, the m target storage devices are ordered according to the order of the health degree of the storage devices from high to low, the target storage devices arranged in the first n bits are used as a first candidate disc group, the target storage devices arranged in the (n+1) th to m bits are used as a second candidate disc group, n is smaller than m, and preferably, video data to be written into a video channel with high priority are written into the target storage devices in the first candidate disc 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 of the first s bits is taken as a first video channel, the video channels to be written with the priorities of the (s+1) th to p bits are taken as a second video channel, wherein s < p, the video data of the first video channel are written into the target storage device in the first candidate disc group, and the video data of the second video channel are written into the target storage device in the second candidate disc group.
It should be noted that, the present implementation is not limited to the number of several candidate disc groups, the number of several video channels, and how to group, the number of candidate disc groups and the number of video channels may be three or more, the number of target storage devices in each candidate disc group may be the same or different, and the example may perform multi-gradient grouping 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 ranked in the first 5 bits is used as the first candidate disc group, the target storage devices in the 6 th to 8 th bits are used as the second candidate disc group, and the target storage devices in the 9 th to 10 th bits are used as the third candidate disc group.
For example, the plurality of target storage devices are ordered according to the order of the health degree of the storage devices from high to low, the target storage devices with the ordered priorities are grouped to obtain a plurality of candidate disk groups, if a plurality of storage devices exist under one candidate disk group, each storage device corresponds to one disk number, and when the collected data needs to be stored, the corresponding storage device is selected according to the size of the disk number.
It can be appreciated that in this embodiment, video data of a video channel to be written with a high priority is preferentially written into a target storage device with a high health degree, so that on one hand, the video data of the video channel to be written with the high priority can be preferentially ensured to be written into the target storage device, and on the other hand, the video data with the high priority is written into the target storage device according to the order of the health degree of the target storage device from high to low, so that the security of the video data to be written with the high priority can be ensured, the loss of the written video data caused by the performance and errors of the storage device is avoided, and the hierarchical storage of the video data of the video channel to be written 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 video channel to be written, and computing resources required by intelligent analysis capacity corresponding to each video channel to be written;
and according to the feature point change information in the video picture and the computing resources required by the intelligent analysis capability, the video channels to be written are subjected to priority ranking.
By way of example, the feature point change information includes a change frequency of a video picture, a change in the number of feature points, a change in the position of the feature point, and a change in the type of the feature point.
In this embodiment, if the more feature point change information in the video frame is, the higher the priority of the corresponding video channel to be written, the still frame and the dynamic frame may be distinguished according to the feature point change information in the video frame, for example, the more people and vehicles are in daytime, the more feature point information in the frame is changed, the less people and vehicles are in evening, the less feature point information in the frame is changed, i.e. the more still frames at night, and if a lot of still frames are stored, the waste of storage resources may be caused, therefore, in this embodiment, the priority ordering is performed on the video channel to be written according to the feature point information in the video frame, so that the video data with the more feature point information change can be ensured to be written into the target storage device.
The intelligent analysis capability comprises behavior analysis, video structuring and face detection, the calculation required by each intelligent analysis capability is different, the more calculation resources required by the intelligent analysis capability are, the higher the priority of the corresponding video channel to be written is, for example, the face detection, the non-motor vehicle detection and the traffic light detection are started by the A video channel, the face detection is started by the B video channel, the function of starting the A video channel is more than that of starting the B video channel, and the video data of the A video channel are more important than that of the B video channel, because the video data of the A video channel are analyzed to obtain more intelligent analysis results.
By means of the method, the video channels to be written are subjected to priority ranking, and further, 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 into are stored in a grading mode according to the priority.
In some of these embodiments, prioritizing video channels to be written according to video picture change frequency and computational resources required for intelligent analysis capability, includes:
According to the video picture change frequency, determining a monitoring scene change value of each video channel to be written;
Determining intelligent analysis capability values of all video channels to be written according to calculation resources required by the intelligent analysis capability;
Adding the monitoring scene change value and the intelligent analysis capability value according to weights to obtain value scores of all video channels to be written;
And prioritizing 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 frame change frequency is, the larger the corresponding monitored scene change value of the video channel to be written is, the more computing resources are required for intelligent analysis capability, and the larger the corresponding intelligent analysis capability value of the 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 formula 1:1, adding weights to obtain value scores of all video channels to be written;
It should be noted that, in this embodiment, the value scoring factor affecting the video channel is not specifically limited, 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 focusing on the video picture change frequency, the monitoring scene change value may be given a greater weight, and in a scene focusing on the intelligent analysis capability, the intelligent analysis capability value may be given a greater weight.
By means of the method, the video channels to be written are subjected to priority ranking, and further, 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 into are stored in a grading mode according to the priority.
In some embodiments, in the case that the target storage devices are plural, the target storage devices are ordered according to the health degree, and video data to be written into the video channel is preferentially written into the target storage device with high health degree.
It can be appreciated that in this embodiment, the video data is written into the target storage device according to the order of the health degree of the target storage device from high to low, so that the loss of the written video data caused by the performance and errors of the storage device is avoided, and the security of the video data to be written can be ensured.
In some of these embodiments, the storage device health may be determined by at least one of:
Data read error rate, write error rate, ultra DMA CRC error count value, number of bad blocks in a sector, and memory device temperature value of the memory device.
It should be noted that, DMA is a data transmission mode, and conventional data transmission needs to be interrupted by a CPU, so that conventionally, the CPU is paused first, data is transmitted from a hard disk to a memory, then the CPU is resumed, and once data is transmitted, the CPU is interrupted, and the DMA can adopt a cycle stealing mode, and can finish data transmission only by taking up one CPU cycle;
CRC is a cyclic redundancy check meaning that a number of bits of check code (the check code is calculated according to a modulo 2 division formula) are added to the rear end of data to be transmitted, when the memory receives the data from the storage device, the data and the check code are compared, and then whether the transmitted data have errors is judged;
The Ultra DMA CRC error count value indicates that the received data has been CRC checked for errors during a DMA transfer, i.e., the data stored on the memory device is correct, but the received data has been error when transferred to memory, and a warning is issued when the erroneous data reaches a threshold.
Fig. 3 is a flowchart of another network hard disk video recording writing method according to an embodiment of the present application, as shown in fig. 3, the flowchart includes the following steps:
Step S301, obtaining a remaining writing rate of the target storage device, where the remaining writing rate is a difference between a total writing rate of the target storage device and a video code rate of the current writing target storage device.
Step S302, obtaining code rates of a plurality of video channels to be written.
Step S303, prioritizing the video channels to be written.
In step S304, 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 with high priority, the video data to be written with the video channel with high priority is preferentially written into the target storage device.
Through the steps, the video data of the video channel to be written with the high level is preferentially written into the target storage device, so that the video data of the video channel to be written with the high level can be preferentially ensured to be written into the target storage device, the problem that the video data of the video channel to be written with the high level cannot be written into the target channel is solved, and the video data of the video channel to be written is classified and stored according to the priority.
It should be noted that the steps illustrated in the above-described flow or 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 other than that illustrated herein. For example, step S301 and step S302 may be interchanged.
Fig. 4 is a flowchart of still another network hard disk video recording method according to an embodiment of the present application, as shown in fig. 4, where the storage device in the present embodiment is a hard disk, and the network hard disk video recording method includes the following steps:
Step S401, the i hard disks are ordered according to the order of the health degree from high to low, the hard disk arranged in the j bit at the front is used as a third candidate disk group, and the hard disk arranged in the (j+1) th to i bit is used 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 read error rate, write error rate, ultraDMACRC error count, and the like, current values of bad block number of scattered area, temperature, and the like, are detected, and specific score values of health degree of each hard disk are evaluated by combining the health index parameters with a certain weight value, and all hard disks are sequentially assigned with disk group numbers according to the specific score values of health degree of the hard disks (thus, a disk group number of 1 represents a hard disk with the best health state of the hard disk);
It should be noted that, the manner of assigning disk groups is to enable each hard disk to occupy a disk group number independently, if a hard disk is newly added or replaced, the health value of the hard disk can be estimated according to the rule, then a disk group number with the most similar health value of the hard disk is determined in the sorted hard disks according to the health value, and the disk group number is assigned to the newly added or replaced hard disk.
Dividing the hard disks into a third candidate disk group and a fourth candidate disk group according to a certain proportion according to the logical disk group numbers, for example, the logical disk group numbers of all the hard disks are 1-N, dividing N by 2, taking the hard disks corresponding to the first 1-N/2 logical disk group numbers as the third candidate disk group, and taking the hard disks corresponding to the last N/2 logical disk group numbers as the fourth candidate disk group. In this way all hard disks are divided into a third candidate disk set and a fourth candidate disk set, and it is apparent that the third candidate disk set is better in health than the fourth candidate disk set.
In step S402, the first hard disk in the third candidate disk set is used as the preferred target hard disk, and the first hard disk in the fourth candidate disk set is used as the normal target hard disk.
Preferably, a USB flash 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 size of the disk group number, and the hard disks respectively corresponding to the USB flash disk group number and the common disk group number are the current preferred target hard disk and the common target hard disk;
if a plurality of hard disks are arranged under one disk group number, the current USB disk group number and/or the common disk group number can be selected according to the size of the slot position number of the hard disk.
Step S403, judging whether the current video channel is a potential value video channel according to a preset rule.
In the present embodiment, if the current video channel is a potentially valuable video channel, step S404 is entered, otherwise step S407 is entered.
The preset rule refers to: and evaluating the value score of each video channel according to the scene change degree detection and the intelligent capability detection. Scene change degree refers to the frequency of video picture change, and is used to distinguish the dynamic picture of the still picture (such as video transmitted from the video camera installed beside the street, the daytime is more because of people, the picture change is large, the evening is less because of less people, and the picture change is small). 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 type of intelligence has different scores, and the more complex the intelligence capability, the higher the score. According to the scene change degree and the intelligent capability value, a score is given to each video channel according to a certain weight, a fixed threshold M is preset, 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 code stream size of the current video channel is smaller than the residual writing rate of the priority target hard disk.
In this embodiment, assuming that the total writing capability of the hard disk is X, the code stream size of the video channel 1 is Y, when the video channel 1 is bound to the hard disk, the remaining writing capability of the hard disk is (Y-X), when the code stream size of the next video channel 2 is G, if (Y-X) > =g, that is, the remaining writing capability of the hard disk can satisfy the code stream data writing pressure of the video channel 2, otherwise, the code stream data writing pressure of the video channel 2 cannot be satisfied, and the video channel 2 should replace the hard disk writing data with sufficient remaining writing capability.
It should be noted that, the relationship between the remaining writing capability and G is not limited to the relationship of greater than, equal to, or less than, but may be that the difference between the remaining writing capability and G is 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 code stream size of the current video channel is smaller than the remaining writing rate of the priority target hard disk, step S405 is entered, otherwise step S406 is entered.
Step S405, writing 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, i.e., video data of the current video channel is written into the priority target hard disk.
Step S406, reselecting the preferred target hard disk in the third candidate disk.
In this embodiment, if the code stream size of the current video channel is greater than or equal to the remaining writing rate of the priority target hard disk, the preferred target hard disk is reselected, and after the preferred target hard disk is reselected, step S404 is performed, for example, the hard disk arranged in the second position in the third candidate disk group may be used as the preferred target hard disk.
Step S407, judging whether the code stream size 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 step S404 is used to determine whether the code stream size of the current video channel is smaller than the remaining writing rate of the normal target hard disk, if so, step S408 is entered, otherwise, step S409 is entered.
Step S408, the video data of the current video channel is written into the common target hard disk.
In this embodiment, the current video channel and the normal target hard disk are written, i.e., video data of the current video channel is written into the normal target hard disk.
Step S409, reselecting the normal target hard disk among the fourth candidate disks.
In this embodiment, if the code stream size of the current video channel is greater than or equal to the remaining writing rate of the normal target hard disk, the normal target hard disk is reselected, and after the normal target hard disk is reselected, step S407 is performed, where, for example, the hard disk arranged in the second position in the fourth candidate disk group may be used as the normal target hard disk.
Through the steps, the value of each video channel is scored by taking the code stream size of each video channel and the IO writing rate of each hard disk as limiting conditions and by scene change degree and intelligent capability detection conditions, the hard disks are classified according to the health states of the hard disks, and videos with high value scores are stored in the hard disks with good health states of the hard disks, so that video classified storage of important channels and common channels and self-adaptive allocation of disk groups are realized.
It should be noted that the steps illustrated in the above-described flow or 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 other than that illustrated herein. For example, step S402 and step S403 may be interchanged.
The embodiment also provides a network hard disk video writing device, which is used for realizing the above embodiment and the preferred implementation manner, and the description is omitted. The terms "module," "unit," "sub-unit," and the like as used below may refer to a combination of software and/or hardware that performs a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
Fig. 5 is a block diagram of a network hard disk video recording 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 writing rate of the target storage device, where the remaining writing rate is a difference between a total writing rate of the target storage device and a video code rate currently written to the target storage device.
A second obtaining module 52, configured to obtain a code rate of the video channel to be written.
The data storage module 53 is connected to the first acquisition module 51 and the second acquisition module 52, 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.
In one embodiment, in the case that the video channels to be written are plural, the network hard disk video recording writing device further includes:
the video channels to be written are subjected to priority ordering;
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 writing device further includes: and the video channels to be written are grouped according to the priority, and the groups with the high priority are written into the target storage device preferentially.
In one embodiment, the network hard disk video writing device further includes: and when the number of the target storage devices is multiple, sorting 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 writing device further includes: the video channels to be written are prioritized by:
Acquiring video picture change frequency corresponding to each video channel to be written and computing resources required by intelligent analysis capacity corresponding to each video channel to be written;
And according to the video picture change frequency and the computing resources required by the intelligent analysis capability, the video channels to be written are subjected to priority ordering.
In one embodiment, the network hard disk video writing device further includes:
According to the video picture change frequency, determining a monitoring scene change value of each video channel to be written;
Determining intelligent analysis capability values of all video channels to be written according to calculation resources required by the intelligent analysis capability;
Adding the monitoring scene change value and the intelligent analysis capability value according to weights to obtain value scores of all video channels to be written;
And prioritizing 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 writing device further includes: and under the condition that a plurality of target storage devices are provided, sequencing the target storage devices according to the health degree, and preferentially writing the video data to be written into the video channels into the target storage devices with high health degree.
In one embodiment, the storage device health is determined by at least one of:
Data read error rate, write error rate, ultra DMA CRC error count value, number of bad blocks in a sector, and memory device temperature value of the memory device.
The above-described respective modules may be functional modules or program modules, and may be implemented by software or hardware. For modules implemented in hardware, the various modules described above may be located in the same processor; or the above modules may be located in different processors in any combination.
There is also provided in this embodiment an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
S1, acquiring 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 of the current writing target storage device.
S2, obtaining the code rate of the video channel to be written.
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, specific examples in this embodiment may refer to examples described in the foregoing embodiments and alternative implementations, and are not described in detail in this embodiment.
In addition, in combination with the network hard disk video recording writing method provided in the above embodiment, a storage medium may be further provided in this embodiment to implement the method. The storage medium has a computer program stored thereon; the computer program when executed by the processor implements any one of the network hard disk video recording writing methods in the above embodiments.
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 made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure in accordance with the embodiments provided herein.
It is to be understood that the drawings are merely illustrative of some embodiments of the present application and that it is possible for those skilled in the art to adapt the present application to other similar situations without the need for inventive work. In addition, it should be appreciated that while the development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as a departure from the disclosure.
The term "embodiment" in this disclosure means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the 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. It will be clear or implicitly understood by those of ordinary skill in the art that the embodiments described in the present application can be combined with other embodiments without conflict.
The foregoing examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the claims. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (9)

1. The network hard disk video recording writing method is characterized by comprising the following 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 of the current writing target storage device;
acquiring the code rate of a video channel to be written;
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;
in the case that the video channels to be written are plural, the method further includes:
the video channels to be written are subjected to priority ranking;
Preferentially writing the video data of the video channel to be written with high priority into the target storage device;
the video channels to be written are prioritized by:
Acquiring video picture change frequency corresponding to each video channel to be written and computing resources required by intelligent analysis capability corresponding to each video channel to be written; wherein the intelligent analysis capability comprises at least one of behavior analysis, video structuring and face detection;
And according to the video picture change frequency and the computing resources required by the intelligent analysis capability, the video channels to be written are subjected to priority ordering.
2. The network hard disk video writing method according to claim 1, wherein, if the target storage devices are plural, the target storage devices are ranked according to the health degree, and video data to be written into the video channel with high priority is preferentially written into the target storage device with high health degree.
3. The network hard disk video recording writing method according to claim 1, wherein said prioritizing the video channels to be written according to the video picture change frequency and the computing resources required for the intelligent analysis capability comprises:
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 the video channels to be written 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 weights to obtain value scores of the video channels to be written;
and prioritizing the video channels to be written according to the order of the value scores from high to low.
4. The network hard disk video recording writing method according to claim 1, wherein the method further comprises:
And if the residual writing rate of the target storage device is smaller 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 device, and reselecting the target storage device.
5. The network hard disk video writing method according to claim 1, wherein, if the target storage devices are plural, the target storage devices are ranked according to the health degree, and the video data to be written into the video channel is preferentially written into the target storage device with high health degree.
6. The network hard disk video writing method of claim 5, wherein the storage device health is determined by at least one of:
Data read error rate, write error rate, ultra DMA CRC error count value, number of bad blocks in a sector, and memory device temperature value of the memory device.
7. The utility model provides a network hard disk video recording writing device which characterized in that includes:
The first acquisition module is used for acquiring 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 of the current writing target storage device;
The second acquisition module is used for acquiring the code rate of the video channel to be written;
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 the case that the video channels to be written are plural, the data storage module is further configured to:
the video channels to be written are subjected to priority ranking;
Preferentially writing the video data of the video channel to be written with high priority into the target storage device;
the data storage module prioritizes the video channels to be written by:
Acquiring video picture change frequency corresponding to each video channel to be written and computing resources required by intelligent analysis capability corresponding to each video channel to be written; wherein the intelligent analysis capability comprises at least one of behavior analysis, video structuring and face detection;
And according to the video picture change frequency and the computing resources required by the intelligent analysis capability, the video channels to be written are subjected to priority ordering.
8. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the network hard disk video recording method of any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the network hard disk video recording method of any of claims 1 to 6.
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 CN114339330A (en) 2022-04-12
CN114339330B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766732B (en) * 2022-11-11 2026-03-24 浙江大华技术股份有限公司 Video recording storage scheduling method, apparatus, computer equipment and storage medium
CN116405620B (en) * 2023-06-06 2023-08-22 深圳市拓阔科技有限公司 Video picture switching method, terminal equipment and readable storage medium

Citations (3)

* 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
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
CN111381769A (en) * 2018-12-29 2020-07-07 深圳市茁壮网络股份有限公司 Distributed data storage method and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004228852A (en) * 2003-01-22 2004-08-12 Toshiba Corp Evaluation support method for vehicle detection processing
KR101431272B1 (en) * 2008-01-30 2014-08-20 엘지전자 주식회사 Apparatus and method for adjusting bit rate in a security device to which external storage is connected and connected
JP5091966B2 (en) * 2010-03-23 2012-12-05 株式会社日立製作所 Surveillance video recording apparatus, surveillance video recording method, and program
CN107077514B (en) * 2016-05-23 2021-05-25 深圳市大疆创新科技有限公司 Method and device for data storage
GB2553569B (en) * 2016-09-09 2020-07-15 Canon Kk Prioritization of video sources
CN110996056B (en) * 2019-12-02 2021-12-17 浙江大华技术股份有限公司 Video storage method and device of cascade monitoring system
CN113630619A (en) * 2021-08-12 2021-11-09 三星电子(中国)研发中心 Program recording method and device

Patent Citations (3)

* 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
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
CN111381769A (en) * 2018-12-29 2020-07-07 深圳市茁壮网络股份有限公司 Distributed data storage method and system

Also Published As

Publication number Publication date
CN114339330A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
CN114339330B (en) Network hard disk video recording method and device, electronic device and storage medium
CN108089814A (en) A kind of date storage method and device
CN115174490B (en) Data transmission method and network application terminal
CN118034593A (en) Method, device, computer equipment and storage medium for hierarchical storage of data blocks
CN101488919A (en) Memory address allocation method and apparatus
CN109151185A (en) A kind of method and device according to vehicle driving scene matching music type
CN120780357A (en) Universal measurement and control system data flow control bus architecture method and system
CN119127415A (en) Task allocation method, device and equipment based on distributed cluster
CN112671670A (en) VR video service identification method and device, intelligent terminal and storage medium
CN114357218B (en) An image archiving method, apparatus, electronic device and storage medium
CN114281557B (en) Data acquisition and reporting methods, systems, chips, CPUs, and storage media
CN116048422A (en) Data processing method, electronic device and storage medium
CN121125660A (en) A data forwarding method and system for an FPGA-based smart network interface card
CN118646682B (en) Multi-port multi-channel message classification statistical device and method
CN116107761B (en) Performance tuning method, system, electronic device and readable storage medium
CN115454889B (en) Storage access scheduling method, system and chip
KR20170092241A (en) METHOD OF LOAD BALANCING AND ROUTING IN WIRELESS SENSOR NETWORKS BASED ON IoT
CN106776393B (en) uninterrupted serial port data receiving method and device
CN116974757A (en) Load balancing method, device, storage medium and processor
CN110677463B (en) Parallel data transmission method, device, medium and electronic equipment
CN114237666A (en) Service degradation method and device, and storage medium
CN109413122B (en) A data processing method, network processor and computer storage medium
CN115865685B (en) Bandwidth allocation method, system and electronic equipment
CN114979827B (en) MAC layer channel allocation method, device and medium based on water quality data
CN121597121A (en) Data storage method, electronic equipment and computer readable storage medium

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