WO2020044086A1 - File transfer and play method and apparatus, and device/terminal/server - Google Patents

File transfer and play method and apparatus, and device/terminal/server Download PDF

Info

Publication number
WO2020044086A1
WO2020044086A1 PCT/IB2018/057146 IB2018057146W WO2020044086A1 WO 2020044086 A1 WO2020044086 A1 WO 2020044086A1 IB 2018057146 W IB2018057146 W IB 2018057146W WO 2020044086 A1 WO2020044086 A1 WO 2020044086A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
data
playback
network environment
cache
Prior art date
Application number
PCT/IB2018/057146
Other languages
French (fr)
Chinese (zh)
Inventor
林继泉
Original Assignee
优视科技新加坡有限公司
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 优视科技新加坡有限公司 filed Critical 优视科技新加坡有限公司
Publication of WO2020044086A1 publication Critical patent/WO2020044086A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/432Content retrieval operation from a local storage medium, e.g. hard-disk
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44227Monitoring of local network, e.g. connection or bandwidth variations; Detecting new devices in the local network

Definitions

  • the present application relates to the field of Internet technologies, and in particular, to a method, device, and device / terminal / server for file transmission and playback.
  • file transfers between users via the Internet often result in file transfer speeds that are too slow due to restrictions on network bandwidth and the like, and file transfers need to be implemented through servers.
  • the protection of user privacy is vulnerable to vulnerabilities.
  • the embodiments of the present application provide a method, an apparatus, and a device / terminal / server for file transmission and playback, which completely or partially solve the problems in the prior art.
  • a method for file transmission and playback includes: judging whether a current network environment of near field communication reaches a preset threshold according to a current file transmission speed; Describe the segment data in the video data that meets the playback requirements, and read and play the cached segment data; if it does not reach, save the segment data in the video data that meets the playback requirements to a local agent, and Reading and playing the segment data through the local agent.
  • a device for file transmission and playback includes: an environment determination module configured to determine whether the current network environment of near field communication reaches a pre- Setting a threshold; a buffer reading module configured to, if reached, cache the segment data in the video data that meets the playback requirements, and read Fetch and play the cached segment data; an agent reading module configured to save the segment data in the video data that meets the playback requirements to a local proxy if it is not reached, and read through the local proxy The segment data is played.
  • a device / terminal / server including: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are And executed by the one or more processors, so that the one or more processors implement operations corresponding to the file transmission and playback method as described above.
  • a computer-readable storage medium in which a computer program is stored, and when the program is executed by a processor, the operations corresponding to the file transmission and playback methods described above are implemented.
  • the embodiment of the present application determines whether the current network environment of the near field communication reaches a preset threshold according to the current file transmission speed.
  • the local agent is used for segmented data storage and read playback.
  • the embodiments of the present application can adopt different data storage modes according to the network environment, so that the transmitted files can be played while the files are being transmitted.
  • the user does not need to wait for the video file to be transmitted before playing, which improves the user experience during the near-field transmission.
  • FIG. 1 is a flowchart of steps in a file transmission and playback method according to Embodiment 1 of the present application; FIG.
  • FIG. 2 is a flowchart of steps in a file transmission and playback method according to Embodiment 2 of the present application;
  • FIG. 3 is a flowchart of steps of an implementation of step S101 of a file transmission and playback method according to Embodiment 3 of the present application;
  • FIG. 4 is a structural block diagram of a file transmission and playback device according to Embodiment 5 of the present application.
  • FIG. 5 is a structural block diagram of a file transmission and playback device according to Embodiment 6 of the present application.
  • FIG. 6 is a structural block diagram of an implementation of an environment judgment module of a file transmission and playback device according to Embodiment 7 of the present application;
  • FIG. 7 is a structural block diagram of a device / terminal / server according to Embodiment 8 of the present application. detailed description
  • FIG. 1 there is shown a flowchart of steps in a method for transmitting and playing a file according to the first embodiment of the present application.
  • steps S 101 to S 103 described in this application do not represent the order of execution.
  • Step S101 Determine whether the current network environment of the near field communication reaches a preset threshold according to the current file transmission speed.
  • the network environment described in the embodiment of the present application may be obtained by the currently received file transmission speed, and the stability and bandwidth of the network may be determined by whether the file transmission speed is substantially the same and the speed of the transmission speed.
  • the preset thresholds described in the embodiments of the present application are set by those skilled in the art as needed.
  • the preset thresholds described in the embodiments of the present application can be adjusted as needed.
  • Step S102 If it is reached, then cache segment data in the video data that meets the playback requirements, and read and play the cached segment data.
  • the network environment described in the embodiment of the present application reaches a preset threshold, it meets the requirements for file transmission and simultaneous playback by means of caching, and then implements segmented storage and reading and playback of data by means of caching.
  • segmented data in video data that meets playback requirements is cached, so that the cached segmented data can be read and played during the file transmission process.
  • the video data that meets the playback requirements is segmented data that is segmented by the video data, which is data that can directly read and play.
  • Step S103 if not, save the segment data in the video data that meets the playback requirements to a local agent, and read and play the segment data through the local agent.
  • a local proxy is used to implement data segmented storage and read and play.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback.
  • the embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
  • the method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • This embodiment includes the above steps S101 to S103.
  • the method further comprising the step S lOO o
  • Step S100 Process the original video file data so that the header file information of the original video file data is located at the head of the video file.
  • the header file information of the video file defines information such as the video playback format, frame information, and rate. These information must be obtained first during playback. If the header file information is placed in the middle or the tail of the video file, partial playback cannot be performed according to the segmented data of the video file, and the playback can only be performed after the video file has been completely transferred.
  • the video provider since the video provider is also a terminal device, the video file data that does not meet the segmentation requirements is repackaged in the terminal device, the header file information is moved to the head of the video file, and then sent to another A terminal device.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. This The embodiment of the application can adopt different data access modes according to the network environment, so that the transmitted file can be played while the file is being transmitted. In the embodiment of the present application, the user does not need to wait for the video file to be transmitted before playing, which improves the user experience during the near-field transmission.
  • the method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • step S101 includes:
  • Step S 101 Determine whether the stability of the current network environment of the near field communication reaches the stability threshold according to the current file transfer speed.
  • the embodiment of the present application determines whether the stability of the current network environment reaches the stability threshold according to whether the change value of the current file transmission speed reaches the stability threshold.
  • Step S 1012 Determine whether the transmission speed of the current network environment of the near field communication reaches the speed threshold according to the current file transmission speed.
  • the embodiment of the present application determines whether the speed of the current network environment reaches the speed threshold according to whether the current file transmission speed reaches the speed threshold.
  • the embodiment of the present application can simply judge the current network environment of near field communication based on the current file transmission speed, so as to determine whether the network connection satisfies the method of implementing file playback during file transmission in a cached manner.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback.
  • the embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
  • the method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • various device terminals or servers including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • This embodiment includes the above steps S101 to S103.
  • the step S102 is specifically: if the preset threshold is reached, the segmented data is saved to the cache area piece by piece, and written into a local file, and the local file in the cache area is simultaneously read and played.
  • Least Recently Used Cache Least Recently Used Cache
  • LmCache is a generic class. It uses a LinkedHashMap internally to store external cache objects in a strong reference manner. It provides get and put methods to complete cache acquisition and addition.
  • the least recently used algorithm caching technology can be used to realize the transmission of video files in near field transmission and play at the same time.
  • the implementation is simple and greatly improves the user experience.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback.
  • the embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
  • the method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • FIG. 4 a structural block diagram of a file transmission and playback device according to Embodiment 5 of the present application is shown.
  • the cache reading module 402 is configured to, if it is reached, cache segment data in the video data that meets the playback requirements, and read and play the cached segment data.
  • the proxy reading module 403 is configured to save the segment data in the video data that meets the playback requirements to a local proxy if it is not reached, and read and play the segment data through the local proxy.
  • the network environment described in the embodiment of the present application may be obtained by the currently received file transmission speed, and the stability and bandwidth of the network may be determined by whether the file transmission speed is substantially the same and the speed of the transmission speed.
  • the preset thresholds described in the embodiments of the present application are set by those skilled in the art as needed.
  • the preset thresholds described in the embodiments of the present application can be adjusted as needed.
  • the network environment described in the embodiment of the present application reaches a preset threshold, it meets the requirements for file transmission and simultaneous playback by means of caching, and then implements segmented storage and reading and playback of data by means of caching.
  • segmented data in video data that meets playback requirements is cached, so that the cached segmented data can be read and played during the file transmission process.
  • the video data that meets the playback requirements described in the embodiments of the present application is segmented data that is segmented by the video data, which is data that can directly read and play.
  • a local proxy is used to implement data segmented storage and read and play.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback.
  • the embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
  • the device for file transmission and playback in this embodiment may be executed by any appropriate device having file transmission and playback capabilities, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • various device terminals or servers including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • This embodiment includes the above-mentioned environment judgment module 401, cache reading module 402, and proxy reading module 403. Referring to FIG. 5, the apparatus further includes:
  • the head processing module 400 is configured to process the original video file data, so that header information of the original video file data is located at the head of the video file.
  • the header file information of the video file defines information such as the video playback format, frame information, and rate. These information must be obtained first during playback. If the header file information is placed in the middle or the tail of the video file, partial playback cannot be performed according to the segmented data of the video file, and the playback can only be performed after the video file has been completely transferred.
  • the video provider since the video provider is also a terminal device, the video file data that does not meet the segmentation requirements is repackaged in the terminal device, the header file information is moved to the head of the video file, and then sent to another A terminal device.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback.
  • the embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
  • the device for file transmission and playback in this embodiment may be executed by any appropriate device having file transmission and playback capabilities, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • This embodiment includes the above-mentioned environment judgment module 401, cache reading module 402, and proxy reading module 403.
  • the environment judgment module 401 includes:
  • the stability judging unit 4011 is configured to judge whether the stability of the current network environment of the near field communication reaches the stability threshold according to the current file transmission speed.
  • the speed determination unit 4012 is configured to determine whether the transmission speed of the current network environment of the near field communication reaches the speed threshold according to the current file transmission speed.
  • the embodiment of the present application determines whether a change value of the current file transmission speed reaches a stable value.
  • the qualitative threshold determines whether the stability of the current network environment reaches the stability threshold.
  • the embodiment of the present application determines whether the speed of the current network environment reaches the speed threshold according to whether the current file transmission speed reaches the speed threshold.
  • the embodiment of the present application can simply judge the current network environment of near field communication based on the current file transmission speed, so as to determine whether the network connection satisfies the method of implementing file playback during file transmission in a cached manner.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback.
  • the embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
  • the device for file transmission and playback in this embodiment may be executed by any appropriate device having file transmission and playback capabilities, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • This embodiment includes the above-mentioned environment judgment module 401, cache reading module 402, and proxy reading module 403.
  • the cache reading module 402 is specifically configured to:
  • the segmented data is saved to the cache area piece by piece, and written into a local file, and the local file in the cache area is read and played simultaneously.
  • Least Recently Used Cache Least Recently Used Cache
  • LmCache is a generic class. It uses a LinkedHashMap internally to store external cache objects in a strong reference manner. It provides get and put methods to complete cache acquisition and addition.
  • the embodiment of the present application can use the least recently used algorithm cache technology to implement The transmission of video files in the field transmission is played at the same time, the implementation method is simple and the user experience is greatly improved.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback.
  • the embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
  • the method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
  • FIG. 7 a structural block diagram of a device / terminal / server according to Embodiment 5 of the present application is shown.
  • the specific embodiment of the present application does not limit the specific implementation of the device / terminal / server.
  • the device / terminal / server may include: one or more processors
  • processor processing circuit
  • memory storage device
  • the processor 702 is configured to execute a program 706, and may specifically perform related steps in the foregoing method embodiment of file transmission and playback.
  • the program 706 may include program code, where the program code includes a computer operation instruction.
  • the processor 702 may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
  • the device / terminal / server includes one or more processors, which can be processors of the same type, such as one or more CPUs; or different types of processors, such as one or more CPUs and one or more ASICs .
  • the storage device 704 is configured to store one or more programs 706.
  • the storage device 704 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • the program 706 may be specifically configured to cause the processor 702 to perform the following operations: File transmission speed to determine whether the current network environment of near field communication has reached a preset threshold; if it is, cache the segment data in the video data that meets the playback requirements and read the cached segment data; if not When it is reached, the segment data in the video data that meets the playback requirements is saved to a local agent, and the segment data is read and played by the local agent.
  • the program 706 is further configured to process the original video file data, so that header information of the original video file data is located at a header of the video file.
  • the program 706 is further configured to determine whether the stability of the current network environment of the near field communication reaches the stability threshold according to the current file transmission speed; determine the current network environment of the near field communication according to the current file transmission speed. Whether the transmission speed reaches the speed threshold.
  • the program 706 is further configured to, if the preset threshold is reached, save the segmented data to the cache area piece by piece, and write the local file to a local file of the cache area The file is read and played simultaneously.
  • the cache area is implemented by a least recently used algorithm cache technology.
  • the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback.
  • the embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
  • each component / step described in the embodiment of the present application may be split into more components / steps, or two or more components / steps or partial operations of components / steps may be combined into New components / steps to achieve the purpose of the embodiments of the present application.
  • the process described above with reference to the flowchart may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing a method shown in a flowchart.
  • the computer program may be downloaded and installed from a network through a communication section, and / or installed from a removable medium.
  • CPU central processing unit
  • the computer-readable medium described in this application may be It is a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable memories Programming read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal that is included in baseband or propagated as part of a carrier wave, and which carries computer-readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, the programming languages including an object-oriented programming language such as Java, Smalltalk, C ++, and also conventional A procedural programming language such as "C" or a similar programming language.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider using the Internet Connection).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more components for implementing a specified Executable instructions for logic functions.
  • the functions marked in the blocks may also occur in a different order than those marked in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts may be implemented in a dedicated hardware-based system that performs the specified function or operation. Or, it can be implemented by a combination of dedicated hardware and computer instructions.
  • a processor includes a receiving unit, a parsing unit, an information selecting unit, and a generating unit. Among them, the names of these units do not in any way constitute a limitation on the unit itself.
  • the receiving unit may also be described as a "unit for receiving a user's web browsing request".
  • the present application also provides a computer-readable medium having stored thereon a computer program that, when executed by a processor, implements a method as described in any one of the above embodiments.
  • the present application further provides a computer-readable medium, which may be included in the device described in the foregoing embodiments; or may exist alone without being assembled into the device.
  • the computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device is caused to: determine whether a current network environment of the near field communication reaches a preset threshold according to a current file transmission speed; When it is reached, the segment data in the video data that meets the playback requirements is cached, and the cached segment data is read and played; if it is not reached, the segment data in the video data that meets the playback requirements is saved To the local agent, and read and play the segment data through the local agent.

Landscapes

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

Abstract

Provided are a file transfer and play method and apparatus, and a device/terminal/server. The method comprises: determining, according to a current file transfer speed, whether a current network environment of near-field communication reaches a preset threshold value; if so, caching segmented data in video data meeting play requirements, and reading and playing the cached segmented data; and if not, saving the segmented data in the video data meeting the play requirements to a local proxy, and reading and playing the segmented data by means of the local proxy. The embodiments of the present application can use different data access methods according to the network environment, thereby being capable of playing a file being transferred while transferring the file.

Description

一种文件传输与播放的方法、 装置和设备 /终端 /服务器 本申请要求在 2018 年 8 月 27 日提交中国专利局、 申请号为 201810982341.1、发明名称为“一种文件传输与播放的方法、装置和设备 /终端 /服务器”的中国专利申请的优先权, 其全部内容通过引用结合在本 申请中。  Method, device and device / terminal / server for file transmission and playback This application requires that the Chinese Patent Office be filed on August 27, 2018, application number 201810982341.1, and the invention name is "A method and device for file transmission and playback And device / terminal / server "priority, the entire contents of which are incorporated in this application by reference.
技术领域  Technical field
本申请涉及互联网技术领域,尤其涉及一种文件传输与播放的方法、 装置和设备 /终端 /服务器。  The present application relates to the field of Internet technologies, and in particular, to a method, device, and device / terminal / server for file transmission and playback.
背景技术  Background technique
随着互联网技术的发展, 用户采用互联网来进行文件传输, 实现文 件的分享变得越来越普遍。 用户之间通过互联网传输文件令文件的分享 更加简便和易于实现。  With the development of Internet technology, users use the Internet for file transfer, and it becomes more and more common to realize file sharing. Sharing files between users via the Internet makes file sharing easier and easier.
但是用户之间通过互联网实现文件传送往往由于网络带宽等限制, 造成文件传输速度过慢, 且文件的传输需要通过服务器来实现, 对用户 隐私的保护容易存在漏洞。  However, file transfers between users via the Internet often result in file transfer speeds that are too slow due to restrictions on network bandwidth and the like, and file transfers need to be implemented through servers. The protection of user privacy is vulnerable to vulnerabilities.
因此, 如何更佳的实现文件传输与播放的成为现有技术中亟待解决 的技术问题。  Therefore, how to better implement file transmission and playback has become a technical problem to be solved urgently in the prior art.
发明内容  Summary of the Invention
本申请实施例提供了一种文件传输与播放的方法、 装置和设备 /终端 /服务器, 全部或者部分解决现有技术中存在的问题。  The embodiments of the present application provide a method, an apparatus, and a device / terminal / server for file transmission and playback, which completely or partially solve the problems in the prior art.
根据本申请实施例的一个方面,提供了一种文件传输与播放的方法, 所述方法包括: 根据当前文件传输速度判断近场通讯的当前网络环境是 否达到预设阈值; 如达到, 则缓存所述满足播放需求的视频数据中的分 段数据, 并读取播放所述缓存的分段数据; 如未达到, 则将所述满足播 放需求的视频数据中的分段数据保存至本地代理, 并通过所述本地代理 读取播放所述分段数据。  According to an aspect of the embodiments of the present application, a method for file transmission and playback is provided. The method includes: judging whether a current network environment of near field communication reaches a preset threshold according to a current file transmission speed; Describe the segment data in the video data that meets the playback requirements, and read and play the cached segment data; if it does not reach, save the segment data in the video data that meets the playback requirements to a local agent, and Reading and playing the segment data through the local agent.
根据本申请实施例的另一个方面, 还提供了一种文件传输与播放的 装置, 所述装置包括: 环境判断模块, 配置用于根据当前文件传输速度 判断近场通讯的当前网络环境是否达到预设阈值; 缓存读取模块, 配置 用于如达到, 则缓存所述满足播放需求的视频数据中的分段数据, 并读 取播放所述缓存的分段数据; 代理读取模块, 配置用于如未达到, 则将 所述满足播放需求的视频数据中的分段数据保存至本地代理, 并通过所 述本地代理读取播放所述分段数据。 According to another aspect of the embodiments of the present application, a device for file transmission and playback is also provided. The device includes: an environment determination module configured to determine whether the current network environment of near field communication reaches a pre- Setting a threshold; a buffer reading module configured to, if reached, cache the segment data in the video data that meets the playback requirements, and read Fetch and play the cached segment data; an agent reading module configured to save the segment data in the video data that meets the playback requirements to a local proxy if it is not reached, and read through the local proxy The segment data is played.
根据本申请实施例的又一个方面, 还提供了一种设备 /终端 /服务器, 包括: 一个或多个处理器; 存储装置, 用于存储一个或多个程序, 当所 述一个或多个程序被所述一个或多个处理器执行, 使得所述一个或多个 处理器实现如上所述的文件传输与播放的方法对应的操作。  According to still another aspect of the embodiments of the present application, a device / terminal / server is further provided, including: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are And executed by the one or more processors, so that the one or more processors implement operations corresponding to the file transmission and playback method as described above.
根据本申请实施例的又一个方面, 还提供了一种计算机可读存储介 质, 其上存储有计算机程序, 该程序被处理器执行时实现如上所述的文 件传输与播放的方法对应的操作。  According to still another aspect of the embodiments of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and when the program is executed by a processor, the operations corresponding to the file transmission and playback methods described above are implemented.
根据本申请实施例提供的技术方案, 本申请实施例根据当前文件传 输速度判断近场通讯的当前网络环境是否达到预设阈值, 达到则采用缓 存方式进行数据分段存储与读取播放, 未达到则采用本地代理进行数据 分段存储与读取播放。 本申请实施例可根据网络环境采取不同的数据存 取方式, 从而实现在文件传输的同时可对所传输的文件进行播放。 本申 请实施例用户无需等待视频文件传输完成再进行播放, 改善了近场传输 过程中的用户体验。  According to the technical solution provided by the embodiment of the present application, the embodiment of the present application determines whether the current network environment of the near field communication reaches a preset threshold according to the current file transmission speed. The local agent is used for segmented data storage and read playback. The embodiments of the present application can adopt different data storage modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file to be transmitted before playing, which improves the user experience during the near-field transmission.
附图说明  BRIEF DESCRIPTION OF THE DRAWINGS
图 1是根据本申请实施例一的一种文件传输与播放的方法的步骤流 程图;  FIG. 1 is a flowchart of steps in a file transmission and playback method according to Embodiment 1 of the present application; FIG.
图 2是根据本申请实施例二的一种文件传输与播放的方法的步骤流 程图;  2 is a flowchart of steps in a file transmission and playback method according to Embodiment 2 of the present application;
图 3 是根据本申请实施例三的一种文件传输与播放的方法的步骤 S 101的一种实现的步骤流程图;  FIG. 3 is a flowchart of steps of an implementation of step S101 of a file transmission and playback method according to Embodiment 3 of the present application;
图 4是根据本申请实施例五的一种文件传输与播放的装置的结构框 图;  4 is a structural block diagram of a file transmission and playback device according to Embodiment 5 of the present application;
图 5是根据本申请实施例六的一种文件传输与播放的装置的结构框 图;  5 is a structural block diagram of a file transmission and playback device according to Embodiment 6 of the present application;
图 6是根据本申请实施例七的一种文件传输与播放的装置的环境判 断模块的一种实现的结构框图;  6 is a structural block diagram of an implementation of an environment judgment module of a file transmission and playback device according to Embodiment 7 of the present application;
图 7是根据本申请实施例八的一种设备 /终端 /服务器的结构框图。 具体实施方式 FIG. 7 is a structural block diagram of a device / terminal / server according to Embodiment 8 of the present application. detailed description
下面结合附图(若干附图中相同的标号表示相同的元素)和实施例, 对本申请实施例的具体实施方式作进一步详细说明。 以下实施例用于说 明本申请, 但不用来限制本申请的范围。  The specific implementation of the embodiments of the present application will be further described in detail below with reference to the accompanying drawings (the same reference numerals in several drawings represent the same elements) and embodiments. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.
本领域技术人员可以理解,本申请实施例中的“第一”、“第二”等术语 仅用于区别不同步骤、 设备或模块等, 既不代表任何特定技术含义, 也 不表示它们之间的必然逻辑顺序。  Those skilled in the art can understand that terms such as “first” and “second” in the embodiments of the present application are only used to distinguish different steps, devices, or modules, etc., and they do not represent any specific technical meaning, nor mean between them. Inevitable logical order.
实施例一 Example one
参照图 1, 示出了根据本申请实施例一的一种文件传输与播放的方 法的步骤流程图。  Referring to FIG. 1, there is shown a flowchart of steps in a method for transmitting and playing a file according to the first embodiment of the present application.
值得说明的是, 本申请所述步骤 S 101至 S 103并不代表其执行的先 后顺序。  It is worth noting that steps S 101 to S 103 described in this application do not represent the order of execution.
本实施例的文件传输与播放的方法包括以下步骤:  The file transmission and playback method in this embodiment includes the following steps:
步骤 S 101 : 根据当前文件传输速度判断近场通讯的当前网络环境是 否达到预设阈值。  Step S101: Determine whether the current network environment of the near field communication reaches a preset threshold according to the current file transmission speed.
具体地, 本申请实施例所述网络环境可以通过当前接收的文件传输 速度获得, 通过所述文件传输速度是否大致相同以及传输速度的快慢确 定所述网络的稳定性和带宽情况。  Specifically, the network environment described in the embodiment of the present application may be obtained by the currently received file transmission speed, and the stability and bandwidth of the network may be determined by whether the file transmission speed is substantially the same and the speed of the transmission speed.
本申请实施例所述预设阈值为本领域技术人员根据需要进行设定。 本申请实施例所述预设阈值可以根据需要进行调整。  The preset thresholds described in the embodiments of the present application are set by those skilled in the art as needed. The preset thresholds described in the embodiments of the present application can be adjusted as needed.
步骤 S 102 : 如达到, 则缓存所述满足播放需求的视频数据中的分段 数据, 并读取播放所述缓存的分段数据。  Step S102: If it is reached, then cache segment data in the video data that meets the playback requirements, and read and play the cached segment data.
本申请实施例所述网络环境达到预设阈值, 则满足通过缓存的方式 进行文件传送与同时播放的要求, 则采用缓存的方式实现数据分段存储 与读取播放。  If the network environment described in the embodiment of the present application reaches a preset threshold, it meets the requirements for file transmission and simultaneous playback by means of caching, and then implements segmented storage and reading and playback of data by means of caching.
在本申请一具体实现中, 通过缓存满足播放需求的视频数据中的分 段数据, 来实现在文件传输过程中即可读取播放所述缓存的分段数据。  In a specific implementation of this application, segmented data in video data that meets playback requirements is cached, so that the cached segmented data can be read and played during the file transmission process.
本申请实施例所述满足播放需求的视频数据为所述视频数据所切分 的分段数据是可以实现直接读取播放的数据。 步骤 S 103 : 如未达到, 则将所述满足播放需求的视频数据中的分段 数据保存至本地代理, 并通过所述本地代理读取播放所述分段数据。 In the embodiment of the present application, the video data that meets the playback requirements is segmented data that is segmented by the video data, which is data that can directly read and play. Step S103: if not, save the segment data in the video data that meets the playback requirements to a local agent, and read and play the segment data through the local agent.
本申请实施例所述网络环境如果未达到预设阈值, 如果继续使用缓 存方式进行文件传送与同时播放, 会因为数据的不连续, 低于播放器播 放速度, 就会出现卡顿、 掉帧等体验问题。 因此, 本申请实施例则采用 本地代理的方式实现数据分段存储与读取播放。  If the network environment described in the embodiment of the present application does not reach the preset threshold, if the file transmission and simultaneous playback are continued in the cache mode, the data discontinuity will be slower than the player playback speed, and there will be stuttering, frame dropping, etc. Experience problems. Therefore, in the embodiment of the present application, a local proxy is used to implement data segmented storage and read and play.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。  From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. The embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
本实施例的文件传输与播放的方法可以由任意适当的具有文件传输 与播放的能力的设备执行, 包括但不限于: 各种设备终端或者服务端, 包括但不限于 PC机、 平板电脑、 移动终端等。  The method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
实施例二 Example two
本实施例包括上述步骤 S 101至步骤 S 103。参见图 2 , 所述方法还包 括步骤 S lOO o This embodiment includes the above steps S101 to S103. Referring to Figure 2, the method further comprising the step S lOO o
步骤 S 100、 对原始视频文件数据进行处理, 令所述原始视频文件数 据的头文件信息位于所述视频文件的头部。  Step S100: Process the original video file data so that the header file information of the original video file data is located at the head of the video file.
视频文件的头文件信息里定义了视频的播放格式、 帧信息、 速率等 信息, 这些信息是播放时必须先获取到的。 如果头文件信息被放在视频 文件的中间或者尾部, 根据视频文件的分段数据就无法进行部分播放, 只能视频文件全部传输完成才可以进行读取播放。  The header file information of the video file defines information such as the video playback format, frame information, and rate. These information must be obtained first during playback. If the header file information is placed in the middle or the tail of the video file, partial playback cannot be performed according to the segmented data of the video file, and the playback can only be performed after the video file has been completely transferred.
因此在近场通信中, 由于视频提供方也是终端设备, 所以在终端设 备中对不符合分段要求的视频文件数据进行重新打包, 把头文件信息移 至视频文件的头部, 然后再发送给另一台终端设备。  Therefore, in near field communication, since the video provider is also a terminal device, the video file data that does not meet the segmentation requirements is repackaged in the terminal device, the header file information is moved to the head of the video file, and then sent to another A terminal device.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。 From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. This The embodiment of the application can adopt different data access modes according to the network environment, so that the transmitted file can be played while the file is being transmitted. In the embodiment of the present application, the user does not need to wait for the video file to be transmitted before playing, which improves the user experience during the near-field transmission.
本实施例的文件传输与播放的方法可以由任意适当的具有文件传输 与播放的能力的设备执行, 包括但不限于: 各种设备终端或者服务端, 包括但不限于 PC机、 平板电脑、 移动终端等。  The method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
实施例三 Example three
本实施例包括上述步骤 S 101至步骤 S 103。参见图 3 ,所述步骤 S 101 包括:  This embodiment includes the above steps S101 to S103. Referring to FIG. 3, the step S101 includes:
步骤 S 101 1、 根据当前文件传输速度判断近场通讯的当前网络环境 的稳定性是否达到稳定性阈值。  Step S 101 1. Determine whether the stability of the current network environment of the near field communication reaches the stability threshold according to the current file transfer speed.
具体地, 本申请实施例根据当前文件传输速度的变化值是否达到稳 定性阈值, 确定当前网络环境的稳定性是否达到稳定性阈值。  Specifically, the embodiment of the present application determines whether the stability of the current network environment reaches the stability threshold according to whether the change value of the current file transmission speed reaches the stability threshold.
步骤 S 1012、 根据当前文件传输速度判断近场通讯的当前网络环境 的传输速度是否达到速度阈值。  Step S 1012: Determine whether the transmission speed of the current network environment of the near field communication reaches the speed threshold according to the current file transmission speed.
具体地, 本申请实施例根据当前文件传输速度是否达到速度阈值, 确定当前网络环境的速度是否达到速度阈值。  Specifically, the embodiment of the present application determines whether the speed of the current network environment reaches the speed threshold according to whether the current file transmission speed reaches the speed threshold.
因此, 本申请实施例通过当前文件传输速度即可简单的判断近场通 讯的当前网络环境, 从而确定网络连接是否满足采取缓存的方式实现文 件传输中的文件播放。  Therefore, the embodiment of the present application can simply judge the current network environment of near field communication based on the current file transmission speed, so as to determine whether the network connection satisfies the method of implementing file playback during file transmission in a cached manner.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。  From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. The embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
本实施例的文件传输与播放的方法可以由任意适当的具有文件传输 与播放的能力的设备执行, 包括但不限于: 各种设备终端或者服务端, 包括但不限于 PC机、 平板电脑、 移动终端等。 实施例四 The method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc. Embodiment 4
本实施例包括上述步骤 S 101至步骤 S 103。 所述步骤 S 102具体为: 如达到预设阈值, 则将所述分段数据逐段保存至高速缓存区, 并写 入本地文件, 对所述高速缓存区的本地文件同时进行读取播放。  This embodiment includes the above steps S101 to S103. The step S102 is specifically: if the preset threshold is reached, the segmented data is saved to the cache area piece by piece, and written into a local file, and the local file in the cache area is simultaneously read and played.
具体地, 当网络环境连接稳定性和传输速度达到预设的阈值时, 无 需在客户端与服务器之间建立本地代理服务器, 只需要以一个恰当容量 的高速缓存区来缓存分段数据, 同时也会写入到本地文件中, 缓存区内 容直接返回给播放器播放, 就能实现视频文件在传输的同时进行播放。  Specifically, when the network environment connection stability and the transmission speed reach a preset threshold, there is no need to establish a local proxy server between the client and the server, and only a cache area with an appropriate capacity is needed to cache the segmented data. It will be written into a local file, and the contents of the buffer area will be directly returned to the player for playback, so that the video file can be played while being transmitted.
本申请实施例所述高速缓存区采用最近最少使用算法缓存技术实现。 最近最少使用算法 ( LruCache, Least Recently Used Cache ) 核心思 想是当缓存满时, 会优先淘汰那些近期最少使用的缓存对象。 LmCache 是一个泛型类, 它内部采用了一个 LinkedHashMap以强引用的方式存储 外界的缓存对象, 其提供 get和 put方法来完成缓存的获取和添加。  The cache area described in the embodiment of the present application is implemented by using the least recently used algorithm cache technology. Least Recently Used Cache (LruCache, Least Recently Used Cache) The core idea is that when the cache is full, those cache objects that are least recently used are preferentially eliminated. LmCache is a generic class. It uses a LinkedHashMap internally to store external cache objects in a strong reference manner. It provides get and put methods to complete cache acquisition and addition.
因此, 本申请实施例可以采用最近最少使用算法缓存技术来实现近 场传输中视频文件的传送同时进行播放, 实现方式简单且极大改善了用 户体验。  Therefore, in the embodiment of the present application, the least recently used algorithm caching technology can be used to realize the transmission of video files in near field transmission and play at the same time. The implementation is simple and greatly improves the user experience.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。  From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. The embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
本实施例的文件传输与播放的方法可以由任意适当的具有文件传输 与播放的能力的设备执行, 包括但不限于: 各种设备终端或者服务端, 包括但不限于 PC机、 平板电脑、 移动终端等。  The method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
实施例五 Example 5
参照图 4 , 示出了根据本申请实施例五的一种文件传输与播放的装 置的结构框图。  Referring to FIG. 4, a structural block diagram of a file transmission and playback device according to Embodiment 5 of the present application is shown.
本实施例的文件传输与播放的装置包括:  The apparatus for file transmission and playback in this embodiment includes:
环境判断模块 401, 配置用于根据当前文件传输速度判断近场通讯 的当前网络环境是否达到预设阈值。 Environment judgment module 401, configured to judge near field communication according to the current file transmission speed Whether or not the current network environment reaches a preset threshold.
缓存读取模块 402,配置用于如达到,则缓存所述满足播放需求的视 频数据中的分段数据, 并读取播放所述缓存的分段数据。  The cache reading module 402 is configured to, if it is reached, cache segment data in the video data that meets the playback requirements, and read and play the cached segment data.
代理读取模块 403 ,配置用于如未达到,则将所述满足播放需求的视 频数据中的分段数据保存至本地代理, 并通过所述本地代理读取播放所 述分段数据。  The proxy reading module 403 is configured to save the segment data in the video data that meets the playback requirements to a local proxy if it is not reached, and read and play the segment data through the local proxy.
具体地, 本申请实施例所述网络环境可以通过当前接收的文件传输 速度获得, 通过所述文件传输速度是否大致相同以及传输速度的快慢确 定所述网络的稳定性和带宽情况。  Specifically, the network environment described in the embodiment of the present application may be obtained by the currently received file transmission speed, and the stability and bandwidth of the network may be determined by whether the file transmission speed is substantially the same and the speed of the transmission speed.
本申请实施例所述预设阈值为本领域技术人员根据需要进行设定。 本申请实施例所述预设阈值可以根据需要进行调整。  The preset thresholds described in the embodiments of the present application are set by those skilled in the art as needed. The preset thresholds described in the embodiments of the present application can be adjusted as needed.
本申请实施例所述网络环境达到预设阈值, 则满足通过缓存的方式 进行文件传送与同时播放的要求, 则采用缓存的方式实现数据分段存储 与读取播放。  If the network environment described in the embodiment of the present application reaches a preset threshold, it meets the requirements for file transmission and simultaneous playback by means of caching, and then implements segmented storage and reading and playback of data by means of caching.
在本申请一具体实现中, 通过缓存满足播放需求的视频数据中的分 段数据, 来实现在文件传输过程中即可读取播放所述缓存的分段数据。  In a specific implementation of this application, segmented data in video data that meets playback requirements is cached, so that the cached segmented data can be read and played during the file transmission process.
本申请实施例所述满足播放需求的视频数据为所述视频数据所切分 的分段数据是可以实现直接读取播放的数据。  The video data that meets the playback requirements described in the embodiments of the present application is segmented data that is segmented by the video data, which is data that can directly read and play.
本申请实施例所述网络环境如果未达到预设阈值, 如果继续使用缓 存方式进行文件传送与同时播放, 会因为数据的不连续, 低于播放器播 放速度, 就会出现卡顿、 掉帧等体验问题。 因此, 本申请实施例则采用 本地代理的方式实现数据分段存储与读取播放。  If the network environment described in the embodiment of the present application does not reach the preset threshold, if the file transmission and simultaneous playback are continued in the cache mode, the data discontinuity will be slower than the player playback speed, and there will be stuttering, frame dropping, etc. Experience problems. Therefore, in the embodiment of the present application, a local proxy is used to implement data segmented storage and read and play.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。  From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. The embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
本实施例的文件传输与播放的装置可以由任意适当的具有文件传输 与播放的能力的设备执行, 包括但不限于: 各种设备终端或者服务端, 包括但不限于 PC机、 平板电脑、 移动终端等。 实施例六 The device for file transmission and playback in this embodiment may be executed by any appropriate device having file transmission and playback capabilities, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc. Example Six
本实施例包括上述环境判断模块 401、 缓存读取模块 402、 代理读取 模块 403。 参见图 5, 所述装置还包括:  This embodiment includes the above-mentioned environment judgment module 401, cache reading module 402, and proxy reading module 403. Referring to FIG. 5, the apparatus further includes:
头部处理模块 400,配置用于对原始视频文件数据进行处理,令所述 原始视频文件数据的头文件信息位于所述视频文件的头部。  The head processing module 400 is configured to process the original video file data, so that header information of the original video file data is located at the head of the video file.
视频文件的头文件信息里定义了视频的播放格式、 帧信息、 速率等 信息, 这些信息是播放时必须先获取到的。 如果头文件信息被放在视频 文件的中间或者尾部, 根据视频文件的分段数据就无法进行部分播放, 只能视频文件全部传输完成才可以进行读取播放。  The header file information of the video file defines information such as the video playback format, frame information, and rate. These information must be obtained first during playback. If the header file information is placed in the middle or the tail of the video file, partial playback cannot be performed according to the segmented data of the video file, and the playback can only be performed after the video file has been completely transferred.
因此在近场通信中, 由于视频提供方也是终端设备, 所以在终端设 备中对不符合分段要求的视频文件数据进行重新打包, 把头文件信息移 至视频文件的头部, 然后再发送给另一台终端设备。  Therefore, in near field communication, since the video provider is also a terminal device, the video file data that does not meet the segmentation requirements is repackaged in the terminal device, the header file information is moved to the head of the video file, and then sent to another A terminal device.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。  From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. The embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
本实施例的文件传输与播放的装置可以由任意适当的具有文件传输 与播放的能力的设备执行, 包括但不限于: 各种设备终端或者服务端, 包括但不限于 PC机、 平板电脑、 移动终端等。  The device for file transmission and playback in this embodiment may be executed by any appropriate device having file transmission and playback capabilities, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
实施例七 Example Seven
本实施例包括上述环境判断模块 401、 缓存读取模块 402、 代理读取 模块 403。 参见图 6, 所述环境判断模块 401包括:  This embodiment includes the above-mentioned environment judgment module 401, cache reading module 402, and proxy reading module 403. Referring to FIG. 6, the environment judgment module 401 includes:
稳定判断单元 4011, 配置用于根据当前文件传输速度判断近场通讯 的当前网络环境的稳定性是否达到稳定性阈值。  The stability judging unit 4011 is configured to judge whether the stability of the current network environment of the near field communication reaches the stability threshold according to the current file transmission speed.
速度判断单元 4012 , 配置用于根据当前文件传输速度判断近场通讯 的当前网络环境的传输速度是否达到速度阈值。  The speed determination unit 4012 is configured to determine whether the transmission speed of the current network environment of the near field communication reaches the speed threshold according to the current file transmission speed.
具体地, 本申请实施例根据当前文件传输速度的变化值是否达到稳 定性阈值, 确定当前网络环境的稳定性是否达到稳定性阈值。 Specifically, the embodiment of the present application determines whether a change value of the current file transmission speed reaches a stable value. The qualitative threshold determines whether the stability of the current network environment reaches the stability threshold.
具体地, 本申请实施例根据当前文件传输速度是否达到速度阈值, 确定当前网络环境的速度是否达到速度阈值。  Specifically, the embodiment of the present application determines whether the speed of the current network environment reaches the speed threshold according to whether the current file transmission speed reaches the speed threshold.
因此, 本申请实施例通过当前文件传输速度即可简单的判断近场通 讯的当前网络环境, 从而确定网络连接是否满足采取缓存的方式实现文 件传输中的文件播放。  Therefore, the embodiment of the present application can simply judge the current network environment of near field communication based on the current file transmission speed, so as to determine whether the network connection satisfies the method of implementing file playback during file transmission in a cached manner.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。  From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. The embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
本实施例的文件传输与播放的装置可以由任意适当的具有文件传输 与播放的能力的设备执行, 包括但不限于: 各种设备终端或者服务端, 包括但不限于 PC机、 平板电脑、 移动终端等。  The device for file transmission and playback in this embodiment may be executed by any appropriate device having file transmission and playback capabilities, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
实施例八 Example eight
本实施例包括上述环境判断模块 401、 缓存读取模块 402、 代理读取 模块 403。 所述缓存读取模块 402具体配置用于:  This embodiment includes the above-mentioned environment judgment module 401, cache reading module 402, and proxy reading module 403. The cache reading module 402 is specifically configured to:
如达到预设阈值, 则将所述分段数据逐段保存至高速缓存区, 并写 入本地文件, 对所述高速缓存区的本地文件同时进行读取播放。  If the preset threshold is reached, the segmented data is saved to the cache area piece by piece, and written into a local file, and the local file in the cache area is read and played simultaneously.
具体地, 当网络环境连接稳定性和传输速度达到预设的阈值时, 无 需在客户端与服务器之间建立本地代理服务器, 只需要以一个恰当容量 的高速缓存区来缓存分段数据, 同时也会写入到本地文件中, 缓存区内 容直接返回给播放器播放, 就能实现视频文件在传输的同时进行播放。  Specifically, when the network environment connection stability and the transmission speed reach a preset threshold, there is no need to establish a local proxy server between the client and the server, and only a cache area with an appropriate capacity is needed to cache the segmented data. It will be written into a local file, and the contents of the buffer area will be directly returned to the player for playback, so that the video file can be played while being transmitted.
本申请实施例所述高速缓存区采用最近最少使用算法缓存技术实现。 最近最少使用算法 ( LruCache, Least Recently Used Cache ) 核心思 想是当缓存满时, 会优先淘汰那些近期最少使用的缓存对象。 LmCache 是一个泛型类, 它内部采用了一个 LinkedHashMap以强引用的方式存储 外界的缓存对象, 其提供 get和 put方法来完成缓存的获取和添加。  The cache area described in the embodiment of the present application is implemented by a least recently used algorithm cache technology. Least Recently Used Cache (LruCache, Least Recently Used Cache) The core idea is that when the cache is full, those cache objects that are least recently used are preferentially eliminated. LmCache is a generic class. It uses a LinkedHashMap internally to store external cache objects in a strong reference manner. It provides get and put methods to complete cache acquisition and addition.
因此, 本申请实施例可以采用最近最少使用算法缓存技术来实现近 场传输中视频文件的传送同时进行播放, 实现方式简单且极大改善了用 户体验。 Therefore, the embodiment of the present application can use the least recently used algorithm cache technology to implement The transmission of video files in the field transmission is played at the same time, the implementation method is simple and the user experience is greatly improved.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。  From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. The embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
本实施例的文件传输与播放的方法可以由任意适当的具有文件传输 与播放的能力的设备执行, 包括但不限于: 各种设备终端或者服务端, 包括但不限于 PC机、 平板电脑、 移动终端等。  The method for file transmission and playback in this embodiment may be performed by any appropriate device capable of file transmission and playback, including but not limited to: various device terminals or servers, including but not limited to PCs, tablets, and mobile phones Terminal, etc.
实施例九 Example Nine
参照图 7 , 示出了根据本申请实施例五的一种设备 /终端 /服务器的结 构框图, 本申请具体实施例并不对设备 /终端 /服务器的具体实现做限定。  Referring to FIG. 7, a structural block diagram of a device / terminal / server according to Embodiment 5 of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the device / terminal / server.
如图 7 所示, 该设备 /终端 /服务器可以包括: 一个或者多个处理器 As shown in Figure 7, the device / terminal / server may include: one or more processors
(processor)702、 存储装置 (memory )704。 (processor) 702, storage device (memory) 704.
其中:  among them:
处理器 702 , 用于执行程序 706 , 具体可以执行上述文件传输与播放 的方法实施例中的相关步骤。  The processor 702 is configured to execute a program 706, and may specifically perform related steps in the foregoing method embodiment of file transmission and playback.
具体地, 程序 706可以包括程序代码, 该程序代码包括计算机操作 指令。  Specifically, the program 706 may include program code, where the program code includes a computer operation instruction.
处理器 702 可能是中央处理器 CPU, 或者是特定集成电路 ASIC ( Application Specific Integrated Circuit ) , 或者是被配置成实施本申请 实施例的一个或多个集成电路。设备 /终端 /服务器包括的一个或多个处理 器, 可以是同一类型的处理器, 如一个或多个 CPU; 也可以是不同类型 的处理器, 如一个或多个 CPU以及一个或多个 ASIC。  The processor 702 may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The device / terminal / server includes one or more processors, which can be processors of the same type, such as one or more CPUs; or different types of processors, such as one or more CPUs and one or more ASICs .
存储装置 704, 用于存放一个或多个程序 706。 存储装置 704可能包 含高速 RAM 存储器, 也可能还包括非易失性存储器 ( non-volatile memory ) , 例如至少一个磁盘存储器。  The storage device 704 is configured to store one or more programs 706. The storage device 704 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
程序 706具体可以用于使得处理器 702执行以下操作: 根据当前文 件传输速度判断近场通讯的当前网络环境是否达到预设阈值; 如达到, 则缓存所述满足播放需求的视频数据中的分段数据, 并读取播放所述缓 存的分段数据; 如未达到, 则将所述满足播放需求的视频数据中的分段 数据保存至本地代理, 并通过所述本地代理读取播放所述分段数据。 The program 706 may be specifically configured to cause the processor 702 to perform the following operations: File transmission speed to determine whether the current network environment of near field communication has reached a preset threshold; if it is, cache the segment data in the video data that meets the playback requirements and read the cached segment data; if not When it is reached, the segment data in the video data that meets the playback requirements is saved to a local agent, and the segment data is read and played by the local agent.
在一种可选的实施方式中, 程序 706还用于对原始视频文件数据进 行处理, 令所述原始视频文件数据的头文件信息位于所述视频文件的头 部。  In an optional implementation manner, the program 706 is further configured to process the original video file data, so that header information of the original video file data is located at a header of the video file.
在一种可选的实施方式中, 程序 706还用于根据当前文件传输速度 判断近场通讯的当前网络环境的稳定性是否达到稳定性阈值; 根据当前 文件传输速度判断近场通讯的当前网络环境的传输速度是否达到速度阈 值。  In an optional implementation manner, the program 706 is further configured to determine whether the stability of the current network environment of the near field communication reaches the stability threshold according to the current file transmission speed; determine the current network environment of the near field communication according to the current file transmission speed. Whether the transmission speed reaches the speed threshold.
在一种可选的实施方式中, 程序 706还用于如达到预设阈值, 则将 所述分段数据逐段保存至高速缓存区, 并写入本地文件, 对所述高速缓 存区的本地文件同时进行读取播放。  In an optional implementation manner, the program 706 is further configured to, if the preset threshold is reached, save the segmented data to the cache area piece by piece, and write the local file to a local file of the cache area The file is read and played simultaneously.
在一种可选的实施方式中, 所述高速缓存区采用最近最少使用算法 缓存技术实现。  In an optional implementation manner, the cache area is implemented by a least recently used algorithm cache technology.
由此可知, 本申请实施例根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值, 达到则采用缓存方式进行数据分段存储 与读取播放, 未达到则采用本地代理进行数据分段存储与读取播放。 本 申请实施例可根据网络环境采取不同的数据存取方式, 从而实现在文件 传输的同时可对所传输的文件进行播放。 本申请实施例用户无需等待视 频文件传输完成再进行播放, 改善了近场传输过程中的用户体验。  From this, it can be known that the embodiment of the present application determines whether the current network environment of near field communication has reached a preset threshold according to the current file transfer speed. If the current network environment reaches a preset threshold, the cache is used for segmented data storage and reading and playback. Segmented storage and read playback. The embodiments of the present application can adopt different data access modes according to the network environment, so that the transmitted files can be played while the files are being transmitted. In the embodiment of the present application, the user does not need to wait for the video file transmission to be completed before playing, which improves the user experience in the near-field transmission process.
需要指出, 根据实施的需要, 可将本申请实施例中描述的各个部件 / 步骤拆分为更多部件 /步骤, 也可将两个或多个部件 /步骤或者部件 /步骤 的部分操作组合成新的部件 /步骤, 以实现本申请实施例的目的。  It should be noted that according to the needs of implementation, each component / step described in the embodiment of the present application may be split into more components / steps, or two or more components / steps or partial operations of components / steps may be combined into New components / steps to achieve the purpose of the embodiments of the present application.
特别地, 根据本公开的实施例, 上文参考流程图描述的过程可以被 实现为计算机软件程序。 例如, 本公开的实施例包括一种计算机程序产 品, 其包括承载在计算机可读介质上的计算机程序, 该计算机程序包含 用于执行流程图所示的方法的程序代码。 在这样的实施例中, 该计算机 程序可以通过通信部分从网络上被下载和安装, 和 /或从可拆卸介质被安 装。在该计算机程序被中央处理单元(CPU)执行时, 执行本申请的方法 中限定的上述功能。 需要说明的是, 本申请所述的计算机可读介质可以 是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意 组合。 计算机可读存储介质例如可以是一一但不限于一一电、 磁、 光、 电磁、 红外线、 或半导体的系统、装置或器件, 或者任意以上的组合。计 算机可读存储介质的更具体的例子可以包括但不限于: 具有一个或多个 导线的电连接、 便携式计算机磁盘、 硬盘、 随机访问存储器 (RAM) 、 只读存储器(ROM) 、 可擦式可编程只读存储器(EPROM或闪存) 、 光 纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、 或者上述的任意合适的组合。 在本申请中, 计算机可读存储介质可以是 任何包含或存储程序的有形介质, 该程序可以被指令执行系统、 装置或 者器件使用或者与其结合使用。 而在本申请中, 计算机可读的信号介质 可以包括在基带中或者作为载波一部分传播的数据信号, 其中承载了计 算机可读的程序代码。 这种传播的数据信号可以采用多种形式, 包括但 不限于电磁信号、 光信号或上述的任意合适的组合。 计算机可读的信号 介质还可以是计算机可读存储介质以外的任何计算机可读介质, 该计算 机可读介质可以发送、 传播或者传输用于由指令执行系统、 装置或者器 件使用或者与其结合使用的程序。 计算机可读介质上包含的程序代码可 以用任何适当的介质传输,包括但不限于:无线、 电线、光缆、 RF等等, 或者上述的任意合适的组合。 In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing a method shown in a flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through a communication section, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), the aforementioned functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in this application may be It is a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable memories Programming read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing. In this application, a computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal that is included in baseband or propagated as part of a carrier wave, and which carries computer-readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device . Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的 操作的计算机程序代码, 所述程序设计语言包括面向对象的程序设计语 言一诸如 Java、 Smalltalk、 C++, 还包括常规的过程式程序设计语言一诸 如” C”语言或类似的程序设计语言。 程序代码可以完全地在用户计算机 上执行、 部分地在用户计算机上执行、 作为一个独立的软件包执行、 部 分在用户计算机上部分在远程计算机上执行、 或者完全在远程计算机或 服务器上执行。 在涉及远程计算机的情形中, 远程计算机可以通过任意 种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机, 或者, 可以连接到外部计算机 (例如利用因特网服务提供商来通过因特 网连接) 。  Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, the programming languages including an object-oriented programming language such as Java, Smalltalk, C ++, and also conventional A procedural programming language such as "C" or a similar programming language. The program code can be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider using the Internet Connection).
附图中的流程图和框图, 图示了按照本申请各种实施例的系统、 方 法和计算机程序产品的可能实现的体系架构、 功能和操作。 在这点上, 流程图或框图中的每个方框可以代表一个模块、 程序段、 或代码的一部 分, 该模块、 程序段、 或代码的一部分包含一个或多个用于实现规定的 逻辑功能的可执行指令。 也应当注意, 在有些作为替换的实现中, 方框 中所标注的功能也可以以不同于附图中所标注的顺序发生。 例如, 两个 接连地表示的方框实际上可以基本并行地执行, 它们有时也可以按相反 的顺序执行, 这依所涉及的功能而定。 也要注意的是, 框图和 /或流程图 中的每个方框、 以及框图和 /或流程图中的方框的组合, 可以用执行规定 的功能或操作的专用的基于硬件的系统来实现, 或者可以用专用硬件与 计算机指令的组合来实现。 The flowchart and block diagrams in the accompanying drawings illustrate the architecture, functions, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more components for implementing a specified Executable instructions for logic functions. It should also be noted that in some alternative implementations, the functions marked in the blocks may also occur in a different order than those marked in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented in a dedicated hardware-based system that performs the specified function or operation. Or, it can be implemented by a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现, 也可以通过硬件的方式来实现。 所描述的单元也可以设置在处理器中, 例如, 可以描述为: 一种处理器包括接收单元、 解析单元、 信息选取单 元和生成单元。 其中, 这些单元的名称在某种情况下并不构成对该单元 本身的限定, 例如, 接收单元还可以被描述为 “接收用户的网页浏览请 求的单元” 。  The units described in the embodiments of the present application may be implemented in a software manner, or may be implemented in a hardware manner. The described unit may also be provided in a processor, for example, it may be described as: A processor includes a receiving unit, a parsing unit, an information selecting unit, and a generating unit. Among them, the names of these units do not in any way constitute a limitation on the unit itself. For example, the receiving unit may also be described as a "unit for receiving a user's web browsing request".
作为另一方面, 本申请还提供了一种计算机可读介质, 其上存储有 计算机程序, 该程序被处理器执行时实现如上述任一实施例中所描述的 方法。  As another aspect, the present application also provides a computer-readable medium having stored thereon a computer program that, when executed by a processor, implements a method as described in any one of the above embodiments.
作为另一方面, 本申请还提供了一种计算机可读介质, 该计算机可 读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在, 而未装配入该装置中。 上述计算机可读介质承载有一个或者多个程序, 当上述一个或者多个程序被该装置执行时, 使得该装置: 根据当前文件 传输速度判断近场通讯的当前网络环境是否达到预设阈值; 如达到, 则 缓存所述满足播放需求的视频数据中的分段数据, 并读取播放所述缓存 的分段数据; 如未达到, 则将所述满足播放需求的视频数据中的分段数 据保存至本地代理, 并通过所述本地代理读取播放所述分段数据。  As another aspect, the present application further provides a computer-readable medium, which may be included in the device described in the foregoing embodiments; or may exist alone without being assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device is caused to: determine whether a current network environment of the near field communication reaches a preset threshold according to a current file transmission speed; When it is reached, the segment data in the video data that meets the playback requirements is cached, and the cached segment data is read and played; if it is not reached, the segment data in the video data that meets the playback requirements is saved To the local agent, and read and play the segment data through the local agent.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。 本领域技术人员应当理解, 本申请中所涉及的发明范围, 并不限于上述 技术特征的特定组合而成的技术方案, 同时也应涵盖在不脱离上述发明 构思的情况下, 由上述技术特征或其等同特征进行任意组合而形成的其 它技术方案。 例如上述特征与本申请中公开的 (但不限于) 具有类似功 能的技术特征进行互相替换而形成的技术方案。  The above description is only a preferred embodiment of the present application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution of the specific combination of the above technical features, but also covers the above technical features or Other technical solutions formed by arbitrarily combining their equivalent features. For example, a technical solution formed by replacing the above features with technical features disclosed in the present application (but not limited to) with similar functions.

Claims

权 利 要 求 书 Claim
1、 一种文件传输与播放的方法, 其特征在于, 所述方法包括: 根据当前文件传输速度判断近场通讯的当前网络环境是否达到预设 阈值; 1. A method of file transmission and playback, characterized in that the method comprises: judging whether a current network environment of near field communication reaches a preset threshold according to a current file transmission speed;
如达到, 则缓存所述满足播放需求的视频数据中的分段数据, 并读 取播放所述缓存的分段数据;  If so, buffer segment data in the video data that meets the playback requirements, and read and play the buffered segment data;
如未达到, 则将所述满足播放需求的视频数据中的分段数据保存至 本地代理, 并通过所述本地代理读取播放所述分段数据。  If not, the segment data in the video data that meets the playback requirements is saved to a local proxy, and the segment data is read and played by the local proxy.
2、 根据权利要求 1所述的方法, 其特征在于, 所述根据当前文件传 输速度判断近场通讯的当前网络环境是否达到预设阈值之前包括:  2. The method according to claim 1, wherein before determining whether the current network environment of the near field communication reaches a preset threshold according to the current file transmission speed comprises:
对原始视频文件数据进行处理, 令所述原始视频文件数据的头文件 信息位于所述视频文件的头部。  The original video file data is processed so that the header file information of the original video file data is located at the head of the video file.
3、 根据权利要求 1所述的方法, 其特征在于, 所述根据当前文件传 输速度判断近场通讯的当前网络环境是否达到预设阈值包括:  3. The method according to claim 1, wherein the determining whether the current network environment of the near field communication reaches a preset threshold according to the current file transmission speed comprises:
根据当前文件传输速度判断近场通讯的当前网络环境的稳定性是否 达到稳定性阈值;  Judging whether the stability of the current network environment of the near field communication reaches the stability threshold according to the current file transfer speed;
根据当前文件传输速度判断近场通讯的当前网络环境的传输速度是 否达到速度阈值。  Determine whether the transmission speed of the current network environment of the near field communication reaches the speed threshold according to the current file transmission speed.
4、 根据权利要求 1所述的方法, 其特征在于, 所述如达到, 则缓存 所述满足播放需求的视频数据中的分段数据, 并读取播放所述缓存的分 段数据具体为:  4. The method according to claim 1, wherein the step of buffering segment data in the video data that meets playback requirements and reading and playing the cached segment data is:
如达到预设阈值, 则将所述分段数据逐段保存至高速缓存区, 并写 入本地文件, 对所述高速缓存区的本地文件同时进行读取播放。  If the preset threshold is reached, the segmented data is saved to the cache area piece by piece, and written into a local file, and the local file in the cache area is read and played simultaneously.
5、 根据权利要求 4所述的方法, 其特征在于, 所述高速缓存区采用 最近最少使用算法缓存技术实现。  5. The method according to claim 4, wherein the cache area is implemented by a least recently used algorithm cache technology.
6、 一种文件传输与播放的装置, 其特征在于, 所述装置包括: 环境判断模块, 配置用于根据当前文件传输速度判断近场通讯的当 前网络环境是否达到预设阈值;  6. A device for file transmission and playback, characterized in that the device includes: an environment judgment module configured to determine whether the current network environment of near field communication has reached a preset threshold according to the current file transmission speed;
缓存读取模块, 配置用于如达到, 则缓存所述满足播放需求的视频 数据中的分段数据, 并读取播放所述缓存的分段数据;  A cache reading module, configured to cache segment data in the video data that satisfies playback requirements if the cache read module is reached, and read and play the cached segment data;
代理读取模块, 配置用于如未达到, 则将所述满足播放需求的视频 数据中的分段数据保存至本地代理, 并通过所述本地代理读取播放所述 分段数据。 A proxy reading module, configured to, if not reached, transfer the video that meets the playback requirements The segment data in the data is saved to a local agent, and the segment data is read and played by the local agent.
7、 根据权利要求 6所述的装置, 其特征在于, 所述装置还包括: 头部处理模块, 配置用于对原始视频文件数据进行处理, 令所述原 始视频文件数据的头文件信息位于所述视频文件的头部。  7. The device according to claim 6, further comprising: a head processing module configured to process the original video file data, so that header information of the original video file data is located in the The head of the video file.
8、 根据权利要求 6所述的装置, 其特征在于, 所述环境判断模块包 括:  8. The device according to claim 6, wherein the environment judgment module comprises:
稳定判断单元, 配置用于根据当前文件传输速度判断近场通讯的当 前网络环境的稳定性是否达到稳定性阈值;  A stability judging unit configured to judge whether the stability of the current network environment of the near field communication reaches a stability threshold according to the current file transfer speed;
速度判断单元, 配置用于根据当前文件传输速度判断近场通讯的当 前网络环境的传输速度是否达到速度阈值。  The speed judging unit is configured to judge whether the transmission speed of the current network environment of the near field communication reaches the speed threshold according to the current file transmission speed.
9、 根据权利要求 6所述的装置, 其特征在于, 所述缓存读取模块具 体配置用于:  9. The device according to claim 6, wherein the cache reading module is specifically configured to:
如达到预设阈值, 则将所述分段数据逐段保存至高速缓存区, 并写 入本地文件, 对所述高速缓存区的本地文件同时进行读取播放。  If the preset threshold is reached, the segmented data is saved to the cache area piece by piece, and written into a local file, and the local file in the cache area is read and played simultaneously.
10、 根据权利要求 9所述的装置, 其特征在于, 所述高速缓存区采 用最近最少使用算法缓存技术实现。  10. The device according to claim 9, wherein the cache area is implemented by a least recently used algorithm cache technology.
1 1、 一种设备 /终端 /服务器, 包括:  1 1. A device / terminal / server, including:
一个或多个处理器;  One or more processors;
存储装置, 用于存储一个或多个程序,  A storage device for storing one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行, 使得所述一 个或多个处理器实现如权利要求 1-5中任一所述的方法。  When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method according to any one of claims 1-5.
12、 一种计算机可读存储介质, 其上存储有计算机程序, 其特征在 于, 该程序被处理器执行时实现如权利要求 1-5中任一所述的方法。  12. A computer-readable storage medium having stored thereon a computer program, characterized in that when the program is executed by a processor, the method according to any one of claims 1-5 is implemented.
PCT/IB2018/057146 2018-08-27 2018-09-18 File transfer and play method and apparatus, and device/terminal/server WO2020044086A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810982341.1A CN108965984A (en) 2018-08-27 2018-08-27 A kind of method, apparatus and equipment/terminal/server file transmission and played
CN201810982341.1 2018-08-27

Publications (1)

Publication Number Publication Date
WO2020044086A1 true WO2020044086A1 (en) 2020-03-05

Family

ID=64474162

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/IB2018/057146 WO2020044086A1 (en) 2018-08-27 2018-09-18 File transfer and play method and apparatus, and device/terminal/server

Country Status (2)

Country Link
CN (1) CN108965984A (en)
WO (1) WO2020044086A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113655B (en) * 2019-05-05 2021-09-21 北京奇艺世纪科技有限公司 Video playing method and device and user terminal
CN110247985B (en) * 2019-06-28 2022-06-03 北京奇艺世纪科技有限公司 Resource downloading method and device, electronic equipment and medium
CN113315810B (en) * 2021-04-29 2023-04-07 上海探寻信息技术有限公司 Online audio playing method and equipment
CN113992651B (en) * 2021-09-24 2024-05-14 深圳市有方科技股份有限公司 Downloading method based on File Transfer Protocol (FTP) and related products

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103402136A (en) * 2013-07-29 2013-11-20 重庆大学 Self-adaptive cache adjustment control method and device and self-adaptive player
CN104320417A (en) * 2014-11-06 2015-01-28 北京安奇智联科技有限公司 Method for interconnection and stream transmission and stream media play between mobile terminal and web terminal
US20170272792A1 (en) * 2016-03-16 2017-09-21 Telefonaktiebolaget Lm Ericsson (Publ) Distributed content popularity determination in a streaming environment with interconnected set-top boxes
US20180167428A1 (en) * 2014-12-19 2018-06-14 Intel Corporation Network proxy for energy efficient video streaming on mobile devices
US20180176615A1 (en) * 2015-07-03 2018-06-21 Telefonaktiebolaget Lm Ericsson (Publ) A media user client, a media user agent and respective methods performed thereby for providing media from a media server to the media user client

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100547995C (en) * 2004-06-30 2009-10-07 联想(北京)有限公司 The data transmission method of equipment room in a kind of network
EP2355563A1 (en) * 2010-02-10 2011-08-10 Cheng Uei Precision Industry Co., Ltd. Method for automatic pairing to a wireless network
CN103874063A (en) * 2012-12-17 2014-06-18 鸿富锦精密工业(深圳)有限公司 Electronic device and method for establishing communication between electronic devices
CN103561480A (en) * 2013-10-21 2014-02-05 广东明创软件科技有限公司 Data transmission method
CN104320164A (en) * 2014-10-14 2015-01-28 宇龙计算机通信科技(深圳)有限公司 Data transmission method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103402136A (en) * 2013-07-29 2013-11-20 重庆大学 Self-adaptive cache adjustment control method and device and self-adaptive player
CN104320417A (en) * 2014-11-06 2015-01-28 北京安奇智联科技有限公司 Method for interconnection and stream transmission and stream media play between mobile terminal and web terminal
US20180167428A1 (en) * 2014-12-19 2018-06-14 Intel Corporation Network proxy for energy efficient video streaming on mobile devices
US20180176615A1 (en) * 2015-07-03 2018-06-21 Telefonaktiebolaget Lm Ericsson (Publ) A media user client, a media user agent and respective methods performed thereby for providing media from a media server to the media user client
US20170272792A1 (en) * 2016-03-16 2017-09-21 Telefonaktiebolaget Lm Ericsson (Publ) Distributed content popularity determination in a streaming environment with interconnected set-top boxes

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"A Strategy of Downloading While Playing", WECHAT OFFICIAL ACOUNTS PLATFORM, 7 September 2017 (2017-09-07), Retrieved from the Internet <URL:https://mp.weixin.qq.com/s?_biz=MzI20TQxMTM40Q==&mid=2247485181&idx=l&sn=b0226b55629bdc5787cbdc71feecbbca&chksm=eaelf3afdd967ab9fe8a81eab348c1a1699a46284f7a45f7f30a8ee8279a565aaf91d39a2de8#rd> *
ZHOU, X.: "A Design and Implement of P2P-Based Streaming Media Proxy System", MASTER THESIS OF BEIJING UNIVERSITY OF POSTS AND TELECOMMUNICATIONS, 10 February 2009 (2009-02-10) *

