CN103929608B - The method and device of a kind of dynamically distributes buffer memory capacity - Google Patents
The method and device of a kind of dynamically distributes buffer memory capacity Download PDFInfo
- Publication number
- CN103929608B CN103929608B CN201410153810.0A CN201410153810A CN103929608B CN 103929608 B CN103929608 B CN 103929608B CN 201410153810 A CN201410153810 A CN 201410153810A CN 103929608 B CN103929608 B CN 103929608B
- Authority
- CN
- China
- Prior art keywords
- buffer memory
- playback
- memory capacity
- array
- video
- 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
Links
Landscapes
- Television Signal Processing For Recording (AREA)
Abstract
The present invention provides a kind of method of dynamically distributes buffer memory capacity, is applied to data management server, including:The status information of array where playback video resource is obtained, array I O process capacity factor is set according to the status information;The playback speed of the detection playback video, and determine the code check of the playback video;Calculated according to the playback speed, code check, array I O process capacity factor and default basic cache size is the buffer memory capacity of the playback video distribution.The present invention can be playback video dynamically distributes buffer memory capacity, and the waste of resource is also effectively reduced while satisfaction playback video is required buffer memory capacity.
Description
Technical field
The present invention relates to monitoring technology field, more particularly to a kind of dynamically distributes buffer memory capacity method and device.
Background technology
The advantages of Video Supervision Technique is due to its authenticity, reliability, popularity is each in security protection, traffic, finance, education etc.
Each industry of row is widely used and rapidly develops.The digitized video data of video monitoring is except for prison in real time
Control, can also first store monitor video, for follow-up playback.
In the prior art, the buffer memory capacity in playback video Shi Weimei roads playback video distribution is all fixed size, is returned
The entry condition for putting data pre-fetching is also fixed value.In this case it is all fixed to be assumed to be the cache size of every road playback unlatching
4MB, the entry condition that playback of data is prefetched is also fixed value, such as 50% when, to every road playback no matter code check is how many, be many
The playback of few speed, how is array I O process ability where playback resource, the cache size of unlatching be all it is changeless, so
The method of salary distribution in low bit- rate, low power speed, in the case that array I O process ability is relatively strong, the caching for distributing 4MB is wasted with regard to some
Resource;Conversely in code check high, speed high, in the case that array I O process ability is poor, the caching for distributing 4MB is likely to occur battle array again
Have little time to return and cause to play back interim card during row I O process.
The content of the invention
In view of this, above-mentioned asking is solved the invention provides the method and device of a kind of dynamically distributes buffer memory capacity
Topic.
The method of the dynamically distributes buffer memory capacity that the present invention is provided, is applied to data management server, including:
The status information of array where playback video resource is obtained, array I O process ability is set according to the status information
Coefficient;
The playback speed of the detection playback video, and determine the code check of the playback video;
According to the playback speed, code check, array I O process capacity factor and default basic cache size calculate for
The buffer memory capacity of the playback video distribution.
The present invention also provides a kind of device of dynamically distributes buffer memory capacity, is applied to data management server, including:
Array status acquiring unit, the status information for obtaining array where playback video resource, according to the state
Information sets array I O process capacity factor;
Playback information detecting unit, for detecting the playback speed of the playback video, and determines the playback video
Code check;
Buffer memory capacity computing unit, for according to the playback speed, code check, array I O process capacity factor and default
Basic cache size calculate be it is described playback video distribution buffer memory capacity.
The method of the dynamically distributes buffer memory capacity that the present invention is provided is by setting playback video resource array I O process ability
Coefficient, and playback speed, the code check of the playback video are obtained, according to the playback speed, code check, array I O process ability system
It is the buffer memory capacity of the playback video distribution that several and default basic cache size is calculated.As can be seen here, the present invention can be
Playback video dynamically distributes buffer memory capacity, resource is also effectively reduced meeting while playback video is required buffer memory capacity
Waste.
Brief description of the drawings
Fig. 1 is dynamically distributes buffer memory capacity device logical construction schematic diagram in the embodiment of the present invention;
Fig. 2 is dynamically distributes buffer memory capacity method flow block diagram in the embodiment of the present invention;
Fig. 3 is dynamically distributes buffer memory capacity method workflow diagram in the embodiment of the present invention.
Specific embodiment
In the prior art, due to playing back the code check of video, playing back the unstability of multiple and array I O process ability, it is
The buffer memory capacity that playback video distribution is fixed normally results in and or the wasting of resources is caused because buffer memory capacity distribution is too high, or
Due to the too low problem for causing to play back video cardton of buffer memory capacity distribution.Regarding to the issue above the invention provides a kind of dynamic point
Method and device with buffer memory capacity, are applied to data management server.It passes through to obtain array where playback video resource
Status information, array I O process capacity factor is set according to the status information, and obtain the playback times of the playback video
Speed and code check, finally according to the playback speed, code check, array I O process capacity factor and default basic cache size meter
It is the buffer memory capacity of the playback video distribution to calculate.
Fig. 1 is refer to, the video data content collection device that the present invention is provided is applied to data management server, the device
Basic hardware environment include CPU, internal memory, nonvolatile memory and other hardware, it is in essence a logic
Device.In the present embodiment, the device of the dynamically distributes buffer memory capacity includes on logic level:Array status obtain single
Unit, playback information detecting unit and buffer memory capacity computing unit, refer to Fig. 2, and the device performs as follows in the process of running
Handling process:
Step 201, array status acquiring unit obtains the status information of array where playback video resource, according to the shape
State information sets array I O process capacity factor;
Step 202, the playback speed of the playback information detecting unit detection playback video, and determine that the playback is regarded
The code check of frequency;
Step 203, buffer memory capacity computing unit according to it is described playback speed, code check, array I O process capacity factor and
It is the buffer memory capacity of the playback video distribution that default basic cache size is calculated.
The digitized video data of video monitoring is except for monitor in real time, can also first store monitor video
Come, for follow-up playback.Fig. 3 is refer to, when user starts video playback business, the array status acquiring unit is obtained
The status information of array where the playback video resource that user is started, the array information can include following four state:Enterprise
Industry disk, array is not rebuild and not synchronous;Monitoring disk, array is not rebuild and not synchronous;Enterprise's disk, array rebuild or
It is synchronous;Monitoring disk, array is in reconstruction or synchronous.The playback video array status are obtained especially by the inquiry playback video
Corresponding SAN(Storage area network)Resource name, and TCP socket is created, the SAN resource names are filled to the TCP
Sent to the storage device communicated to connect with the data management server by TCP message in socket.Storage device is connecing
After receiving the TCP message for carrying SAN resource names, the array according to where SAN resource names search the playback video resource
Array status information where status information, and the playback video resource that will be found is filled into TCP socket by TCP message
Replied.
After array status acquiring unit receives the TCP message of storage device reply, parse what is carried in the TCP message
Playback video resource array status information, array I O process capacity factor is set according to the status information.According to the state for obtaining
Information sets array I O process capacity factor and may be referred to shown in table 1:
Array status information | Array I O process capacity factor |
Enterprise's disk, array is not rebuild and not synchronous | 0.25 |
Monitoring disk, array is not rebuild and not synchronous | 0.5 |
Enterprise's disk, array is in reconstruction or synchronous | 0.5 |
Monitoring disk, array is in reconstruction or synchronous | 1 |
Table 1
Table 1 array status information and array I O process capacity factor corresponding relation list item where playback video resource,
The playback video resource array status information carried in TCP message is parsed, the array IO of the playback video can be set according to table 1
Disposal ability coefficient.Array I O process ability due to enterprise's disk generally compared with monitoring disk is weak, therefore is setting at array IO
During reason capacity factor, the ratio that can monitor the array I O process capacity factor setting of disk monitors the array I O process energy of disk
Force coefficient is higher, to provide the array I O process ability of stabilization.The array I O process capacity factor can be set by developer, this
Invention is simultaneously unrestricted to this.
In addition, when array status information changes, then can trigger storage device and be sent to array status acquiring unit
The TCP message of current array status information and SAN resource names is carried, when the message of the state change is received, according to
The array status information readjusts array I O process capacity factor corresponding with the SAN resource names carried in message.
Then, playback information detecting unit detection user starts the playback speed selected during playback video, the playback times
Fast then according to user selection determines that such as user have selected the playback of 1 speed, then the playback speed is then 1, if user selects
2 speeds playback, then the playback speed is then 2.
Meanwhile, playback information detecting unit determines the code check of the playback video.Because code check is only broadcast in playback video
Drawn according to the I frames group parsing read after putting, accurate code check cannot be drawn before video playback is played back, therefore the present invention is implemented
In example before video playback is played back, default code check value can be pre-set as initial bit rate, in embodiments of the present invention can be with
The default code check is set to 8, and is calculated as playing back the buffer memory capacity of video distribution according to the default code check 8.Will be default
Code check be set to 8, although can temporarily take more resource, but can be the normal play for ensureing playback video.Certainly, should
Default code check can also be set by developer, and the present invention is simultaneously unrestricted to this.
After video playback is played back, an I frame group of the playback video is read, according to the byte-header of I frames group 12
In parse current code check.
In embodiment of the present invention, when being calculated as playing back the buffer memory capacity of video distribution, basic cache size is there is provision of.
In embodiments of the present invention, it is contemplated that must be at least the playback video distribution can meet the buffer memory capacity of playing condition, can be with
The default value of the basic cache size is set into 0.25M to be calculated, while the basic cache size is adjusted also dependent on needs
It is whole.
In addition, it is necessary to explanation, does not have strict ordinal relation, this hair between the step 201 and step 202
Can also be it is determined that after playback speed, code check and default basic cache size, obtaining playback video resource in bright implementation method
The status information of place array, array I O process capacity factor is set according to status information;Can also set simultaneously at array IO
Reason capacity factor, playback speed, code check and default basic cache size, the present invention are simultaneously unrestricted to this.
After above-mentioned array I O process capacity factor, playback speed, code check and default basic cache size is obtained, then
Can be calculated as the playback is regarded according to array I O process capacity factor, playback speed, code check and default basic cache size
The buffer memory capacity that frequency division is matched somebody with somebody.In embodiment of the present invention, for the calculation for playing back video distribution buffer memory capacity is:
W=B*M*S*R
Wherein, W is the buffer memory capacity for playing back video distribution, and B is default basic cache size, and M is code check, and S is playback times
Speed, R is array I O process capacity factor.
Exemplarily, before video playback is played back, it is assumed that array I O process capacity factor R is set according to array status information
It is 0.5, playback speed S is 2, code check M is default code check 8, default basic cache size is 0.25, then be the playback video point
The buffer memory capacity W for matching somebody with somebody is then 2M(0.5*2*8*0.25).
After video playback is played back, it is assumed that array I O process capacity factor R is set to 0.5 according to array status information, return
It is 2 to put speed S, and code check M is 6 for parsing, and default basic cache size is 0.25, then be the caching of the playback video distribution
Capacity W is then 1.5M(0.5*2*6*0.25).
Further, it is playback video to prevent playing back when video code rate is too small, array I O process capacity factor is smaller
The too low buffer memory capacity of distribution, embodiment of the present invention for playback video by setting minimal cache quota to ensure in caching
Can at least there is the video data of playable 2s.Therefore in embodiments of the present invention, if the caching to play back video distribution holds
Amount is less than the minimal cache quota, then using the minimal cache quota as buffer memory capacity;If described is playback video point
The buffer memory capacity matched somebody with somebody is more than or equal to the minimal cache quota, then made using the buffer memory capacity for playback video distribution
It is buffer memory capacity.
The minimal cache quota is default fixed value or is the value related to code check, if the minimal cache quota be with
During the value of code check correlation, its computational methods can be:
Wmin=(M/8)*2
Wherein Wmin is minimal cache quota, and M is code check.Assuming that code check M is 6, then the minimal cache quota is then
1.5M。
Assuming that it is 1M to be calculated to play back the buffer memory capacity of video distribution according to W=B*M*S*R, minimal cache quota is
1.5M, then for the buffer memory capacity for playing back video distribution is minimal cache quota 1.5M;
Assuming that it is 1.5M to be calculated to play back the buffer memory capacity of video distribution according to W=B*M*S*R, minimal cache quota is
1.5M, then for the buffer memory capacity for playing back video distribution is the buffer memory capacity 1.5M that is calculated according to W=B*M*S*R.
Assuming that it is 2M to be calculated to play back the buffer memory capacity of video distribution according to W=B*M*S*R, minimal cache quota is
1.5M, then for the buffer memory capacity for playing back video distribution is the buffer memory capacity 2M that is calculated according to W=B*M*S*R.
Further, the present invention provide dynamically distributes buffer memory capacity device, detect it is described playback speed, code check,
When at least one of array I O process capacity factor and default basic cache size change, then described returning is recalculated as
Put the buffer memory capacity of video distribution.
For playback video distribution buffer memory capacity after, still can real-time monitoring play back video playback speed, code check, array IO
Disposal ability coefficient and default basic cache size.When any one or more changing is detected, then recalculate
It is the buffer memory capacity of the playback video distribution, and when code check changes, the minimum that also recalculate the playback video is delayed
Quota is deposited, while whether being judged as playing back the buffer memory capacity of video distribution less than minimal cache quota, and is according to judged result
The playback video distribution buffer memory capacity.
In sum, the invention provides the method and device of a kind of dynamically distributes buffer memory capacity, played back by obtaining
The status information of array where video resource, sets array I O process capacity factor, and getting according to the status information
It is described playback video playback speed and code check after, according to it is described playback speed, code check, array I O process capacity factor and
Default basic cache size is playback video dynamically distributes buffer memory capacity.The present invention is meeting playback video to buffer memory capacity requirement
While also effectively reduce the waste of cache resources.Can be prevented effectively from additionally by for playback video sets minimal cache quota
Code check is too small or be the problem for playing back the too low buffer memory capacity of video distribution during smaller array I O process capacity factor.
Presently preferred embodiments of the present invention is the foregoing is only, is not intended to limit the invention, it is all in essence of the invention
Within god and principle, any modification, equivalent substitution and improvements done etc. should be included within the scope of protection of the invention.
Claims (10)
1. a kind of method of dynamically distributes buffer memory capacity, is applied to data management server, it is characterised in that including:
The status information of array where playback video resource is obtained, array I O process ability system is set according to the status information
Number;
The playback speed of the detection playback video, and determine the code check of the playback video;Wherein, in playback video playback
Before, default code check value is pre-set as initial bit rate;
Calculated as described according to the playback speed, code check, array I O process capacity factor and default basic cache size
Play back the buffer memory capacity of video distribution.
2. the method for claim 1, it is characterised in that the status information of array where the acquisition playback video resource
Specifically include,
SAN resource names corresponding with the playback video are searched, to the storage communicated to connect with the data management server
Equipment sends the message for carrying the SAN resource names;
The back message for receiving is parsed to obtain the status information for playing back array where video resource.
3. the method for claim 1, it is characterised in that according to the playback speed, code check, array I O process ability system
The buffer memory capacity that several and default basic cache size is calculated as the playback video distribution is specially:
W=B*M*S*R
Wherein, W is the buffer memory capacity for playing back video distribution, and B is default basic cache size, and M is code check, and S is playback speed, R
It is array I O process capacity factor.
4. the method for claim 1, it is characterised in that methods described also includes, if it is described calculate for playback is regarded
The buffer memory capacity that frequency division is matched somebody with somebody is less than minimal cache quota, then using the minimal cache quota as buffer memory capacity;
If the buffer memory capacity to play back video distribution for calculating is used more than or equal to the minimal cache quota
The buffer memory capacity to play back video distribution as buffer memory capacity, wherein the minimal cache quota be default fixed value or
It is the value related to code check.
5. the method for claim 1, it is characterised in that if detecting the playback speed, code check, array I O process energy
When at least one of force coefficient and default basic cache size change, then the playback video distribution is recalculated as
Buffer memory capacity.
6. a kind of device of dynamically distributes buffer memory capacity, is applied to data management server, it is characterised in that including:
Array status acquiring unit, the status information for obtaining array where playback video resource, according to the status information
Array I O process capacity factor is set;
Playback information detecting unit, for detecting the playback speed of the playback video, and determines the code of the playback video
Rate;Wherein, before video playback is played back, default code check value is pre-set as initial bit rate;
Buffer memory capacity computing unit, for according to the playback speed, code check, array I O process capacity factor and default base
It is the buffer memory capacity of the playback video distribution that plinth cache size is calculated.
7. device as claimed in claim 6, it is characterised in that the array status acquiring unit specifically for,
SAN resource names corresponding with the playback video are searched, to the storage communicated to connect with the data management server
Equipment sends the message for carrying the SAN resource names;
The back message for receiving is parsed to obtain the status information for playing back array where video resource.
8. device as claimed in claim 6, it is characterised in that the buffer memory capacity computing unit is specially:
W=B*M*S*R
Wherein, W is the buffer memory capacity for playing back video distribution, and B is default basic cache size, and M is code check, and S is playback speed, R
It is array I O process capacity factor.
9. device as claimed in claim 6, it is characterised in that described device also includes minimum quota judge module, for
Judge that the buffer memory capacity to play back video distribution for calculating less than minimal cache quota, is then matched somebody with somebody using the minimal cache
Volume is used as buffer memory capacity;
If the buffer memory capacity to play back video distribution for calculating is used more than or equal to the minimal cache quota
The buffer memory capacity to play back video distribution as buffer memory capacity, wherein the minimal cache quota be default fixed value or
It is the value related to code check.
10. device as claimed in claim 6, it is characterised in that if detecting the playback speed, code check, array I O process
When at least one of capacity factor and default basic cache size change, then the playback video distribution is recalculated as
Buffer memory capacity.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410153810.0A CN103929608B (en) | 2014-04-16 | 2014-04-16 | The method and device of a kind of dynamically distributes buffer memory capacity |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410153810.0A CN103929608B (en) | 2014-04-16 | 2014-04-16 | The method and device of a kind of dynamically distributes buffer memory capacity |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103929608A CN103929608A (en) | 2014-07-16 |
CN103929608B true CN103929608B (en) | 2017-06-16 |
Family
ID=51147669
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410153810.0A Active CN103929608B (en) | 2014-04-16 | 2014-04-16 | The method and device of a kind of dynamically distributes buffer memory capacity |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103929608B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108153506B (en) * | 2018-01-24 | 2021-07-13 | 北京小米移动软件有限公司 | Image processing method and device and terminal equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001362A (en) * | 2006-01-11 | 2007-07-18 | 腾讯科技(深圳)有限公司 | Method and terminal of on-line playing flow media |
CN101135994A (en) * | 2007-09-07 | 2008-03-05 | 杭州华三通信技术有限公司 | Method and apparatus for dividing cache space and cache controller thereof |
CN101282467A (en) * | 2008-05-15 | 2008-10-08 | 中兴通讯股份有限公司 | Method and apparatus for caching data when playing medium with low speed |
CN101635841A (en) * | 2009-09-04 | 2010-01-27 | 杭州华三通信技术有限公司 | Method and equipment for adjusting read-write performance of video service information |
JP2011172256A (en) * | 2011-03-30 | 2011-09-01 | Fujitsu Ltd | Video data storage device, and video data storage method |
CN102801690A (en) * | 2011-05-25 | 2012-11-28 | 华为技术有限公司 | Stream media processing method, distribution server, client and system |
CN102868908A (en) * | 2011-07-04 | 2013-01-09 | 哈尔滨融智达网络科技有限公司 | High-efficiency streaming media playing method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI262476B (en) * | 2003-12-29 | 2006-09-21 | Lite On It Corp | A control method of recording speed in optical disk drives |
KR101867286B1 (en) * | 2012-02-27 | 2018-06-15 | 삼성전자주식회사 | Distributed processing apparatus and method for big data using hardware acceleration based on work load |
-
2014
- 2014-04-16 CN CN201410153810.0A patent/CN103929608B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001362A (en) * | 2006-01-11 | 2007-07-18 | 腾讯科技(深圳)有限公司 | Method and terminal of on-line playing flow media |
CN101135994A (en) * | 2007-09-07 | 2008-03-05 | 杭州华三通信技术有限公司 | Method and apparatus for dividing cache space and cache controller thereof |
CN101282467A (en) * | 2008-05-15 | 2008-10-08 | 中兴通讯股份有限公司 | Method and apparatus for caching data when playing medium with low speed |
CN101635841A (en) * | 2009-09-04 | 2010-01-27 | 杭州华三通信技术有限公司 | Method and equipment for adjusting read-write performance of video service information |
JP2011172256A (en) * | 2011-03-30 | 2011-09-01 | Fujitsu Ltd | Video data storage device, and video data storage method |
CN102801690A (en) * | 2011-05-25 | 2012-11-28 | 华为技术有限公司 | Stream media processing method, distribution server, client and system |
CN102868908A (en) * | 2011-07-04 | 2013-01-09 | 哈尔滨融智达网络科技有限公司 | High-efficiency streaming media playing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN103929608A (en) | 2014-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10031671B2 (en) | Method, apparatus, and system for calculating identification threshold to distinguish cold data and hot data | |
US9158460B2 (en) | Selecting data nodes using multiple storage policies in cloud storage system | |
WO2017156995A1 (en) | Content recommendation method, apparatus and system | |
US8239641B2 (en) | Choosing location or manner of storing data | |
CN103067297B (en) | A kind of dynamic load balancing method based on resource consumption prediction and device | |
CN106302595B (en) | Method and equipment for carrying out health check on server | |
WO2016145993A1 (en) | Method and system for user device identification | |
CN106649349A (en) | Method, device and system for data caching, applicable to game application | |
CN106202569A (en) | A kind of cleaning method based on big data quantity | |
CN106656583A (en) | Dynamic threshold alarming method and device | |
CN104184832A (en) | Data submitting method and device in network application | |
CN110968279B (en) | Message degradation method and related device | |
US9880879B1 (en) | Identifying task instance outliers based on metric data in a large scale parallel processing system | |
CN110311959A (en) | The method, apparatus and data processing system of message push and renewal of the page | |
CN105302907A (en) | Request processing method and device | |
CN107491549A (en) | A kind of data processing method and system | |
US20150220648A1 (en) | Systems and Methods for Performing Machine-Implemented Tasks | |
CN107911447A (en) | Operation system expansion method and device | |
CN103929608B (en) | The method and device of a kind of dynamically distributes buffer memory capacity | |
CN107959696A (en) | A kind of daily record bill processing method and system | |
CN106203179A (en) | A kind of completeness check system and method to file | |
CN117793200A (en) | Optimizing network utilization | |
CN106570006A (en) | Multimedia file recommendation system and releasing information storage method | |
CN105573838A (en) | Cache health degree detection method and device | |
CN106254092A (en) | A kind of method for early warning, Apparatus and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |