Invention content
A kind of method and apparatus for supporting to play online is provided in the embodiment of the present invention, can overcome depositing for foreign aid's equipment
The limitation for storing up capacity, meets massive demand of the user to Media Stream.
In order to solve the above-mentioned technical problem, the embodiment of the invention discloses following technical solutions:
In a first aspect, a kind of method for supporting to play online is provided, including:
Receive the request of the first media file of terminal plays;
Judge whether first media file is virtual file according to the description information of first media file;
If so, obtaining the pre-stored corresponding network address of first media file;
Establish network connection;
Corresponding second media file of first media file is downloaded according to the network address;
Second media file downloaded is transmitted to the terminal, so as to downloaded described in the terminal plays
Second media file.
In conjunction with above-mentioned in a first aspect, in the first possible implementation, second media that will have been downloaded
File is transmitted to the terminal, including:
While downloading second media file, second media file synchronization downloaded is transmitted to described
Terminal.
In conjunction with it is above-mentioned in a first aspect, and/or the first possible realization method, in second of possible realization method,
It is described that second media file downloaded is transmitted to the terminal, including:
Second media file downloaded is cached;
When the data volume for the second media file downloaded described in the caching reaches threshold value, it will be downloaded described in caching
The second media file be transmitted to the terminal.
In conjunction with it is above-mentioned in a first aspect, and/or the first possible realization method and/or second of possible realization method,
In the third possible realization method, the second media file downloaded described in caching is transmitted to the terminal described
Afterwards, further include:
Delete second media file downloaded of the caching.
In conjunction with it is above-mentioned in a first aspect, and/or the first possible realization method and/or second of possible realization method,
And/or the third possible realization method, in the 4th kind of possible realization method, second media that will have been downloaded
File is transmitted to the terminal, including:
By second media file storage downloaded to local;
Second media file for being stored in local is transmitted to the terminal.
Second aspect provides a kind of equipment for supporting to play online, including:
Receiving module, the request for receiving the first media file of terminal plays;
Judgment module, for according to the description information of first media file judge first media file whether be
Virtual file;
Address acquisition module, for when the judgment module judges that first media file is virtual file, obtaining
The pre-stored corresponding network address of first media file;
Network connecting module, for establishing network connection;
File download module, for downloading the corresponding second media text of first media file according to the network address
Part;
Transmission module, for second media file downloaded to be transmitted to the terminal, so that the terminal is broadcast
Put second media file downloaded.
In conjunction with above-mentioned second aspect, in the first possible implementation, the transmission module is specifically used for described
While file download module downloads second media file, second media file synchronization downloaded is transmitted to institute
State terminal.
In conjunction with above-mentioned second aspect and/or the first possible realization method, in second of possible realization method,
The transmission module includes:
Buffer unit, for caching second media file downloaded;
When the data volume of first transmission unit, the second media file for having downloaded described in the caching reaches threshold value,
The second media file downloaded described in caching is transmitted to the terminal.
In conjunction with above-mentioned second aspect and/or the first possible realization method and/or second of possible realization method,
In the third possible realization method, further include:
Module is removed, it is described for being transmitted to the second media file downloaded described in caching in the transmission unit
After terminal, second media downloaded that transmission unit described in the buffer unit has been transferred to the terminal are removed
File.
In conjunction with above-mentioned second aspect and/or the first possible realization method and/or second of possible realization method,
And/or the third possible realization method, in the 4th kind of possible realization method, the transmission module includes:
Storage unit, for by second media file storage downloaded to local;
Second transmission unit is transmitted to the terminal for will be stored in local second media file.
The embodiment of the present invention by the foreign aids such as USB equipment or terminal inner with storing virtual file and its corresponding network
Location so that equipment or terminal can be somebody's turn to do according to network address in real time when receiving the request of terminal plays virtual file
The corresponding entity file of virtual file, so as to support the online broadcasting of terminal.The method overcome foreign aids' equipment such as USB
The limitation of memory space meets massive demand of the user to Media Stream.
Specific implementation mode
In order to make those skilled in the art more fully understand the technical solution in the embodiment of the present invention, and make of the invention real
The above objects, features, and advantages for applying example can be more obvious and easy to understand, below in conjunction with the accompanying drawings to technical side in the embodiment of the present invention
Case is described in further detail.
It is a kind of method flow diagram for supporting to play online of the embodiment of the present invention referring to Fig. 1.
It is described to support that the method played online may include:
Step 101, the request of the first media file of terminal plays is received.
The terminal can be television set, digital camera etc., not limit herein;The executive agent of the present embodiment can be outer
It is connected on foreign aids' equipment such as USB in terminal, can also be an embedded device or module in the terminal, the present embodiment is with USB
It is illustrated for equipment.
USB device receives asking for the first media file of broadcasting that terminal is sent by the interface with terminal, such as USB interface
It asks.First media file can be the files such as video, picture;It may include the title or of the first media file in the request
Other identification informations of one media file.
Step 102, judge whether first media file is virtual according to the description information of first media file
File.
The memory space of USB device is little, in order to meet massive demand of the user to media file etc., implements in the present invention
In the USB device of example other than storage entity file, a big memory space is also fictionalized, for storing virtual file, nothing
Can also be other types file by being that entity file or virtual file may each be media file.Wherein, entity file can
With with description information and file data, and virtual file only has description information, does not have actual file data.File
Description information in may include for identify this document whether be virtual file information, such as file name, entity file
It can also includes the title and other correlation letters of file that can have different naming rules, the description information with virtual file
Breath.
In this step, the description information for the first media file that USB device asks to play by reading terminals, you can
Judge whether first media file is virtual file.If not virtual file but entity file, then USB device can be with
The storage address of the entity file in the usb device is obtained according to existing way, then by the corresponding entity text of the storage address
Part is transmitted to terminal and plays out;If it is virtual file, then next step 103 is further executed.
Step 103, the pre-stored corresponding network address of first media file is obtained.
It can also be stored with virtual file and the correspondence of virtual address in the usb device, which is used for
The network address of the actual file data of the virtual file is obtained, the correspondence of the virtual file and virtual address specifically can be with
It stores in the form of a list.
USB device is after determining the first media file that terminal request plays for virtual file, you can according to pre-stored
The correspondence of virtual file and virtual address obtains the network address corresponding to first media file.
Step 104, network connection is established.
The USB device can pass through Ethernet, WiFi(Wireless network communication technique), 3rd generation mobile communication technology
(3rd-generation, 3G), digital subscriber line(Digital Subscriber Line, DSL)Etc. modes establish network company
It connects.The network connection can be attached to internet, can also be to be connected to LAN etc..
Step 105, corresponding second media file of first media file is downloaded according to the network address.
It is corresponding according to the network address the first media file of download in network side after USB device establishes network connection
Second media file.
Wherein, " first ", " second " are only the media file of distinguishing different or different storage locations, not refer in particular to or
It limits.The storage location of first media file and the second media file is different, but can be with file name having the same.
Step 106, second media file downloaded is transmitted to the terminal, so that described in the terminal plays
The second media file downloaded.
The embodiment of the present invention by the foreign aids such as USB equipment or terminal inner with storing virtual file and its corresponding network
Location so that equipment or terminal can be somebody's turn to do according to network address in real time when receiving the request of terminal plays virtual file
The corresponding entity file of virtual file, so as to support the online broadcasting of terminal.The method overcome foreign aids' equipment such as USB
The limitation of memory space meets massive demand of the user to Media Stream.
By the second media file downloaded be transmitted to terminal process can there are many mode, such as:
In one embodiment, in USB device while downloading the second media file, the second media file for will having downloaded
Synchronous transfer is to terminal, so that terminal plays second media file downloaded simultaneously.In which, USB device is to downloading
The second media file without storage, but directly downloading data is synchronized and is sent to terminal, USB device plays data download
With the effect of data forwarding.
In another embodiment, which can first cache the second media file of download, then transmit again
To terminal, as shown in Fig. 2, this method may include:
Step 201, second media file downloaded is cached.
The second media file downloaded can be buffered in the buffering area of the equipment by the USB device, such as be buffered in
In specified temporary folder.
Step 202, judge whether the data volume of second media file downloaded of caching reaches threshold value.
The data volume of second media file of USB device statistics caching, and be compared with preset threshold value, such as the threshold
Value is 10MB, when the data volume of the second media file of caching reaches threshold value 10MB, that is, executes step 203 and otherwise continues to hold
Row step 201~202.
Step 203, the second media file downloaded described in caching is transmitted to terminal.
When the data volume of the second media file of caching reaches threshold value, the second media file that will just cache is transmitted to end
End.
After the second media file of caching is transmitted to terminal, it can further include:
Step 204, second media file downloaded of the caching is deleted.
Since the buffer space of USB device is limited, after the second media file that will be cached is transmitted to terminal, can delete
Except second media file transmitted, the resource in buffering area to discharge its occupancy.
The method for being first buffered in transmission is not take up the fixed storage space of USB device, and compared in previous embodiment
The mode of synchronous transfer can still ensure that terminal can continuously play media file in unstable networks.
In another embodiment, as shown in figure 3, the USB device also can also be performed after downloading the second media file with
Lower step:
Step 301, by second media file storage downloaded to local.
USB device can be specifically stored in specified folder by the second media file storage of download in local.
The storage mode is different from the caching in previous embodiment, caches as interim storage, when stopping downloading or closing USB device,
Data in buffering area can be eliminated, and can not search acquisition, and the storage of USB device is stored in when storage in the present embodiment
In medium, acquisition can be searched after storage at any time.
USB device executes step 302 again after can downloading complete second media file of acquisition, can also be obtained downloading
Step 302 is executed after the second media file of part.
Step 302, local second media file will be stored in and is transmitted to the terminal.
If storing second media file in the usb device, while the management letter of first media file can be updated
Breath, including:The description information of first media file is revised as entity file, and by the corresponding network of the first media file
It is revised as the storage address of second media file in the usb device in address.
It is the description to the method for the present invention embodiment above, below to realizing that the device of the above method is introduced.
It is a kind of structural schematic diagram for the equipment for supporting to play online of the embodiment of the present invention referring to Fig. 4.
The equipment 400 that the support plays online may include:
Receiving module 401, the request for receiving the first media file of terminal plays;
Judgment module 402, for judging that first media file is according to the description information of first media file
No is virtual file;
Address acquisition module 403 judges that first media file is virtual file for working as the judgment module 402
When, obtain the pre-stored corresponding network address of first media file;
Network connecting module 404, for establishing network connection;
File download module 405, for downloading corresponding second matchmaker of first media file according to the network address
Body file;
Transmission module 406, for second media file downloaded to be transmitted to the terminal, so that the terminal
The second media file downloaded described in playing.
Receiving module 401 reads the first media after receiving the request for playing the first media file, by judgment module 402
The description information of file, and according to the information for identifying virtual file in description information judge first media file whether be
Virtual file, if so, address acquisition module 403 reads the corresponding network address of the first media file to prestore, then by net
Network address is sent to network connecting module 404, and network connecting module 404 establishes network connection according to the network address, the network
Link block 404 specifically can establish network connection one of in the following manner:Ethernet, WiFi, 3G, DSL etc., then file
Download module 405 downloads the second media file according to the network address, finally by transmission module 406 that second media of download are literary
Part is transmitted to terminal, and terminal can play second media file.
The equipment stores virtual file and its corresponding network address by above-mentioned module in the embodiment of the present invention, is receiving
To terminal plays virtual file request when, can the corresponding entity file of the virtual file be obtained according to network address in real time,
So as to support the online broadcasting of terminal.Which overcomes the limitations of memory space, meet sea of the user to Media Stream
Amount demand.
In another embodiment of the invention, transmission module 406 specifically can be used for downloading in the file download module
While second media file, second media file synchronization downloaded is transmitted to the terminal.
In another embodiment of the invention, as shown in figure 5, transmission module in the equipment 400 that the support plays online
406 may further include:
Buffer unit 501, for caching second media file downloaded;
First transmission unit 502, the data volume for working as the second media file downloaded described in caching reach threshold value
When, the second media file downloaded described in caching is transmitted to the terminal.
The equipment 400 that the support plays online can further include:
Module 503 is removed, for transmitting the second media file downloaded described in caching in the transmission unit 502
It has been downloaded to after the terminal, removing transmission unit described in the buffer unit 501 and having been transferred to the described of the terminal
The second media file.
The second media file of download is cached by increasing the cache module, is then transmitted to terminal again, it can be with
In unstable networks, still ensure that terminal can continuously play media file.
In another embodiment of the invention, as shown in fig. 6, the transmission module 406 can also include:
Storage unit 601, for by second media file storage downloaded to local;
Second transmission unit 602 is transmitted to the terminal for will be stored in local second media file.
The description information of first media file can also be revised as entity file by storage unit 601;By described
The corresponding network address of one media file is revised as the storage address of second media file.
The equipment that above-mentioned support plays online can be USB device, can also be other equipment, which can be external
Can also be to be arranged in terminal inner as an independent module, such as be integrated in inside television in terminal.
The embodiment of the invention also discloses a kind of equipment for supporting to play online, which may include transceiver, storage
Device and processor.
Wherein, transceiver, the request for receiving the first media file of terminal plays;The second media file that will have been downloaded
It is transmitted to the terminal, so that the second media file downloaded described in the terminal plays.
One section of program is stored in memory, processor is used to read the program in memory, executes following steps:
Judge whether first media file is virtual file according to the description information of first media file;
If so, obtaining the pre-stored corresponding network address of first media file;
Establish network connection;
Corresponding second media file of first media file is downloaded according to the network address;
Second media file downloaded is sent to transceiver.
In the embodiment of the present invention, the equipment is by storing virtual file and its corresponding network address so that is receiving
When the request of terminal plays virtual file, can the corresponding entity file of the virtual file be obtained according to network address in real time, from
And it can support the online broadcasting of terminal.Which overcomes the limitations of memory space, meet magnanimity of the user to Media Stream
Demand.
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.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, it can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, 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
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be the indirect coupling by some interfaces, device or unit
It closes or communicates to connect, 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.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product
It is stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially in other words
The part of the part that contributes to existing technology or the technical solution can be expressed in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment(Can be
People's computer, server or network equipment etc.)Or processor(processor)Execute side described in each embodiment of the present invention
The all or part of step of method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory(ROM, Read-Only
Memory), random access memory(RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.