CN109982160A - A kind of method, apparatus, client device and server that video uploads - Google Patents

A kind of method, apparatus, client device and server that video uploads Download PDF

Info

Publication number
CN109982160A
CN109982160A CN201910281811.6A CN201910281811A CN109982160A CN 109982160 A CN109982160 A CN 109982160A CN 201910281811 A CN201910281811 A CN 201910281811A CN 109982160 A CN109982160 A CN 109982160A
Authority
CN
China
Prior art keywords
video
fragment
uploaded
slicing
upload
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910281811.6A
Other languages
Chinese (zh)
Inventor
魏晓峰
查智文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910281811.6A priority Critical patent/CN109982160A/en
Publication of CN109982160A publication Critical patent/CN109982160A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • 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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Environmental & Geological Engineering (AREA)
  • Power Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention provides method, apparatus, client device and servers that a kind of video uploads.The described method includes: obtaining video to be uploaded;Detect current network conditions;According to the corresponding relationship of preset Network status and video slicing data volume size, current video fragment data amount size is determined;Video to be uploaded is pressed into the current video fragment data amount size, fragment is carried out, obtains multiple video slicings;Multiple video slicings of video to be uploaded are uploaded to server, so that the video slicing received is combined by server, obtain complete video.As it can be seen that when video to be uploaded is carried out fragment, video can be carried out fragment by different data volume sizes according to Network status using the embodiment of the present invention, unlike no matter video is all carried out fragment by fixed size to the prior art by the good or bad of Network status.Therefore, in the case where Network status is bad, a possibility that video slicing uploads successfully, is big, improves the success rate of video upload.

Description

A kind of method, apparatus, client device and server that video uploads
Technical field
The present invention relates to the technical field that video uploads, the method, apparatus uploaded more particularly to a kind of video, client Equipment and server.
Background technique
Currently, from client device uploaded videos to server, such as: the video or advertisement video material that user is shot When equal videos upload server, most common mode is to carry out fragment by fixed size to all videos.Such as it can be by view The every 20M of the size of frequency is a video slicing, then uploads each video slicing, the video slicing that will be received by server It is combined, obtains complete video.
Inventor has found that at least there are the following problems for the prior art in the implementation of the present invention:
When carrying out fragment to video, no matter video slicing is all multiple views by fixed size by the good or bad of Network status A possibility that frequency division piece causes in the case where Network status is bad, and video slicing uploads failure is big, and success rate is not high enough.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of method, apparatus, client device and server that video uploads, To improve the success rate of video upload.Specific technical solution is as follows:
In a first aspect, being applied to client device, the side the embodiment of the invention provides a kind of method that video uploads Method includes:
Obtain video to be uploaded;
Detect current network conditions;
According to the corresponding relationship of preset Network status and video slicing data volume size, current video fragment data is determined Measure size;
The video to be uploaded is pressed into the current video fragment data amount size, carries out fragment, obtains multiple videos point Piece;
Multiple video slicings of the video to be uploaded are uploaded to server, so that server divides the video received Piece is combined, and obtains complete video.
Optionally, after the acquisition video to be uploaded the step of, before the step of detecting current network conditions, also Include:
Uploaded videos are sent to request to server;
Receive the unique identification that server returns, the mark as the video to be uploaded;
Multiple video slicings by the video to be uploaded are uploaded to server, so that the view that server will receive The step of frequency division piece is combined, obtains complete video, comprising:
The mark of each video slicing and the video to be uploaded is uploaded to server simultaneously, so that server will receive To video slicing be combined by the mark of the video to be uploaded, obtain complete video.
Optionally, the step of detection current network conditions, comprising:
According to preset for detecting the data volume size of the fragment of network speed, a piece of detection network speed fragment, the spy are obtained It include the mark of the video to be uploaded in survey grid speed fragment;
Send the detection network speed fragment;
It records the sending time of the detection network speed fragment and receives the detection network speed fragment that server returns and upload The time of success message;
According in the detection network speed fragment sending time and the detection network speed fragment for receiving server return The time of success message is passed, the current transmission duration of the detection network speed fragment is calculated, as current network conditions index;
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: detection network speed fragment Transmit the corresponding relationship of duration range and video slicing data volume size;
The corresponding relationship according to preset Network status and video slicing data volume size, determines current video fragment The step of data volume size, comprising:
Transmission duration range locating for current transmission duration is determined, according to the transmission duration range of the detection network speed fragment With the corresponding relationship of video slicing data volume size, current video fragment data amount size is determined;
Or,
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: Network status is good or bad With the corresponding relationship of video slicing data volume size;
The corresponding relationship according to preset Network status and video slicing data volume size, determines current video fragment The step of size, comprising:
Judge whether current transmission duration is less than the good or bad transmission duration threshold value of preset Network status for identification;
If it is less, determining that Network status is good, otherwise determine that Network status is bad;
According to Network status is good or the bad corresponding relationship with video slicing data volume size, current video fragment data is determined Measure size.
Optionally, the data volume size according to the preset fragment for being used to detect network speed, obtains a piece of detection network speed The step of fragment includes the mark of the video to be uploaded in the detection network speed fragment, comprising:
According to preset for detecting the data volume size of the fragment of network speed, a piece of detection network speed fragment is obtained;
Calculate the MD5 value of the detection network speed fragment;
The calculated MD5 value is added in detection network speed fragment, so that server receives the detection network speed fragment The MD5 value that received detection network speed fragment is calculated after data, according to the MD5 value and itself meter in detection network speed fragment The MD5 value of calculation does MD5 verification, and successfully disappears after verifying successfully to the upload that client device returns to the detection network speed fragment Breath.
Optionally, described that the video to be uploaded is pressed into the current video fragment data amount size, fragment is carried out, is obtained The step of multiple video slicings, comprising:
The video to be uploaded is pressed into the current video fragment size, carries out fragment;
Calculate the MD5 value of the video slicing;
The MD5 value of the video slicing is added in video slicing so that server receive the video slicing data it The MD5 value for calculating received video slicing afterwards is done according to the MD5 value in the video slicing and the MD5 value itself calculated MD5 is verified, and returns to the upload success message of presently described video slicing to client device after verifying successfully.
Optionally, multiple video slicings by the video to be uploaded are uploaded to server, so that server will connect The step of video slicing received is combined, obtains complete video, comprising:
Each video slicing is sent into upload fragment queue to be processed, the video slicing includes the number of the video slicing According to, the mark of range, MD5 value and the video to be uploaded;
Video slicing is successively uploaded to server from upload fragment queue to be processed, so that server receives the view The MD5 value that received video slicing is calculated after frequency division sheet data, according in the video slicing MD5 value and itself The MD5 value of calculating does MD5 verification, for the video slicing verified by MD5, sends to client device and uploads success message;
According to whether receiving the upload success message of server return, judge whether video slicing uploads success;
If not receiving the upload success message of server return, video slicing feeding mistake is retried into fragment team Column, and judge whether there are also video slicings in upload fragment queue to be processed;
If receiving the upload success message of server return, judge whether there are also regard in upload fragment queue to be processed Frequency division piece;
If there are also video slicing in upload fragment queue to be processed, execute it is described from upload fragment queue to be processed successively The step of video slicing is uploaded to server;
If not having video slicing in upload fragment queue to be processed, also whether misjudgment retried in fragment queue Video slicing;
If mistake retries in fragment queue, there are also video slicings, and the video slicing that mistake retries fragment queue is sent into Upload fragment queue to be processed;
If mistake, which retries in fragment queue, does not have video slicing, sends the message that this uploaded videos terminates and extremely service Device, so that server carries out group according to the fragment range received and the mark of video to be uploaded, by the video slicing received It closes, obtains complete video.
Optionally, after each determining upload success message for not receiving server return, further includes:
Statistics does not upload successful number;
Judgement does not upload whether successful number is less than upload errors number threshold limit;
Errors number threshold limit is uploaded if not uploading successful number and being less than, is executed described by the video slicing It is put into the step of mistake retries fragment queue;
If not uploading successful number not less than errors number limitation is uploaded, cancel the upload of this video.
Optionally, after the acquisition video to be uploaded the step of, before the step of detecting current network conditions, also Include:
Read user configuration information, judge user whether configuration data format check;
If user configuration data format verifies, the data format check information of user configuration is read;
According to the data format check information, the data format information of video to be uploaded is obtained;
Judge whether the data format information of the video to be uploaded meets data format verification condition;
If it is satisfied, then the step of determining that verification passes through, executing the detection current network conditions.
Optionally,
The data format check information of the user configuration includes: stringent verification or non-critical verification;
It is described according to data format check information if user configuration is strictly to verify, obtain video to be uploaded The step of data format information, comprising: obtain format, the ratio of width to height, duration and the data volume of video to be uploaded;
The step of whether data format information of the video to be uploaded meets data format verification condition judged, comprising:
According to the standard value of preset format, the ratio of width to height, duration and data volume, the data format information of uploaded videos is treated It is verified;
It is described according to data format check information if user configuration is non-critical verification, obtain video to be uploaded Data format information the step of, comprising: obtain the data volume of video to be uploaded;
Whether the data format information for judging the video to be uploaded meets the step of data format verification condition, packet It includes:
According to the standard value of preset data volume, the data format information for treating uploaded videos is verified.
Optionally, after the acquisition video to be uploaded the step of, the detection current network conditions the step of it Before, further includes:
User configuration information is read, judges whether user is provided with fragment data amount size;
If user setting fragment data amount size, is sized to the fragment data amount of user setting to work as forward sight Frequency division sheet data amount size;
It executes and the video to be uploaded is pressed into the current video fragment data amount size, carry out fragment, obtain multiple views The step of frequency division piece;
The step of if fragment data amount size is not arranged in user, executes the detection current network conditions.
Second aspect, the embodiment of the invention provides a kind of methods that video uploads, and are applied to server, the method packet It includes:
Multiple video slicings that client device is sent are received, the video slicing is that client device obtains view to be uploaded After frequency, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, determination is worked as The video to be uploaded is pressed the current video fragment data amount size, carries out fragment, obtain by forward sight frequency division sheet data amount size The multiple video slicings obtained;
The video slicing received is combined, complete video is obtained.
Optionally, it is described reception client device send multiple video slicings the step of before, further includes:
Receive the uploaded videos request that client device is sent;
Unique identification is sent to client device, so that client device is using the unique identification as video to be uploaded Mark;
The multiple video slicings for receiving client device and sending, the video slicing are that client device is obtained to upper After passing video, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, really The video to be uploaded is pressed the current video fragment data amount size, is divided by settled forward sight frequency division sheet data amount size Piece, in multiple video slicings of acquisition, the video slicing include the data of the video slicing, range, MD5 value and it is described to The mark of uploaded videos;
The step of video slicing that will be received is combined, obtains complete video, comprising:
Video belonging to the video slicing is determined according to the mark of the video to be uploaded of client device transmission;
According to the data of the video slicing received, the MD5 value of received video slicing is calculated, according to itself MD5 value in the MD5 value and the video slicing of calculating, does MD5 verification, judges whether the video slicing uploads success;
If video slicing uploads successfully, sends and upload success message to client device;
Judge whether that receiving the video uploads end message;
If receiving video uploads end message, execute the video slicing that will be received and be combined, obtains The step of complete video.
The third aspect, the invention also discloses the devices that a kind of video uploads, and are applied to client device, described device packet It includes:
First obtains unit, for obtaining video to be uploaded;
First probe unit, for detecting current network conditions;
First determination unit, for the corresponding relationship according to preset Network status and video slicing data volume size, really Settled forward sight frequency division sheet data amount size;
First sharding unit is divided for the video to be uploaded to be pressed the current video fragment data amount size Piece obtains multiple video slicings;
Multiple video slicings of the video to be uploaded are uploaded to server by the first uploading unit, so that server will The video slicing received is combined, and obtains complete video.
Optionally, described device further include:
First transmission unit, for being detected described first after the first obtains unit obtains video to be uploaded Before unit detects current network conditions, sends uploaded videos and request to server;
First receiving unit, the mark for receiving the unique identification of server return, as the video to be uploaded;
First uploading unit, comprising: the first uploading module;
First uploading module, for the mark of each video slicing and the video to be uploaded to be uploaded to clothes simultaneously Business device obtains complete view so that the video slicing received is combined by server by the mark of the video to be uploaded Frequently.
Optionally, first probe unit, comprising: first obtain module, the first sending module, the first logging modle and First computing module;
Described first obtains module, for, for detecting the data volume size of the fragment of network speed, obtaining one according to preset Piece detects network speed fragment, includes the mark of the video to be uploaded in the detection network speed fragment;
First sending module, for sending the detection network speed fragment;
First logging modle, for recording the sending time of the detection network speed fragment and receiving what server returned The detection network speed fragment uploads the time of success message;
First computing module, for being returned according to the detection network speed fragment sending time and the reception server The detection network speed fragment upload success message time, calculate it is described detection network speed fragment current transmission duration, as Current network conditions index;
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: detection network speed fragment Transmit the corresponding relationship of duration range and video slicing data volume size;
First determination unit, comprising: the first determining module;
First determining module, for determining transmission duration range locating for current transmission duration, according to the detection The transmission duration range of network speed fragment and the corresponding relationship of video slicing data volume size, determine that current video fragment data amount is big It is small;
Or,
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: Network status is good or bad With the corresponding relationship of video slicing data volume size;
First determination unit, comprising: first judgment module, the second determining module, third determining module;
The first judgment module, for judging it is good whether current transmission duration is less than preset Network status for identification Or bad transmission duration threshold value;
Second determining module, if being less than the transmission duration threshold value for current transmission duration, it is determined that network Situation is good, otherwise determines that Network status is bad;
The third determining module, for according to Network status it is good or badly it is corresponding with video slicing data volume size close System, determines current video fragment data amount size.
Optionally, described first module is obtained, comprising: the first acquisition submodule, the first computational submodule and first are added Submodule;
First acquisition submodule, for, for detecting the data volume size of the fragment of network speed, being obtained according to preset A piece of detection network speed fragment;
First computational submodule, for calculating the MD5 value of the detection network speed fragment;
Described first is added submodule, for the calculated MD5 value to be added in detection network speed fragment, so that server The MD5 value that the detection network speed fragment data calculates received detection network speed fragment later is received, according to detection network speed The MD5 value of MD5 value and itself calculating in fragment does MD5 verification, and returns to the spy to client device after verifying successfully The upload success message of survey grid speed fragment.
Optionally, first sharding unit, comprising: module is added in the first fragment module, the first computing module and first;
The first fragment module carries out fragment for the video to be uploaded to be pressed the current video fragment size;
First computing module, for calculating the MD5 value of the video slicing;
Described first is added module, for the MD5 value of the video slicing to be added in video slicing, so that server receives The MD5 value that received video slicing is calculated after to the video slicing data, according to the MD5 in the video slicing Value and the MD5 value itself calculated do MD5 verification, and return to presently described video slicing to client device after verifying successfully Upload success message.
Optionally, first uploading module, comprising: first is sent into submodule, the first upload submodule, the first judgement Module, second are sent into submodule, second judgment submodule, the first implementation sub-module, third judging submodule, third and are sent into submodule Block and the first sending submodule;
Described first is sent into submodule, for each video slicing to be sent into upload fragment queue to be processed, the video Fragment includes the data, range, the mark of MD5 value and the video to be uploaded of the video slicing;
Described first uploads submodule, for video slicing to be successively uploaded to service from upload fragment queue to be processed Device, so that server receives the MD5 value that the video slicing data calculate received video slicing later, according to described The MD5 value of MD5 value and itself calculating in video slicing does MD5 verification, for the video slicing verified by MD5, to client End equipment, which is sent, uploads success message;
First judging submodule, for according to whether receive server return upload success message, judge video Whether fragment uploads success;
Described second is sent into submodule, if the upload success message for not receiving server return, by the view Frequency division piece is sent into mistake and retries fragment queue, and judges whether there are also video slicings in upload fragment queue to be processed;
The second judgment submodule, if the upload success message for receiving server return, judges to be processed Upload in fragment queue whether there are also video slicings;
First implementation sub-module, if being used in upload fragment queue to be processed also video slicing, described in triggering First upload submodule, which is executed from upload fragment queue to be processed, is successively uploaded to server for video slicing;
The third judging submodule, if misdeemed for not having video slicing in upload fragment queue to be processed Accidentally retry in fragment queue whether there are also video slicings;
The third is sent into submodule, if retried in fragment queue for mistake, there are also video slicings, by mistake weight The video slicing for trying fragment queue is sent into upload fragment queue to be processed;
First sending submodule sends this if retrying in fragment queue for mistake does not have video slicing The message that uploaded videos terminate is to server, so that server is according to the fragment range received and the mark of video to be uploaded, The video slicing received is combined, complete video is obtained.
Optionally, described device further include: the first statistic submodule, the 4th judging submodule, the second implementation sub-module, One cancels submodule;
First statistic submodule, for uniting after each determining upload success message for not receiving server return Meter does not upload successful number;
4th judging submodule does not upload whether successful number is less than upload errors number limitation threshold for judging Value;
Second implementation sub-module, if being less than upload errors number threshold limit for not uploading successful number, It then triggers the third feeding submodule execution and video slicing feeding mistake is retried into fragment queue;
Described first cancels submodule, if limited for not uploading successful number not less than errors number is uploaded, Cancel the upload of this video.
Optionally, described device further include:
First judging unit, for being detected described first after the first obtains unit obtains video to be uploaded Unit detect current network conditions before, read user configuration information, judge user whether configuration data format check;
First reading unit reads the data format school of user configuration if verified for user configuration data format Test information;
First acquisition unit, for obtaining the data format letter of video to be uploaded according to the data format check information Breath;
Second judgment unit, for judging whether the data format information of the video to be uploaded meets data format verification Condition;
First execution unit, for if it is satisfied, then determining that verification passes through, triggering first probe unit to execute detection Current network conditions.
Optionally,
The data format check information of the user configuration includes: stringent verification or non-critical verification;
The first acquisition unit, including the first acquisition module;Described first obtains module, for being when user configuration When stringent verification, format, the ratio of width to height, duration and the data volume of video to be uploaded are obtained;
The second judgment unit, including the second judgment module;Second judgment module, for being when user configuration When stringent verification, according to the standard value of preset format, the ratio of width to height, duration and data volume, the data format of uploaded videos is treated Information is verified;Or
The first acquisition unit, including the second acquisition module;Described second obtains module, for being when user configuration When non-critical verification, the data volume of video to be uploaded is obtained;
The second judgment unit, including third judgment module;The third judgment module, for being when user configuration When non-critical verification, according to the standard value of preset data volume, the data format information for treating uploaded videos is verified.
Optionally, described device further include: third judging unit, the first determination unit, the second execution unit, third execute Unit;
The third judging unit is used for after the first obtains unit obtains video to be uploaded, described first Before probe unit detects current network conditions, user configuration information is read, it is big to judge whether user is provided with fragment data amount It is small;
First determination unit, if for user setting fragment data amount size, by the fragment of user setting Data volume is sized to current video fragment data amount size;
Second execution unit is worked as the video to be uploaded as described for triggering first sharding unit and executing The step of forward sight frequency division sheet data amount size carries out fragment, obtains multiple video slicings;
The third execution unit triggers first detection if fragment data amount size is not arranged for user Unit executes detection current network conditions.
Fourth aspect, the invention also discloses the devices that a kind of video uploads, and are applied to server, and described device includes:
Second receiving unit, for receiving multiple video slicings of client device transmission, the video slicing is client After end equipment obtains video to be uploaded, current network conditions are detected, it is big according to preset Network status and video slicing data volume Small corresponding relationship determines current video fragment data amount size, and the video to be uploaded is pressed the current video fragment number According to amount size, fragment, multiple video slicings of acquisition are carried out;
First assembled unit obtains complete video for the video slicing received to be combined.
Optionally, described device further include:
Third receiving unit, for second receiving unit receive client device send multiple video slicings it Before, receive the uploaded videos request that client device is sent;
Second transmission unit, for sending unique identification to client device, so that client device is by unique mark Know the mark as video to be uploaded;
The multiple video slicings for receiving client device and sending, the video slicing are that client device is obtained to upper After passing video, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, really The video to be uploaded is pressed the current video fragment data amount size, is divided by settled forward sight frequency division sheet data amount size Piece, in multiple video slicings of acquisition, the video slicing include the data of the video slicing, range, MD5 value and it is described to The mark of uploaded videos;
First assembled unit, comprising:
The mark of 4th determining module, the video to be uploaded for being sent according to client device determines the video Video belonging to fragment;
4th judgment module calculates received video point for the data according to the video slicing received The MD5 value of piece, the MD5 value in MD5 value and the video slicing calculated according to itself, does MD5 verification, judges the video Whether fragment uploads success;
Second sending module sends if uploaded successfully for video slicing and uploads success message to client device;
5th judgment module, for judging whether that receiving the video uploads end message;
First execution module triggers first assembled unit and holds if uploading end message for receiving video The video slicing for being about to receive is combined, and obtains complete video.
Present invention implementation additionally provides a kind of computer readable storage medium, storage in the computer readable storage medium There is computer program, the computer program realizes that above-mentioned video uploads method when being executed by processor is set applied to client Standby any method and step;Or the method that above-mentioned video uploads is applied to any method and step of server.
The embodiment of the invention also provides a kind of computer program products comprising instruction, when it runs on computers When, so that computer executes the method that the method that any of the above-described video uploads is applied to client device;Or execute above-mentioned The method that one video uploads is applied to the method for server.
The embodiment of the invention provides method, apparatus, client device and servers that a kind of video uploads.Client is set It is standby to obtain video to be uploaded;Detect current network conditions;According to pair of preset Network status and video slicing data volume size It should be related to, determine current video fragment data amount size;The video to be uploaded is big by the current video fragment data amount It is small, fragment is carried out, multiple video slicings are obtained;Multiple video slicings of the video to be uploaded are uploaded to server, so that The video slicing received is combined by server, obtains complete video.As it can be seen that using the embodiment of the present invention, it will be to upper When passing video progress fragment, video can be carried out by different data volume sizes, unlike existing skill by fragment according to Network status No matter video is all carried out fragment by fixed size to art by the good or bad of Network status.Therefore, in the case where Network status is bad, A possibility that video slicing uploads successfully is big, improves the success rate of video upload.
Certainly, implement any of the products of the present invention or method it is not absolutely required at the same reach all the above excellent Point.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described.
Fig. 1 is a kind of flow chart that the method that video provided in an embodiment of the present invention uploads is applied to client device;
Fig. 2 is another flow chart that the method that video provided in an embodiment of the present invention uploads is applied to client device;
Fig. 3 is a kind of specific flow chart of step S211 in embodiment illustrated in fig. 2;
Fig. 4 is a kind of specific flow chart of step S216 in embodiment illustrated in fig. 2;
The method that Fig. 5 video provided in an embodiment of the present invention uploads is applied to a kind of flow chart of server;
The method that Fig. 6 video provided in an embodiment of the present invention uploads is applied to another flow chart of server;
Fig. 7 is the structural schematic diagram that the device that video provided in an embodiment of the present invention uploads is applied to client device;
Fig. 8 is the structural schematic diagram that the device that video provided in an embodiment of the present invention uploads is applied to server;
Fig. 9 is the structural schematic diagram of client device provided in an embodiment of the present invention;
Figure 10 is the structural schematic diagram of server provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is described.
In order to improve the success rate of video upload, the embodiment of the invention provides the method and devices that a kind of video uploads.
Referring to Fig. 1, Fig. 1 is a kind of stream that the method that video provided in an embodiment of the present invention uploads is applied to client device Cheng Tu, this method may comprise steps of:
Step S101 obtains video to be uploaded.
Client device can obtain video to be uploaded.It is enforceable, client device can for mobile phone, computer or other Smart machine.
Step S102 detects current network conditions.
It is enforceable, can according to it is preset for detect network speed fragment data volume size, from video to be uploaded, Divide a piece of detection network speed fragment, sends the detection network speed fragment and detect current network conditions.
It is enforceable, the video slicing of a piece of detection network speed pre-set can also be sent, including video slicing No matter data volume size, data etc. upload any video, all send the video slicing.Certainly other technologies can also be used Means detect current network conditions.
Step S103, according to the corresponding relationship of preset Network status and video slicing data volume size, forward sight is worked as in determination Frequency division sheet data amount size.
Enforceable, the corresponding relationship of the preset Network status and video slicing data volume size may include: to visit The transmission duration range of survey grid speed fragment and the corresponding relationship of video slicing data volume size.
In one embodiment, transmission duration range locating for current transmission duration can be determined, according to the detection The transmission duration range of network speed fragment and the corresponding relationship of video slicing data volume size, determine that current video fragment data amount is big It is small.
Enforceable, the corresponding relationship of the preset Network status and video slicing data volume size, may include: net Network situation is good or the bad corresponding relationship with video slicing data volume size.
In one embodiment, it can be determined that it is good whether current transmission duration is less than preset Network status for identification Or otherwise bad transmission duration threshold value determines that Network status is bad if it is less, determining that Network status is good.According to Network status The good or bad corresponding relationship with video slicing data volume size, determines current video fragment data amount size.It is specific enforceable, 3s can be set when current transmission duration is less than 3s by transmission duration threshold value determine that Network status is good, by current video fragment Data volume is dimensioned to 100M;If it is greater than 3s, it is determined that Network status is bad, and current video fragment data amount size is arranged For 10M.
The video to be uploaded is pressed the current video fragment data amount size, carries out fragment, obtained more by step S104 A video slicing.
Multiple video slicings of the video to be uploaded are uploaded to server by step S105, so that server will receive To video slicing be combined, obtain complete video.
As it can be seen that when video to be uploaded is carried out fragment, client device can be according to network-like using the embodiment of the present invention Video is carried out fragment by different data volume sizes by condition, unlike the prior art no matter fix by good or bad all press of Network status Video is carried out fragment by size.Therefore, in the case where Network status is bad, a possibility that video slicing uploads successfully, is big, mentions The success rate that high video uploads.
The method that a kind of video provided in an embodiment of the present invention uploads is applied to another process of client device, such as schemes Shown in 2, comprising:
Step S201 obtains video to be uploaded.
Step S202 sends uploaded videos and requests to server.
It is enforceable, send uploaded videos request to server, allow server know will uploaded videos so that server Return to unique identification.
Step S203 receives the unique identification that server returns, the mark as the video to be uploaded.
Step S204, read user configuration information, judge user whether configuration data format check.
It is enforceable, read user configuration information, judge user whether configuration data format check, user configuration interface and The data format verification can be preset.
If it is judged that be it is yes, i.e. user configuration data format verification thens follow the steps S205;If it is judged that Be it is no, i.e., user does not have configuration data format check, thens follow the steps S209.
Step S205 reads the data format check information of user configuration.
Enforceable, the data format check information of the user configuration includes stringent verification or non-critical verification.
Step S206 obtains the data format information of video to be uploaded according to data format check information.
It is enforceable, if user configuration is strictly to verify, can obtain the format of video to be uploaded, the ratio of width to height, Duration and data volume.It is enforceable, if user configuration is non-critical verification, the data of video to be uploaded can be obtained Amount.
Step S207, judges whether the data format information of the video to be uploaded meets data format verification condition.
It is enforceable, if user configuration is strictly to verify, can according to preset format, the ratio of width to height, duration and The standard value of data volume, the data format information for treating uploaded videos are verified.In one embodiment, if it is stringent Verification, data format verifies condition can be with are as follows: video is the MP4 format of H264 coding and the ratio of width to height of video is 16:9 and duration Less than 5min and data volume size is less than 500M;
It is enforceable, if user configuration is that non-critical verification is treated according to the standard value of preset data volume The data format information for passing video is verified.In one embodiment, data format verification condition can be with are as follows: data volume is big It is less than 500M.
Generally, when uploading advertisement video, if it is video is cut before advertisement therein, it can be set to stringent school It tests.Because if cutting the condition that video is unsatisfactory for strictly verifying before advertisement, uploaded successfully even if cutting video before the advertisement, rear Video is cut before advertisement described in phase also will appear the problems such as not being available, and first screen in early period in this way, prompts user, avoids wave The time at expense family.If video to be uploaded is ordinary video, there is no particular/special requirement to format, the ratio of width to height and duration, logarithm It can choose non-critical verification when requiring according to amount.Certain user, which also can choose, to be treated uploaded videos and is not provided with data format school Information is tested, video is not screened before video uploads, user can be configured according to self-demand, promote user's body It tests.
If being unsatisfactory for data format verification condition, S208 is thened follow the steps;If meeting data format verification condition, Verification passes through, and executes step S209.
Step S208, verification failure, prompts user.
Enforceable, data format verification failure prompts user's video format mistake.In one embodiment, may be used To export prompting frame, User Format verification failure is prompted, if continue to upload the video.
Step S209 reads user configuration information, judges whether user is provided with fragment data amount size.
If user setting fragment data amount size, thens follow the steps S210;If fragment data amount is not arranged in user Size thens follow the steps S211.
The fragment data amount of user setting is sized to current video fragment data amount size by step S210.
S210 is executed the step, step S213 is executed.
In the specific implementation, fragment data amount size can be set by user according to Network status.In this case, It can be using the fragment data amount size of user setting as current video fragment data amount size.
Step S211 detects current network conditions.
Step S212, according to the corresponding relationship of preset Network status and video slicing data volume size, forward sight is worked as in determination Frequency division sheet data amount size.
In practical application, step S212 can be identical as step S103.
The video to be uploaded is pressed the current video fragment data amount size, carries out fragment, obtained more by step S213 A video slicing.
Step S214 calculates the MD5 value of the video slicing.
It is enforceable, calculate the MD5 value of every video slicing.
The MD5 value of the video slicing is added in step S215 in video slicing, so that server receives the video point The MD5 value that received video slicing is calculated after sheet data according to the MD5 value in the video slicing and itself calculates MD5 value do MD5 verification, and successfully disappear after verifying successfully to the upload that client device returns to presently described video slicing Breath.
The mark of each video slicing and the video to be uploaded is uploaded to server simultaneously, so that clothes by step S216 The video slicing received is combined by business device by the mark of the video to be uploaded, obtains complete video.
The method that video provided in an embodiment of the present invention uploads, when video to be uploaded is carried out fragment, client device can According to Network status, video is carried out fragment by different data volume sizes, unlike the prior art no matter Network status it is good Or video is all badly subjected to fragment by fixed size.In the case where Network status is bad, video slicing, which uploads, successfully may Property it is big, improve video upload success rate.
Moreover, the MD5 value of the video slicing is added in video slicing, so that server receives the video slicing number According to the MD5 value for calculating received video slicing later, according to the MD5 value in the video slicing and the MD5 itself calculated Value does MD5 verification, and returns to the upload success message of presently described video slicing to client device after verifying successfully, verifying Without losing or mistake in video slicing transmission process.
In addition, also before detecting current network conditions, data format verification can be set in embodiment shown in Fig. 2, For being unsatisfactory for the video of data format verification, user's video format mistake is prompted.Video first carries out video before uploading Screening, reduces subsequent video and uploads successfully, but be not available the problem of may wasting time.If user setting view Frequency division sheet data amount size, then be sized to video slicing data volume size for the fragment data amount of user setting, improve User experience.
Specifically, in embodiment illustrated in fig. 2 step S211 specific implementation process, may refer to Fig. 3;The tool of step S216 Body realizes process, may refer to Fig. 4.
Fig. 3 is a kind of specific flow chart of step S211 in embodiment illustrated in fig. 2, comprising:
Step S301 obtains a piece of detection network speed point according to preset for detecting the data volume size of the fragment of network speed Piece.
Enforceable, the data volume size of the preset fragment for detecting network speed can be set to 5M.
Step S302 calculates the MD5 value of the detection network speed fragment.
The calculated MD5 value is added in detection network speed fragment, so that server receives the detection in step S303 The MD5 value that received detection network speed fragment is calculated after network speed fragment data, according to the MD5 value in detection network speed fragment, The MD5 value calculated with itself does MD5 verification, and returns to the upper of the detection network speed fragment to client device after verifying successfully Pass success message.
Step S304 sends the detection network speed fragment.
It is enforceable, the detection network speed fragment is sent to server, may include this in the detection network speed fragment The MD5 value of fragment.
Step S305 records the sending time of the detection network speed fragment and receives the detection network speed that server returns The time of fragment upload success message.
Step S306, according to the detection network speed fragment sending time and the detection network for receiving server and returning Fast fragment uploads the time of success message, the current transmission duration of the detection network speed fragment is calculated, as current network conditions Index.
Fig. 4 is a kind of specific flow chart of step S216 in embodiment illustrated in fig. 2, comprising:
Each video slicing is sent into upload fragment queue to be processed by step S401, and the video slicing includes the video Data, range, the mark of MD5 value and the video to be uploaded of fragment.
Video slicing is successively uploaded to server from upload fragment queue to be processed, so that server connects by step S402 The MD5 value that the video slicing data calculate received video slicing later is received, according to the MD5 in the video slicing Value and the MD5 value itself calculated do MD5 verification, for the video slicing verified by MD5, send and upload to client device Success message.
It is enforceable, video slicing is successively uploaded to server from upload fragment queue to be processed.In a kind of embodiment party In formula, can from the video slicing of upload fragment queue to be processed successively concurrent preset quantity to server, such as: can be each Three video slicings are sent to server.
Step S403 judges whether video slicing uploads into according to whether receiving the upload success message of server return Function.
It is enforceable, if receiving the upload success message of server return, it is determined that go out video slicing and upload successfully.
It is enforceable, if client device confiscates the upload success message of server return, can determine to regard Frequency division piece does not upload successfully.Such as: it can unsuccessfully disappear in the upload for receiving server return in a kind of specific embodiment When breath, determination does not receive upload success message.In another specific embodiment, uplink time threshold also can be set Value, such as: the uplink time threshold value can be 30s.If because by taking excessively poor 1M broadband network as an example, theoretical transmission speed Degree is 128kb/s, and 1M fragment can upload in 10s and finish, but present is 100M broadband network mostly, and 100M fragment can be with Upload and finish in 10s, here by uplink time threshold value be set as 30s be it is fault-tolerant in order to improve, preventing network from surging causes It is elongated to pass the time.Certain technical staff can also set uplink time threshold value to other times numerical value, not do herein specific It limits.If it is more than the uplink time threshold value that video slicing, which uploads, the upload success message of server return is confiscated, then may be used To determine that video slicing does not upload successfully, cancels the video slicing and upload.
If not receiving the upload success message of server return, determines that video slicing does not upload successfully, then execute step Rapid S404;If receiving the upload success message of server return, determines that video slicing uploads successfully, then follow the steps S407。
Step S404, statistics do not upload successful number.
Step S405, judgement do not upload whether successful number is less than the threshold value for uploading errors number limitation.
Enforceable, the threshold value for uploading errors number limitation can be set to 30 times.
Errors number threshold limit is uploaded if not uploading successful number and being less than, thens follow the steps S406;If on not Successful number is passed not less than errors number threshold limit is uploaded, then cancels the upload of this video, prompts user video to upload and loses It loses.
The video slicing is put into mistake and retries fragment queue by step S406.
Step S407 judges whether there are also video slicings in upload fragment queue to be processed.
If there are also video slicings in upload fragment queue to be processed, the step S402 is executed;If on to be processed Passing in fragment queue does not have video slicing, thens follow the steps S408.
Step S408, misjudgment retry in fragment queue whether there are also video slicings.
If mistake retries in fragment queue, there are also video slicings, then follow the steps S409;If mistake retries fragment team There is no video slicing in column, thens follow the steps S410.
The video slicing that mistake retries fragment queue is put into upload fragment queue to be processed by step S409.
Step S410 sends message that this uploaded videos terminates to server, so that server is according to point received The video slicing received is combined by the mark of piece range and video to be uploaded, obtains complete video.
As it can be seen that using the embodiment of the present invention, by safeguarding that upload fragment queue to be processed and mistake retry when video uploads Fragment queue is completed video slicing and is uploaded.When upload errors number reaches errors number threshold limit, cancel this upload.It keeps away Having exempted from the of short duration situation of burst causes video slicing to upload the case where mistake once just influences the upload of entire video.And it realizes and disappears Breath subscribing mechanism all can when video starts upload, video slicing upload fails, video upload fails or is successful User is prompted, the user experience is improved.
The method that a kind of video provided in an embodiment of the present invention uploads is applied to a kind of process of server, as shown in figure 5, Include:
Step S501, receives multiple video slicings that client device is sent, and the video slicing obtains for client device After obtaining video to be uploaded, current network conditions are detected, it is corresponding with video slicing data volume size according to preset Network status Relationship determines current video fragment data amount size, and the video to be uploaded is pressed the current video fragment data amount size, Carry out fragment, multiple video slicings of acquisition.
The video slicing received is combined by step S502, obtains complete video.
As it can be seen that using the embodiment of the present invention, when video to be uploaded is carried out fragment by client device, client device can be with According to Network status, video is subjected to fragment by different data volume sizes, unlike the prior art no matter Network status good or It is bad that video is all subjected to fragment by fixed size.Therefore, in the case where Network status is bad, video slicing upload successfully may be used Energy property is big, improves the success rate of video upload.
The method that a kind of video provided in an embodiment of the present invention uploads is applied to another process of server, such as Fig. 6 institute Show, comprising:
Step S601 receives the uploaded videos request that client device is sent.
Step S602 sends unique identification to client device so that client device using the unique identification as to The mark of uploaded videos.
Step S603, receive client device send video slicing, the video slicing be client device obtain to After uploaded videos, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, It determines current video fragment data amount size, the video to be uploaded is pressed into the current video fragment data amount size, is carried out Fragment, multiple video slicings of acquisition, the video slicing include the data of the video slicing, range, MD5 value and it is described to The mark of uploaded videos.
Step S604 is determined belonging to the video slicing according to the mark of the video to be uploaded of client device transmission Video.
Step S605 calculates the MD5 value of received video slicing according to the data of the video slicing received, According to itself calculate MD5 value and the video slicing in MD5 value, do MD5 verification, judge the video slicing whether on It passes successfully.If MD5 verification passes through, success is uploaded;Otherwise it uploads unsuccessful.
If video slicing does not upload successfully, S606 is thened follow the steps;If video slicing uploads successfully, then follow the steps S607。
Step S606, returns to step S605, does MD5 verification to the next video slicing received.
Enforceable, if the video slicing does not upload successfully, server can be to the next video received Fragment does MD5 verification, returns to step S605.
Step S607 sends and uploads success message to client device.
Enforceable, server sends the video slicing to client device and uploads success message, so that client device According to whether receiving the upload success message of server return, judge whether video slicing uploads success.In addition, server is true Surely upload it is unsuccessful, can also to client device send upload failed message.
Step S608 judges whether that receiving the video uploads end message.
If receiving the video uploads end message, S609 is thened follow the steps;If not receiving the video and uploading terminates to disappear Breath, then execute the step S603.
The video slicing received is combined by step S609, obtains complete video.
Enforceable, server can be according to the mark of the fragment range and video to be uploaded that receive, by what is received Video slicing is combined, and obtains complete video.
The method that video provided in an embodiment of the present invention uploads, when video to be uploaded is carried out fragment, client device can According to Network status, video is carried out fragment by different data volume sizes, unlike the prior art no matter Network status it is good Or video is all badly subjected to fragment by fixed size.In the case where Network status is bad, video slicing, which uploads, successfully may Property it is big, improve video upload success rate.
Moreover, the MD5 value of received video slicing is calculated according to the data of the video slicing received, according to The MD5 value in MD5 value and the video slicing that itself is calculated, does MD5 verification, judges whether the video slicing uploads into Function, and the upload success message of presently described video slicing is returned after verifying successfully to client device, demonstrate video point Without loss or mistake in piece transmission process.
The device that video provided in an embodiment of the present invention uploads is applied to the structural schematic diagram of client device, such as Fig. 7 institute Show, comprising:
First obtains unit 701, for obtaining video to be uploaded;
First probe unit 702, for detecting current network conditions;
First determination unit 703, for the corresponding relationship according to preset Network status and video slicing data volume size, Determine current video fragment data amount size;
First sharding unit 704 is carried out for the video to be uploaded to be pressed the current video fragment data amount size Fragment obtains multiple video slicings;
Multiple video slicings of the video to be uploaded are uploaded to server, so that server by the first uploading unit 705 The video slicing received is combined, complete video is obtained.
Optionally, described device further include:
First transmission unit, for being detected described first after the first obtains unit obtains video to be uploaded Before unit detects current network conditions, sends uploaded videos and request to server;
First receiving unit, the mark for receiving the unique identification of server return, as the video to be uploaded;
First uploading unit, comprising: the first uploading module;
First uploading module, for the mark of each video slicing and the video to be uploaded to be uploaded to clothes simultaneously Business device obtains complete view so that the video slicing received is combined by server by the mark of the video to be uploaded Frequently.
Optionally, first probe unit, comprising: first obtain module, the first sending module, the first logging modle and First computing module;
Described first obtains module, for, for detecting the data volume size of the fragment of network speed, obtaining one according to preset Piece detects network speed fragment, includes the mark of the video to be uploaded in the detection network speed fragment;
First sending module, for sending the detection network speed fragment;
First logging modle, for recording the sending time of the detection network speed fragment and receiving what server returned The detection network speed fragment uploads the time of success message;
First computing module, for being returned according to the detection network speed fragment sending time and the reception server The detection network speed fragment upload success message time, calculate it is described detection network speed fragment current transmission duration, as Current network conditions index;
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: detection network speed fragment Transmit the corresponding relationship of duration range and video slicing data volume size;
First determination unit, comprising: the first determining module;
First determining module, for determining transmission duration range locating for current transmission duration, according to the detection The transmission duration range of network speed fragment and the corresponding relationship of video slicing data volume size, determine that current video fragment data amount is big It is small;
Or,
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: Network status is good or bad With the corresponding relationship of video slicing data volume size;
First determination unit, comprising: first judgment module, the second determining module, third determining module;
The first judgment module, for judging it is good whether current transmission duration is less than preset Network status for identification Or bad transmission duration threshold value;
Second determining module, if being less than the transmission duration threshold value for current transmission duration, it is determined that network Situation is good, otherwise determines that Network status is bad;
The third determining module, for according to Network status it is good or badly it is corresponding with video slicing data volume size close System, determines current video fragment data amount size.
Optionally, described first module is obtained, comprising: the first acquisition submodule, the first computational submodule and first are added Submodule;
First acquisition submodule, for, for detecting the data volume size of the fragment of network speed, being obtained according to preset A piece of detection network speed fragment;
First computational submodule, for calculating the MD5 value of the detection network speed fragment;
Described first is added submodule, for the calculated MD5 value to be added in detection network speed fragment, so that server The MD5 value that the detection network speed fragment data calculates received detection network speed fragment later is received, according to detection network speed The MD5 value of MD5 value and itself calculating in fragment does MD5 verification, and returns to the spy to client device after verifying successfully The upload success message of survey grid speed fragment.
Optionally, first sharding unit, comprising: module is added in the first fragment module, the first computing module and first;
The first fragment module carries out fragment for the video to be uploaded to be pressed the current video fragment size;
First computing module, for calculating the MD5 value of the video slicing;
Described first is added module, for the MD5 value of the video slicing to be added in video slicing, so that server receives The MD5 value that received video slicing is calculated after to the video slicing data, according to the MD5 in the video slicing Value and the MD5 value itself calculated do MD5 verification, and return to presently described video slicing to client device after verifying successfully Upload success message.
Optionally, first uploading module, comprising: first is sent into submodule, the first upload submodule, the first judgement Module, second are sent into submodule, second judgment submodule, the first implementation sub-module, third judging submodule, third and are sent into submodule Block and the first sending submodule;
Described first is sent into submodule, for each video slicing to be sent into upload fragment queue to be processed, the video Fragment includes the data, range, the mark of MD5 value and the video to be uploaded of the video slicing;
Described first uploads submodule, for video slicing to be successively uploaded to service from upload fragment queue to be processed Device, so that server receives the MD5 value that the video slicing data calculate received video slicing later, according to described The MD5 value of MD5 value and itself calculating in video slicing does MD5 verification, for the video slicing verified by MD5, to client End equipment, which is sent, uploads success message;
First judging submodule, for according to whether receive server return upload success message, judge video Whether fragment uploads success;
Described second is sent into submodule, if the upload success message for not receiving server return, by the view Frequency division piece is sent into mistake and retries fragment queue, and judges whether there are also video slicings in upload fragment queue to be processed;
The second judgment submodule, if the upload success message for receiving server return, judges to be processed Upload in fragment queue whether there are also video slicings;
First implementation sub-module, if being used in upload fragment queue to be processed also video slicing, described in triggering First upload submodule, which is executed from upload fragment queue to be processed, is successively uploaded to server for video slicing;
The third judging submodule, if misdeemed for not having video slicing in upload fragment queue to be processed Accidentally retry in fragment queue whether there are also video slicings;
The third is sent into submodule, if retried in fragment queue for mistake, there are also video slicings, by mistake weight The video slicing for trying fragment queue is sent into upload fragment queue to be processed;
First sending submodule sends this if retrying in fragment queue for mistake does not have video slicing The message that uploaded videos terminate is to server, so that server is according to the fragment range received and the mark of video to be uploaded, The video slicing received is combined, complete video is obtained.
Optionally, described device further include: the first statistic submodule, the 4th judging submodule, the second implementation sub-module, One cancels submodule;
First statistic submodule, for uniting after each determining upload success message for not receiving server return Meter does not upload successful number;
4th judging submodule does not upload whether successful number is less than upload errors number limitation threshold for judging Value;
Second implementation sub-module, if being less than upload errors number threshold limit for not uploading successful number, It then triggers the third feeding submodule execution and video slicing feeding mistake is retried into fragment queue;
Described first cancels submodule, if limited for not uploading successful number not less than errors number is uploaded, Cancel the upload of this video.
Optionally, described device further include:
First judging unit, for being detected described first after the first obtains unit obtains video to be uploaded Unit detect current network conditions before, read user configuration information, judge user whether configuration data format check;
First reading unit reads the data format school of user configuration if verified for user configuration data format Test information;
First acquisition unit, for obtaining the data format letter of video to be uploaded according to the data format check information Breath;
Second judgment unit, for judging whether the data format information of the video to be uploaded meets data format verification Condition;
First execution unit, for if it is satisfied, then determining that verification passes through, triggering first probe unit to execute detection Current network conditions.
Optionally,
The data format check information of the user configuration includes: stringent verification or non-critical verification;
The first acquisition unit, including the first acquisition module;Described first obtains module, for being when user configuration When stringent verification, format, the ratio of width to height, duration and the data volume of video to be uploaded are obtained;
The second judgment unit, including the second judgment module;Second judgment module, for being when user configuration When stringent verification, according to the standard value of preset format, the ratio of width to height, duration and data volume, the data format of uploaded videos is treated Information is verified;Or
The first acquisition unit, including the second acquisition module;Described second obtains module, for being when user configuration When non-critical verification, the data volume of video to be uploaded is obtained;
The second judgment unit, including third judgment module;The third judgment module, for being when user configuration When non-critical verification, according to the standard value of preset data volume, the data format information for treating uploaded videos is verified.
Optionally, described device further include: third judging unit, the first determination unit, the second execution unit, third execute Unit;
The third judging unit is used for after the first obtains unit obtains video to be uploaded, described first Before probe unit detects current network conditions, user configuration information is read, it is big to judge whether user is provided with fragment data amount It is small;
First determination unit, if for user setting fragment data amount size, by the fragment of user setting Data volume is sized to current video fragment data amount size;
Second execution unit is worked as the video to be uploaded as described for triggering first sharding unit and executing The step of forward sight frequency division sheet data amount size carries out fragment, obtains multiple video slicings;
The third execution unit triggers first detection if fragment data amount size is not arranged for user Unit executes detection current network conditions.
As it can be seen that when video to be uploaded is carried out fragment, client device can be according to network-like using the embodiment of the present invention Video is carried out fragment by different data volume sizes by condition, unlike the prior art no matter fix by good or bad all press of Network status Video is carried out fragment by size.Therefore, in the case where Network status is bad, a possibility that video slicing uploads successfully, is big, mentions The success rate that high video uploads.
The device that video provided in an embodiment of the present invention uploads is applied to the structural schematic diagram of server, as shown in figure 8, packet It includes:
Second receiving unit 801, for receiving multiple video slicings of client device transmission, the video slicing is visitor After family end equipment obtains video to be uploaded, current network conditions are detected, according to preset Network status and video slicing data volume The corresponding relationship of size determines current video fragment data amount size, and the video to be uploaded is pressed the current video fragment Data volume size carries out fragment, multiple video slicings of acquisition;
First assembled unit 802 obtains complete video for the video slicing received to be combined.
Optionally, described device further include:
Third receiving unit, for second receiving unit receive client device send multiple video slicings it Before, receive the uploaded videos request that client device is sent;
Second transmission unit, for sending unique identification to client device, so that client device is by unique mark Know the mark as video to be uploaded;
The multiple video slicings for receiving client device and sending, the video slicing are that client device is obtained to upper After passing video, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, really The video to be uploaded is pressed the current video fragment data amount size, is divided by settled forward sight frequency division sheet data amount size Piece, in multiple video slicings of acquisition, the video slicing include the data of the video slicing, range, MD5 value and it is described to The mark of uploaded videos;
First assembled unit, comprising:
The mark of 4th determining module, the video to be uploaded for being sent according to client device determines the video Video belonging to fragment;
4th judgment module calculates received video point for the data according to the video slicing received The MD5 value of piece, the MD5 value in MD5 value and the video slicing calculated according to itself, does MD5 verification, judges the video Whether fragment uploads success;
Second sending module sends if uploaded successfully for video slicing and uploads success message to client device;
5th judgment module, for judging whether that receiving the video uploads end message;
First execution module triggers first assembled unit and holds if uploading end message for receiving video The video slicing for being about to receive is combined, and obtains complete video.
As it can be seen that when video to be uploaded is carried out fragment, client device can be according to network-like using the embodiment of the present invention Video is carried out fragment by different data volume sizes by condition, unlike the prior art no matter fix by good or bad all press of Network status Video is carried out fragment by size.Therefore, in the case where Network status is bad, a possibility that video slicing uploads successfully, is big, mentions The success rate that high video uploads.
The embodiment of the invention also provides a kind of client devices, as shown in figure 9, including processor 901, communication interface 902, memory 903 and communication bus 904, wherein processor 901, communication interface 902, memory 903 pass through communication bus 904 complete mutual communication,
Memory 903, for storing computer program;
Processor 901 when for executing the program stored on memory 903, realizes following steps:
Obtain video to be uploaded;
Detect current network conditions;
According to the corresponding relationship of preset Network status and video slicing data volume size, current video fragment data is determined Measure size;
The video to be uploaded is pressed into the current video fragment data amount size, carries out fragment, obtains multiple videos point Piece;
Multiple video slicings of the video to be uploaded are uploaded to server, so that server divides the video received Piece is combined, and obtains complete video.
As it can be seen that when video to be uploaded is carried out fragment, client device can be according to network-like using the embodiment of the present invention Video is carried out fragment by different data volume sizes by condition, unlike the prior art no matter fix by good or bad all press of Network status Video is carried out fragment by size.Therefore, in the case where Network status is bad, a possibility that video slicing uploads successfully, is big, mentions The success rate that high video uploads.
The embodiment of the invention also provides a kind of servers, as shown in Figure 10, including processor 1001, communication interface 1002, memory 1003 and communication bus 1004, wherein processor 1001, communication interface 1002, memory 1003 pass through communication Bus 1004 completes mutual communication,
Memory 1003, for storing computer program;
Processor 1001 when for executing the program stored on memory 1003, realizes following steps:
Multiple video slicings that client device is sent are received, the video slicing is that client device obtains view to be uploaded After frequency, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, determination is worked as The video to be uploaded is pressed the current video fragment data amount size, carries out fragment, obtain by forward sight frequency division sheet data amount size The multiple video slicings obtained;
The video slicing received is combined, complete video is obtained.
As it can be seen that when video to be uploaded is carried out fragment, client device can be according to network-like using the embodiment of the present invention Video is carried out fragment by different data volume sizes by condition, unlike the prior art no matter fix by good or bad all press of Network status Video is carried out fragment by size.Therefore, in the case where Network status is bad, a possibility that video slicing uploads successfully, is big, mentions The success rate that high video uploads.
The communication bus that above-mentioned client device and server are mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned client device and server and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.
In another embodiment provided by the invention, a kind of computer readable storage medium is additionally provided, which can It reads to be stored with computer program in storage medium, the computer program realizes that any of the above-described video uploads when being executed by processor Method the step of.
In another embodiment provided by the invention, a kind of computer program product comprising instruction is additionally provided, when it When running on computers, so that computer executes the method that any video uploads in above-described embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For the embodiments such as client device, server, computer readable storage medium and computer program product, due to its basic phase It is similar to embodiment of the method, so being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (26)

1. a kind of method that video uploads is applied to client device, which is characterized in that the described method includes:
Obtain video to be uploaded;
Detect current network conditions;
According to the corresponding relationship of preset Network status and video slicing data volume size, determine that current video fragment data amount is big It is small;
The video to be uploaded is pressed into the current video fragment data amount size, fragment is carried out, obtains multiple video slicings;
Multiple video slicings of the video to be uploaded are uploaded to server so that server by the video slicing received into Row combination, obtains complete video.
2. the method according to claim 1, wherein being visited after the acquisition video to be uploaded the step of Before the step of surveying current network conditions, further includes:
Uploaded videos are sent to request to server;
Receive the unique identification that server returns, the mark as the video to be uploaded;
Multiple video slicings by the video to be uploaded are uploaded to server, so that server divides the video received The step of piece is combined, and obtains complete video, comprising:
The mark of each video slicing and the video to be uploaded is uploaded to server simultaneously, so that server will receive Video slicing is combined by the mark of the video to be uploaded, obtains complete video.
3. according to the method described in claim 2, it is characterized in that, the step of the detection current network conditions, comprising:
According to preset for detecting the data volume size of the fragment of network speed, a piece of detection network speed fragment, the detection network are obtained It include the mark of the video to be uploaded in fast fragment;
Send the detection network speed fragment;
It records the sending time of the detection network speed fragment and receives the detection network speed fragment that server returns and upload successfully The time of message;
According to it is described detection network speed fragment sending time and it is described receive server return the detection network speed fragment upload at The time of function message calculates the current transmission duration of the detection network speed fragment, as current network conditions index;
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: the transmission of detection network speed fragment The corresponding relationship of duration range and video slicing data volume size;
The corresponding relationship according to preset Network status and video slicing data volume size, determines current video fragment data The step of measuring size, comprising:
Transmission duration range locating for current transmission duration is determined, according to the transmission duration range and view of the detection network speed fragment The corresponding relationship of frequency division sheet data amount size determines current video fragment data amount size;
Or,
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: Network status it is good or badly with view The corresponding relationship of frequency division sheet data amount size;
The corresponding relationship according to preset Network status and video slicing data volume size, determines current video fragment size The step of, comprising:
Judge whether current transmission duration is less than the good or bad transmission duration threshold value of preset Network status for identification;
If it is less, determining that Network status is good, otherwise determine that Network status is bad;
According to Network status is good or the bad corresponding relationship with video slicing data volume size, determine that current video fragment data amount is big It is small.
4. according to the method described in claim 3, it is characterized in that, the number according to the preset fragment for being used to detect network speed According to amount size, a piece of detection network speed fragment is obtained, the step of the mark comprising the video to be uploaded in the detection network speed fragment Suddenly, comprising:
According to preset for detecting the data volume size of the fragment of network speed, a piece of detection network speed fragment is obtained;
Calculate the MD5 value of the detection network speed fragment;
The calculated MD5 value is added in detection network speed fragment, so that server receives the detection network speed fragment data The MD5 value for calculating received detection network speed fragment later according to MD5 value in detection network speed fragment and itself calculates MD5 value does MD5 verification, and returns to the upload success message of the detection network speed fragment to client device after verifying successfully.
5. according to the method described in claim 2, it is characterized in that, described divided the video to be uploaded by the current video The step of sheet data amount size carries out fragment, obtains multiple video slicings, comprising:
The video to be uploaded is pressed into the current video fragment size, carries out fragment;
Calculate the MD5 value of the video slicing;
The MD5 value of the video slicing is added in video slicing, so that server is counted after receiving the video slicing data The MD5 value for calculating received video slicing is MD5 according to the MD5 value in the video slicing and the MD5 value itself calculated It verifies, and returns to the upload success message of presently described video slicing to client device after verifying successfully.
6. according to the method described in claim 5, it is characterized in that, described will be on multiple video slicings of the video to be uploaded Server is reached, so that the step of video slicing received is combined, obtains complete video by server, comprising:
Each video slicing is sent into upload fragment queue to be processed, the video slicing includes the data of the video slicing, model It encloses, the mark of MD5 value and the video to be uploaded;
Video slicing is successively uploaded to server from upload fragment queue to be processed, so that server receives the video point The MD5 value that received video slicing is calculated after sheet data according to the MD5 value in the video slicing and itself calculates MD5 value do MD5 verification, for the video slicing verified by MD5, sent to client device and upload success message;
According to whether receiving the upload success message of server return, judge whether video slicing uploads success;
If not receiving the upload success message of server return, video slicing feeding mistake is retried into fragment queue, And judge whether there are also video slicings in upload fragment queue to be processed;
If receiving the upload success message of server return, judge whether there are also videos point in upload fragment queue to be processed Piece;
If there are also video slicings in upload fragment queue to be processed, execution is described successively will view from upload fragment queue to be processed The step of frequency division piece is uploaded to server;
If not having video slicing in upload fragment queue to be processed, misjudgment retries in fragment queue whether there are also videos Fragment;
If mistake retries in fragment queue, there are also video slicings, and the video slicing that mistake retries fragment queue is sent into wait locate Reason uploads fragment queue;
If mistake, which retries in fragment queue, does not have video slicing, message that this uploaded videos terminates is sent to server, So that the video slicing received is combined by server according to the fragment range received and the mark of video to be uploaded, Obtain complete video.
7. according to the method described in claim 6, it is characterized in that, determining that the upload for not receiving server return is successful each After message, further includes:
Statistics does not upload successful number;
Judgement does not upload whether successful number is less than upload errors number threshold limit;
Errors number threshold limit is uploaded if not uploading successful number and being less than, executes and described is put into the video slicing Mistake retries the step of fragment queue;
If not uploading successful number not less than errors number limitation is uploaded, cancel the upload of this video.
8. the method according to claim 1, wherein being visited after the acquisition video to be uploaded the step of Before the step of surveying current network conditions, further includes:
Read user configuration information, judge user whether configuration data format check;
If user configuration data format verifies, the data format check information of user configuration is read;
According to the data format check information, the data format information of video to be uploaded is obtained;
Judge whether the data format information of the video to be uploaded meets data format verification condition;
If it is satisfied, then the step of determining that verification passes through, executing the detection current network conditions.
9. according to the method described in claim 8, it is characterized in that,
The data format check information of the user configuration includes: stringent verification or non-critical verification;
It is described according to data format check information if user configuration is strictly to verify, obtain the data of video to be uploaded The step of format information, comprising: obtain format, the ratio of width to height, duration and the data volume of video to be uploaded;
The step of whether data format information of the video to be uploaded meets data format verification condition judged, comprising:
According to the standard value of preset format, the ratio of width to height, duration and data volume, the data format information for treating uploaded videos is carried out Verification;
It is described according to data format check information if user configuration is non-critical verification, obtain the number of video to be uploaded The step of according to format information, comprising: obtain the data volume of video to be uploaded;
Whether the data format information for judging the video to be uploaded meets the step of data format verification condition, comprising:
According to the standard value of preset data volume, the data format information for treating uploaded videos is verified.
10. the method according to claim 1, wherein after the acquisition video to be uploaded the step of, in institute Before the step of stating detection current network conditions, further includes:
User configuration information is read, judges whether user is provided with fragment data amount size;
If user setting fragment data amount size, the fragment data amount of user setting is sized to current video point Sheet data amount size;
It executes and the video to be uploaded is pressed into the current video fragment data amount size, carry out fragment, obtain multiple videos point The step of piece;
The step of if fragment data amount size is not arranged in user, executes the detection current network conditions.
11. a kind of method that video uploads, which is characterized in that be applied to server, which comprises
Multiple video slicings that client device is sent are received, the video slicing is that client device obtains video to be uploaded Afterwards, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, are determined current The video to be uploaded is pressed the current video fragment data amount size, carries out fragment, obtained by video slicing data volume size Multiple video slicings;
The video slicing received is combined, complete video is obtained.
12. according to the method for claim 11, which is characterized in that
It is described reception client device send multiple video slicings the step of before, further includes:
Receive the uploaded videos request that client device is sent;
Unique identification is sent to client device, so that client device is using the unique identification as the mark of video to be uploaded Know;
The multiple video slicings for receiving client device and sending, the video slicing are that client device obtains view to be uploaded After frequency, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, determination is worked as The video to be uploaded is pressed the current video fragment data amount size, carries out fragment, obtain by forward sight frequency division sheet data amount size Multiple video slicings in, the video slicing includes the data of the video slicing, range, MD5 value and described to be uploaded The mark of video;
The step of video slicing that will be received is combined, obtains complete video, comprising:
Video belonging to the video slicing is determined according to the mark of the video to be uploaded of client device transmission;
According to the data of the video slicing received, the MD5 value of received video slicing is calculated, is calculated according to itself MD5 value and the video slicing in MD5 value, do MD5 verification, judge whether the video slicing uploads success;
If video slicing uploads successfully, sends and upload success message to client device;
Judge whether that receiving the video uploads end message;
If receiving video uploads end message, execute the video slicing that will be received and be combined, obtains complete Video the step of.
13. the device that a kind of video uploads is applied to client device, which is characterized in that described device includes:
First obtains unit, for obtaining video to be uploaded;
First probe unit, for detecting current network conditions;
First determination unit, for the corresponding relationship according to preset Network status and video slicing data volume size, determination is worked as Forward sight frequency division sheet data amount size;
First sharding unit carries out fragment, obtains for the video to be uploaded to be pressed the current video fragment data amount size Obtain multiple video slicings;
Multiple video slicings of the video to be uploaded are uploaded to server by the first uploading unit, so that server will receive To video slicing be combined, obtain complete video.
14. device according to claim 13, which is characterized in that further include:
First transmission unit is used for after the first obtains unit obtains video to be uploaded, in first probe unit Before detecting current network conditions, sends uploaded videos and request to server;
First receiving unit, the mark for receiving the unique identification of server return, as the video to be uploaded;
First uploading unit, comprising: the first uploading module;
First uploading module, for the mark of each video slicing and the video to be uploaded to be uploaded to service simultaneously Device obtains complete video so that the video slicing received is combined by server by the mark of the video to be uploaded.
15. device according to claim 14, which is characterized in that first probe unit, comprising: first obtains mould Block, the first sending module, the first logging modle and the first computing module;
Described first obtains module, for, for detecting the data volume size of the fragment of network speed, obtaining a piece of spy according to preset Survey grid speed fragment, the mark detected in network speed fragment comprising the video to be uploaded;
First sending module, for sending the detection network speed fragment;
First logging modle, for recording the sending time of the detection network speed fragment and receiving described in server return Detect the time that network speed fragment uploads success message;
First computing module, for according to the detection network speed fragment sending time and the institute for receiving server and returning The time that detection network speed fragment uploads success message is stated, the current transmission duration of the detection network speed fragment is calculated, as current Network status index;
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: the transmission of detection network speed fragment The corresponding relationship of duration range and video slicing data volume size;
First determination unit, comprising: the first determining module;
First determining module, for determining transmission duration range locating for current transmission duration, according to the detection network speed The transmission duration range of fragment and the corresponding relationship of video slicing data volume size, determine current video fragment data amount size;
Or,
The corresponding relationship of the preset Network status and video slicing data volume size, comprising: Network status it is good or badly with view The corresponding relationship of frequency division sheet data amount size;
First determination unit, comprising: first judgment module, the second determining module, third determining module;
The first judgment module, for judging it is good or bad whether current transmission duration is less than preset Network status for identification Transmission duration threshold value;
Second determining module, if being less than the transmission duration threshold value for current transmission duration, it is determined that Network status It is good, otherwise determine that Network status is bad;
The third determining module, for according to Network status is good or the bad corresponding relationship with video slicing data volume size, really Settled forward sight frequency division sheet data amount size.
16. device according to claim 15, which is characterized in that described first obtains module, comprising: first obtains submodule Submodule is added in block, the first computational submodule and first;
First acquisition submodule, for, for detecting the data volume size of the fragment of network speed, being obtained a piece of according to preset Detect network speed fragment;
First computational submodule, for calculating the MD5 value of the detection network speed fragment;
Described first is added submodule, for the calculated MD5 value to be added in detection network speed fragment, so that server receives The MD5 value that received detection network speed fragment is calculated after to the detection network speed fragment data, according to detection network speed fragment In MD5 value and the MD5 value that itself calculates do MD5 verification, and to the client device return detection network after verify successfully The upload success message of fast fragment.
17. device according to claim 14, which is characterized in that first sharding unit, comprising: the first collapsible mould Module is added in block, the first computing module and first;
The first fragment module carries out fragment for the video to be uploaded to be pressed the current video fragment size;
First computing module, for calculating the MD5 value of the video slicing;
Described first is added module, for the MD5 value of the video slicing to be added in video slicing, so that server receives institute The MD5 value that video slicing data calculate received video slicing later is stated, according to the MD5 value in the video slicing, and The MD5 value itself calculated does MD5 verification, and returns to the upload of presently described video slicing to client device after verifying successfully Success message.
18. device according to claim 17, which is characterized in that first uploading module, comprising: first is sent into submodule Block, first upload submodule, the first judging submodule, the second feeding submodule, second judgment submodule, the first execution submodule Block, third judging submodule, third are sent into submodule and the first sending submodule;
Described first is sent into submodule, for each video slicing to be sent into upload fragment queue to be processed, the video slicing The mark of data, range, MD5 value and the video to be uploaded including the video slicing;
Described first uploads submodule, for video slicing to be successively uploaded to server from upload fragment queue to be processed, with The MD5 value that received video slicing is calculated after making server receive the video slicing data, according to the video The MD5 value of MD5 value and itself calculating in fragment does MD5 verification, for the video slicing verified by MD5, sets to client Preparation serves biography success message;
First judging submodule, for according to whether receive server return upload success message, judge video slicing Whether upload is successful;
Described second is sent into submodule, if the upload success message for not receiving server return, by the video point Piece is sent into mistake and retries fragment queue, and judges whether there are also video slicings in upload fragment queue to be processed;
The second judgment submodule, if the upload success message for receiving server return, judges upload to be processed Whether there are also video slicings in fragment queue;
First implementation sub-module, if for there are also video slicing, triggerings described first in upload fragment queue to be processed It uploads submodule execution and video slicing is successively uploaded to server from upload fragment queue to be processed;
The third judging submodule, if judge incorrectly weight for not having video slicing in upload fragment queue to be processed Try in fragment queue whether there are also video slicings;
The third is sent into submodule, if retried in fragment queue for mistake there are also video slicing, mistake is retried point The video slicing of piece queue is sent into upload fragment queue to be processed;
First sending submodule sends this upload if retrying in fragment queue for mistake does not have video slicing The message that video terminates is to server, so that server will connect according to the fragment range received and the mark of video to be uploaded The video slicing received is combined, and obtains complete video.
19. device according to claim 18, which is characterized in that further include: the first statistic submodule, the 4th judge submodule Block, the second implementation sub-module, first cancel submodule;
First statistic submodule, for after each determining upload success message for not receiving server return, statistics to be not Upload successful number;
4th judging submodule does not upload whether successful number is less than upload errors number threshold limit for judging;
Second implementation sub-module touches if being less than upload errors number threshold limit for not uploading successful number It sends out third described and is sent into submodule to execute and video slicing feeding mistake is retried into fragment queue;
Described first cancels submodule, if cancelled for not uploading successful number not less than errors number limitation is uploaded This video uploads.
20. device according to claim 13, which is characterized in that further include:
First judging unit is used for after the first obtains unit obtains video to be uploaded, in first probe unit Detect current network conditions before, read user configuration information, judge user whether configuration data format check;
First reading unit reads the data format verification letter of user configuration if verified for user configuration data format Breath;
First acquisition unit, for obtaining the data format information of video to be uploaded according to the data format check information;
Second judgment unit, for judging whether the data format information of the video to be uploaded meets data format verification item Part;
First execution unit, for if it is satisfied, then determining that verification passes through, it is current that triggering first probe unit executes detection Network status.
21. device according to claim 20, which is characterized in that
The data format check information of the user configuration includes: stringent verification or non-critical verification;
The first acquisition unit, including the first acquisition module;Described first obtains module, is stringent for work as user configuration When verification, format, the ratio of width to height, duration and the data volume of video to be uploaded are obtained;
The second judgment unit, including the second judgment module;Second judgment module is stringent for work as user configuration When verification, according to the standard value of preset format, the ratio of width to height, duration and data volume, the data format information of uploaded videos is treated It is verified;Or
The first acquisition unit, including the second acquisition module;Described second obtains module, is non-tight for work as user configuration When lattice verify, the data volume of video to be uploaded is obtained;
The second judgment unit, including third judgment module;The third judgment module is non-tight for work as user configuration When lattice verify, according to the standard value of preset data volume, the data format information for treating uploaded videos is verified.
22. device according to claim 13, which is characterized in that further include: third judging unit, the first determination unit, Second execution unit, third execution unit;
The third judging unit, for being detected described first after the first obtains unit obtains video to be uploaded Before unit detects current network conditions, user configuration information is read, judges whether user is provided with fragment data amount size;
First determination unit, if for user setting fragment data amount size, by the fragment data of user setting Amount is sized to current video fragment data amount size;
The video to be uploaded is worked as forward sight by described for triggering first sharding unit and executing by second execution unit The step of frequency division sheet data amount size carries out fragment, obtains multiple video slicings;
The third execution unit triggers first probe unit if fragment data amount size is not arranged for user Execute detection current network conditions.
23. the device that a kind of video uploads, which is characterized in that be applied to server, described device includes:
Second receiving unit, for receiving multiple video slicings of client device transmission, the video slicing sets for client After standby acquisition video to be uploaded, current network conditions are detected, according to preset Network status and video slicing data volume size Corresponding relationship determines current video fragment data amount size, and the video to be uploaded is pressed the current video fragment data amount Size carries out fragment, multiple video slicings of acquisition;
First assembled unit obtains complete video for the video slicing received to be combined.
24. device according to claim 23, which is characterized in that further include:
Third receiving unit, for second receiving unit receive client device send multiple video slicings before, Receive the uploaded videos request that client device is sent;
Second transmission unit, for sending unique identification to client device, so that client device makees the unique identification For the mark of video to be uploaded;
The multiple video slicings for receiving client device and sending, the video slicing are that client device obtains view to be uploaded After frequency, current network conditions are detected, according to the corresponding relationship of preset Network status and video slicing data volume size, determination is worked as The video to be uploaded is pressed the current video fragment data amount size, carries out fragment, obtain by forward sight frequency division sheet data amount size Multiple video slicings in, the video slicing includes the data of the video slicing, range, MD5 value and described to be uploaded The mark of video;
First assembled unit, comprising:
The mark of 4th determining module, the video to be uploaded for being sent according to client device determines the video slicing Affiliated video;
4th judgment module calculates received video slicing for the data according to the video slicing received MD5 value, the MD5 value in MD5 value and the video slicing calculated according to itself, does MD5 verification, judges the video slicing Whether upload is successful;
Second sending module sends if uploaded successfully for video slicing and uploads success message to client device;
5th judgment module, for judging whether that receiving the video uploads end message;
First execution module, if for receive video upload end message, trigger first assembled unit execute general The video slicing received is combined, and obtains complete video.
25. a kind of client device, which is characterized in that including processor, communication interface, memory and communication bus, wherein place Device, communication interface are managed, memory completes mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-10.
26. a kind of server, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method step of claim 11-12 Suddenly.
CN201910281811.6A 2019-04-09 2019-04-09 A kind of method, apparatus, client device and server that video uploads Pending CN109982160A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910281811.6A CN109982160A (en) 2019-04-09 2019-04-09 A kind of method, apparatus, client device and server that video uploads

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910281811.6A CN109982160A (en) 2019-04-09 2019-04-09 A kind of method, apparatus, client device and server that video uploads

Publications (1)

Publication Number Publication Date
CN109982160A true CN109982160A (en) 2019-07-05

Family

ID=67083817

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910281811.6A Pending CN109982160A (en) 2019-04-09 2019-04-09 A kind of method, apparatus, client device and server that video uploads

Country Status (1)

Country Link
CN (1) CN109982160A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602229A (en) * 2019-09-20 2019-12-20 中国银行股份有限公司 Terminal system version downloading method, device and system based on dynamic slicing
CN111770309A (en) * 2020-06-24 2020-10-13 浙江大华技术股份有限公司 Video uploading method and device, electronic equipment and storage medium
CN112422682A (en) * 2020-11-18 2021-02-26 青岛海尔科技有限公司 Data transmission method and device, storage medium, and electronic device
CN112492033A (en) * 2020-11-30 2021-03-12 深圳市移卡科技有限公司 File transmission method, system and computer readable storage medium
CN112615757A (en) * 2020-12-11 2021-04-06 上海哔哩哔哩科技有限公司 Content delivery network link evaluation method and device
CN112637357A (en) * 2020-12-29 2021-04-09 成都知道创宇信息技术有限公司 File transmission method and device and terminal equipment
CN113037846A (en) * 2021-03-17 2021-06-25 成都新希望金融信息有限公司 Data reporting method and device, electronic equipment and computer readable storage medium
CN113438499A (en) * 2021-06-29 2021-09-24 北京奇艺世纪科技有限公司 Data uploading and receiving method, device, equipment and storage medium
CN113438520A (en) * 2021-06-29 2021-09-24 北京奇艺世纪科技有限公司 Data processing method, device and system
CN113518108A (en) * 2021-04-23 2021-10-19 北京奇艺世纪科技有限公司 Fragment uploading method, device, equipment and storage medium
CN113747245A (en) * 2021-09-06 2021-12-03 北京字跳网络技术有限公司 Multimedia resource uploading method and device, electronic equipment and readable storage medium
CN113852642A (en) * 2021-10-09 2021-12-28 珠海迈科智能科技股份有限公司 TS (transport stream) fragment uploading method and device based on DVB (digital video broadcasting) standard
CN115529307A (en) * 2022-08-23 2022-12-27 北京奇艺世纪科技有限公司 File uploading method and system, client device and server
CN115643453A (en) * 2022-12-23 2023-01-24 北京安锐卓越信息技术股份有限公司 Video uploading method, system, user terminal, server and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101848067A (en) * 2010-06-22 2010-09-29 中兴通讯股份有限公司 Data transmission method and system for self-adaptive bandwidth
CN101895536A (en) * 2010-06-30 2010-11-24 北京新媒传信科技有限公司 Multimedia information sharing method
US20110066708A1 (en) * 2001-03-21 2011-03-17 Ascentive Llc Computer Program Product For Determining A Group Of Network Configuration Settings That Provide Optimal Network Performance
CN102611945A (en) * 2011-12-19 2012-07-25 北京蓝汛通信技术有限责任公司 Streaming media slicing method, slicing server and streaming media demand system
CN104350518A (en) * 2014-05-20 2015-02-11 华为技术有限公司 Configuration method of advertisement templete, server and system
CN104967634A (en) * 2014-05-21 2015-10-07 腾讯科技(北京)有限公司 File upload method and apparatus thereof
CN105050133A (en) * 2015-07-31 2015-11-11 腾讯科技(深圳)有限公司 Method and device for detecting internet speed under Wi-Fi hotspot
CN105245578A (en) * 2015-09-11 2016-01-13 北京金山安全软件有限公司 Data uploading method, data uploading system and data uploading device
CN105898318A (en) * 2015-12-21 2016-08-24 乐视云计算有限公司 Offline transcoding method and system
CN105959083A (en) * 2016-04-22 2016-09-21 乐视控股(北京)有限公司 Long-distance transmission method and device and computer device
CN106487780A (en) * 2016-09-12 2017-03-08 乐视控股(北京)有限公司 Advertisement placement method, apparatus and system
CN108595705A (en) * 2018-05-10 2018-09-28 广州师培社教育科技有限公司 Micro- class production method, system, device and the learning platform of multi-format document encapsulation

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110066708A1 (en) * 2001-03-21 2011-03-17 Ascentive Llc Computer Program Product For Determining A Group Of Network Configuration Settings That Provide Optimal Network Performance
CN101848067A (en) * 2010-06-22 2010-09-29 中兴通讯股份有限公司 Data transmission method and system for self-adaptive bandwidth
CN101895536A (en) * 2010-06-30 2010-11-24 北京新媒传信科技有限公司 Multimedia information sharing method
CN102611945A (en) * 2011-12-19 2012-07-25 北京蓝汛通信技术有限责任公司 Streaming media slicing method, slicing server and streaming media demand system
CN104350518A (en) * 2014-05-20 2015-02-11 华为技术有限公司 Configuration method of advertisement templete, server and system
CN104967634A (en) * 2014-05-21 2015-10-07 腾讯科技(北京)有限公司 File upload method and apparatus thereof
CN105050133A (en) * 2015-07-31 2015-11-11 腾讯科技(深圳)有限公司 Method and device for detecting internet speed under Wi-Fi hotspot
CN105245578A (en) * 2015-09-11 2016-01-13 北京金山安全软件有限公司 Data uploading method, data uploading system and data uploading device
CN105898318A (en) * 2015-12-21 2016-08-24 乐视云计算有限公司 Offline transcoding method and system
CN105959083A (en) * 2016-04-22 2016-09-21 乐视控股(北京)有限公司 Long-distance transmission method and device and computer device
CN106487780A (en) * 2016-09-12 2017-03-08 乐视控股(北京)有限公司 Advertisement placement method, apparatus and system
CN108595705A (en) * 2018-05-10 2018-09-28 广州师培社教育科技有限公司 Micro- class production method, system, device and the learning platform of multi-format document encapsulation

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602229A (en) * 2019-09-20 2019-12-20 中国银行股份有限公司 Terminal system version downloading method, device and system based on dynamic slicing
CN111770309A (en) * 2020-06-24 2020-10-13 浙江大华技术股份有限公司 Video uploading method and device, electronic equipment and storage medium
CN112422682A (en) * 2020-11-18 2021-02-26 青岛海尔科技有限公司 Data transmission method and device, storage medium, and electronic device
CN112492033A (en) * 2020-11-30 2021-03-12 深圳市移卡科技有限公司 File transmission method, system and computer readable storage medium
CN112615757A (en) * 2020-12-11 2021-04-06 上海哔哩哔哩科技有限公司 Content delivery network link evaluation method and device
CN112637357A (en) * 2020-12-29 2021-04-09 成都知道创宇信息技术有限公司 File transmission method and device and terminal equipment
CN113037846A (en) * 2021-03-17 2021-06-25 成都新希望金融信息有限公司 Data reporting method and device, electronic equipment and computer readable storage medium
CN113518108A (en) * 2021-04-23 2021-10-19 北京奇艺世纪科技有限公司 Fragment uploading method, device, equipment and storage medium
CN113438520A (en) * 2021-06-29 2021-09-24 北京奇艺世纪科技有限公司 Data processing method, device and system
CN113438499A (en) * 2021-06-29 2021-09-24 北京奇艺世纪科技有限公司 Data uploading and receiving method, device, equipment and storage medium
CN113438520B (en) * 2021-06-29 2023-01-03 北京奇艺世纪科技有限公司 Data processing method, device and system
CN113438499B (en) * 2021-06-29 2023-02-03 北京奇艺世纪科技有限公司 Data uploading and receiving method, device, equipment and storage medium
CN113747245A (en) * 2021-09-06 2021-12-03 北京字跳网络技术有限公司 Multimedia resource uploading method and device, electronic equipment and readable storage medium
WO2023029846A1 (en) * 2021-09-06 2023-03-09 北京字跳网络技术有限公司 Multimedia resource uploading method and apparatus, electronic device, and readable storage medium
CN113852642A (en) * 2021-10-09 2021-12-28 珠海迈科智能科技股份有限公司 TS (transport stream) fragment uploading method and device based on DVB (digital video broadcasting) standard
CN113852642B (en) * 2021-10-09 2023-05-09 珠海迈科智能科技股份有限公司 DVB standard-based TS (transport stream) stream fragment uploading method and device
CN115529307A (en) * 2022-08-23 2022-12-27 北京奇艺世纪科技有限公司 File uploading method and system, client device and server
CN115643453A (en) * 2022-12-23 2023-01-24 北京安锐卓越信息技术股份有限公司 Video uploading method, system, user terminal, server and storage medium

Similar Documents

Publication Publication Date Title
CN109982160A (en) A kind of method, apparatus, client device and server that video uploads
WO2017113527A1 (en) Method and device for switching virtual sim card, and terminal
CN102629898B (en) Data transmission method and device as well as system
CN104598342B (en) The detection method and device of memory
CN107870832B (en) Multi-path storage device based on multi-dimensional health diagnosis method
CN109254864A (en) A kind of application failure restorative procedure, device and electronic equipment
CN104917749A (en) Account registration method and device
CN113472607A (en) Application program network environment detection method, device, equipment and storage medium
CN102546618A (en) Method, device, system and website for detecting fishing website
CN108390856A (en) A kind of ddos attack detection method, device and electronic equipment
CN104954343A (en) Verification information processing method, server and system
CN107800663A (en) The detection method and device of flow off-line files
CN105872118A (en) Detection method and device of node servers in DNS (Domain Name System) network
CN105763505A (en) Operation method and device based on user account
CN107861832A (en) Data verification method, device and readable storage medium storing program for executing
CN102801699B (en) The system preventing server data from distorting, method and apparatus
CN104780123B (en) A kind of network pack receiving and transmitting processing unit and its design method
CN105656996A (en) Data node survival detection method and device
CN109002253A (en) A kind of processing method and processing device for damaging band
CN108197498A (en) Obtain the method and device of data
CN106941690A (en) A kind of quality of data determines method and apparatus
CN107430533A (en) A kind of data verification method and device
CN112783942B (en) Block chain-based data acquisition quality verification method, system, device and medium
CN107608868B (en) Log collection method, Baseboard Management Controller (BMC) and disk controller
CN100561953C (en) A kind of method of recording and diagnosing data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190705

RJ01 Rejection of invention patent application after publication