CN108551485A - A kind of streaming medium content caching method, device and computer storage media - Google Patents
A kind of streaming medium content caching method, device and computer storage media Download PDFInfo
- Publication number
- CN108551485A CN108551485A CN201810368101.2A CN201810368101A CN108551485A CN 108551485 A CN108551485 A CN 108551485A CN 201810368101 A CN201810368101 A CN 201810368101A CN 108551485 A CN108551485 A CN 108551485A
- Authority
- CN
- China
- Prior art keywords
- streaming medium
- cached
- medium content
- content
- cache
- 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.)
- Withdrawn
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
- H04L67/5682—Policies or rules for updating, deleting or replacing the stored data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/60—Router architectures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention is suitable for software field, provides a kind of streaming medium content caching method, device and computer storage media, method and includes:Obtain streaming medium content to be cached;Obtain current cache space;If current cache space cannot accommodate streaming medium content to be cached, with regard to obtaining the content name of streaming medium content to be cached;In the content storage table to prestore, the content name of acquisition is matched with the content name cached;If matching is unsuccessful, the hop count of the streaming medium content cached, requested number are just obtained;Model, the hop count of the streaming medium content cached, requested number are generated using preset caching value, generate the corresponding caching value of the streaming medium content cached;It obtains minimal cache and is worth corresponding streaming medium content;Streaming medium content caching to be cached is fallen into minimal cache and is worth corresponding streaming medium content.The present invention is conducive to improve the caching effect of streaming medium content.
Description
Technical field
The invention belongs to a kind of software field more particularly to streaming medium content caching method, device and computer storages to be situated between
Matter.
Background technology
It is a kind of Novel Internet architectural model to name data network (Named Data Networking, NDN),
Various buffer services are intended to provide, to alleviate the network flow of the rapid growth severe pressure caused by network bandwidth.
Name data network has a large amount of NDN routers, and the forwarding mechanism of NDN routers is Buffer forwarding, i.e., after cache information, forwarding
Information, information include streaming medium content, since the spatial cache of NDN routers is smaller, it is therefore desirable in timely streaming media
Appearance is replaced, and to discharge spatial cache, improves the utilization rate of spatial cache.
However, the streaming medium content caching method of existing NDN routers, when the access frequency of streaming medium content is identical,
Random replacement streaming medium content replaces the streaming medium content more than hop count sometimes, and the communication of streaming medium content is caused to be prolonged
Increase late, is unfavorable for improving the caching effect of streaming medium content.The reason is that the replacement of existing streaming medium content caching method
Strategy has:Strategy and Size strategies is least commonly used in least recently used strategy.It is minimum to use strategy at least making recently
Streaming medium content is replaced, and the minimum frequency of use strategy streaming medium content few to frequency of use is replaced, Size
Policy replacement falls maximum streaming medium content.Although above-mentioned strategy does not all use the hop count of streaming medium content, work as stream
When the access frequency of media content is identical, usually random replacement streaming medium content, in this way, it is more to replace hop count sometimes
Streaming medium content, subsequent user request can only arrive source server acquisition streaming medium content, and the stream matchmaker more than hop count again
Body description of contents separation is remote from source server, in this way, increasing unnecessary hop count, leads to the communication of streaming medium content
Delay increases, and is unfavorable for improving the caching effect of streaming medium content.
Invention content
In view of this, an embodiment of the present invention provides the storages of a kind of streaming medium content caching method, device and computer to be situated between
Matter is replaced with solving a kind of existing streaming medium content caching method when the access frequency of streaming medium content is identical sometimes
Streaming medium content more than hop count causes the communication delay of streaming medium content to increase, and is unfavorable for improving the slow of streaming medium content
The problem of depositing effect.
The first aspect of the embodiment of the present invention provides a kind of streaming medium content caching method, including:
NDN routers obtain streaming medium content to be cached by NDN networks;
Obtain current cache space;
It is just to be cached described in acquisition if the current cache space cannot accommodate the streaming medium content to be cached
The content name of streaming medium content;
In the content storage table to prestore, the content name of acquisition is matched with the content name cached;
If matching is unsuccessful, the hop count of the streaming medium content cached, requested number are just obtained;
Using preset caching value generate model, the hop count of the streaming medium content cached, requested time
It counts, the corresponding caching value of the streaming medium content cached described in generation;
Caching value is ranked up, minimal cache value is obtained;
In the streaming medium content cached, obtains minimal cache and be worth corresponding streaming medium content;
In the storage location that the minimal cache is worth corresponding streaming medium content, be written the stream matchmaker to be cached
Hold in vivo, so that the streaming medium content to be cached replaces the minimal cache and is worth corresponding streaming medium content;
Wherein, the caching value generation model is specially:
Wherein,Indicate the caching value of the streaming medium content n cached when period i;N indicates the Streaming Media cached
The serial number of content, n value ranges are 1 to N, and N is the total number of the streaming medium content cached;It indicates in the upper of period i
When one period, the caching of the streaming medium content n cached is worth;HopnIt is jumped for the routing of the streaming medium content n cached
Number indicates NDN routers and the hop count between source server where the streaming medium content n cached;Requestn
When indicating period i, the requested number of the streaming medium content n cached;TmIndicate the streaming medium content n cached requested time
Several weights, Tm=m*t, m are preset constant, and t is preset cycle duration.
As a kind of realization method of the present embodiment, in the streaming medium content caching method, the NDN routers pass through
NDN networks obtain streaming medium content to be cached, specially:
NDN routers extract cache tag position by NDN network received data packets in the data packet;
Judge whether the value of the cache tag position is 1;
If the value of the cache tag position is 1, just in the data packet, streaming medium content to be cached is obtained.
As a kind of realization method of the present embodiment, in the streaming medium content caching method, the NDN routers pass through
NDN networks obtain streaming medium content to be cached, specially:
NDN routers extract cache tag position by NDN network received data packets in the data packet;
Judge whether the value of the cache tag position is 0;
If the value of the cache tag position is 0, just in the data packet, streaming medium content to be cached is obtained.
As a kind of realization method of the present embodiment, in the streaming medium content caching method, if described current
Spatial cache cannot accommodate the streaming medium content to be cached, the content name of streaming medium content to be cached, tool described in acquisition
Body is:
If the current cache space cannot accommodate the streaming medium content to be cached, the Streaming Media cached is obtained
Minimum cache-time of the content in current cache space;
Judge whether the minimum cache-time is more than 30 seconds;
If the minimum cache-time is more than 30 seconds, with regard to the content name of streaming medium content to be cached described in acquisition.
As a kind of realization method of the present embodiment, in the streaming medium content caching method, if described current
Spatial cache cannot accommodate the streaming medium content to be cached, and obtain the streaming medium content cached in current cache space
Minimum cache-time, specially:
If the current cache space cannot accommodate the streaming medium content to be cached, the Streaming Media cached is obtained
Cache-time of the content in current cache space;
The cache-time is ranked up, according to ranking results, obtains the streaming medium content cached in current cache
Minimum cache-time in space.
The second aspect of the embodiment of the present invention provides a kind of streaming medium content buffer storage, including:
Streaming medium content acquisition module, for obtaining streaming medium content to be cached by NDN networks;
Current cache space acquisition module, for obtaining current cache space;
Content name acquisition module, if cannot be accommodated in the Streaming Media to be cached for the current cache space
Hold, just the content name of streaming medium content to be cached described in acquisition;
Matching module, in the content storage table to prestore, the content name of acquisition and the content name cached to be carried out
Matching;
If first acquisition module just obtains hop count, the quilt of the streaming medium content cached unsuccessful for matching
Request number of times;
Caching value generation module, for using in preset caching value generation model, the Streaming Media cached
The hop count of appearance is requested number, the corresponding caching value of the streaming medium content cached described in generation;
Minimal cache value capture module obtains minimal cache value for being ranked up to caching value;
Second acquisition module is worth corresponding stream in the streaming medium content cached, obtaining minimal cache
Media content;
Streaming medium content cache module, the storage location for being worth corresponding streaming medium content in the minimal cache
In, it is written by the streaming medium content to be cached, so that the streaming medium content to be cached replaces the minimal cache
It is worth corresponding streaming medium content;
Wherein, the caching value generation model is specially:
Wherein,Indicate the caching value of the streaming medium content n cached when period i;N indicates the Streaming Media cached
The serial number of content, n value ranges are 1 to N, and N is the total number of the streaming medium content cached;It indicates in the upper of period i
When one period, the caching of the streaming medium content n cached is worth;HopnIt is jumped for the routing of the streaming medium content n cached
Number indicates NDN routers and the hop count between source server where the streaming medium content n cached;Requestn
When indicating period i, the requested number of the streaming medium content n cached;TmIndicate the streaming medium content n cached requested time
Several weights, Tm=m*t, m are preset constant, and t is preset cycle duration.
As a kind of realization method of the present embodiment, in the streaming medium content buffer storage, the streaming medium content obtains
Modulus block is specifically used for:
By NDN network received data packets, cache tag position is extracted in the data packet;
Judge whether the value of the cache tag position is 1;
If the value of the cache tag position is 1, just in the data packet, streaming medium content to be cached is obtained;
Alternatively, the streaming medium content acquisition module is specifically used for:
By NDN network received data packets, cache tag position is extracted in the data packet;
Judge whether the value of the cache tag position is 0;
If the value of the cache tag position is 0, just in the data packet, streaming medium content to be cached is obtained.
As a kind of realization method of the present embodiment, in the streaming medium content buffer storage, the content name obtains mould
Block is specifically used for:
If the current cache space cannot accommodate the streaming medium content to be cached, the Streaming Media cached is obtained
Minimum cache-time of the content in current cache space;
Judge whether the minimum cache-time is more than 30 seconds;
If the minimum cache-time is more than 30 seconds, with regard to the content name of streaming medium content to be cached described in acquisition;
Wherein, if current cache space cannot accommodate the streaming medium content to be cached, acquisition has been delayed
Minimum cache-time of the streaming medium content deposited in current cache space, specially:
If the current cache space cannot accommodate the streaming medium content to be cached, the Streaming Media cached is obtained
Cache-time of the content in current cache space;
The cache-time is ranked up, according to ranking results, obtains the streaming medium content cached in current cache
Minimum cache-time in space.
The third aspect of the embodiment of the present invention provides a kind of streaming medium content buffer storage, including memory, processor
And it is stored in the computer program that can be run in the memory and on the processor, the processor executes the meter
The step of above method is realized when calculation machine program.
The fourth aspect of the embodiment of the present invention provides a kind of computer storage media, the computer storage media storage
The step of having computer program, the above method is realized when the computer program is executed by processor.
Existing advantageous effect is the embodiment of the present invention compared with prior art:
When the access frequency of streaming medium content is identical, preferentially replaces and jump the few streaming medium content of hop count, retain
Streaming medium content more than hop count leads to Streaming Media so as to avoid there is replacing the streaming medium content more than hop count
The case where communication delay of content increases is conducive to the caching effect for improving streaming medium content.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some
Embodiment for those of ordinary skill in the art without having to pay creative labor, can also be according to these
Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation flow chart of streaming medium content caching method provided in an embodiment of the present invention;
Fig. 2 is a kind of structure diagram of streaming medium content buffer storage provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of streaming medium content buffer storage provided in an embodiment of the present invention.
Specific implementation mode
In being described below, for illustration and not for limitation, it is proposed that such as tool of particular system structure, technology etc
Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific
The present invention can also be realized in the other embodiments of details.In other situations, it omits to well-known system, device, electricity
The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
It should be appreciated that ought use in this specification and in the appended claims, the instruction of term " comprising " is described special
Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step,
Operation, element, component and/or its presence or addition gathered.
It is also understood that the term used in this description of the invention is merely for the sake of the mesh for describing specific embodiment
And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singulative, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is
Refer to any combinations and all possible combinations of one or more of associated item listed, and includes these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt
Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or
" if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true
It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
Embodiment one
With reference to figure 1, Fig. 1 is a kind of implementation flow chart of streaming medium content caching method provided in an embodiment of the present invention, should
Method is applied to terminal device, and a kind of streaming medium content caching method may comprise steps of as shown in Figure 1:
S101, NDN router obtain streaming medium content to be cached by NDN networks;
NDN routers extract cache tag position by NDN network received data packets in the data packet;
Judge whether the value of the cache tag position is 0 or 1;
If the value of the cache tag position is 0 or 1, just in the data packet, streaming medium content to be cached is obtained.
Wherein, data packet carries cache tag position, streaming medium content, using NDN agreements to resolve packet, you can carry
Take cache tag position, streaming medium content.NDN agreements are the prior art, and this will not be repeated here.
S102 obtains current cache space;
S103 is just waited for described in acquisition if the current cache space cannot accommodate the streaming medium content to be cached
The content name of the streaming medium content of caching;
S104 matches the content name of acquisition with the content name cached in the content storage table to prestore;
Wherein, content storage table includes the content name cached, and the content name each cached only corresponds to one and cached
Streaming medium content.
S105 just obtains the hop count of the streaming medium content cached, requested number if matching is unsuccessful;
If matching is unsuccessful, indicates that identical content name is not present in content storage table, cannot directly replace and to have cached
Streaming medium content needs to obtain the hop count of the streaming medium content cached, requested number.
If successful match, indicate that there are identical content names in content storage table, can directly replace identical content name and correspond to
The streaming medium content cached, need to obtain the hop count of the streaming medium content cached, requested number.
S106, using it is preset caching value generate model, the streaming medium content cached hop count, asked
Number is sought, the corresponding caching value of the streaming medium content cached described in generation;
S107 is ranked up caching value, obtains minimal cache value;
S108 obtains minimal cache and is worth corresponding streaming medium content in the streaming medium content cached;
S109, in the storage location that the minimal cache is worth corresponding streaming medium content, write-in waits caching by described
Streaming medium content so that the streaming medium content to be cached replaces the minimal cache and is worth in corresponding Streaming Media
Hold;
Wherein, the caching value generation model is specially:
Wherein,Indicate the caching value of the streaming medium content n cached when period i;N indicates the Streaming Media cached
The serial number of content, n value ranges are 1 to N, and N is the total number of the streaming medium content cached;It indicates in the upper of period i
When one period, the caching of the streaming medium content n cached is worth;HopnIt is jumped for the routing of the streaming medium content n cached
Number indicates NDN routers and the hop count between source server where the streaming medium content n cached;Requestn
When indicating period i, the requested number of the streaming medium content n cached;TmIndicate the streaming medium content n cached requested time
Several weights, Tm=m*t, m are preset constant, and t is preset cycle duration.
Wherein, NDN routers are the router named in data network.
Wherein, HopnHop count of the NDN routers apart from source server where the streaming medium content n that has cached.
Wherein, it is worth from caching and generates modelIt is found that Pi nAnd HopnIt is just
Proportionate relationship, when the access frequency of streaming medium content is identical, hop count HopnMore, caching value is also bigger, subsequently
Caching value is ranked up, minimal cache value is obtained, minimal cache is obtained and is worth corresponding streaming medium content, will wait caching
Streaming medium content caching fall minimal cache and be worth corresponding streaming medium content, what can be generated has the technical effect that:Preferentially replace
The few streaming medium content of hop count is jumped, the streaming medium content more than reserved route hop count avoids and occurs replacing hop count
More streaming medium contents, cause streaming medium content communication delay increase the case where, be conducive to improve streaming medium content caching
Effect.
Wherein, caching value generates the requested number of the requested number and current period before model considers,
And a period higher in the weight ratio of current period, the time is more long, and the influence for being requested number is smaller.Such computational methods are preferable
Ground embodies the caching value of streaming medium content.
Wherein, after S109, a kind of streaming medium content caching method further includes:
In the caching remaining time field of the streaming medium content to be cached, residual cache time is written, works as residue
When cache-time is less than 30 seconds, which can be replaced.
Wherein, NDN routers where the streaming medium content n cached are referred to as:First NDN routers.
Wherein, the information interactive process of the first NDN routers and request of data node, is summarized as follows:
When request of data node asks the streaming medium content n cached, streaming medium content n can be sent in NDN networks
User request;
When the user of streaming medium content n asks to reach the first NDN routers, the first NDN routers can be to request of data
Node returns to the streaming medium content n cached.
In this way, user's request of streaming medium content n does not just have to reach source server.With source server and data requesting node
Hop count between request is compared, and the hop count between the first NDN routers and the request of data requesting node will lack, because
This, the user of streaming medium content n and streaming medium content n ask the hop count of approach NDN routers also just to reduce, and pass through reduction
Unnecessary hop count, and then reduce the communication delay of the streaming medium content n cached.
For purposes of illustration only, being exemplified below:
First NDN router caches streaming medium content A and streaming medium content B,
It is 10 that the streaming medium content A that first NDN router distances have cached, which corresponds to the hop count of source server, that is, is cached
The hop count of streaming medium content A reductions is 10, the streaming medium content A corresponding source services that the first NDN router distances have cached
The hop count of device is 20, that is, the hop count for caching streaming medium content B reductions is 10;
When period i, the requested number of the streaming medium content A and B cached is identical, i.e., access frequency is identical, at this point, needing
Streaming medium content C to be cached is replaced into streaming medium content A or B, when retaining streaming medium content A, the hop count of reduction
It is 10, when retaining streaming medium content B, the hop count of reduction is 20, and in this case, retaining streaming medium content B can more drop
Average hop count in low NDN networks, therefore, the caching value of the streaming medium content B cached are higher than the stream cached
Media content A.And in caching is worth and generates model, caching value Pi nWith hop count HopnIt is proportional relationship, is accessing
When frequency is identical, the caching value of streaming medium content B is higher than the streaming medium content A cached, subsequently by stream matchmaker to be cached
Hold C in vivo and replace streaming medium content A, the average hop count in NDN networks can be reduced, the communication for reducing streaming medium content is prolonged
Late, be conducive to improve the caching effect of streaming medium content.
In embodiments of the present invention, when the access frequency of streaming medium content is identical, it is few preferentially to replace jump hop count
Streaming medium content, the streaming medium content more than reserved route hop count, so as to avoid there is replacing the stream matchmaker more than hop count
Be conducive to the caching effect for improving streaming medium content the case where holding in vivo, the communication delay of streaming medium content is caused to increase.
Embodiment two
Corresponding to the method described in foregoing embodiments one, with reference to figure 2, Fig. 2 is a kind of stream matchmaker provided in an embodiment of the present invention
The structure diagram for holding buffer storage in vivo, is applied to terminal device, terminal device includes but not limited to NDN routers, computer
And cloud server.For purposes of illustration only, only the parts related to this embodiment are shown.For convenience of description, illustrate only with
The relevant part of the present embodiment.
With reference to Fig. 2, which includes:
Streaming medium content acquisition module 21, for obtaining streaming medium content to be cached by NDN networks;
Current cache space acquisition module 22, for obtaining current cache space;
Content name acquisition module 23, if cannot be accommodated in the Streaming Media to be cached for the current cache space
Hold, just the content name of streaming medium content to be cached described in acquisition;
Matching module 24, in the content storage table to prestore, by the content name of acquisition and the content name cached into
Row matching;
First acquisition module 25, if for matching it is unsuccessful, just obtain the streaming medium content cached hop count,
Requested number;
Caching value generation module 26, for generating model, the Streaming Media cached using preset caching value
The hop count of content is requested number, the corresponding caching value of the streaming medium content cached described in generation;
Minimal cache value capture module 27 obtains minimal cache value for being ranked up to caching value;
Second acquisition module 28, it is corresponding in the streaming medium content cached, obtaining minimal cache value
Streaming medium content;
Streaming medium content cache module 29, the storage location for being worth corresponding streaming medium content in the minimal cache
In, it is written by the streaming medium content to be cached, so that the streaming medium content to be cached replaces the minimal cache
It is worth corresponding streaming medium content;
Wherein, the caching value generation model is specially:
Wherein,Indicate the caching value of the streaming medium content n cached when period i;N indicates the Streaming Media cached
The serial number of content, n value ranges are 1 to N, and N is the total number of the streaming medium content cached;It indicates in the upper of period i
When one period, the caching of the streaming medium content n cached is worth;HopnIt is jumped for the routing of the streaming medium content n cached
Number indicates NDN routers and the hop count between source server where the streaming medium content n cached;Requestn
When indicating period i, the requested number of the streaming medium content n cached;TmIndicate the streaming medium content n cached requested time
Several weights, Tm=m*t, m are preset constant, and t is preset cycle duration.
As a kind of realization method of the present embodiment, in the streaming medium content buffer storage, the streaming medium content obtains
Modulus block is specifically used for:
By NDN network received data packets, cache tag position is extracted in the data packet;
Judge whether the value of the cache tag position is 1;
If the value of the cache tag position is 1, just in the data packet, streaming medium content to be cached is obtained;
Alternatively, the streaming medium content acquisition module is specifically used for:
By NDN network received data packets, cache tag position is extracted in the data packet;
Judge whether the value of the cache tag position is 0;
If the value of the cache tag position is 0, just in the data packet, streaming medium content to be cached is obtained.
As a kind of realization method of the present embodiment, in the streaming medium content buffer storage, the content name obtains mould
Block is specifically used for:
If the current cache space cannot accommodate the streaming medium content to be cached, the Streaming Media cached is obtained
Minimum cache-time of the content in current cache space;
Judge whether the minimum cache-time is more than 30 seconds;
If the minimum cache-time is more than 30 seconds, with regard to the content name of streaming medium content to be cached described in acquisition;
Wherein, if current cache space cannot accommodate the streaming medium content to be cached, acquisition has been delayed
Minimum cache-time of the streaming medium content deposited in current cache space, specially:
If the current cache space cannot accommodate the streaming medium content to be cached, the Streaming Media cached is obtained
Cache-time of the content in current cache space;
The cache-time is ranked up, according to ranking results, obtains the streaming medium content cached in current cache
Minimum cache-time in space.
In embodiments of the present invention, when the access frequency of streaming medium content is identical, it is few preferentially to replace jump hop count
Streaming medium content, the streaming medium content more than reserved route hop count, so as to avoid there is replacing the stream matchmaker more than hop count
Be conducive to the caching effect for improving streaming medium content the case where holding in vivo, the communication delay of streaming medium content is caused to increase.
Embodiment three
Fig. 3 is a kind of schematic diagram of streaming medium content buffer storage provided in an embodiment of the present invention.As shown in figure 3, the reality
A kind of streaming medium content buffer storage 3 for applying example includes:It processor 30, memory 31 and is stored in the memory 31 simultaneously
The computer program 32 that can be run on the processor 30, such as a kind of streaming medium content cache program.The processor 30
The step in a kind of above-mentioned each streaming medium content caching method embodiment is realized when executing the computer program 32.
Illustratively, the computer program 32 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 31, and are executed by the processor 30, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for
Implementation procedure of the computer program 32 in a kind of streaming medium content buffer storage 3 is described.
A kind of streaming medium content buffer storage 3 can be that the calculating such as NDN routers, computer and cloud server are set
It is standby.A kind of streaming medium content buffer storage may include, but be not limited only to, processor 30, memory 31.
It will be understood by those skilled in the art that Fig. 3 is only a kind of example of streaming medium content buffer storage 3, not structure
A kind of restriction of pairs of streaming medium content buffer storage 3, may include components more more or fewer than diagram, or combine certain
Component or different components, such as a kind of streaming medium content buffer storage can also include input-output equipment, network
Access device, bus etc..
Alleged processor 30 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor
Deng.
The memory 31 can be a kind of internal storage unit of streaming medium content buffer storage 3, such as a kind of
The hard disk or memory of streaming medium content buffer storage 3.The memory 31 can also be a kind of streaming medium content caching dress
Set the plug-in type hard disk being equipped on 3 External memory equipment, such as a kind of streaming medium content buffer storage 3, intelligent storage
Block (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..
Further, the memory 31 can also both include a kind of streaming medium content buffer storage 3 internal storage unit or
Including External memory equipment.The memory 31 is for storing the computer program and a kind of streaming medium content caching
Other programs needed for device and data.The memory 31, which can be also used for temporarily storing, have been exported or will export
Data.It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function
The division progress of unit, module, can be as needed and by above-mentioned function distribution by different work(for example, in practical application
Energy unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, to complete above retouch
The all or part of function of stating.Each functional unit, module in embodiment can be integrated in a processing unit, can also
It is that each unit physically exists alone, can also be during two or more units be integrated in one unit, above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.In addition, each functional unit,
The specific name of module is also only to facilitate mutually distinguish, the protection domain being not intended to limit this application.In above system
The specific work process of unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
A kind of computer storage media is provided in another embodiment of the invention, and the computer storage media is stored with
Computer program, the computer program realize a kind of above-mentioned each streaming medium content caching method implementation when being executed by processor
Step in example.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment
The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that lists described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is implemented in hardware or software, depends on the specific application and design constraint of technical solution.Professional technician
Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed
The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device and method can pass through others
Mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the module or unit,
Only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component can be with
In conjunction with or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed
Mutual coupling or direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING of device or unit or
Communication connection can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple
In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or
In use, can be stored in a computer read/write memory medium.Based on this understanding, the present invention realizes above-mentioned implementation
All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program
Calculation machine program can be stored in a computer storage media, and the computer program is when being executed by processor, it can be achieved that above-mentioned each
The step of a embodiment of the method..Wherein, the computer program includes computer program code, the computer program code
Can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium can
To include:Can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disc,
CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random
Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the computer
The content that readable medium includes can carry out increase and decrease appropriate according to legislation in jurisdiction and the requirement of patent practice, such as
In certain jurisdictions, according to legislation and patent practice, computer-readable medium is including being electric carrier signal and telecommunications letter
Number.
Described device can be the computing devices such as desktop PC, notebook, palm PC and cloud server.It is described
Device may include, but be not limited only to, processor, memory.It will be understood by those skilled in the art that the schematic diagram is only to fill
The example set, the not restriction of structure twin installation may include than illustrating more or fewer components, or the certain portions of combination
Part or different components, such as described device can also include input-output equipment, network access equipment, bus etc..
Alleged processor can be central processing unit (Central Processing Unit, CPU), can also be it
His general processor, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor
Deng the processor is the control centre of described device, utilizes the various pieces of various interfaces and connection whole device.
The memory can be used for storing the computer program and/or module, and the processor is by running or executing
Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization
The various functions of device.The memory can include mainly storing program area and storage data field, wherein storing program area can deposit
Store up the application program (such as sound-playing function, image player function etc.) etc. needed for operating system, at least one function;Storage
Data field can be stored uses created data (such as audio data, phone directory etc.) etc. according to mobile phone.In addition, memory can
Can also include nonvolatile memory, such as hard disk, memory, plug-in type hard disk, intelligence to include high-speed random access memory
Energy storage card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash
Card), at least one disk memory, flush memory device or other volatile solid-state parts.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality
Applying example, invention is explained in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each
Technical solution recorded in embodiment is modified or equivalent replacement of some of the technical features;And these are changed
Or replace, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution should all
It is included within protection scope of the present invention.
Claims (10)
1. a kind of streaming medium content caching method, which is characterized in that including:
NDN routers obtain streaming medium content to be cached by NDN networks;
Obtain current cache space;
If the current cache space cannot accommodate the streaming medium content to be cached, with regard to stream matchmaker to be cached described in acquisition
The content name held in vivo;
In the content storage table to prestore, the content name of acquisition is matched with the content name cached;
If matching is unsuccessful, the hop count of the streaming medium content cached, requested number are just obtained;
Model, the hop count of the streaming medium content cached, requested number are generated using preset caching value, it is raw
At the corresponding caching value of the streaming medium content cached;
Caching value is ranked up, minimal cache value is obtained;
In the streaming medium content cached, obtains minimal cache and be worth corresponding streaming medium content;
In the storage location that the minimal cache is worth corresponding streaming medium content, write-in will be in the Streaming Media be cached
Hold, so that the streaming medium content to be cached replaces the minimal cache and is worth corresponding streaming medium content;
Wherein, the caching value generation model is specially:
Wherein,Indicate the caching value of the streaming medium content n cached when period i;N indicates the streaming medium content cached
Serial number, n value ranges are 1 to N, and N is the total number of the streaming medium content cached;Indicated the upper period in period i
When, the caching value of the streaming medium content n cached;HopnFor the hop count of the streaming medium content n cached, indicate
NDN routers and the hop count between source server where the streaming medium content n cached;RequestnIndicate the period
When i, the requested number of the streaming medium content n cached;TmIndicate that the streaming medium content n cached is requested the power of number
Weight, Tm=m*t, m are preset constant, and t is preset cycle duration.
2. the method as described in claim 1, which is characterized in that the NDN routers obtain stream to be cached by NDN networks
Media content, specially:
NDN routers extract cache tag position by NDN network received data packets in the data packet;
Judge whether the value of the cache tag position is 1;
If the value of the cache tag position is 1, just in the data packet, streaming medium content to be cached is obtained.
3. the method as described in claim 1, which is characterized in that the NDN routers obtain stream to be cached by NDN networks
Media content, specially:
NDN routers extract cache tag position by NDN network received data packets in the data packet;
Judge whether the value of the cache tag position is 0;
If the value of the cache tag position is 0, just in the data packet, streaming medium content to be cached is obtained.
4. the method as described in claim 1, which is characterized in that if current cache space cannot accommodate described wait for
The streaming medium content of caching, the content name of streaming medium content to be cached described in acquisition, specially:
If the current cache space cannot accommodate the streaming medium content to be cached, the streaming medium content cached is obtained
Minimum cache-time in current cache space;
Judge whether the minimum cache-time is more than 30 seconds;
If the minimum cache-time is more than 30 seconds, with regard to the content name of streaming medium content to be cached described in acquisition.
5. method as claimed in claim 4, which is characterized in that if current cache space cannot accommodate described wait for
The streaming medium content of caching obtains minimum cache-time of the streaming medium content cached in current cache space, specially:
If the current cache space cannot accommodate the streaming medium content to be cached, the streaming medium content cached is obtained
Cache-time in current cache space;
The cache-time is ranked up, according to ranking results, obtains the streaming medium content cached in current cache space
In minimum cache-time.
6. a kind of streaming medium content buffer storage, which is characterized in that including:
Streaming medium content acquisition module, for obtaining streaming medium content to be cached by NDN networks;
Current cache space acquisition module, for obtaining current cache space;
Content name acquisition module, if the streaming medium content to be cached cannot be accommodated for the current cache space, just
The content name of streaming medium content to be cached described in acquisition;
Matching module, in the content storage table to prestore, the content name of acquisition to be matched with the content name cached;
First acquisition module just obtains the hop count of the streaming medium content cached, is requested if unsuccessful for matching
Number;
Caching value generation module, for generating model, the streaming medium content cached using preset caching value
Hop count is requested number, the corresponding caching value of the streaming medium content cached described in generation;
Minimal cache value capture module obtains minimal cache value for being ranked up to caching value;
Second acquisition module is worth corresponding Streaming Media in the streaming medium content cached, obtaining minimal cache
Content;
Streaming medium content cache module, in the storage location that the minimal cache is worth corresponding streaming medium content, writing
Enter the streaming medium content to be cached, so that the streaming medium content to be cached replaces the minimal cache value pair
The streaming medium content answered;
Wherein, the caching value generation model is specially:
Wherein,Indicate the caching value of the streaming medium content n cached when period i;N indicates the streaming medium content cached
Serial number, n value ranges are 1 to N, and N is the total number of the streaming medium content cached;Indicated the upper period in period i
When, the caching value of the streaming medium content n cached;HopnFor the hop count of the streaming medium content n cached, indicate
NDN routers and the hop count between source server where the streaming medium content n cached;RequestnIndicate the period
When i, the requested number of the streaming medium content n cached;TmIndicate that the streaming medium content n cached is requested the power of number
Weight, Tm=m*t, m are preset constant, and t is preset cycle duration.
7. device as claimed in claim 6, which is characterized in that the streaming medium content acquisition module is specifically used for:
By NDN network received data packets, cache tag position is extracted in the data packet;
Judge whether the value of the cache tag position is 1;
If the value of the cache tag position is 1, just in the data packet, streaming medium content to be cached is obtained;
Alternatively, the streaming medium content acquisition module is specifically used for:
By NDN network received data packets, cache tag position is extracted in the data packet;
Judge whether the value of the cache tag position is 0;
If the value of the cache tag position is 0, just in the data packet, streaming medium content to be cached is obtained.
8. device as claimed in claim 6, which is characterized in that the content name acquisition module is specifically used for:
If the current cache space cannot accommodate the streaming medium content to be cached, the streaming medium content cached is obtained
Minimum cache-time in current cache space;
Judge whether the minimum cache-time is more than 30 seconds;
If the minimum cache-time is more than 30 seconds, with regard to the content name of streaming medium content to be cached described in acquisition;
Wherein, if current cache space cannot accommodate the streaming medium content to be cached, what acquisition had cached
Minimum cache-time of the streaming medium content in current cache space, specially:
If the current cache space cannot accommodate the streaming medium content to be cached, the streaming medium content cached is obtained
Cache-time in current cache space;
The cache-time is ranked up, according to ranking results, obtains the streaming medium content cached in current cache space
In minimum cache-time.
9. a kind of streaming medium content buffer storage, including memory, processor and it is stored in the memory and can be in institute
State the computer program run on processor, which is characterized in that the processor is realized when executing the computer program as weighed
Profit requires the step of any one of 1 to 5 the method.
10. a kind of computer storage media, the computer storage media is stored with computer program, which is characterized in that described
It is realized when computer program is executed by processor such as the step of any one of claim 1 to 5 the method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810368101.2A CN108551485A (en) | 2018-04-23 | 2018-04-23 | A kind of streaming medium content caching method, device and computer storage media |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810368101.2A CN108551485A (en) | 2018-04-23 | 2018-04-23 | A kind of streaming medium content caching method, device and computer storage media |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108551485A true CN108551485A (en) | 2018-09-18 |
Family
ID=63512344
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810368101.2A Withdrawn CN108551485A (en) | 2018-04-23 | 2018-04-23 | A kind of streaming medium content caching method, device and computer storage media |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108551485A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111107000A (en) * | 2019-12-13 | 2020-05-05 | 东南大学 | Content caching method in named data network based on network coding |
CN112039781A (en) * | 2020-09-09 | 2020-12-04 | 北京同创神州航天科技有限公司 | Named data network forwarding method based on flow control |
CN114070840A (en) * | 2020-07-30 | 2022-02-18 | 中移(苏州)软件技术有限公司 | Storage method, device and storage medium |
-
2018
- 2018-04-23 CN CN201810368101.2A patent/CN108551485A/en not_active Withdrawn
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111107000A (en) * | 2019-12-13 | 2020-05-05 | 东南大学 | Content caching method in named data network based on network coding |
CN111107000B (en) * | 2019-12-13 | 2021-09-07 | 东南大学 | Content caching method in named data network based on network coding |
CN114070840A (en) * | 2020-07-30 | 2022-02-18 | 中移(苏州)软件技术有限公司 | Storage method, device and storage medium |
CN114070840B (en) * | 2020-07-30 | 2024-04-09 | 中移(苏州)软件技术有限公司 | Storage method, device and storage medium |
CN112039781A (en) * | 2020-09-09 | 2020-12-04 | 北京同创神州航天科技有限公司 | Named data network forwarding method based on flow control |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107992356A (en) | Block chain affairs block processes method, electronic device and readable storage medium storing program for executing | |
CN104092756B (en) | A kind of resource dynamic distributing method of the cloud storage system based on DHT mechanism | |
CN103338252B (en) | Realizing method of distributed database concurrence storage virtual request mechanism | |
CN108683720A (en) | A kind of container cluster service configuration method and device | |
US9042252B2 (en) | Inter-packet interval prediction learning algorithm | |
CN108551485A (en) | A kind of streaming medium content caching method, device and computer storage media | |
CN108027789A (en) | The service quality of interconnection piece with multistage arbitration | |
CN108667777A (en) | A kind of service chaining generation method and network function composer NFVO | |
CN105740178B (en) | Chip network system with and forming method thereof | |
CN108418874A (en) | Guiding method, device, computer equipment and storage medium are returned across wide area network data | |
CN108259603A (en) | A kind of load-balancing method and device | |
CN104866339A (en) | Distributed persistent management method, system and device of FOTA data | |
CN110474845A (en) | Flow entry eliminates method and relevant apparatus | |
CN109327511A (en) | A kind of data request method and server based on http protocol | |
CN108924203A (en) | Data copy self-adapting distribution method, distributed computing system and relevant device | |
CN108650306A (en) | A kind of game video caching method, device and computer storage media | |
CN113328953B (en) | Method, device and storage medium for network congestion adjustment | |
CN103248636B (en) | The system and method downloaded offline | |
CN106294191B (en) | The method for handling table, the method and apparatus for accessing table | |
CN111597041B (en) | Calling method and device of distributed system, terminal equipment and server | |
CN114070791B (en) | Speed limiting processing method and device for data traffic | |
CN109933595A (en) | A kind of internet of things equipment information sharing system, device and terminal device | |
CN108540569A (en) | A kind of software installation packet replacement method, device and computer storage media | |
CN108763517A (en) | A kind of method and relevant device for deleting metadata | |
CN102902593B (en) | Agreement distributing and processing system based on caching mechanism |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180918 |