Also Published As

Publication number Publication date
CN108965984A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
WO2020044086A1 (en) File transfer and play method and apparatus, and device/terminal/server
US9934065B1 (en) Servicing I/O requests in an I/O adapter device
US8495262B2 (en) Using a table to determine if user buffer is marked copy-on-write
US10360913B2 (en) Speech recognition method, device and system based on artificial intelligence
US20160112919A1 (en) Seamless application connectivity
WO2017129130A1 (en) Audio processing method, server, user equipment, and system
WO2021136161A1 (en) Playback mode determining method and apparatus
WO2024037296A1 (en) Protocol family-based quic data transmission method and device
US9325803B2 (en) Methods, circuits, devices, systems and associated computer executable code for caching content
US10140246B2 (en) Optimizing remote direct memory access (RDMA) with cache aligned operations
EP3804244A1 (en) Systems and methods for transport layer processing of server message block protocol messages
WO2015055008A1 (en) Storage controller chip and disk packet transmission method
KR100449806B1 (en) A network-storage apparatus for high-speed streaming data transmission through network
US10949095B2 (en) Method, network adapters and computer program product using network adapter memory to service data requests
US20160261484A9 (en) Chip multi processor and router for chip multi processor
JP2011505623A (en) Method, apparatus, and computer program for improving memory usage
JP2010004262A (en) Information reception device and information reception method
US7826356B2 (en) Method and system for controlling flow in an asymmetric communication channel
WO2020044087A2 (en) Method, device, and equipment/terminal/server for conversational file transmission
WO2014205638A1 (en) Method and device for transmitting data packet
US20090106395A1 (en) Satellite Data Network Acceleration
CN113438162B (en) Method and device for realizing two-layer forwarding
KR101376909B1 (en) User terminal and data providing server for less traffic in wireless communication network, data streaming system and method using the same
JP2002202929A (en) Rapid delivery-required data processing method and device therefor
KR101836220B1 (en) Apparatus and method for media sharing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18932098

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18932098

Country of ref document: EP

Kind code of ref document: A1