CN110099134A - Video file method for down loading, device, electronic equipment and storage medium - Google Patents

Video file method for down loading, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110099134A
CN110099134A CN201910482804.2A CN201910482804A CN110099134A CN 110099134 A CN110099134 A CN 110099134A CN 201910482804 A CN201910482804 A CN 201910482804A CN 110099134 A CN110099134 A CN 110099134A
Authority
CN
China
Prior art keywords
video file
downloading
video
file
download
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910482804.2A
Other languages
Chinese (zh)
Other versions
CN110099134B (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.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething 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 Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Publication of CN110099134A publication Critical patent/CN110099134A/en
Application granted granted Critical
Publication of CN110099134B publication Critical patent/CN110099134B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

A kind of video file method for down loading, which comprises the head file of to download video files from content distributing network CDN node;According to the head file, the download time point of the video file is determined;Calculate the time difference of the play time of the download time point and the video file;According to the time difference, the downloading mode that the video file currently needs is determined;The video data of the video file is downloaded using the downloading mode;Wherein, the downloading mode includes: the CDN node downloading, or, the CDN node and user node mixing downloading, or, the user node is downloaded.The present invention also provides a kind of video file download apparatus, electronic equipment and storage mediums.The present invention under the premise of each bit-rate video smooth playing, can reduce the bandwidth cost of CDN node.

Description

Video file method for down loading, device, electronic equipment and storage medium
Technical field
The present invention relates to video technique field more particularly to a kind of video file method for down loading, device, electronic equipment and deposit Storage media.
Background technique
Current major video website is all using P2P (Chinese name: peer-to-peer network, full name in English: Peer to Peer) Technology drops to save CDN (Chinese name: content distributing network, full name in English: Content Delivery Network) bandwidth Low cost determined whether by play position and the document misregistration difference of download location using CDN node downloading data, but This mode is limited to the code rate of video, effective cannot meet the video smooth playing of each code rate, such as onesize Document misregistration difference, the duration that can be played for high bit-rate video is shorter (video file cached in advance is too short), can lead Cause high bit-rate video play time and download time point it is close in addition be overlapped when still use CDN node downloading data, Ke Nengzao At broadcasting Caton;And longer (the caching in advance of duration that an equal amount of document misregistration difference can play low bit-rate video Video file it is too long), low bit-rate video slave CDN source server downloading excessive when playing increases bandwidth cost.
Therefore, how under the premise of each bit-rate video smooth playing, the bandwidth cost for reducing CDN node is this field skill Art personnel's technical issues that need to address.
Summary of the invention
In view of the foregoing, it is necessary to a kind of video file method for down loading, device, electronic equipment and storage medium are provided, Under the premise of each bit-rate video smooth playing, the bandwidth cost of CDN node can be reduced.
The first aspect of the present invention provides a kind of video file method for down loading, which comprises
The head file of to download video files from content distributing network CDN node;
According to the head file, the download time point of the video file is determined;
Calculate the time difference of the play time of the download time point and the video file;
According to the time difference, the downloading mode that the video file currently needs is determined;
The video data of the video file is downloaded using the downloading mode;Wherein, the downloading mode includes: described CDN node downloading, or, the CDN node and user node mixing downloading, or, the user node is downloaded.
In one possible implementation, described according to the time difference, determine what the video file currently needed Downloading mode includes:
If the time difference is less than or equal to first time threshold, the downloading mode that presently described video file needs is determined For CDN node downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the CDN node.
In one possible implementation, described according to the time difference, determine what the video file currently needed Downloading mode includes:
If the time difference is greater than first time threshold, and the time difference is less than or equal to second time threshold, determines The downloading mode that presently described video file needs is the CDN node and user node mixing downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the CDN node and user node mixing.
In one possible implementation, described according to the time difference, determine what the video file currently needed Downloading mode includes:
If the time difference is greater than second time threshold, and the time difference is less than or equal to third time threshold, determines The downloading mode that presently described video file needs is user node downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the user node.
In one possible implementation, the method also includes:
If the time difference is greater than third time threshold, stop the video data for downloading the video file.
In one possible implementation, described according to the head file, when determining the downloading of the video file Between point include:
The file offset address of the video file and the corresponding relationship at time point are obtained from the head file;
Obtain file destination offset address corresponding to the current download location of the video file;
According to the corresponding relationship, the corresponding object time point of the file destination offset address is determined as the video The download time point of file.
In one possible implementation, the video file is order video file or to download video files.
The second aspect of the present invention provides a kind of video file download apparatus, and the video file download apparatus includes:
Download module, the head file for the to download video files from content distributing network CDN node;
First determining module, for determining the download time point of the video file according to the head file;
Computing module, the time difference of the play time for calculating the download time point and the video file;
Second determining module, for determining the downloading mode that the video file currently needs according to the time difference;
The download module is also used for the video data that the downloading mode downloads the video file;Wherein, institute Stating downloading mode includes: the CDN node downloading, or, the CDN node and user node mixing downloading, or, the user saves Point downloading.
The third aspect of the present invention provides a kind of electronic equipment, and the electronic equipment includes processor and memory, described Processor realizes the video file method for down loading when being used to execute the computer program stored in the memory.
The fourth aspect of the present invention provides a kind of computer readable storage medium, deposits on the computer readable storage medium Computer program is contained, the video file method for down loading is realized when the computer program is executed by processor.
By above technical scheme, in the present invention, can first from content distributing network CDN node to download video files head Portion's file determines the download time point of the video file according to the head file;Further, when calculating the downloading Between point and the play time of the video file time difference;It further, can be according to the time difference, described in determination The downloading mode that video file currently needs, and download using the downloading mode video data of the video file;Wherein, The downloading mode includes: the CDN node downloading, or, the CDN node and user node mixing downloading, or, the user Node downloading.As it can be seen that in the present invention, it can be by calculating the download time point and the play time of the video file Under time difference selects different downloading modes according to the different time differences in entire downloading process, and then use is appropriate Load mode carrys out the video data of to download video files, so as under the premise of each bit-rate video smooth playing, reduce CDN section The bandwidth cost of point.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of the preferred embodiment of video file method for down loading disclosed by the invention.
Fig. 2 is a kind of schematic diagram of the download phase of video file disclosed by the invention.
Fig. 3 is a kind of functional block diagram of the preferred embodiment of video file download apparatus disclosed by the invention.
Fig. 4 is the structural schematic diagram of the electronic equipment for the preferred embodiment that the present invention realizes video file method for down loading.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real Applying example, the present invention will be described in detail.It should be noted that in the absence of conflict, the embodiment of the present invention and embodiment In feature can be combined with each other.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool The purpose of the embodiment of body, it is not intended that in the limitation present invention.
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real Applying mode, the present invention is described in further detail.
Wherein, the electronic equipment includes that one kind can be automatic to carry out numerical value meter according to the instruction for being previously set or storing It calculates and/or the electronic equipment of information processing, hardware includes but is not limited to microprocessor, specific integrated circuit (ASIC), can compile Journey gate array (FPGA), digital processing unit (DSP), embedded device etc..The electronic equipment may also include the network equipment and/or User equipment.Wherein, the network equipment includes but is not limited to the service of single network server, multiple network servers composition Device group or the cloud being made of a large amount of hosts or network server for being based on cloud computing (Cloud Computing), wherein cloud computing It is one kind of distributed computing, a super virtual computer consisting of a loosely coupled set of computers.The user Equipment include but is not limited to any one can with user by the modes such as keyboard, mouse, remote controler, touch tablet or voice-operated device into The electronic product of row human-computer interaction, for example, personal computer, tablet computer, smart phone, personal digital assistant PDA, game Machine, Interactive Internet TV IPTV, intellectual wearable device etc..Wherein, net locating for the user equipment and the network equipment Network includes but is not limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, Virtual Private Network VPN etc..
Referring to Figure 1, Fig. 1 is a kind of flow chart of the preferred embodiment of video file method for down loading disclosed by the invention. Wherein, the sequence of step can change in the flow chart according to different requirements, and certain steps can be omitted.
The head file of S11, electronic equipment to download video files from content distributing network CDN node.
Wherein, the purpose of CDN (Content Delivery Network, content distributing network) is by existing Increase by one layer of new network architecture in Internet, the content of website is published to the network " edge " closest to user, uses Family can obtain required content nearby, improve the response speed that user accesses website.
Wherein, the CDN node includes traditional CDN source server and fringe node, and the video file is program request Video file or to download video files, such as MP4 video file.
In the embodiment of the present invention, when receiving the online playing request of video file, electronic equipment can be from content point The head file of to download video files in hairnet network CDN node.Wherein, the video file is broadly divided into video head and video Two parts of data, wherein the video head includes therefore the corresponding relationship of file offset address and time point is obtaining To after the head file of video file, the corresponding relationship in head file can use, determine any file of video file The corresponding download time point of offset address.
S12, electronic equipment determine the download time point of the video file according to the head file.
Wherein, the download time point is the current download location corresponding time point of the video file, such as described The total duration of video file is 60 seconds, and current download time point is 5 seconds, i.e., the described video file is in 5 seconds positions.Its In, the download time point is real-time variable, i.e., changes with the progress of downloading.
Specifically, it is described according to the head file, determine that the download time point of the video file includes:
The file offset address of the video file and the corresponding relationship at time point are obtained from the head file;
Obtain file destination offset address corresponding to the current download location of the video file;
According to the corresponding relationship, the corresponding object time point of the file destination offset address is determined as the video The download time point of file.
Wherein, electronic equipment is after the head file that content distributing network CDN node gets the video file The file offset address of the video file and the corresponding relationship at time point are obtained from the head file, wherein described right It should be related to and contain each byte location (i.e. file offset address) corresponding time point of the video file.Electronic equipment can To obtain file destination offset address corresponding to current download location, and according to the corresponding relationship, the target text is determined The object time point can be determined as current download time point by the corresponding object time point of part offset address.
S13, electronic equipment calculate the time difference of the play time of the download time point and the video file.
Wherein it is possible to the play time of presently described video file is obtained by player, the play time The playing duration of i.e. presently described video file, wherein the play time is real-time variable, i.e., the described play time meeting It changes with the progress of broadcasting.
Wherein, the length of the time difference can be understood as currently having downloaded but the video file not played can also be broadcast The duration put.
S14, electronic equipment determine the downloading mode that the video file currently needs according to the time difference.
Wherein, the downloading mode includes: the CDN node downloading, or, under the CDN node and user node mixing It carries, or, the user node is downloaded.Wherein, the user node uses P2P (Peer to Peer, peer-to-peer network) to carry out The personal slack resources node of data transmission, for example play objective cloud node Peer.
Wherein, the speed using CDN node foradownloaded video data is fast, can satisfy the urgent need of video data, utilizes CDN node downloads the bandwidth occupancy that can reduce CDN.
Wherein it is possible to which the online request downloading process of the video file is divided into (such as 4 ranks of multiple stages in advance Section), the corresponding downloading section of each stage, which is time range belonging to the time difference, each download area Between time range can indicate that different downloading modes can be used to download in different downloading sections with time threshold State the video data of video file.
It is a kind of schematic diagram of the download phase of video file disclosed by the invention please also refer to Fig. 2, Fig. 2.Such as Fig. 2 institute Show, the online request downloading process of the video file is divided into 4 stages, i.e. the first download phase, the second download phase, third Download phase and the 4th download phase.
Wherein, in the first download phase, since the head file of video file can only be obtained from the CDN node, Moreover, more stable by CDN node downloading, rate is very fast, therefore, when just starting to play the video file, is Ensure the player timely and smooth broadcasting video file, needs to save in first download phase using the CDN Point is downloaded.Wherein, the corresponding downloading section of first download phase can be set to the time difference and be less than or equal to First time threshold (such as 2 seconds).
Wherein, described in order to reduce due to having there is certain video data to provide broadcasting in the second download phase The bandwidth cost of CDN node can use the CDN node and user node mixing downloading in the second download phase;Its In, the corresponding downloading section of second download phase can be set to the time difference greater than first time threshold (such as 2 Second), and the time difference is less than or equal to second time threshold (such as 5 seconds).
Wherein, in third download phase, so fast speed of download is not needed, in order to further reduce the CDN The bandwidth cost of node can be downloaded in third download phase using the user node;Wherein, the third download phase pair The downloading section answered can be set to the time difference greater than second time threshold (such as 5 seconds), and the time difference be less than or Equal to third time threshold (such as 60 seconds).
Wherein, in the 4th download phase, broadcasting is provided due to having sufficient data, to avoid being cached more videos Data cause stored memory excessive, can stop downloading in the 4th download phase, wherein under the 4th download phase is corresponding Carrying section can be set to the time difference greater than third time threshold (such as 60 seconds).
Later, in a manner mentioned above, time point to be downloaded and the time difference of play time become smaller, further according to the time Difference is determined the section of download time belonging to current downloading process, and is downloaded using corresponding downloading mode, until the video Until the video data of file has all been downloaded.
Specifically, described according to the time difference, the downloading mode for determining that the video file currently needs includes:
If the time difference is less than or equal to first time threshold, the downloading mode that presently described video file needs is determined For CDN node downloading.
Wherein, when calculating the time difference less than or equal to first time threshold, presently described video can be determined The downloading process of file belongs to the first download phase, that is, can determine the corresponding downloading mode (CDN of first download phase Node downloading) it is the downloading mode that the video file needs.
Specifically, described according to the time difference, the downloading mode for determining that the video file currently needs includes:
If the time difference is greater than first time threshold, and the time difference is less than or equal to second time threshold, determines The downloading mode that presently described video file needs is the CDN node and user node mixing downloading.
Wherein, when calculating the time difference greater than first time threshold, and when the time difference is less than or equal to second Between threshold value when, can determine that the downloading process of presently described video file belongs to the second download phase, that is, can determine described second The corresponding downloading mode of download phase (CDN node and user node mixing downloading) is what the video file needed Downloading mode.
Specifically, described according to the time difference, the downloading mode for determining that the video file currently needs includes:
If the time difference is greater than second time threshold, and the time difference is less than or equal to third time threshold, determines The downloading mode that presently described video file needs is user node downloading.
Wherein, when calculating the time difference greater than second time threshold, and when the time difference is less than or equal to third Between threshold value when, can determine that the downloading process of presently described video file belongs to third download phase, that is, can determine the third The corresponding downloading mode of download phase (the user node downloading) is the downloading mode that the video file needs.
As an alternative embodiment, the method also includes:
If the time difference is greater than third time threshold, stop the video data for downloading the video file.
It should be noted that above-mentioned first time threshold, second time threshold and third time threshold are to first pass through in advance What test of many times obtained, the first time threshold is less than the second time threshold, and the second time threshold is less than described Third time threshold.
S15, electronic equipment download the video data of the video file using the downloading mode.
Wherein, after determining the downloading mode that presently described video file needs, electronic equipment can be used it is described under Load mode downloads the video data of the video file.
If the downloading mode is CDN node downloading, electronic equipment be can be used described in the CDN node downloading The video data of video file.
If the downloading mode is the CDN node and user node mixing downloading, electronic equipment be can be used The video data of the video file is downloaded in the CDN node and user node mixing.
If the downloading mode is user node downloading, user node downloading institute is can be used in electronic equipment State the video data of video file.
Wherein, it by calculating the time difference of download time point and play time, is determined described in use by the time difference CDN node foradownloaded video data, or the user node foradownloaded video data are used, it can be in the quality of the user node In the case where bad, the mode for reserving the downloading of CDN node described in sufficient time switchback carrys out complementing video data, ensure that each code Rate video playing is smooth, and use CDN node foradownloaded video data few as far as possible, reduces CDN bandwidth, save the cost.
In the method flow described in Fig. 1, can first from content distributing network CDN node to download video files head Portion's file determines the download time point of the video file according to the head file;Further, when calculating the downloading Between point and the play time of the video file time difference;It further, can be according to the time difference, described in determination The downloading mode that video file currently needs, and download using the downloading mode video data of the video file;Wherein, The downloading mode includes: the CDN node downloading, or, the CDN node and user node mixing downloading, or, the user Node downloading.As it can be seen that in the present invention, it can be by calculating the download time point and the play time of the video file Under time difference selects different downloading modes according to the different time differences in entire downloading process, and then use is appropriate Load mode carrys out the video data of to download video files, so as under the premise of each bit-rate video smooth playing, reduce CDN section The bandwidth cost of point.
The above is only a specific embodiment of the invention, but scope of protection of the present invention is not limited thereto, for For those skilled in the art, without departing from the concept of the premise of the invention, improvement, but these can also be made It all belongs to the scope of protection of the present invention.
Fig. 3 is referred to, Fig. 3 is a kind of functional module of the preferred embodiment of video file download apparatus disclosed by the invention Figure.
In some embodiments, the video file download apparatus is run in electronic equipment.The video file downloading Device may include multiple functional modules as composed by program code segments.Each program in the video file download apparatus The program code of section can store in memory, and as performed by least one processor, to execute video described in Fig. 1 Step some or all of in document down loading method.
In the present embodiment, function of the video file download apparatus according to performed by it can be divided into multiple function It can module.The functional module may include: that download module 301, the first determining module 302, computing module 303 and second are determining Module 304.The so-called module of the present invention refers to that one kind performed by least one processor and can complete fixed function The series of computation machine program segment of energy, storage is in memory.It in some embodiments, will be rear about the function of each module It is described in detail in continuous embodiment.
Download module 301, the head file for the to download video files from content distributing network CDN node;
Wherein, the purpose of CDN (Content Delivery Network, content distributing network) is by existing Increase by one layer of new network architecture in Internet, the content of website is published to the network " edge " closest to user, uses Family can obtain required content nearby, improve the response speed that user accesses website.
Wherein, the CDN node includes traditional CDN source server and fringe node, and the video file is program request Video file or to download video files, such as MP4 video file.
In the embodiment of the present invention, when receiving the online playing request of video file, electronic equipment can be from content point The head file of to download video files in hairnet network CDN node.Wherein, the video file is broadly divided into video head and video Two parts of data, wherein the video head includes therefore the corresponding relationship of file offset address and time point is obtaining To after the head file of video file, the corresponding relationship in head file can use, determine any file of video file The corresponding download time point of offset address.
First determining module 302, for determining the download time point of the video file according to the head file;
Wherein, the download time point is the download location corresponding time point of presently described video file, such as described The total duration of video file is 60 seconds, and current download time point is 5 seconds, i.e., the described video file is in 5 seconds positions.
Specifically, it is described according to the head file, determine that the download time point of the video file includes:
The file offset address of the video file and the corresponding relationship at time point are obtained from the head file;
Obtain file destination offset address corresponding to the current download location of the video file;
According to the corresponding relationship, the corresponding object time point of the file destination offset address is determined as the video The download time point of file.
Wherein, electronic equipment is after the head file that content distributing network CDN node gets the video file The file offset address of the video file and the corresponding relationship at time point are obtained from the head file, wherein described right The each byte location (i.e. file offset address) for containing the video file should be related to corresponding time point.Electronic equipment File destination offset address corresponding to available current download location, and according to the corresponding relationship, determine the target The object time point can be determined as current download time point by the corresponding object time point of file offset address.
Computing module 303, the time difference of the play time for calculating the download time point and the video file;
Wherein it is possible to the play time of presently described video file is obtained by player, the play time The playing duration of i.e. presently described video file.
Wherein, the length of the time difference can be understood as currently having downloaded but the video file not played can also be broadcast The duration put.
Second determining module 304, for determining the downloading side that the video file currently needs according to the time difference Formula;
Wherein, the downloading mode includes: the CDN node downloading, or, under the CDN node and user node mixing It carries, or, the user node is downloaded.Wherein, the user node uses P2P (Peer to Peer, peer-to-peer network) to carry out The personal slack resources node of data transmission, for example play objective cloud node Peer.
Wherein, the speed using CDN node foradownloaded video data is fast, can satisfy the urgent need of video data, utilizes CDN node downloads the bandwidth occupancy that can reduce CDN.
Wherein it is possible to which the online request downloading process of the video file is divided into (such as 4 ranks of multiple stages in advance Section), the corresponding downloading section of each stage, which is time range belonging to the time difference, each download area Between time range can indicate that different downloading modes can be used to download in different downloading sections with time threshold State the video data of video file.
It is a kind of schematic diagram of the download phase of video file disclosed by the invention please also refer to Fig. 2, Fig. 2.Such as Fig. 2 institute Show, the online request downloading process of the video file is divided into 4 stages, i.e. the first download phase, the second download phase, third Download phase and the 4th download phase.
Wherein, in the first download phase, since the head file of video file can only be obtained from the CDN node, Moreover, more stable by CDN node downloading, rate is very fast, therefore, when just starting to play the video file, is Ensure the player timely and smooth broadcasting video file, needs to save in first download phase using the CDN Point is downloaded.Wherein, the corresponding downloading section of first download phase can be set to the time difference and be less than or equal to First time threshold (such as 2 seconds).
Wherein, described in order to reduce due to having there is certain video data to provide broadcasting in the second download phase The bandwidth cost of CDN node can use the CDN node and user node mixing downloading in the second download phase;Its In, the corresponding downloading section of second download phase can be set to the time difference greater than first time threshold (such as 2 Second), and the time difference is less than or equal to second time threshold (such as 5 seconds).
Wherein, in third download phase, so fast speed of download is not needed, in order to further reduce the CDN The bandwidth cost of node can be downloaded in third download phase using the user node;Wherein, the third download phase pair The downloading section answered can be set to the time difference greater than second time threshold (such as 5 seconds), and the time difference be less than or Equal to third time threshold (such as 60 seconds).
Wherein, in the 4th download phase, broadcasting is provided due to having sufficient data, to avoid being cached more videos Data cause stored memory excessive, can stop downloading in the 4th download phase, wherein under the 4th download phase is corresponding Carrying section can be set to the time difference greater than third time threshold (such as 60 seconds).
Later, in a manner mentioned above, time point to be downloaded and the time difference of play time become smaller, further according to the time Difference is determined the section of download time belonging to current downloading process, and is downloaded using corresponding downloading mode, until the video Until the video data of file has all been downloaded.
The download module 301 is also used for the video data that the downloading mode downloads the video file;Its In, the downloading mode includes: the CDN node downloading, or, the CDN node and user node mixing downloading, or, described User node downloading.
Specifically, second determining module 304 is according to the time difference, under determining that the video file currently needs Load mode includes:
If the time difference is less than or equal to first time threshold, the downloading mode that presently described video file needs is determined For CDN node downloading;
The download module 301 includes using the video data that the downloading mode downloads the video file:
The video data of the video file is downloaded using the CDN node.
Specifically, second determining module 304 is according to the time difference, under determining that the video file currently needs Load mode includes:
If the time difference is greater than first time threshold, and the time difference is less than or equal to second time threshold, determines The downloading mode that presently described video file needs is the CDN node and user node mixing downloading;
The download module 301 includes using the video data that the downloading mode downloads the video file:
The video data of the video file is downloaded using the CDN node and user node mixing.
Specifically, second determining module 304 is according to the time difference, under determining that the video file currently needs Load mode includes:
If the time difference is greater than second time threshold, and the time difference is less than or equal to third time threshold, determines The downloading mode that presently described video file needs is user node downloading;
The download module 301 includes using the video data that the downloading mode downloads the video file:
The video data of the video file is downloaded using the user node.
Optionally, the video file download apparatus further include:
Stopping modular stops the video for downloading the video file if being greater than third time threshold for the time difference Data.
Optionally, first determining module 302 determines the download time of the video file according to the head file It puts and includes:
Obtain the file offset address of the video file;
The corresponding relationship of file offset address and download time point is obtained from the head file;
According to the corresponding relationship, determine under the corresponding video file of the file offset address of the video file Carry time point.
Wherein, the video file is order video file or to download video files.
It, can the first foradownloaded video from content distributing network CDN node in the video file download apparatus described in Fig. 3 The head file of file determines the download time point of the video file according to the head file;Further, institute is calculated State the time difference of the play time of download time point and the video file;Further, can according to the time difference, It determines the downloading mode that the video file currently needs, and downloads the video counts of the video file using the downloading mode According to;Wherein, the downloading mode includes: the CDN node downloading, or, the CDN node and user node mixing downloading, or, The user node downloading.As it can be seen that the broadcasting of calculating the download time point and the video file can be passed through in the present invention The time difference at time point selects different downloading modes according to the different time differences, and then use in entire downloading process Appropriate downloading mode carrys out the video data of to download video files, so as under the premise of each bit-rate video smooth playing, Reduce the bandwidth cost of CDN node.
Fig. 4 is referred to, Fig. 4 is the structure of the electronic equipment for the preferred embodiment that the present invention realizes video file method for down loading Schematic diagram.The electronic equipment 4 includes memory 41, at least one processor 42, is stored in the memory 41 and can be The computer program 43 and at least one communication bus 44 run at least one described processor 42.
It will be understood by those skilled in the art that schematic diagram shown in Fig. 4 is only the example of the electronic equipment 4, not The restriction to the electronic equipment 4 is constituted, may include components more more or fewer than diagram, or combine certain components, or The different component of person, such as the electronic equipment 4 can also include input-output equipment, network access equipment etc..
The electronic equipment 4 further include but be not limited to any one can be with user by keyboard, mouse, remote controler, touch The modes such as plate or voice-operated device carry out the electronic product of human-computer interaction, for example, personal computer, tablet computer, smart phone, a Personal digital assistant (Personal Digital Assistant, PDA), game machine, Interactive Internet TV (Internet Protocol Television, IPTV), intellectual wearable device etc..Network locating for the electronic equipment 4 includes but not It is limited to internet, wide area network, Metropolitan Area Network (MAN), local area network, Virtual Private Network (Virtual Private Network, VPN) etc..
At least one described processor 42 can be central processing unit (Central Processing Unit, CPU), It can also be other general processors, digital signal processor (Digital Signal Processor, DSP), dedicated 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..The processor 42 can be microprocessor or the processor 42 is also possible to any conventional processor Deng the processor 42 is the control centre of the electronic equipment 4, utilizes various interfaces and the entire electronic equipment 4 of connection Various pieces.
The memory 41 can be used for storing the computer program 43 and/or module/unit, and the processor 42 passes through Operation executes the computer program and/or module/unit being stored in the memory 41, and calls and be stored in memory Data in 41 realize the various functions of the electronic equipment 4.The memory 41 can mainly include storing program area and storage Data field, wherein storing program area can application program needed for storage program area, at least one function (for example sound plays Function, image player function etc.) etc.;Storage data area, which can be stored, uses created data (such as sound according to electronic equipment 4 Frequency evidence, phone directory etc.) etc..In addition, memory 41 may include high-speed random access memory, it can also include non-volatile Memory, such as hard disk, memory, plug-in type hard disk, intelligent memory 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 part.
In conjunction with Fig. 1, the memory 41 in the electronic equipment 4 stores multiple instruction to realize under a kind of video file The multiple instruction can be performed to realize in support method, the processor 42:
The head file of to download video files from content distributing network CDN node;
According to the head file, the download time point of the video file is determined;
Calculate the time difference of the play time of the download time point and the video file;
According to the time difference, the downloading mode that the video file currently needs is determined;
The video data of the video file is downloaded using the downloading mode;Wherein, the downloading mode includes: described CDN node downloading, or, the CDN node and user node mixing downloading, or, the user node is downloaded.
It is described according to the time difference in a kind of optional embodiment, determine what the video file currently needed Downloading mode includes:
If the time difference is less than or equal to first time threshold, the downloading mode that presently described video file needs is determined For CDN node downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the CDN node.
It is described according to the time difference in a kind of optional embodiment, determine what the video file currently needed Downloading mode includes:
If the time difference is greater than first time threshold, and the time difference is less than or equal to second time threshold, determines The downloading mode that presently described video file needs is the CDN node and user node mixing downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the CDN node and user node mixing.
It is described according to the time difference in a kind of optional embodiment, determine what the video file currently needed Downloading mode includes:
If the time difference is greater than second time threshold, and the time difference is less than or equal to third time threshold, determines The downloading mode that presently described video file needs is user node downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the user node.
In a kind of optional embodiment, the method also includes:
If the time difference is greater than third time threshold, stop the video data for downloading the video file.
It is described according to the head file in a kind of optional embodiment, when determining the downloading of the video file Between point include:
The file offset address of the video file and the corresponding relationship at time point are obtained from the head file;
Obtain file destination offset address corresponding to the current download location of the video file;
According to the corresponding relationship, the corresponding object time point of the file destination offset address is determined as the video The download time point of file.
In a kind of optional embodiment, the video file is order video file or to download video files.
Specifically, the processor 42 can refer to the concrete methods of realizing of above-metioned instruction related in Fig. 1 corresponding embodiment The description of step, this will not be repeated here.
It, can the first to download video files from content distributing network CDN node in the electronic equipment 4 described in Fig. 4 Head file determines the download time point of the video file according to the head file;Further, the downloading is calculated The time difference of the play time of time point and the video file;Further, institute can be determined according to the time difference The downloading mode that video file currently needs is stated, and downloads the video data of the video file using the downloading mode;Its In, the downloading mode includes: the CDN node downloading, or, the CDN node and user node mixing downloading, or, described User node downloading.As it can be seen that the play time of calculating the download time point and the video file can be passed through in the present invention The time difference of point selects different downloading modes according to the different time differences, and then using appropriate in entire downloading process Downloading mode carry out the video data of to download video files, so as to reduce under the premise of each bit-rate video smooth playing The bandwidth cost of CDN node.
If the integrated module/unit of the electronic equipment 4 is realized in the form of SFU software functional unit and as independent Product when selling or using, can store in a computer readable storage medium.Based on this understanding, the present invention is real All or part of the process in existing above-described embodiment method, can also instruct relevant hardware come complete by computer program At the computer program can be stored in a computer readable storage medium, which is being executed by processor When, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, described Computer program code can be source code form, object identification code form, executable file or certain intermediate forms etc..The meter Calculation machine readable medium may include: can carry the computer program code any entity or device, recording medium, USB flash disk, Mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory Device (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs to illustrate It is that the content that the computer-readable medium includes can be fitted according to the requirement made laws in jurisdiction with patent practice When increase and decrease, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier wave letter Number and telecommunication signal.
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the module It divides, only a kind of logical function partition, there may be another division manner in actual implementation.
The module as illustrated by the separation member may or may not be physically separated, aobvious as module The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.Some or all of the modules therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
It, can also be in addition, each functional module in each embodiment of the present invention can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included in the present invention.Any attached associated diagram label in claim should not be considered as right involved in limitation to want It asks.Furthermore, it is to be understood that one word of " comprising " does not exclude other units or steps, odd number is not excluded for plural number.It is stated in system claims Multiple units or device can also be implemented through software or hardware by a unit or device.Second equal words are used to table Show title, and does not indicate any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention Technical solution is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. a kind of video file method for down loading, which is characterized in that the described method includes:
The head file of to download video files from content distributing network CDN node;
According to the head file, the download time point of the video file is determined;
Calculate the time difference of the play time of the download time point and the video file;
According to the time difference, the downloading mode that the video file currently needs is determined;
The video data of the video file is downloaded using the downloading mode;Wherein, the downloading mode includes: the CDN Node downloading, or, the CDN node and user node mixing downloading, or, the user node is downloaded.
2. video file method for down loading according to claim 1, which is characterized in that it is described according to the time difference, it determines The downloading mode that the video file currently needs includes:
If the time difference is less than or equal to first time threshold, the downloading mode for determining that presently described video file needs is institute State CDN node downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the CDN node.
3. video file method for down loading according to claim 1, which is characterized in that it is described according to the time difference, it determines The downloading mode that the video file currently needs includes:
If the time difference is greater than first time threshold, and the time difference is less than or equal to second time threshold, determines current The downloading mode that the video file needs is the CDN node and user node mixing downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the CDN node and user node mixing.
4. video file method for down loading according to claim 1, which is characterized in that it is described according to the time difference, it determines The downloading mode that the video file currently needs includes:
If the time difference is greater than second time threshold, and the time difference is less than or equal to third time threshold, determines current The downloading mode that the video file needs is user node downloading;
The video data for downloading the video file using the downloading mode includes:
The video data of the video file is downloaded using the user node.
5. video file method for down loading according to any one of claim 1 to 4, which is characterized in that the method is also wrapped It includes:
If the time difference is greater than third time threshold, stop the video data for downloading the video file.
6. video file method for down loading according to any one of claim 1 to 4, which is characterized in that described according to Head file determines that the download time point of the video file includes:
The file offset address of the video file and the corresponding relationship at time point are obtained from the head file;
Obtain file destination offset address corresponding to the current download location of the video file;
According to the corresponding relationship, the corresponding object time point of the file destination offset address is determined as the video file Download time point.
7. video file method for down loading according to any one of claim 1 to 4, which is characterized in that the video file For order video file or to download video files.
8. a kind of video file download apparatus, which is characterized in that the video file download apparatus includes:
Download module, the head file for the to download video files from content distributing network CDN node;
First determining module, for determining the download time point of the video file according to the head file;
Computing module, the time difference of the play time for calculating the download time point and the video file;
Second determining module, for determining the downloading mode that the video file currently needs according to the time difference;
The download module is also used for the video data that the downloading mode downloads the video file;Wherein, under described Load mode includes: the CDN node downloading, or, the CDN node and user node mixing downloading, or, under the user node It carries.
9. a kind of electronic equipment, which is characterized in that the electronic equipment includes processor and memory, and the processor is for holding The computer program stored in line storage is to realize video file downloading side as claimed in any of claims 1 to 7 in one of claims Method.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has at least one Instruction, at least one described instruction realize video file as claimed in any of claims 1 to 7 in one of claims when being executed by processor Method for down loading.
CN201910482804.2A 2018-09-26 2019-06-04 Video file downloading method and device, electronic equipment and storage medium Active CN110099134B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2018111257968 2018-09-26
CN201811125796.8A CN109218430A (en) 2018-09-26 2018-09-26 A kind of video file transfer method, system and electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110099134A true CN110099134A (en) 2019-08-06
CN110099134B CN110099134B (en) 2022-04-01

Family

ID=64981668

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201811125796.8A Pending CN109218430A (en) 2018-09-26 2018-09-26 A kind of video file transfer method, system and electronic equipment and storage medium
CN201910482804.2A Active CN110099134B (en) 2018-09-26 2019-06-04 Video file downloading method and device, electronic equipment and storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201811125796.8A Pending CN109218430A (en) 2018-09-26 2018-09-26 A kind of video file transfer method, system and electronic equipment and storage medium

Country Status (1)

Country Link
CN (2) CN109218430A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596166A (en) * 2021-08-02 2021-11-02 北京金山云网络技术有限公司 Data acquisition method and device, computer equipment and storage medium
CN113645288A (en) * 2021-08-02 2021-11-12 北京金山云网络技术有限公司 Data downloading method and device, computer equipment and storage medium
CN114244843A (en) * 2021-11-03 2022-03-25 网宿科技股份有限公司 Streaming media downloading method, electronic equipment and storage medium
CN114666609A (en) * 2022-03-31 2022-06-24 北京奇艺世纪科技有限公司 Video data downloading method and device, electronic equipment and storage medium
US20220272145A1 (en) * 2021-02-20 2022-08-25 Wangsu Science & Technology Co., Ltd. Method for requesting resources and terminal
CN116320507A (en) * 2023-05-26 2023-06-23 湖南快乐阳光互动娱乐传媒有限公司 Video data downloading method and device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218430A (en) * 2018-09-26 2019-01-15 深圳市网心科技有限公司 A kind of video file transfer method, system and electronic equipment and storage medium
CN109981778B (en) * 2019-03-27 2022-09-02 百度在线网络技术(北京)有限公司 Method, device, equipment and storage medium for realizing service of content distribution network
CN110049348B (en) * 2019-04-03 2022-04-05 网宿科技股份有限公司 Video analysis method and system and video analysis server
CN111031117B (en) * 2019-12-02 2023-05-16 深圳市迅雷网络技术有限公司 Multimedia file downloading method and related device
CN112019916B (en) * 2020-08-26 2022-05-03 广州市百果园信息技术有限公司 Video downloading method, device, server and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160173394A1 (en) * 2014-12-10 2016-06-16 Limelight Networks, Inc. Strategically scheduling tcp stream transmissions
CN105897836A (en) * 2015-12-07 2016-08-24 乐视云计算有限公司 Back source request processing method and device
CN108512921A (en) * 2018-03-28 2018-09-07 深圳市网心科技有限公司 File downloading method based on P2P network, electronic equipment and storage medium
CN108712654A (en) * 2018-05-18 2018-10-26 网宿科技股份有限公司 A kind of code-transferring method and equipment of audio/video flow
CN109218430A (en) * 2018-09-26 2019-01-15 深圳市网心科技有限公司 A kind of video file transfer method, system and electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160173394A1 (en) * 2014-12-10 2016-06-16 Limelight Networks, Inc. Strategically scheduling tcp stream transmissions
CN105897836A (en) * 2015-12-07 2016-08-24 乐视云计算有限公司 Back source request processing method and device
CN108512921A (en) * 2018-03-28 2018-09-07 深圳市网心科技有限公司 File downloading method based on P2P network, electronic equipment and storage medium
CN108712654A (en) * 2018-05-18 2018-10-26 网宿科技股份有限公司 A kind of code-transferring method and equipment of audio/video flow
CN109218430A (en) * 2018-09-26 2019-01-15 深圳市网心科技有限公司 A kind of video file transfer method, system and electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
万明刚: "CDN-P2P 混合流媒体分发系统中用户群分组方法研究", 《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220272145A1 (en) * 2021-02-20 2022-08-25 Wangsu Science & Technology Co., Ltd. Method for requesting resources and terminal
US11785075B2 (en) * 2021-02-20 2023-10-10 Wangsu Science & Technology Co., Ltd. Method for requesting resources and terminal
CN113596166A (en) * 2021-08-02 2021-11-02 北京金山云网络技术有限公司 Data acquisition method and device, computer equipment and storage medium
CN113645288A (en) * 2021-08-02 2021-11-12 北京金山云网络技术有限公司 Data downloading method and device, computer equipment and storage medium
CN113596166B (en) * 2021-08-02 2023-09-01 北京金山云网络技术有限公司 Data acquisition method, device, computer equipment and storage medium
CN114244843A (en) * 2021-11-03 2022-03-25 网宿科技股份有限公司 Streaming media downloading method, electronic equipment and storage medium
CN114666609A (en) * 2022-03-31 2022-06-24 北京奇艺世纪科技有限公司 Video data downloading method and device, electronic equipment and storage medium
CN116320507A (en) * 2023-05-26 2023-06-23 湖南快乐阳光互动娱乐传媒有限公司 Video data downloading method and device
CN116320507B (en) * 2023-05-26 2023-08-08 湖南快乐阳光互动娱乐传媒有限公司 Video data downloading method and device

Also Published As

Publication number Publication date
CN109218430A (en) 2019-01-15
CN110099134B (en) 2022-04-01

Similar Documents

Publication Publication Date Title
CN110099134A (en) Video file method for down loading, device, electronic equipment and storage medium
US9432452B2 (en) Systems and methods for dynamic networked peer-to-peer content distribution
CN102572557B (en) Current device location advertisement distribution method and system
EP4021000A1 (en) Video playback method, device, apparatus, and storage medium
JP6219800B2 (en) Multi-track video content service method and system for providing multi-track video content
US20100179973A1 (en) Systems, methods, and computer programs for delivering content via a communications network
CN107197359B (en) Video file caching method and device
CN102546711B (en) Storage adjustment method, device and system for contents in streaming media system
CN107333148B (en) Method for processing video frequency and device, computer storage medium and equipment
US20150039678A1 (en) Method for Automatically Storing New Media
CN110336885A (en) Fringe node distribution method, device, dispatch server and storage medium
US20160381127A1 (en) Systems and methods for dynamic networked peer-to-peer content distribution
CN108200444B (en) Video live broadcast method, device and system
CN108683730B (en) Resource scheduling method, service server, client terminal, network system and medium
US11533543B1 (en) Community boosting of stream visibility
CN105610869B (en) Method and device for scheduling streaming media
CN109739440A (en) Distributed sharing storage method, storage medium, electronic equipment and system
JP6342526B2 (en) Method and system for sharing live broadcast data
KR101089509B1 (en) Cloud computing network system and file distrubuting method of the same
CN104410879A (en) Time-shifting implementation method and device and server
CN102665096B (en) System and method for wireless distribution system proxy caches
US9372778B1 (en) Collaborative based caching
CN108683728B (en) Data transmission method, server, terminal, network system and storage medium
JP2017108386A (en) Sliding window management method and system for time machine function
CN105872764A (en) Data downloading method and device based on P2P (Peer-to-Peer) network

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
GR01 Patent grant