WO2018072629A1 - Media fragment push method, server and client - Google Patents

Media fragment push method, server and client Download PDF

Info

Publication number
WO2018072629A1
WO2018072629A1 PCT/CN2017/105714 CN2017105714W WO2018072629A1 WO 2018072629 A1 WO2018072629 A1 WO 2018072629A1 CN 2017105714 W CN2017105714 W CN 2017105714W WO 2018072629 A1 WO2018072629 A1 WO 2018072629A1
Authority
WO
WIPO (PCT)
Prior art keywords
push
slice
client
fragment
pending
Prior art date
Application number
PCT/CN2017/105714
Other languages
French (fr)
Chinese (zh)
Inventor
高莹
顾迎节
张尧烨
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018072629A1 publication Critical patent/WO2018072629A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • H04L65/612Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for unicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/762Media network packet handling at the source 
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26258Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for generating a list of items to be played back in a given order, e.g. playlist, or scheduling item distribution according to such list
    • 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/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • 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/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47202End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
    • 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
    • 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

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method, a server, and a client for pushing a media slice.
  • Hypertext Transfer Protocol English: Hypertext Transfer Protocol, HTTP
  • P2P peer-to-peer
  • Play to local disk HTTP progressive download (English: HTTP Progressive Download)
  • HTTP Dynamic Adaptive Streaming over HTTP (DASH) scheme Among them, DASH put forward a series of technical requirements for all aspects involved in the use of HTTP transmission Moving Picture Experts Group (English: Moving Picture Experts Group, MPEG for short).
  • the DASH standard specifies the format of the media description file (English: Media Presentation description, MPD) and segmentation. Any media resource is composed of shards.
  • the shard is the basic unit for the DASH client to request media resources from the DASH server.
  • the MPD mainly describes the information of the media resources, including the download addresses of the fragments of different code rates.
  • the client can select the appropriate code rate according to the network status, such as the download speed and the number of caches.
  • the server sends the fragment to the client through the HTTP protocol according to the client's selection to ensure the user's viewing experience.
  • part6 DASH with Server Push and WebSockets, which is being developed in the DASH standard (ISO-IEC_23009-6), proposes a push mechanism.
  • the client sends an MPD request message to the server, where the request message carries a Push Directive, where the push command includes an identifier of a fragment that the client wants to push the server, such as initializing the fragment.
  • logo the push command includes an identifier of a fragment that the client wants to push the server, such as initializing the fragment.
  • logo logo.
  • Step 2 The server sends a Push Promise and an MPD to the client in response to the client's request.
  • the push commitment indicates to the stream indicated by the StreamID that the server will push the initial fragment.
  • Step 3 After sending the MPD and the push commitment, the server actively pushes the initialization fragment to the client in the flow specified by the push commitment according to the flow identifier.
  • Step 4 The client sends a fragmentation request message to the server, where the message includes an identifier of the request fragment and a push instruction, where the push instruction includes a fragment identifier that the client wants to push the server; the fragment identifier that the client wants the server to push may be The download address of the slice described by the form of a list or a template may also be a number of consecutive slices after the requested slice is specified. For example, the client requests the fragment 1 and includes the identifier of the fragment 2, the identifier 3 of the fragment, the fragment 4, and the identifier of the fragment 5 in the push instruction.
  • Step 5 The server responds to the request of the client, and sequentially sends the push commitment of the slice 2, the push commitment of the slice 3, the push commitment of the slice 4, the push commitment of the slice 5, the slice 1 to the client, and the push commitment includes A stream identifier and a tile identifier for each tile to be pushed to indicate which tile to push in which stream.
  • Step 6 the flow identifier in the commitment is pushed, and the server pushes the fragment to the client in the specified stream.
  • Step 7 The client receives the fragment pushed by the server according to the fragment identifier and the stream identifier in the push commitment, and performs decoding and playing. Repeat steps 4 through 7 until playback is complete or the user stops watching. Through the server's active push, you can speed up media playback, reduce latency, and reduce message interaction.
  • the method shown in FIG. 1 has the disadvantage that if the number of fragments that the client requests the server to push is large, the server needs to send the push commitment frame corresponding to all the fragments to be pushed later, and then the data of the fragment 1 is sent. For example, if the client pushes the request to push the subsequent 50 fragments, the server will first send 50 push commitment frames to notify the client that the next 50 fragments will be pushed by which stream identifiers respectively, and then the fragments will be sent. 1 data, increased playback delay of the client.
  • the embodiment of the invention provides a method for pushing media fragments and related devices, which can reduce the playback delay of the client.
  • an embodiment of the present invention provides a method for pushing a media slice, including:
  • the server receives the fragment request message sent by the client, and the fragment request message includes a request fragment identifier and a push instruction, where the push instruction is used to instruct the client to request the pushed fragment.
  • the server determines the pushable slice and the pending push slice according to the slice pushed by the client request.
  • the server sends, to the client, a push commitment corresponding to each fragment in the pushable fragment, a fragment corresponding to the request fragment identifier, and a pending push indication information, where the pending push indication information is used to indicate that the client waits to receive the push of the pending push slice. committed to.
  • the server groups the fragments that the client requests to push, so as to send the push commitment corresponding to a part of the fragment first, and then sends the push commitment corresponding to the other fragments in the subsequent process, so as to avoid pushing the request by the client.
  • the large number of shards causes the client to delay playback due to receiving too many push commitments before receiving the requested shards, thereby reducing the playback delay of the client.
  • the server determines the pushable slice and the pending push slice according to the slice that the client requests to push, including: the server divides the slice that the client requests to push according to the first pending push parameter into a pushable Fragmentation and pending push shards.
  • the first pending push parameter is carried in the server local configuration or in the fragment request message.
  • the server determines the pushable slice and the pending push slice according to the first pending push parameter.
  • the first pending push parameter can be locally configured by the server, so that the server can determine the pushable fragment by combining the ability of the server to push the slice.
  • the first pending push parameter may also be set by the client, and the server determines the pushable fragment according to the requirements of the client, and can meet the personalized push requirement of different users compared with the manner that the server sets the first pending push parameter.
  • the server divides the fragment that the client requests to push according to the first pending push parameter into a pushable slice and a pending push slice, specifically: the first pending push parameter is a push threshold, and the server determines the client.
  • the first fragment to the Nth fragment in the fragment requested by the terminal are pushable fragments, and the other fragments except the pushable fragments in the fragment requested by the client request are determined as pending push fragments.
  • N is a positive integer determined by the push threshold; or the first pending push parameter is a random indicator, and the server determines, as a random indicator, the cached slice in the slice requested by the client to be pushable slice And determine the slice other than the pushable slice in the slice pushed by the client request as the pending push slice.
  • the server determines the pushable fragment by pushing the threshold or the currently cached fragment of the server, so that the number of push commitments sent by the server is not excessive, so that the playback delay of the client is avoided.
  • the server further includes: the server is determined according to the first to be determined.
  • Push parameters to determine pushable slices in the pending push slice The server sends the push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client according to the second pending push parameter, and the pushable slice in the pending push slice is the pending push slice. Part or all of the pieces.
  • the second pending push parameter is used to instruct the server to send the condition of the push commitment of the pushable slice in the pending push slice to the client, and the second pending push parameter is carried in the server locally or in the slice request message. .
  • the server determines, according to the second pending push parameter, a sending opportunity of the push commitment corresponding to the pushable slice, so as to timely send the push commitment corresponding to the pushable slice in the to-be-seged slice to the client, Improve the delivery efficiency of push commitments.
  • the second pending push parameter may be locally configured by the server, so that the server can determine the push commitment corresponding to the pushable slice when combined with the ability of the server to push the slice.
  • the second pending push parameter may also be set by the client, and the server determines, according to the requirements of the client, when to send the push commitment corresponding to the pushable slice, and can satisfy the different users according to the manner that the server sets the second pending push parameter. Personalized push requirements.
  • the server sends a push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client according to the second pending push parameter, specifically: when the pushed promise is sent and the push is not pushed.
  • the server sends the push commitment corresponding to the pushable slice in the pending push slice to the client; or, when the pending push slice includes the cached one that meets the second preset quantity
  • the server sends a push commitment corresponding to the pushable slice in the pending push shard to the client.
  • the server determines, according to the remaining number of fragments that have been pushed and not pushed, or the number of cached fragments of the server, when to send the push commitment corresponding to the pushable fragments in the pending push slice to the client. Therefore, the push commitment corresponding to the to-be-seged slice can be sent to the client in time to improve the transmission efficiency of the push commitment.
  • the server further includes: the server receiving the client A cancel push request message sent one by one by a slice that has been pushed and not pushed.
  • the server cancels the push of the pushed push promised and unpushed fragments to the client according to the cancel push request message.
  • the server cancels pushing the shards that have not yet sent the push promise to the client.
  • the client stops playing the media resource it only needs to send the cancel push request message one by one for all the fragments that have been sent and not pushed, without sending the cancel push request for the fragment that has not sent the push commitment.
  • the message reduces the number of times the client sends a cancel push request message, thereby reducing the client's overhead.
  • the server further includes: the server receiving the client
  • the cancel push request message sent by the target fragment, the target fragment is any fragment that has sent the push commitment and is not pushed, and the cancel push request message includes canceling the pending push indication information, and the cancel pending push indication information is used to instruct the server to cancel the direction.
  • the client pushes the shard that has not sent the push promise.
  • the server cancels the push of the target shard to the client according to the cancel push request message, and cancels pushing the shard that has not yet sent the push promise to the client.
  • the client may carry the cancellation pending push indication information in the sent cancellation push request message, instructing the server to cancel pushing the fragment that has not sent the push commitment to the client, and the server determines according to the cancel pending push indication information. It is necessary to cancel the shard that pushes the push promise that has not been sent to the client.
  • the embodiment of the present invention can prevent the server from receiving the last one, as compared with the manner in which the server cancels pushing all the fragments that have been sent and not pushed according to the client, and indirectly determines to cancel the pushing of the fragment that has not yet sent the push commitment to the client. Before the cancel push request message of the shard that has been pushed and not pushed, the server has already sent the push commitment corresponding to the push shard to the client, so that the cancel operation is more timely.
  • the server determines the pushable and pending pushes based on the fragments pushed by the client request. After the fragmentation, the method further includes: the server generates a first fragment list, where the identifier of the fragment that has sent the push commitment and is not pushed and the corresponding stream identifier are recorded in the first fragment list. By maintaining the first shard list, the server can clarify which shards that have sent push commitments have not been pushed.
  • the server further includes: the server generates a second slice list, where the second slice list records The identity of the shard that has not yet sent the push promise.
  • the server sends the push commitment corresponding to the pushable slice in the to-be-seged slice to the client, the server deletes the identifier corresponding to the pushable slice in the pending push slice from the second slice list.
  • the canceling the push request message carries the flow identifier
  • the server cancels the fragment that has sent the pushed push commitment and is not pushed to the client according to the cancel push request message, specifically: the server carries the message according to the push request message.
  • the flow identifier deletes the record corresponding to the flow identifier in the first fragment list.
  • the server cancels the shard that has not sent the push commitment to the client, specifically: the server empties or deletes the second shard list.
  • an embodiment of the present invention provides a method for pushing a media slice, including:
  • the client sends a fragmentation request message to the server.
  • the fragmentation request message includes a request fragment identifier and a push instruction, and the push instruction is used to instruct the client to request the pushed fragment.
  • the client receives the push commitment corresponding to each fragment in the pushable fragment sent by the server, the fragment corresponding to the request fragment identifier, and the pending push indication information, where the pending push indication information is used to instruct the client to wait for the receiving client to request the push.
  • the push commitment of the pending push slice other than the pushable slice in the slice.
  • the client after the client requests the server to push the fragment, the client only receives the push commitment corresponding to the pushable fragment, and determines, according to the pending push indication information returned by the server, the push commitment of the subsequent server to send the remaining fragment.
  • the client on the one hand, it can avoid the problem that the client has a large playback delay due to receiving too many push commitments before receiving the requested fragment; on the other hand, the client only needs to wait for the server to continue to send the remaining
  • the push commitment of the fragment can be used, and the resend fragment request message does not need to be sent to the server again, which saves the message overhead.
  • the fragment request message further includes a first pending push parameter, where the first pending push parameter is used to instruct the server to divide the slice that the client requests to push according to the first pending push parameter into a pushable slice. And pending push shards.
  • the client sets the first pending push parameter, and the server determines the pushable slice and the pending push slice according to the first pending push parameter sent by the client, thereby satisfying the personalized push requirement of different users.
  • the first pending push parameter includes a push threshold for indicating the number of pushable slices or a random indicator for instructing the server to determine the cached slice as a pushable slice.
  • the client sets a push threshold or a random indicator, so that the server determines the pushable fragment according to the push threshold or the currently cached fragment of the server, so as to ensure that the number of push commitments sent by the server is not excessive. Therefore, the playback delay of the client is prevented from being large.
  • the client after receiving the push commitment corresponding to each fragment in the pushable fragment sent by the server, the fragment corresponding to the request fragment identifier, and the pending push indication information, the client further includes: the client receiving server
  • the push commitment corresponding to the pushable slice in the sent push slice to be sent, the pushable slice in the pending push slice is a part or all partial slices in the pending push slice.
  • the client can also receive the push commitment corresponding to the pushable fragment in the to-be-seged slice, so as to implement the push commitment in batches, compared to the prior art, in the embodiment of the present invention, the client The terminal does not receive the push commitment corresponding to all the fragments requested by the client at one time, and avoids the large number of fragments pushed by the client request, so that the client receives too many pushes before receiving the requested fragment. Commitment leads to a problem with a large playback delay, which can reduce the playback delay of the client.
  • the fragment request message further includes a second pending push parameter, where the second pending push parameter is used to instruct the server to determine, according to the second pending push parameter, the corresponding pushable slice in the pending push slice.
  • the client sends a second pending push parameter to the server, so that the server determines, according to the second pending push parameter, a sending opportunity of the push commitment corresponding to the pushable slice.
  • the second pending push parameter includes: when the remaining number of fragments that have been sent and not pushed is smaller than the first preset quantity, the server will correspond to the pushable fragments in the pending push slice.
  • the push commitment is sent to the client; or, when the pending push shard includes the cached shard that meets the second preset number, the server sends the push commitment corresponding to the pushable shard in the pending push shard to the client.
  • the client may receive the push commitment corresponding to the pending push fragment in time.
  • the client after the client receives the push commitment corresponding to each of the shards sent by the server, the shard corresponding to the request shard identifier, and the pending push indication information, the client includes: A shard that pushes the promise and is not pushed, sends a cancel push request message to the server one by one, and the cancel push request message is used to instruct the server to cancel the shard that has pushed the pushed push promise to the client and has not been pushed.
  • the client stops playing the media resource it only needs to send the cancel push request message one by one for all the fragments that have sent the push promise and not pushed, without sending the cancel push request for the fragment that has not sent the push promise.
  • the message reduces the number of times the client sends a cancel push request message, thereby reducing the client's overhead.
  • the client after receiving the push commitment corresponding to each fragment in the pushable fragment sent by the server, the fragment corresponding to the request fragment identifier, and the pending push indication information, the client further includes: the client targets the target.
  • the fragment sends a cancel push request message to the server.
  • the target fragment is any fragment that has sent the push commitment and is not pushed.
  • the cancel push request message includes canceling the pending push indication information, and the cancel pending push indication information is used to instruct the server to cancel the direction.
  • the client pushes the shard that has not sent the push promise.
  • the client may carry the cancellation pending push indication information in the sent cancellation push request message, instructing the server to cancel pushing the fragment that has not sent the push commitment to the client, and the server determines according to the cancel pending push indication information. It is necessary to cancel the shard that pushes the push promise that has not been sent to the client.
  • the embodiment of the present invention can prevent the server from receiving the last one, as compared with the manner in which the server cancels pushing all the fragments that have been sent and not pushed according to the client, and indirectly determines to cancel the pushing of the fragment that has not yet sent the push commitment to the client. Before the cancel push request message of the shard that has been pushed and not pushed, the server has already sent the push commitment corresponding to the push shard to the client, so that the cancel operation is more timely.
  • the client after receiving the push commitment corresponding to each fragment in the pushable fragment sent by the server, the fragment corresponding to the request fragment identifier, and the pending push indication information, the client further includes: the client according to the server The sent push promise determines that the shard can be pushed, and the pending push shard is determined based on the pushable shard and the shard that the client requests to push.
  • the client after the client determines the pushable fragment according to the push commitment sent by the server, and determines the pending push fragment according to the pushable fragment and the slice requested by the client, the client also generates: a first fragment list in which the identifier of the fragment that has sent the push commitment and is not pushed and the corresponding stream identifier are recorded.
  • the client can clarify which shards that have sent push commitments have not been pushed.
  • the client determines the pushable fragment according to the push commitment sent by the server, and determines the pending push fragment according to the pushable fragment and the fragment requested by the client request, and further includes: the client generates the first Two-part column In the table, the identifier of the fragment that has not sent the push commitment is recorded in the second fragment list.
  • the method further includes: the client deleting the identifier corresponding to the pushable fragment in the pending push fragment from the second fragment list .
  • the client after the client sends the cancel push request message to the server one by one, the client sends the first slice list and the second slice list to the server. Or delete.
  • an embodiment of the present invention provides a server, which has a function of implementing server behavior in the foregoing first aspect.
  • the functions can be implemented in hardware or in hardware by executing the corresponding software.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the structure of the server includes a processor and a memory for storing a program that supports the server to perform the above method, and the processor is configured to execute a program stored in the memory.
  • the server can also include a communication interface for the server to communicate with other devices or communication networks.
  • an embodiment of the present invention provides a client, where the client has a function of implementing client behavior in the foregoing second aspect.
  • the functions can be implemented in hardware or in hardware by executing the corresponding software.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the client structure includes a processor and a memory for storing a program that supports the client to perform the above method, and the processor is configured to execute a program stored in the memory.
  • the client can also include a communication interface for the client to communicate with other devices or communication networks.
  • the present invention provides a server, the server comprising a module or unit for performing the push method of the media slice described in the above first aspect or any one of the first aspects.
  • the present invention provides a client comprising a module or unit for performing a push method of a media slice as described in any of the possible aspects of the second aspect or the second aspect above.
  • the present invention provides a communication system, including a server and a client, wherein the server is the server described in the third aspect or the fifth aspect, and the client is the client described in the fourth aspect or the sixth aspect. .
  • an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the server, which includes a program designed to execute the first aspect of the server.
  • an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the client, which includes a program designed to execute the second aspect of the foregoing client.
  • the server divides the fragment requested by the client into a pushable fragment and a pending push fragment, and sends a push commitment and a pending push indication information corresponding to each of the pushable fragments to the client, the client.
  • the new push commitment can be received according to the pending push indication information when subsequently receiving the pushed fragment. Therefore, when the number of fragments requested by the client is large, the client can be prevented from receiving due to the need to receive a large number of push commitments. The problem of large fragmentation delay.
  • FIG. 1 is a schematic flow chart of a method for pushing a media slice in a conventional technology
  • FIG. 2 is a schematic structural diagram of a media slice pushing system according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a method for pushing a media slice according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of a method for canceling push media segmentation according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a server according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a client according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a media sharding push system 200 according to an embodiment of the present invention, including: a server 201, a client 202, and a network 203.
  • Client 202 communicates with server 201 over network 203.
  • the client is responsible for sending a fragmentation request message to the server for requesting the acquisition of the fragment, wherein the fragment includes the initialization fragment and the media fragment.
  • the initialization fragment includes metadata required for media resource playback, and the media fragment includes real data of the media resource.
  • the fragment request message includes a request fragment identifier for requesting data of a certain fragment.
  • the fragmentation request message may further include a push instruction, where the push instruction includes an identifier of a fragment that the client wishes the server to push.
  • the fragment identifier that the client wants to push the server may be a download address describing the fragment in the form of a list or a template, or may be a consecutive fragment after the requested fragment is specified.
  • the slice request message may also include a pending push parameter.
  • the pending push parameter is used to indicate the number of push commitments sent by the server each time or when to send a push commitment for the slice to be pushed.
  • the pending push parameter may specifically be that a maximum of several push commitments are sent at a time, or at least a few push commitments are sent at a time, or a subsequent interval of each batch of push commitments after the first batch of push commitments is sent, or any other It can be used to decide the number of sent push promises or when to send the push promise, such as the number of fragments in the client cache.
  • the client is also used to receive fragments sent or pushed by the server, and is responsible for decoding, decrypting, rendering, and rendering of the fragments.
  • the server is responsible for storing and distributing the fragment, receiving the fragment request message of the client, parsing the push instruction in the fragment request message, and dividing the fragment pushed by the client request into two groups according to the push instruction, and one group is pushable fragment.
  • the other group is pending push shards.
  • the server first sends a push commitment corresponding to each fragment in the pushable fragment to the client, and in the process of subsequently pushing the fragment, the push commitment of the pending push fragment is sent to the client in batches to ensure that each The number of push commitments sent at a time is not excessive, so that the client avoids the problem of large delay caused by receiving too many push commitments when receiving the pushed fragments.
  • the server may further determine the number of transmission commitments and the transmission timing according to the pending push parameters sent by the client, and then send the push commitment to the client according to the number of transmissions and the sending timing.
  • the method in the embodiment of the present invention not only supports the HTTP-based dynamic adaptive stream (DASH) technology, but also applies to other HTTP stream technologies, including HTTP live stream (English: HTTP Live Streaming, referred to as HLS). , HTTP Dynamic Streaming (HDS) and HTTP Smooth Streaming (English: HTTP Smooth Streaming, referred to as HSS).
  • HTTP live stream English: HTTP Live Streaming, referred to as HLS
  • HDS HTTP Dynamic Streaming
  • HTTP Smooth Streaming English: HTTP Smooth Streaming, referred to as HSS
  • the number of the clients 202 may also be multiple, which is not limited by the embodiment of the present invention.
  • the client 202 can be any terminal such as a mobile phone, a tablet computer, a desktop computer, or a notebook computer.
  • the server 201 or the client 202 in FIG. 2 may be the computer device (or system) in FIG. The way to achieve it.
  • FIG. 3 is a schematic diagram of a computer device according to an embodiment of the present invention.
  • Computer device 300 includes at least one processor 301, a communication bus 302, a memory 303, and at least one communication interface 304.
  • the processor 301 can be a general-purpose central processing unit (English: Central Process ing Unit, CPU for short), a microprocessor, an application-specific integrated circuit (ASIC), or one or more An integrated circuit for controlling the execution of the program of the present invention.
  • CPU Central Process ing Unit
  • ASIC application-specific integrated circuit
  • Communication bus 302 can include a path for communicating information between the components described above.
  • the communication interface 304 uses a device such as any transceiver for communicating with other devices or communication networks, such as an Ethernet, a radio access network (English: Radio Access Technology, RAN), and a wireless local area network (English: Wireless Local Area Networks, referred to as WLAN).
  • a radio access network English: Radio Access Technology, RAN
  • WLAN Wireless Local Area Networks
  • the memory 303 may be a read-only memory (English: Read-Only Memory, ROM for short) or other types of static storage devices that can store static information and instructions, a random access memory (English: Random Access Memory, RAM for short). Other types of dynamic storage devices that can store information and instructions, or can be electrically readable Erasable Programmable Read-Only Memory (EEPROM) or read-only discs (English: Compact Disc Read) -Only Memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or can be used to carry Or any other medium having a desired program code in the form of an instruction or data structure and accessible by a computer, but is not limited thereto.
  • the memory can exist independently and be connected to the processor via a bus. The memory can also be integrated with the processor.
  • the memory 303 is used to store program code for executing the solution of the present invention, and is controlled by the processor 301 for execution.
  • the processor 301 is configured to execute program code stored in the memory 303.
  • processor 301 may include one or more CPUs, such as CPU0 and CPU1 in FIG.
  • computer device 300 can include multiple processors, such as processor 301 and processor 308 in FIG. Each of these processors can be a single-CPU processor or a multi-core processor.
  • processors herein may refer to one or more devices, circuits, and/or processing cores for processing data, such as computer program instructions.
  • computer device 300 may also include an output device 305 and an input device 306.
  • Output device 305 is in communication with processor 301 and can display information in a variety of ways.
  • the output device 305 can be a liquid crystal display (English: Liquid Crystal Display, abbreviated as: LCD), a light emitting diode (English: Light Emitting Diode, abbreviated as: LED) display device, a cathode ray tube (English: Cathode Ray Tube, referred to as : CRT) Display device, or projector (projector), etc.
  • Input device 306 is in communication with processor 301 and can accept user input in a variety of ways.
  • input device 406 can be a mouse, keyboard, touch screen device, or sensing device, and the like.
  • the computer device 300 described above can be a general purpose computer device or a special purpose computer device.
  • the computer device 300 can be a desktop computer, a portable computer, a network server, a handheld computer (English: Personal Digital Assistant, PDA for short), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, or There are devices of similar construction in Figure 3. Embodiments of the invention do not limit the type of computer device 300.
  • the server 201 in FIG. 2 may be the device shown in FIG. 3, and one or more software modules (such as an interaction module and a processing module) are stored in the memory of the server 201.
  • the client 202 in FIG. 2 can also be the device shown in FIG.
  • One or more software modules (such as interaction modules and processing modules) are stored in the memory of the client.
  • the server or the client can implement the software module through the processor and the program code in the memory to implement the push of the slice.
  • FIG. 4 is a flowchart of a method for pushing a media slice according to an embodiment of the present invention, including the following steps.
  • S401 The client sends a fragment request message for obtaining the fragment 1 to the server, where the fragment request message includes a push instruction.
  • the fragment request message carries the identifier of the fragment 1 and a push instruction.
  • the push command is used to determine the identifier that the client expects the server to push the shards.
  • the client wants the server to push the shard 2, the shard 3, the shard 4, and the shard 5 as an example.
  • the identifier of the fragment includes, but is not limited to, a uniform resource locator (English: Uniform Resoure Locator, abbreviated as: URL).
  • the client sends a fragment request message carrying a push instruction to the server as shown in the following code 1:
  • the server receives the fragment request message sent by the client, and divides the fragment that the client requests to push into a pushable fragment and a pending push fragment.
  • the server divides the fragment that the client requests to push into a pushable slice and a pending push slice according to the first pending push parameter.
  • the first pending push parameter may be locally configured by the server.
  • the first pending push parameter may be set according to a specific application scenario, and is used to divide the slice that the client requests to push into a pushable slice and a pending push slice, so that the client may request to send the segment in batches.
  • the push promise of the film avoids sending too many push promises at once. causess the client to play delayed.
  • the first pending push parameters include, but are not limited to, a push threshold (eg, a maximum number of push commitments sent at a time, a minimum number of push commitments sent at a time), a random indicator.
  • the push threshold is used to indicate how many shards the server determines as pushable shards.
  • the random indicator is used to instruct the server to determine the currently locally cached slice as a pushable slice.
  • the server sequentially sorts the 50 fragments of the client request from the first slice according to the quantity 4 (ie, the slice 2
  • the fourth slice ie, slice 5
  • the remaining 46 slices are determined as pending push slices.
  • the server currently caches only the fragment 2 to the fragment 5, and the server determines the fragment 2 to the fragment 5 as pushable fragments, and the remaining 46 The slice is determined to be a push slice to be determined.
  • S403 The server sends the push commitment of the slice 2, the push commitment of the slice 3, the push commitment of the slice 4, the push commitment of the slice 5, the pending push indication information, and the slice 1 to the client in response to the request of the client.
  • the push commitment indicates that the server will push the fragment in the stream indicated by the stream ID.
  • the server sends a push commitment for the slice 2, the slice 3, the slice 4, and the slice 5 respectively.
  • these four push commitments are sent to the client before sending the fragment 1.
  • the push commitment of the slice 2, the push commitment of the slice 3, the push commitment of the slice 4, the push commitment of the slice 5, the pending push indication information, and the slice 1 may be part of the same response message. , carrying the same stream ID.
  • the server sends push commitments and shards 1 to the client as shown in the following code 2-6:
  • the format is a Boolean type. In other implementable manners, the format of the pending push indication information may also be other types.
  • " ⁇ binary data for segment 1 ⁇ " is the data of slice 1 requested by the client.
  • the HEADERS frame in which the server pushes the pending push indication information in the returned response message is taken as an example.
  • the pending push may also be performed.
  • the indication information is carried in a certain push commitment sent by the server, or is carried in a newly defined certain message or a certain frame, which is not specifically limited in the embodiment of the present invention.
  • the server may further maintain a fragment list that has sent the push commitment and is not pushed, and the identifier of the fragment that has sent the push commitment and is not pushed and the corresponding stream identifier are recorded in the list.
  • the server sends a push commitment for each pushable fragment to the client.
  • the server sends a push commitment from slice 2 to slice 5 to the client
  • the pushed push commitment is sent.
  • the URL of the slice 2 to the slice 5 and the corresponding stream identifier are recorded in the un-pushed slice list.
  • the format of the slice list that has sent the push commitment and is not pushed can be as shown in Table 1.
  • Table 1 lists of fragments that have been sent push commitments and have not been pushed
  • the server can also maintain a list of pending push fragments, which record the identity of the fragment that the client requested to push and that the server has not sent the push commitment. For example, after the server divides the fragment requested by the client into the pushable slice and the pending push slice, the URL of the slice 6 to the slice 51 is recorded in the pending push slice list.
  • the format of the pending push slice list can be as shown in Table 2.
  • S404 The client receives the push commitment of the slice 2 sent by the server, the push commitment of the slice 3, the push commitment of the slice 4, the push commitment of the slice 5, the pending push indication information, and the slice 1, processing and playing the score Slice 1.
  • the client first receives the push commitment corresponding to each fragment in the pushable fragment, and according to the push commitment client, the client can know which stream the subsequent server will push, according to the fragment identifier carried in the push commitment. And the corresponding flow identifier, the client can maintain a fragment list that has sent the push commitment and has not been pushed.
  • the list records the identifier of the fragment that the server has sent the push commitment and has not pushed to the client, and the corresponding stream identifier. For example, if the URL of the slice 2 to the slice 5 and the corresponding stream identifier are recorded in the slice list that has been sent and the push is not pushed, the format of the slice list that has sent the push commitment and is not pushed can be seen in Table 1.
  • the client learns, according to the received push indication information, that it needs to wait for the push commitment of the other fragments in the fragment that the client requests to push to send the push commitment. Specifically, the client may further determine, according to the fragment that is pushed by the request and the fragment that the server has sent the push commitment, the fragment that has not sent the push commitment, and maintain a pending push fragment list, where the client request is recorded in the list. The identity of the shard that was pushed and the server has not sent a push commitment. For example, the URL of the slice 6 to the slice 51 is recorded in the pending push slice list. See Table 2 for the format of the pending push slice list.
  • the client receives the data of the slice 1, processes and plays the slice 1, and waits for the slice pushed by the server.
  • S405 The server pushes the fragment 2 to the client.
  • the server is The client sends the fragment 2 as shown in the following code 7:
  • the server pushes the fragment 2 to the client, the identifier of the fragment 2 and the stream identifier 2 are deleted from the sent push promised and unpushed fragment list in the server, thereby updating the list.
  • S406 The client receives the fragment 2 sent by the server, and processes and plays the fragment 2.
  • the client After receiving the fragment 2 sent by the server, the client deletes the identifier of the fragment 2 and the stream identifier 2 from the sent push promised and unpushed fragment list in the client, thereby updating the list.
  • the client may further determine whether the response message includes a push commitment.
  • the server pushes the fragment 3 and the fragment 4 to the client, and the client receives the fragment 3 and the fragment 4 pushed by the server.
  • the server For the process, reference may be made to step S405 and step S406, and details are not described herein again.
  • the server pushes a fragment to the client, it needs to delete the corresponding fragment identifier and the corresponding stream identifier from the server's sent push promised and unpushed fragment list, thereby updating the server's sent push commitment and not pushing.
  • the shard list is a fragment identifier and the corresponding stream identifier from the server's sent push promised and unpushed fragment list, thereby updating the server's sent push commitment and not pushing.
  • the client Each time the client receives a push fragment, the client needs to delete the corresponding fragment identifier and the corresponding stream identifier from the fragment list of the client that has sent the push commitment and does not push, and updates the sent push commitment of the client and does not push.
  • the shard list Each time the client receives a push fragment, the client needs to delete the corresponding fragment identifier and the corresponding stream identifier from the fragment list of the client that has sent the push commitment and does not push, and updates the sent push commitment of the client and does not push.
  • S407 The server determines a pushable slice in the pending push slice.
  • the server determines, according to the first pending push parameter, the pushable slice in the pending push slice.
  • the specific form of the first pending push parameter is described in step 402, and details are not described herein again.
  • the server sends the first of the remaining 46 fragments after sending the push commitment corresponding to the slice 2 to the slice 5
  • the slices (ie, slice 6) to the fourth slice (ie, slice 9) are determined to be pushable slices.
  • the server currently caches only the fragment 6 to the fragment 9, and the server determines the fragment 6 to the fragment 9 as pushable fragments.
  • S408 The server sequentially sends the push commitment of the slice 6, the push commitment of the slice 7, the push commitment of the slice 8, the push commitment of the slice 9, and the slice 5 to the client.
  • the server determines, according to the second pending push parameter, a condition for sending a push commitment of the pushable slice in the pending push slice to the client, and when the condition is met, the server corresponds to the pushable slice in the pending push slice.
  • the push promise is sent to the client.
  • the second pending push parameter may be locally configured by the server.
  • the second pending push parameters include, but are not limited to, a minimum value of the remaining number of fragments that have sent the push commitment and are not pushed, or a threshold number of fragments of the server currently buffered.
  • the push commitment corresponding to the pushable shards included in the pending push shard is sent to the client. That is, when the server determines that the push has been sent When there is only one record left in the slice list that is delivered and not pushed, it is determined that the push commitment corresponding to the pushable slice included in the pending push slice is sent to the client. For example, the pushable slice in the pending push slice is slice 6 to slice 9. When the server determines that only the slice 5 is left in the slice list that has been sent and not pushed, the remaining number is less than 2
  • the server sends the corresponding push commitments of each of the fragments 6 to 9 to the client. Preferably, the server may send a push commitment corresponding to each of the fragments 6 to 9 to the client before sending the fragment 5 to the client.
  • the server locally configures 4 slices per cache
  • the corresponding push commitments of the 4 segments can be sent. For example, when the server pushes the fragment 2 to the fragment 5 to the client, the server caches more fragments, for example, the fragment 6 to the fragment 9 in the pending push fragment list, and the number of cached fragments. If four are satisfied, the server sends the corresponding push commitment of each of the fragments 6 to 9 to the client.
  • the server when the condition indicated by the second pending push parameter is met, the server needs to send a part of the push commitment again, on the one hand, avoiding sending too many push commitments each time, causing the client to play the delay;
  • the push commitment of the subsequent fragments is sent to the client in time to avoid the playback delay caused by the client not receiving the fragment pushed by the server in time.
  • the second pending push parameter is only exemplified herein, and the specific form of the second pending push parameter is not limited by the present invention.
  • the code format of the push commitment of the fragment 6 to the fragment 9 sent by the server to the client may refer to the code format of the push commitment of the fragment 2 to the fragment 5, and details are not described herein again.
  • the server sends the fragment 5 to the client as shown in the following code 8:
  • push-policy “urn:mpeg:dash:fdh:2016:push-template”; “http://example/rendition1/segment ⁇ %03d ⁇ : ⁇ 6-9 ⁇ ” means the server The next push strategy is to push slice 6 to slice 9.
  • the server may also carry the pending push indication information, and notify the client to send the push commitment of the remaining fragments that have not yet sent the push commitment. For example, if the server sends the fragment 1 to the client, indicating that the current push is the fragment 2 to the fragment 5, and carries the pending push indication information, the server sends the fragment 5 to the client, in addition to the need. In addition to the information indicating that the push is from slice 6 to slice 9, the push push indication information may be carried, and the client has been notified to continue to wait for the push commitment of the remaining slice that has not yet sent the push commitment. In this case, the server sends the fragment 5 to the client as shown in the following code 9:
  • the server also needs to delete the identifier of the fragment 6 to the fragment 9 from the pending push fragment list, and simultaneously add the identifier of the fragment 6 to the fragment 9 and the corresponding stream identifier to the score that has been sent and not pushed.
  • the slice list After the server pushes the fragment 5 to the client, the server deletes the identifier of the fragment 5 from the fragment list that has sent the push commitment and has not been pushed, thereby updating the list. It should be noted that when the pending push fragment list in the server is empty, it indicates that the push commitment of the fragment requested by the client has been completely transmitted. At this time, the server will not need to send the pending push indication information to the client. .
  • the order in which the server sends the corresponding push commitments from the fragment 6 to the fragment 9 to the client and the server sends the fragment 5 to the client is not specifically limited.
  • the client receives the push commitment corresponding to the fragment 6 sent by the server, the push commitment corresponding to the fragment 7, the push commitment corresponding to the fragment 8, the push commitment corresponding to the fragment 9, and the fragment 5, and processes and plays the fragment. 5.
  • the client first receives the push commitment corresponding to each of the pushable fragments in the to-be-pushed slice, and according to the push commitment client, the client can know which stream the subsequent server will push, according to the push commitment.
  • the fragment identifier and the stream identifier corresponding to the fragment the client can update the fragment list that has sent the push commitment and has not been pushed. For example, the identifier of the fragment 6 to the fragment 9 and the stream identifier corresponding to the fragment 6 to the fragment 9 are added to the fragment list of the client that has sent the push commitment and is not pushed, and at the same time, the fragment 6 to the fragment is segmented.
  • the identity of 9 is removed from the client's pending push slice list.
  • the client processes and plays the slice 5 and waits for the slice 6 to slice 9 pushed by the receiving server.
  • the client learns, according to the pending push indication information, that it needs to wait for receiving the push commitment of the other fragments that have not sent the push commitment.
  • S410 The server pushes the last fragment that has sent the push commitment and has not been pushed to the client.
  • step S410 steps S407 to S409 are repeated between the server and the client until the condition of step S410 is satisfied.
  • the last slice that has sent the push commitment and has not been pushed should be the slice 51.
  • S411 The client receives the last fragment that has been sent by the server and has not been pushed, and processes and plays the fragment, and the playback ends.
  • steps S401 to S411 in the embodiment of the present invention may be repeated until all the fragmentation ends. Repeated descriptions are not repeated here.
  • the server divides the slice that the client requests to push into two parts: a pushable slice and a pending push slice, and firstly pushes the push commitment corresponding to the pushable slice, the pending push indication information, and the client request.
  • the fragment is sent to the client, and in the process of subsequently pushing the fragment, the push commitment of the pending push fragment is sent to the client in batches to ensure that the number of push commitments sent each time is not excessive, avoiding Because the client requests to push the fragmentation There are many problems that result in a large delay caused by receiving a large number of push commitments before receiving the requested fragment, thus reducing the playback delay of the client.
  • the server can only send push commitments for fragments that can send push commitments, even if a push commitment can be sent.
  • the server Before the shards are all pushed, when there are more shards on the server that can be pushed, this part of the shards will not be actively pushed to the client. The client can only send the fragment request message again after receiving all the pushed fragments to obtain more fragments.
  • the server sends a push commitment to the client according to the currently cached fragment, and the client may determine, according to the pending push indication information sent by the server, to continue to receive the pending push fragment in the subsequent process.
  • Push commitment so there is no need to send the fragment request message again for the fragment that has requested the push, which saves the overhead of the client sending the fragment request message again.
  • the first pending push parameter may also be set by the client, and the client sends the first pending push parameter to the server in the slice request message of the slice 1.
  • the server receives the fragment request message that is sent by the client and carries the first pending push parameter, and divides the fragment that the client requests to push into the pushable slice and the pending push slice according to the first pending push parameter, and the division manner can be referred to The description of the above step S402 will not be repeated here.
  • the client sends a fragment request message carrying the first pending push parameter to the server as shown in the following code 10:
  • the second pending push parameter may also be set by the client, and the client sends the second pending push parameter in the slice request message of the slice 1 and sends it to the server.
  • the server receives a fragmentation request message that is sent by the client and carries a second pending push parameter, and determines, according to the second pending push parameter, when to send the push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client, and determines
  • the client sends the second pending push parameter in the slice request message of the slice 1 and sends it to the server.
  • the server receives a fragmentation request message that is sent by the client and carries a second pending push parameter, and determines, according to the second pending push parameter, when to send the push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client, and determines
  • the client sends a fragment request message carrying the first pending push parameter to the server, as shown in the following code 9, wherein the latestPush is used as the second pending push parameter, that is, the client wants the server to push the last sent push promise. And the unsubmitted shards are sent the next batch of push promises that can push the shards.
  • the server needs to determine the pushable slice jointly by combining the first first pending push parameter and the first pending push parameter sent by the client. If the server is locally configured to send up to 4 push commitments at a time, and the first pending push parameter sent by the client indicates that the minimum number of push commitments sent each time is 5, the server prioritizes its own pushability and will be able to push points. The number of pieces is determined to be four. Similarly, if the server is configured with the second pending push parameter locally, the server needs to determine, together with the local second pending push parameter and the second pending push parameter sent by the client, when to push the sliceable slice in the pending push slice. The push promise is sent to the client.
  • the server may further carry the first pending push parameter and/or the second pending push parameter.
  • the server sends a slice 1 to the client as shown in code 11:
  • the pending push parameter and/or the second pending push parameter that is, the maximum number of push commitment frames per transmission is five, and the next batch of pushable fragments is sent when the last slice that has sent the push commitment and is not pushed is pushed. Push promise.
  • the first pending push parameter and/or the second pending push parameter are set by the client, and can be provided more than the method of setting the first pending push parameter and/or the second pending push parameter by the server. Flexible push method to better meet the user's actual experience needs.
  • the process of normally playing all the pieces in the media resource is taken as an example.
  • an application scenario in which the mediation is cancelled in the middle is also involved, for example, the user is halfway. If you don't want to continue watching, you need to cancel playing a certain shard and subsequent shards.
  • the client processes and plays the slice 3, and then cancels the playback of the slice 4 and the full-part slice after the slice 4 as an example.
  • FIG. 5 it is a cancellation provided by the embodiment of the present invention.
  • the flowchart of the method for pushing the media shards includes the steps S501-S510, wherein the steps S501-S506 can refer to the steps S401-S406 in the embodiment shown in FIG. 4, and details are not described herein again.
  • S507 The client sends a cancel push request message for the fragment 4 to the server.
  • the client may send a cancel push request message according to the stream identifier 6 of the fragment 4 recorded in the fragment list of the client that has sent the push commitment and is not pushed.
  • the server sends a cancel push request message for the slice 4 to the client as shown in the following code 12:
  • the error code CANCEL is used to indicate that the push fragment is canceled.
  • the client may further delete the identifier of the fragment 4 recorded in the fragment list of the client that has sent the push commitment and is not pushed, and the corresponding stream identifier.
  • S508 The server receives the cancel push request message sent by the client for the fragment 4, and cancels pushing the fragment 4 to the client.
  • the server determines that the client wants to cancel pushing the fragment corresponding to the stream identifier 6 http://example/rendition1/segment004 according to the stream identifier 6 carried in the cancel push request message, so the fragment 4 is pushed to the client. Specifically, the server deletes the identifier of the fragment 4 and the corresponding stream identifier from the fragment list of the server that has sent the push commitment and is not pushed.
  • S509 The client sends a cancel push request message for the fragment 5 to the server.
  • the client may send a cancel push request message according to the flow identifier 8 of the fragment 5 recorded in the fragment list of the client that has sent the push commitment and is not pushed.
  • the server sends a cancel push request message for the slice 5 to the client as shown in the following code 13:
  • the client may also delete the identifier of the fragment 5 recorded in the fragment list of the client that has been sent and not pushed, and the corresponding stream identifier.
  • the client has canceled all the shards that have sent the push promise and have not been pushed, and has cleared or deleted the client's sent push promised and unpushed shard list.
  • the client since the client does not continue to play media resources, the client also needs to clear or delete the pending push fragment list.
  • S510 The server receives the cancel push request message sent by the client for the fragment 5, and cancels pushing the fragment 5 to the client.
  • the server determines that the client wants to cancel pushing the fragment corresponding to the flow identifier 8 http://example/rendition1/segment005 according to the flow identifier 8 carried in the cancel push request message, so the fragment 5 is pushed to the client. Specifically, the server deletes the identifier of the fragment 5 and the corresponding stream identifier from the fragment list that has sent the push commitment and has not been pushed.
  • S511 The server determines that it is necessary to cancel the fragment that has not sent the push commitment to the client according to the server's sent push commitment and the unpushed fragment list is empty.
  • the server determines that the server has sent the push commitment and the un-pushed fragment list is empty, it is determined that the client does not want to continue playing the media resource, and therefore, the fragment that has not sent the push commitment is pushed to the client at the same time. Specifically, the server clears or deletes the pending push fragment list, so that the push commitment is not sent to the client yet. Fragmentation.
  • the server may indirectly determine to cancel the fragment that has not sent the push commitment to the client by canceling all the fragments that have been sent and not pushed by the client.
  • the server sends the push commitment of the fragment requested by the client to the client at one time. Therefore, when the client wants to cancel the fragment that the server has sent the push commitment, it needs to send for each fragment.
  • the push request message is canceled once, and the request message carries the flow identifier corresponding to the fragment to be cancelled.
  • the client needs to send a cancel push request message one by one for the slice that has been sent and not pushed. The cost is relatively large.
  • the server since the server sends the push commitment in batches, when the client cancels the play midway, only the cancel push request message needs to be sent one by one for the fragments that have been pushed and not pushed. There is no need to send a cancel push request message for a slice that has not yet sent a push commitment, which saves the overhead of the client sending a large number of cancel push request messages.
  • the client may also instruct the server to cancel pushing a fragment of the push commitment when canceling pushing a certain fragment by adding a cancellation pending push indication message to a cancel push request message.
  • the client sends the cancel push push indication information in the cancel push request message of the fragment 4 as an example.
  • the server sends the cancel push request message of the fragment 4 to the client as shown in the following code 14:
  • the error code CANCEL PENDING is used to indicate that the shard that has not yet sent the push promise is canceled.
  • the server cancels the fragment that has not sent the push commitment to the client, specifically: the server clears or deletes the pending push fragmentation list of the server.
  • the client may carry the cancel pending push indication information in a certain cancel push request message
  • the server determines, according to the cancel pending push indication information, that the fragment that has not yet sent the push commitment to be pushed to the client needs to be canceled.
  • the embodiment of the present invention can prevent the server from receiving the last one, as compared with the manner in which the server cancels the push of all the sent push promises that have not been pushed by the client, and indirectly determines the manner of canceling the push of the fragment that has not yet sent the push commitment to the client.
  • the server Before the cancel push request message of the slice that has been pushed and not pushed, the server has sent the push commitment corresponding to the pushable slice in the pending push slice to the client, so that the cancel operation is more timely.
  • the embodiment of the invention also describes a schematic structural diagram of a server under the same inventive concept as the method embodiment shown in FIG. 4 above.
  • the server 600 is configured to perform the functions of the server in the foregoing method embodiment of FIG. 4, and includes: a receiving unit 601, a processing unit 602, and a sending unit 603.
  • the receiving unit 601 is configured to receive a fragment request message sent by the client, where the fragment request message includes a request fragment identifier and a push instruction, where the push instruction is used to indicate that the client requests the pushed fragment;
  • the processing unit 602 is configured to determine, according to the slice that the client requests to push, the pushable slice and the pending push slice, and the sending unit 603 is configured to send, to the client, each of the pushable segments.
  • the processing unit 602 is configured to determine, according to the fragment that is sent by the client, the pushable fragment and the pending push fragment, where the client sends a request according to the first pending push parameter.
  • the shards are divided into the pushable shards and the to-be-scheduled shards; wherein the first pending push parameters are carried locally in the server or carried in the fragment request message.
  • the processing unit 602 is configured to divide, according to the first pending push parameter, the slice that the client requests to push into the pushable slice and the to-be-sent push slice, specifically:
  • the first pending push parameter is a push threshold, and determining that the first slice to the Nth slice of the slice that the client requests to push are the pushable slice, and the client requests the push.
  • the other fragments in the slice other than the pushable slice are determined as the pending push slice, where N is a positive integer determined by the push threshold; or
  • the first pending push parameter is a random indicator, and according to the random indicator, the cached slice in the slice that the client requests to push is determined as the pushable slice, and the client is The slice other than the pushable slice in the slice requested to be pushed is determined as the pending push slice.
  • the sending unit 603 sends, to the client, the push commitment corresponding to each fragment in the pushable fragment, the fragment corresponding to the requested fragment identifier, and the pending push indication information
  • the processing unit 602 is further configured to determine, according to the first pending push parameter, a pushable slice in the pending push slice;
  • the sending unit 603 is further configured to send, according to the second pending push parameter, a push commitment corresponding to the pushable slice in the to-be-sent push slice to the client, where the pending push slice is in the
  • the pushable fragment is a partial or full partial slice of the pending push slice; wherein the second pending push parameter is used to instruct the server to send the pushable in the pending push slice to the client
  • the conditions of the push commitment of the fragment, and the second pending push parameter is carried in the server or configured in the fragment request message.
  • the sending unit 603 is configured to send, according to the second pending push parameter, a push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client, specifically:
  • the sending unit 603 sends, to the client, the push commitment corresponding to each fragment in the pushable fragment, the fragment corresponding to the requested fragment identifier, and the pending push indication information
  • the receiving unit 601 is further configured to receive, by the client, a cancel push request message that is sent one by one for the fragment that has sent the push commitment and is not pushed;
  • the processing unit 602 is further configured to cancel, according to the cancel push request message, a slice that is pushed to the client and that is not pushed, and when the processing unit 602 cancels all the Push the sent After the shard that is committed and not pushed, the processing unit 602 is further configured to cancel pushing the shard that has not sent the push commitment to the client.
  • the sending unit 603 sends, to the client, the push commitment corresponding to each fragment in the pushable fragment, the fragment corresponding to the requested fragment identifier, and the pending push indication information
  • the receiving unit 601 is further configured to receive a cancel push request message sent by the client for the target fragment, where the target fragment is any fragment that has sent a push commitment and is not pushed, and the cancel push request message
  • the canceling the push indication information is used to indicate that the server cancels pushing the shard that has not sent the push commitment to the client;
  • the processing unit 602 is further configured to cancel pushing the target fragment to the client according to the cancel push request message, and cancel pushing, to the client, a fragment that has not sent a push commitment.
  • server 600 is presented in the form of a functional unit.
  • a "unit” herein may refer to an ASIC circuit, a processor and memory that executes one or more software or firmware programs, integrated logic circuits, and/or other devices that provide the functionality described above.
  • server 600 can take the form shown in FIG.
  • the receiving unit 601, the processing unit 602, and the transmitting unit 603 can be implemented by the processor and memory of FIG.
  • the embodiment of the present invention further describes a structure of a client according to the same inventive concept as the method embodiment shown in FIG. 4 above.
  • the client 700 is configured to perform the functions of the client in the foregoing method embodiment of FIG. 4, including: a sending unit 701 and a receiving unit 702.
  • the sending unit 701 is configured to send a fragmentation request message to the server, where the fragmentation request message includes a request fragment identifier and a push instruction, where the push instruction is used to indicate that the client requests the pushed fragment; the receiving unit 702.
  • the device is configured to receive a push commitment corresponding to each of the shards sent by the server, a shard corresponding to the request shard identifier, and a pending push indication information, where the pending push indication information is used to indicate
  • the client waits to receive a push commitment of the pending push slice other than the pushable slice in the slice requested by the client.
  • the fragment request message further includes a first pending push parameter, where the first pending push parameter is used to instruct the server to send the fragment requested by the client according to the first pending push parameter. Divided into the pushable slice and the pending push slice.
  • the first pending push parameter includes a push threshold for indicating a number of pushable slices or a random indicator for indicating that the server determines the cached slice as a pushable slice.
  • the receiving unit 702 receives the push commitment corresponding to each of the pushable fragments sent by the server, the fragment corresponding to the requested fragment identifier, and the pending push indication information
  • the receiving unit 702 is further configured to receive a push commitment corresponding to the pushable slice in the to-be-sent push slice sent by the server, where the pushable slice in the pending push slice is the to-be-sent push score Part or all of the pieces in the film.
  • the fragment request message further includes a second pending push parameter, where the second pending push parameter is used to indicate that the server determines to send the pending push slice according to the second pending push parameter.
  • the conditions of the push commitment corresponding to the slice can be pushed.
  • the receiving unit 702 receives the push commitment corresponding to each of the pushable fragments sent by the server, the fragment corresponding to the requested fragment identifier, and the pending push indication information
  • the sending unit 701 is further configured to send, to the server, a cancel push request message, where the target fragment is any fragment that has sent a push commitment and is not pushed, and the cancel push request message includes Cancel pending push Instructing information, the cancel pending push indication information is used to instruct the server to cancel pushing a slice that has not sent a push commitment to the client.
  • client 700 is presented in the form of a functional unit.
  • a "unit” herein may refer to an ASIC circuit, a processor and memory that executes one or more software or firmware programs, integrated logic circuits, and/or other devices that provide the functionality described above.
  • client 700 can take the form shown in FIG.
  • the transmitting unit 701 and the receiving unit 702 can be implemented by the processor and the memory of FIG.
  • the embodiment of the present invention further provides a computer storage medium for storing computer software instructions used by the server shown in FIG. 6 above, which includes a program designed to execute the foregoing method embodiments.
  • the delivery of the push promise can be achieved by executing the stored program.
  • the embodiment of the present invention further provides another computer storage medium for storing computer software instructions used by the client described in FIG. 7 above, which includes a program designed to execute the foregoing method embodiments.
  • the reception of the push promise can be achieved by executing the stored program.
  • embodiments of the present invention can be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program is stored/distributed in a suitable medium, provided with other hardware or as part of hardware, or in other distributed forms, such as through the Internet or other wired or wireless telecommunication systems.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed in the present invention are a media fragment push method, a server and a client, wherein the method comprises: receiving, by a server, a fragment request message sent by a client, the fragment request message comprising a requested fragment identifier and a push instruction, the push instruction being used to indicate a fragment requested to be pushed by the client; determining, by the server, pushable fragments and to-be-decided push fragments according to the fragment requested to be pushed by the client; and sending, by the server, a push commitment corresponding to each fragment in the pushable fragments, a fragment corresponding to the requested fragment identifier and to-be-decided push indication information to the client, wherein the to-be-decided push indication information is used to instruct the client to wait to receive push commitments for the to-be-decided push fragments. Adopting the method of the present invention can reduce the playback delay of a client.

Description

一种媒体分片的推送方法、服务器及客户端Pushing method, server and client for media segmentation
本申请要求于2016年10月18日提交中国专利局、申请号为201610908973.4、发明名称为“一种媒体分片的推送方法、服务器及客户端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on October 18, 2016, the Chinese Patent Office, the application number is 201610908973.4, and the invention name is “a push method, server and client for media segmentation”. The citations are incorporated herein by reference.
技术领域Technical field
本发明涉及通信技术领域,尤其涉及一种媒体分片的推送方法、服务器及客户端。The present invention relates to the field of communications technologies, and in particular, to a method, a server, and a client for pushing a media slice.
背景技术Background technique
客户端获取媒体资源并进行播放的方式有多种,典型的有:超文本传输协议(英文:Hypertext Transfer Protocol,简称:HTTP)文件下载或者点对点(英文:Peer to Peer,简称:P2P)文件下载到本地磁盘后播放、HTTP渐进式下载(英文:HTTP Progressive Download)以及HTTP的动态自适应流(英文:Dynamic Adaptive Streaming over HTTP,简称:DASH)方案等等。其中,DASH对采用HTTP传输运动图像专家组(英文:Moving Picture Experts Group,简称:MPEG)媒体涉及到的各方面提出了一系列的技术要求。There are many ways for the client to obtain media resources and play them. Typical examples are: Hypertext Transfer Protocol (English: Hypertext Transfer Protocol, HTTP) file download or peer-to-peer (Peer to Peer, P2P) file download. Play to local disk, HTTP progressive download (English: HTTP Progressive Download) and HTTP Dynamic Adaptive Streaming over HTTP (DASH) scheme. Among them, DASH put forward a series of technical requirements for all aspects involved in the use of HTTP transmission Moving Picture Experts Group (English: Moving Picture Experts Group, MPEG for short).
DASH标准规范了媒体描述文件(英文:Media Presentation description,简称:MPD)和分片(Segment)的格式。任意媒体资源都由一个个分片构成,其中,分片是DASH客户端向DASH服务器请求媒体资源的基本单位。MPD主要描述了媒体资源的信息,包括不同码率的分片的下载地址。客户端获取MPD后,可以根据网络状况如下载速度、缓存多少等,选择合适码率的分片;服务器根据客户端的选择,通过HTTP协议将分片发送到客户端,以保证用户的观看体验。The DASH standard specifies the format of the media description file (English: Media Presentation description, MPD) and segmentation. Any media resource is composed of shards. The shard is the basic unit for the DASH client to request media resources from the DASH server. The MPD mainly describes the information of the media resources, including the download addresses of the fragments of different code rates. After obtaining the MPD, the client can select the appropriate code rate according to the network status, such as the download speed and the number of caches. The server sends the fragment to the client through the HTTP protocol according to the client's selection to ensure the user's viewing experience.
为了减小客户端播放时延,DASH标准(ISO-IEC_23009-6)中正在制定的part6:DASH with Server Push and WebSockets提出了推送机制。具体如图1所示:步骤1、客户端向服务器发送MPD请求消息,该请求消息中携带推送指令(Push Directive),推送指令中包含客户端希望服务器推送的分片的标识,如初始化分片的标识。步骤2、服务器响应客户端的请求,发送推送承诺(Push Promise)和MPD给客户端。推送承诺指示服务器将会在哪个流标识(StreamID)指示的流中推送初始化分片。步骤3、服务器在发送完MPD和推送承诺后,根据流标识,在推送承诺指定的流中主动推送初始化分片至客户端。步骤4、客户端向服务器发送分片请求消息,消息中包括请求分片的标识和推送指令,推送指令中包含客户端希望服务器推送的分片标识;客户端希望服务器推送的分片标识可以是通过列表或模板的形式描述的分片的下载地址,也可以是指定了所请求的分片之后连续的几个分片。例如客户端请求分片1,在推送指令中包括分片2的标识、分片的标识3、分片4和分片5的标识。步骤5、服务器响应客户端的请求,依次发送分片2的推送承诺、分片3的推送承诺、分片4的推送承诺、分片5的推送承诺、分片1至客户端,推送承诺包含了每个即将推送的分片的流标识和分片标识,用于指示在哪个流中推送哪个分片。步骤6、根据第5步推送承诺中的流标识,服务器在指定流中向客户端推送分片。步骤7、客户端根据推送承诺中的分片标识和流标识,接收服务器推送来的分片,进行解码播放。重复步骤4至7直到播放完毕或用户停止观看等。 通过服务器的主动推送,可以加快媒体播放启动速度,减少延迟,也减少了消息的交互。In order to reduce the client playback delay, part6:DASH with Server Push and WebSockets, which is being developed in the DASH standard (ISO-IEC_23009-6), proposes a push mechanism. Specifically, as shown in FIG. 1 , the client sends an MPD request message to the server, where the request message carries a Push Directive, where the push command includes an identifier of a fragment that the client wants to push the server, such as initializing the fragment. Logo. Step 2: The server sends a Push Promise and an MPD to the client in response to the client's request. The push commitment indicates to the stream indicated by the StreamID that the server will push the initial fragment. Step 3: After sending the MPD and the push commitment, the server actively pushes the initialization fragment to the client in the flow specified by the push commitment according to the flow identifier. Step 4: The client sends a fragmentation request message to the server, where the message includes an identifier of the request fragment and a push instruction, where the push instruction includes a fragment identifier that the client wants to push the server; the fragment identifier that the client wants the server to push may be The download address of the slice described by the form of a list or a template may also be a number of consecutive slices after the requested slice is specified. For example, the client requests the fragment 1 and includes the identifier of the fragment 2, the identifier 3 of the fragment, the fragment 4, and the identifier of the fragment 5 in the push instruction. Step 5: The server responds to the request of the client, and sequentially sends the push commitment of the slice 2, the push commitment of the slice 3, the push commitment of the slice 4, the push commitment of the slice 5, the slice 1 to the client, and the push commitment includes A stream identifier and a tile identifier for each tile to be pushed to indicate which tile to push in which stream. Step 6. According to the step 5, the flow identifier in the commitment is pushed, and the server pushes the fragment to the client in the specified stream. Step 7: The client receives the fragment pushed by the server according to the fragment identifier and the stream identifier in the push commitment, and performs decoding and playing. Repeat steps 4 through 7 until playback is complete or the user stops watching. Through the server's active push, you can speed up media playback, reduce latency, and reduce message interaction.
图1所示方法存在的缺陷在于:如果客户端请求服务器推送的分片数量较多,服务器需要先发送后续要推送的所有分片对应的推送承诺帧,然后才会发送分片1的数据。例如,客户端的推送指令中请求推送后续的50个分片,那么服务器将会先发送50个推送承诺帧通知客户端后续50个分片将分别采用哪些流标识进行推送,然后才会发送分片1的数据,增加了客户端的播放延迟。The method shown in FIG. 1 has the disadvantage that if the number of fragments that the client requests the server to push is large, the server needs to send the push commitment frame corresponding to all the fragments to be pushed later, and then the data of the fragment 1 is sent. For example, if the client pushes the request to push the subsequent 50 fragments, the server will first send 50 push commitment frames to notify the client that the next 50 fragments will be pushed by which stream identifiers respectively, and then the fragments will be sent. 1 data, increased playback delay of the client.
发明内容Summary of the invention
本发明实施例提供了一种媒体分片的推送方法及相关设备,可以减少客户端的播放延迟。The embodiment of the invention provides a method for pushing media fragments and related devices, which can reduce the playback delay of the client.
第一方面,本发明的实施例提供一种媒体分片的推送方法,包括:In a first aspect, an embodiment of the present invention provides a method for pushing a media slice, including:
服务器接收客户端发送的分片请求消息,分片请求消息包括请求分片标识和推送指令,推送指令用于指示客户端请求推送的分片。服务器根据客户端请求推送的分片,确定可推送分片和待定推送分片。服务器向客户端发送可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息,待定推送指示信息用于指示客户端等待接收待定推送分片的推送承诺。本发明实施例中,服务器将客户端请求推送的分片进行分组,从而先发送一部分分片对应的推送承诺,在后续过程中再发送其他分片对应的推送承诺,避免因客户端请求推送的分片的数量较大,导致客户端在接收请求的分片之前因接收过多的推送承诺导致播放延迟较大的问题,从而可以减少客户端的播放延迟。The server receives the fragment request message sent by the client, and the fragment request message includes a request fragment identifier and a push instruction, where the push instruction is used to instruct the client to request the pushed fragment. The server determines the pushable slice and the pending push slice according to the slice pushed by the client request. The server sends, to the client, a push commitment corresponding to each fragment in the pushable fragment, a fragment corresponding to the request fragment identifier, and a pending push indication information, where the pending push indication information is used to indicate that the client waits to receive the push of the pending push slice. committed to. In the embodiment of the present invention, the server groups the fragments that the client requests to push, so as to send the push commitment corresponding to a part of the fragment first, and then sends the push commitment corresponding to the other fragments in the subsequent process, so as to avoid pushing the request by the client. The large number of shards causes the client to delay playback due to receiving too many push commitments before receiving the requested shards, thereby reducing the playback delay of the client.
在一种可能的设计中,服务器根据客户端请求推送的分片,确定可推送分片和待定推送分片,包括:服务器根据第一待定推送参数将客户端请求推送的分片分为可推送分片和待定推送分片。其中,第一待定推送参数为服务器本地配置的或者分片请求消息中携带的。本发明实施例中,服务器根据第一待定推送参数来确定可推送分片和待定推送分片。第一待定推送参数可以由服务器本地配置,便于服务器结合自身推送分片的能力,来确定可推送分片。第一待定推送参数也可以由客户端来设置,服务器按照客户端的要求确定可推送分片,与由服务器设置第一待定推送参数的方式相比,可以满足不同用户的个性化推送需求。In a possible design, the server determines the pushable slice and the pending push slice according to the slice that the client requests to push, including: the server divides the slice that the client requests to push according to the first pending push parameter into a pushable Fragmentation and pending push shards. The first pending push parameter is carried in the server local configuration or in the fragment request message. In the embodiment of the present invention, the server determines the pushable slice and the pending push slice according to the first pending push parameter. The first pending push parameter can be locally configured by the server, so that the server can determine the pushable fragment by combining the ability of the server to push the slice. The first pending push parameter may also be set by the client, and the server determines the pushable fragment according to the requirements of the client, and can meet the personalized push requirement of different users compared with the manner that the server sets the first pending push parameter.
在一种可能的设计中,服务器根据第一待定推送参数将客户端请求推送的分片分为可推送分片和待定推送分片,具体为:第一待定推送参数为推送阈值,服务器确定客户端请求推送的分片中第1个分片至第N个分片为可推送分片,并将客户端请求推送的分片中除可推送分片以外的其他分片确定为待定推送分片,其中N为由推送阈值确定的正整数;或者,第一待定推送参数为随机指示符,服务器根据随机指示符,将客户端请求推送的分片中已缓存的分片确定为可推送分片,并将客户端请求推送的分片中除可推送分片以外的其他分片确定为待定推送分片。本发明实施例中,服务器通过推送阈值或者服务器当前缓存的分片来确定可推送分片,可以使得服务器每次发送推送承诺的数量不至于过多,从而避免客户端的播放时延较大。In a possible design, the server divides the fragment that the client requests to push according to the first pending push parameter into a pushable slice and a pending push slice, specifically: the first pending push parameter is a push threshold, and the server determines the client. The first fragment to the Nth fragment in the fragment requested by the terminal are pushable fragments, and the other fragments except the pushable fragments in the fragment requested by the client request are determined as pending push fragments. Where N is a positive integer determined by the push threshold; or the first pending push parameter is a random indicator, and the server determines, as a random indicator, the cached slice in the slice requested by the client to be pushable slice And determine the slice other than the pushable slice in the slice pushed by the client request as the pending push slice. In the embodiment of the present invention, the server determines the pushable fragment by pushing the threshold or the currently cached fragment of the server, so that the number of push commitments sent by the server is not excessive, so that the playback delay of the client is avoided.
在一种可能的设计中,服务器向客户端发送可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息之后,还包括:服务器根据第一待定推送参数,确定待定推送分片中的可推送分片。服务器根据第二待定推送参数,将待定推送分片中的可推送分片对应的推送承诺发送给客户端,待定推送分片中的可推送分片为待定推送分片 中的部分或全部分片。其中,第二待定推送参数用于指示服务器向客户端发送待定推送分片中的可推送分片的推送承诺的条件,且第二待定推送参数为服务器本地配置的或者分片请求消息中携带的。In a possible design, after the server sends the push commitment corresponding to each fragment in the pushable fragment to the client, the fragment corresponding to the request fragment identifier, and the pending push indication information, the server further includes: the server is determined according to the first to be determined. Push parameters to determine pushable slices in the pending push slice. The server sends the push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client according to the second pending push parameter, and the pushable slice in the pending push slice is the pending push slice. Part or all of the pieces. The second pending push parameter is used to instruct the server to send the condition of the push commitment of the pushable slice in the pending push slice to the client, and the second pending push parameter is carried in the server locally or in the slice request message. .
本发明实施例中,服务器根据第二待定推送参数来确定可推送分片对应的推送承诺的发送时机,从而及时地将待定推送分片中的可推送分片对应的推送承诺发送给客户端,提高推送承诺的发送效率。第二待定推送参数可以由服务器本地配置,便于服务器结合自身推送分片的能力,来确定何时发送可推送分片对应的推送承诺。第二待定推送参数也可以由客户端来设置,服务器按照客户端的要求确定何时发送可推送分片对应的推送承诺,与由服务器设置第二待定推送参数的方式相比,可以满足不同用户的个性化推送需求。In the embodiment of the present invention, the server determines, according to the second pending push parameter, a sending opportunity of the push commitment corresponding to the pushable slice, so as to timely send the push commitment corresponding to the pushable slice in the to-be-seged slice to the client, Improve the delivery efficiency of push commitments. The second pending push parameter may be locally configured by the server, so that the server can determine the push commitment corresponding to the pushable slice when combined with the ability of the server to push the slice. The second pending push parameter may also be set by the client, and the server determines, according to the requirements of the client, when to send the push commitment corresponding to the pushable slice, and can satisfy the different users according to the manner that the server sets the second pending push parameter. Personalized push requirements.
在一种可能的设计中,服务器根据第二待定推送参数,将待定推送分片中的可推送分片对应的推送承诺发送给客户端,具体为:当已发送推送承诺且未推送的分片的剩余数量小于第一预设数量时,服务器将待定推送分片中的可推送分片对应的推送承诺发送给客户端;或者,当待定推送分片中包含满足第二预设数量的已缓存分片时,服务器将待定推送分片中的可推送分片对应的推送承诺发送给客户端。本发明实施例中,服务器根据已发送推送承诺且未推送的分片剩余数量或者服务器已缓存分片的数量,确定何时将待定推送分片中的可推送分片对应的推送承诺发送给客户端,从而可以及时地将待定推送分片对应的推送承诺发送给客户端,提高推送承诺的发送效率。In a possible design, the server sends a push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client according to the second pending push parameter, specifically: when the pushed promise is sent and the push is not pushed. When the remaining quantity is less than the first preset quantity, the server sends the push commitment corresponding to the pushable slice in the pending push slice to the client; or, when the pending push slice includes the cached one that meets the second preset quantity When sharding, the server sends a push commitment corresponding to the pushable slice in the pending push shard to the client. In the embodiment of the present invention, the server determines, according to the remaining number of fragments that have been pushed and not pushed, or the number of cached fragments of the server, when to send the push commitment corresponding to the pushable fragments in the pending push slice to the client. Therefore, the push commitment corresponding to the to-be-seged slice can be sent to the client in time to improve the transmission efficiency of the push commitment.
在一种可能的设计中,服务器向客户端发送可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息之后,还包括:服务器接收客户端针对已发送推送承诺且未推送的分片逐一发送的取消推送请求消息。服务器根据取消推送请求消息,取消向客户端推送已发送推送承诺且未推送的分片。当服务器取消向客户端推送已发送推送承诺且未推送的所有分片之后,服务器取消向客户端推送尚未发送推送承诺的分片。本发明实施例中,客户端如果中止播放媒体资源时,只需要针对所有已发送推送承诺且未推送的分片逐一发送取消推送请求消息,而无需针对尚未发送推送承诺的分片发送取消推送请求消息,减少了客户端发送取消推送请求消息的次数,从而降低了客户端的开销。In a possible design, after the server sends the push commitment corresponding to each fragment in the pushable fragment to the client, the fragment corresponding to the request fragment identifier, and the pending push indication information, the server further includes: the server receiving the client A cancel push request message sent one by one by a slice that has been pushed and not pushed. The server cancels the push of the pushed push promised and unpushed fragments to the client according to the cancel push request message. After the server cancels all shards that have been pushed to the client and have not been pushed, the server cancels pushing the shards that have not yet sent the push promise to the client. In the embodiment of the present invention, if the client stops playing the media resource, it only needs to send the cancel push request message one by one for all the fragments that have been sent and not pushed, without sending the cancel push request for the fragment that has not sent the push commitment. The message reduces the number of times the client sends a cancel push request message, thereby reducing the client's overhead.
在一种可能的设计中,服务器向客户端发送可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息之后,还包括:服务器接收客户端针对目标分片发送的取消推送请求消息,目标分片为任一已发送推送承诺且未推送的分片,取消推送请求消息中包括取消待定推送指示信息,取消待定推送指示信息用于指示服务器取消向客户端推送尚未发送推送承诺的分片。服务器根据取消推送请求消息,取消向客户端推送目标分片,以及取消向客户端推送尚未发送推送承诺的分片。In a possible design, after the server sends the push commitment corresponding to each fragment in the pushable fragment to the client, the fragment corresponding to the request fragment identifier, and the pending push indication information, the server further includes: the server receiving the client The cancel push request message sent by the target fragment, the target fragment is any fragment that has sent the push commitment and is not pushed, and the cancel push request message includes canceling the pending push indication information, and the cancel pending push indication information is used to instruct the server to cancel the direction. The client pushes the shard that has not sent the push promise. The server cancels the push of the target shard to the client according to the cancel push request message, and cancels pushing the shard that has not yet sent the push promise to the client.
本发明实施例中,客户端可以在发送的某一取消推送请求消息中携带取消待定推送指示信息,指示服务器取消向客户端推送尚未发送推送承诺的分片,服务器根据取消待定推送指示信息,确定出需要取消向客户端推送尚未发送推送承诺的分片。相较于服务器根据客户端取消推送已发送推送承诺且未推送的所有分片,来间接确定取消向客户端推送尚未发送推送承诺的分片的方式,本发明实施例可以避免服务器在接收最后一个已发送推送承诺且未推送的分片的取消推送请求消息之前,服务器就已将待定推送分片对应的推送承诺发送给客户端造成的开销,从而使得取消操作更加及时。In the embodiment of the present invention, the client may carry the cancellation pending push indication information in the sent cancellation push request message, instructing the server to cancel pushing the fragment that has not sent the push commitment to the client, and the server determines according to the cancel pending push indication information. It is necessary to cancel the shard that pushes the push promise that has not been sent to the client. The embodiment of the present invention can prevent the server from receiving the last one, as compared with the manner in which the server cancels pushing all the fragments that have been sent and not pushed according to the client, and indirectly determines to cancel the pushing of the fragment that has not yet sent the push commitment to the client. Before the cancel push request message of the shard that has been pushed and not pushed, the server has already sent the push commitment corresponding to the push shard to the client, so that the cancel operation is more timely.
在一种可能的设计中,服务器根据客户端请求推送的分片,确定可推送分片和待定推送 分片之后,还包括:服务器生成第一分片列表,该第一分片列表中记录有已发送推送承诺且未推送的分片的标识和对应的流标识。通过维护第一分片列表,服务器可以明确哪些已发送推送承诺的分片还未推送。In one possible design, the server determines the pushable and pending pushes based on the fragments pushed by the client request. After the fragmentation, the method further includes: the server generates a first fragment list, where the identifier of the fragment that has sent the push commitment and is not pushed and the corresponding stream identifier are recorded in the first fragment list. By maintaining the first shard list, the server can clarify which shards that have sent push commitments have not been pushed.
在一种可能的设计中,服务器根据客户端请求推送的分片,确定可推送分片和待定推送分片之后,还包括:服务器生成第二分片列表,该第二分片列表中记录有尚未发送推送承诺的分片的标识。服务器将待定推送分片中的可推送分片对应的推送承诺发送给客户端之后,服务器将待定推送分片中的可推送分片对应的标识从第二分片列表中删除。通过维护第二分片列表,服务器可以明确哪些分片还未发送推送承诺。In a possible design, after the server determines the pushable slice and the pending push slice according to the slice that the client requests to push, the server further includes: the server generates a second slice list, where the second slice list records The identity of the shard that has not yet sent the push promise. After the server sends the push commitment corresponding to the pushable slice in the to-be-seged slice to the client, the server deletes the identifier corresponding to the pushable slice in the pending push slice from the second slice list. By maintaining the second shard list, the server can clarify which shards have not yet sent push commitments.
在一种可能的设计中,取消推送请求消息中携带流标识,服务器根据取消推送请求消息,取消向客户端推送已发送推送承诺且未推送的分片,具体为:服务器根据推送请求消息中携带的流标识,删除第一分片列表中与所述流标识对应的记录。服务器取消向客户端推送尚未发送推送承诺的分片,具体为:服务器将第二分片列表清空或删除。In a possible design, the canceling the push request message carries the flow identifier, and the server cancels the fragment that has sent the pushed push commitment and is not pushed to the client according to the cancel push request message, specifically: the server carries the message according to the push request message. The flow identifier deletes the record corresponding to the flow identifier in the first fragment list. The server cancels the shard that has not sent the push commitment to the client, specifically: the server empties or deletes the second shard list.
第二方面,本发明实施例提供了一种媒体分片的推送方法,包括:In a second aspect, an embodiment of the present invention provides a method for pushing a media slice, including:
客户端向服务器发送分片请求消息,分片请求消息包括请求分片标识和推送指令,推送指令用于指示客户端请求推送的分片。客户端接收服务器发送的可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息,待定推送指示信息用于指示客户端等待接收客户端请求推送的分片中除可推送分片以外的待定推送分片的推送承诺。本发明实施例中,客户端向服务器请求推送分片之后,客户端只收到可推送分片对应的推送承诺,根据服务器返回的待定推送指示信息确定后续服务器还会发送剩余分片的推送承诺,相对于现有技术而言,一方面可以避免客户端在接收请求的分片之前因接收过多的推送承诺导致播放时延较大的问题;另一方面客户端只需要等待服务器继续发送剩余分片的推送承诺即可,不需要再次向服务器发送重新发送的分片请求消息,节约了消息开销。The client sends a fragmentation request message to the server. The fragmentation request message includes a request fragment identifier and a push instruction, and the push instruction is used to instruct the client to request the pushed fragment. The client receives the push commitment corresponding to each fragment in the pushable fragment sent by the server, the fragment corresponding to the request fragment identifier, and the pending push indication information, where the pending push indication information is used to instruct the client to wait for the receiving client to request the push. The push commitment of the pending push slice other than the pushable slice in the slice. In the embodiment of the present invention, after the client requests the server to push the fragment, the client only receives the push commitment corresponding to the pushable fragment, and determines, according to the pending push indication information returned by the server, the push commitment of the subsequent server to send the remaining fragment. Compared with the prior art, on the one hand, it can avoid the problem that the client has a large playback delay due to receiving too many push commitments before receiving the requested fragment; on the other hand, the client only needs to wait for the server to continue to send the remaining The push commitment of the fragment can be used, and the resend fragment request message does not need to be sent to the server again, which saves the message overhead.
在一种可能的设计中,分片请求消息中还包括第一待定推送参数,第一待定推送参数用于指示服务器根据第一待定推送参数将客户端请求推送的分片分为可推送分片和待定推送分片。本发明实施例中,客户端来设置第一待定推送参数,服务器根据客户端发送的第一待定推送参数来确定可推送分片和待定推送分片,从而满足了不同用户的个性化推送需求。In a possible design, the fragment request message further includes a first pending push parameter, where the first pending push parameter is used to instruct the server to divide the slice that the client requests to push according to the first pending push parameter into a pushable slice. And pending push shards. In the embodiment of the present invention, the client sets the first pending push parameter, and the server determines the pushable slice and the pending push slice according to the first pending push parameter sent by the client, thereby satisfying the personalized push requirement of different users.
在一种可能的设计中,第一待定推送参数包括用于指示可推送分片数量的推送阈值或者用于指示服务器将已缓存的分片确定为可推送分片的随机指示符。本发明实施例中,客户端设置推送阈值或随机指示符,使得服务器根据推送阈值或者服务器当前缓存的分片来确定可推送分片,以保证服务器每次发送推送承诺的数量不至于过多,从而避免客户端的播放时延较大。In one possible design, the first pending push parameter includes a push threshold for indicating the number of pushable slices or a random indicator for instructing the server to determine the cached slice as a pushable slice. In the embodiment of the present invention, the client sets a push threshold or a random indicator, so that the server determines the pushable fragment according to the push threshold or the currently cached fragment of the server, so as to ensure that the number of push commitments sent by the server is not excessive. Therefore, the playback delay of the client is prevented from being large.
在一种可能的设计中,客户端接收服务器发送的可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息之后,还包括:客户端接收服务器发送的待定推送分片中的可推送分片对应的推送承诺,待定推送分片中的可推送分片为待定推送分片中的部分或全部分片。本发明实施例中,客户端还可以接收待定推送分片中的可推送分片对应的推送承诺,从而实现分批次地发送推送承诺,相较于现有技术,本发明实施例中,客户端不会一次性将客户端请求的所有分片对应的推送承诺接收完,避免因客户端请求推送的分片的数量较大,导致客户端在接收请求的分片之前因接收过多的推送承诺导致播放延迟较大的问题,可以减少客户端的播放延迟。 In a possible design, after receiving the push commitment corresponding to each fragment in the pushable fragment sent by the server, the fragment corresponding to the request fragment identifier, and the pending push indication information, the client further includes: the client receiving server The push commitment corresponding to the pushable slice in the sent push slice to be sent, the pushable slice in the pending push slice is a part or all partial slices in the pending push slice. In the embodiment of the present invention, the client can also receive the push commitment corresponding to the pushable fragment in the to-be-seged slice, so as to implement the push commitment in batches, compared to the prior art, in the embodiment of the present invention, the client The terminal does not receive the push commitment corresponding to all the fragments requested by the client at one time, and avoids the large number of fragments pushed by the client request, so that the client receives too many pushes before receiving the requested fragment. Commitment leads to a problem with a large playback delay, which can reduce the playback delay of the client.
在一种可能的设计中,分片请求消息中还包括第二待定推送参数,第二待定推送参数用于指示服务器根据第二待定推送参数确定发送待定推送分片中的可推送分片对应的推送承诺的条件。本发明实施例中,客户端向服务器发送第二待定推送参数,以使服务器根据第二待定推送参数来确定可推送分片对应的推送承诺的发送时机。In a possible design, the fragment request message further includes a second pending push parameter, where the second pending push parameter is used to instruct the server to determine, according to the second pending push parameter, the corresponding pushable slice in the pending push slice. Push the terms of the promise. In the embodiment of the present invention, the client sends a second pending push parameter to the server, so that the server determines, according to the second pending push parameter, a sending opportunity of the push commitment corresponding to the pushable slice.
在一种可能的设计中,第二待定推送参数包括:当已发送推送承诺且未推送的分片的剩余数量小于第一预设数量时,服务器将待定推送分片中的可推送分片对应的推送承诺发送给客户端;或者,当待定推送分片中包含满足第二预设数量的已缓存分片时,服务器将待定推送分片中的可推送分片对应的推送承诺发送给客户端。本发明实施例中,当已发送推送承诺且未推送的分片剩余数量或者服务器已缓存分片的数量满足预设条件时,客户端可以及时地接收待定推送分片对应的推送承诺。In a possible design, the second pending push parameter includes: when the remaining number of fragments that have been sent and not pushed is smaller than the first preset quantity, the server will correspond to the pushable fragments in the pending push slice. The push commitment is sent to the client; or, when the pending push shard includes the cached shard that meets the second preset number, the server sends the push commitment corresponding to the pushable shard in the pending push shard to the client. . In the embodiment of the present invention, when the remaining number of fragments that have been pushed and not pushed or the number of cached fragments of the server meet the preset condition, the client may receive the push commitment corresponding to the pending push fragment in time.
在一种可能的设计中,客户端接收服务器发送的可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息之后,还包括:客户端针对已发送推送承诺且未推送的分片,向服务器逐一发送取消推送请求消息,取消推送请求消息用于指示服务器取消向客户端推送已发送推送承诺且未推送的分片。本发明实施例中,客户端如果中止播放媒体资源时,只需要针对已发送推送承诺且未推送的所有分片逐一发送取消推送请求消息,而无需针对尚未发送推送承诺的分片发送取消推送请求消息,减少了客户端发送取消推送请求消息的次数,从而降低了客户端的开销。In a possible design, after the client receives the push commitment corresponding to each of the shards sent by the server, the shard corresponding to the request shard identifier, and the pending push indication information, the client includes: A shard that pushes the promise and is not pushed, sends a cancel push request message to the server one by one, and the cancel push request message is used to instruct the server to cancel the shard that has pushed the pushed push promise to the client and has not been pushed. In the embodiment of the present invention, if the client stops playing the media resource, it only needs to send the cancel push request message one by one for all the fragments that have sent the push promise and not pushed, without sending the cancel push request for the fragment that has not sent the push promise. The message reduces the number of times the client sends a cancel push request message, thereby reducing the client's overhead.
在一种可能的设计中,客户端接收服务器发送的可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息之后,还包括:客户端针对目标分片向服务器发送取消推送请求消息,目标分片为任一已发送推送承诺且未推送的分片,取消推送请求消息中包括取消待定推送指示信息,取消待定推送指示信息用于指示服务器取消向客户端推送尚未发送推送承诺的分片。In a possible design, after receiving the push commitment corresponding to each fragment in the pushable fragment sent by the server, the fragment corresponding to the request fragment identifier, and the pending push indication information, the client further includes: the client targets the target. The fragment sends a cancel push request message to the server. The target fragment is any fragment that has sent the push commitment and is not pushed. The cancel push request message includes canceling the pending push indication information, and the cancel pending push indication information is used to instruct the server to cancel the direction. The client pushes the shard that has not sent the push promise.
本发明实施例中,客户端可以在发送的某一取消推送请求消息中携带取消待定推送指示信息,指示服务器取消向客户端推送尚未发送推送承诺的分片,服务器根据取消待定推送指示信息,确定出需要取消向客户端推送尚未发送推送承诺的分片。相较于服务器根据客户端取消推送已发送推送承诺且未推送的所有分片,来间接确定取消向客户端推送尚未发送推送承诺的分片的方式,本发明实施例可以避免服务器在接收最后一个已发送推送承诺且未推送的分片的取消推送请求消息之前,服务器就已将待定推送分片对应的推送承诺发送给客户端造成的开销,从而使得取消操作更加及时。In the embodiment of the present invention, the client may carry the cancellation pending push indication information in the sent cancellation push request message, instructing the server to cancel pushing the fragment that has not sent the push commitment to the client, and the server determines according to the cancel pending push indication information. It is necessary to cancel the shard that pushes the push promise that has not been sent to the client. The embodiment of the present invention can prevent the server from receiving the last one, as compared with the manner in which the server cancels pushing all the fragments that have been sent and not pushed according to the client, and indirectly determines to cancel the pushing of the fragment that has not yet sent the push commitment to the client. Before the cancel push request message of the shard that has been pushed and not pushed, the server has already sent the push commitment corresponding to the push shard to the client, so that the cancel operation is more timely.
在一种可能的设计中,客户端接收服务器发送的可推送分片中每一个分片对应的推送承诺、请求分片标识对应的分片以及待定推送指示信息之后,还包括:客户端根据服务器发送的推送承诺确定可推送分片,并根据可推送分片以及客户端请求推送的分片确定待定推送分片。In a possible design, after receiving the push commitment corresponding to each fragment in the pushable fragment sent by the server, the fragment corresponding to the request fragment identifier, and the pending push indication information, the client further includes: the client according to the server The sent push promise determines that the shard can be pushed, and the pending push shard is determined based on the pushable shard and the shard that the client requests to push.
在一种可能的设计中,在客户端根据服务器发送的推送承诺确定可推送分片,并根据可推送分片以及客户端请求推送的分片确定待定推送分片之后,还包括:客户端生成第一分片列表,该第一分片列表中记录有已发送推送承诺且未推送的分片的标识和对应的流标识。通过维护第一分片列表,客户端可以明确哪些已发送推送承诺的分片还未推送。In a possible design, after the client determines the pushable fragment according to the push commitment sent by the server, and determines the pending push fragment according to the pushable fragment and the slice requested by the client, the client also generates: a first fragment list in which the identifier of the fragment that has sent the push commitment and is not pushed and the corresponding stream identifier are recorded. By maintaining the first shard list, the client can clarify which shards that have sent push commitments have not been pushed.
在一种可能的设计中,客户端根据服务器发送的推送承诺确定可推送分片,并根据可推送分片以及客户端请求推送的分片确定待定推送分片之后,还包括:客户端生成第二分片列 表,该第二分片列表中记录有尚未发送推送承诺的分片的标识。当客户端接收服务器发送的待定推送分片中的可推送分片对应的推送承诺之后,还包括:客户端将待定推送分片中的可推送分片对应的标识从第二分片列表中删除。通过维护第二分片列表,客户端可以明确哪些分片还未发送推送承诺。In a possible design, the client determines the pushable fragment according to the push commitment sent by the server, and determines the pending push fragment according to the pushable fragment and the fragment requested by the client request, and further includes: the client generates the first Two-part column In the table, the identifier of the fragment that has not sent the push commitment is recorded in the second fragment list. After the client receives the push commitment corresponding to the pushable fragment in the pending push fragment sent by the server, the method further includes: the client deleting the identifier corresponding to the pushable fragment in the pending push fragment from the second fragment list . By maintaining the second shard list, the client can clarify which shards have not yet sent push commitments.
在一种可能的设计中,客户端针对已发送推送承诺且未推送的分片,向服务器逐一发送取消推送请求消息之后,还包括:客户端将第一分片列表以及第二分片列表清空或删除。In a possible design, after the client sends the cancel push request message to the server one by one, the client sends the first slice list and the second slice list to the server. Or delete.
第三方面,本发明实施例提供了一种服务器,该服务器具有实现上述第一方面中服务器行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。In a third aspect, an embodiment of the present invention provides a server, which has a function of implementing server behavior in the foregoing first aspect. The functions can be implemented in hardware or in hardware by executing the corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
在一个可能的设计中,该服务器的结构中包括处理器和存储器,存储器用于存储支持该服务器执行上述方法的程序,处理器被配置为用于执行存储器中存储的程序。该服务器还可以包括通信接口,用于该服务器与其他设备或通信网络通信。In one possible design, the structure of the server includes a processor and a memory for storing a program that supports the server to perform the above method, and the processor is configured to execute a program stored in the memory. The server can also include a communication interface for the server to communicate with other devices or communication networks.
第四方面,本发明实施例提供了一种客户端,该客户端具有实现上述第二方面中客户端行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。In a fourth aspect, an embodiment of the present invention provides a client, where the client has a function of implementing client behavior in the foregoing second aspect. The functions can be implemented in hardware or in hardware by executing the corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
在一个可能的设计中,该客户端的结构中包括处理器和存储器,存储器用于存储支持该客户端执行上述方法的程序,处理器被配置为用于执行存储器中存储的程序。该客户端还可以包括通信接口,用于该客户端与其他设备或通信网络通信。In one possible design, the client structure includes a processor and a memory for storing a program that supports the client to perform the above method, and the processor is configured to execute a program stored in the memory. The client can also include a communication interface for the client to communicate with other devices or communication networks.
第五方面,本发明提供了一种服务器,该服务器包括用于执行上述第一方面或第一方面任意一种实现方式所描述的媒体分片的推送方法的模块或单元。In a fifth aspect, the present invention provides a server, the server comprising a module or unit for performing the push method of the media slice described in the above first aspect or any one of the first aspects.
第六方面,本发明提供了一种客户端,该客户端包括用于执行上述第二方面或第二方面任意一种可能的设计所描述的媒体分片的推送方法的模块或单元。In a sixth aspect, the present invention provides a client comprising a module or unit for performing a push method of a media slice as described in any of the possible aspects of the second aspect or the second aspect above.
第七方面,本发明提供了一种通信系统,包括服务器和客户端,其中,服务器为第三方面或第五方面所描述的服务器,客户端为第四方面或第六方面所描述的客户端。According to a seventh aspect, the present invention provides a communication system, including a server and a client, wherein the server is the server described in the third aspect or the fifth aspect, and the client is the client described in the fourth aspect or the sixth aspect. .
第八方面,本发明实施例提供了一种计算机存储介质,用于储存为上述服务器所用的计算机软件指令,其包含用于执行上述第一方面为服务器所设计的程序。In an eighth aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the server, which includes a program designed to execute the first aspect of the server.
第九方面,本发明实施例提供了一种计算机存储介质,用于储存为上述客户端所用的计算机软件指令,其包含用于执行上述第二方面为客户端所设计的程序。According to a ninth aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the client, which includes a program designed to execute the second aspect of the foregoing client.
通过实施本发明实施例,服务器将客户端请求推送的分片划分为可推送分片以及待定推送分片,并向客户端发送可推送分片各自对应的推送承诺以及待定推送指示信息,客户端可以根据待定推送指示信息在后续接收推送的分片时准备接收新的推送承诺,因此,当客户端请求推送的分片的数量较大时,可以避免客户端因需要接收大量的推送承诺导致接收分片延迟较大的问题。By implementing the embodiment of the present invention, the server divides the fragment requested by the client into a pushable fragment and a pending push fragment, and sends a push commitment and a pending push indication information corresponding to each of the pushable fragments to the client, the client. The new push commitment can be received according to the pending push indication information when subsequently receiving the pushed fragment. Therefore, when the number of fragments requested by the client is large, the client can be prevented from receiving due to the need to receive a large number of push commitments. The problem of large fragmentation delay.
本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These and other aspects of the invention will be more apparent from the following description of the embodiments.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。 In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below.
图1是传统技术中媒体分片的推送方法的流程示意图;1 is a schematic flow chart of a method for pushing a media slice in a conventional technology;
图2是本发明实施例提供的媒体分片推送系统的架构示意图;2 is a schematic structural diagram of a media slice pushing system according to an embodiment of the present invention;
图3是本发明实施例提供的一种计算机设备的结构示意图;3 is a schematic structural diagram of a computer device according to an embodiment of the present invention;
图4是本发明实施例提供的一种媒体分片的推送方法的流程示意图;4 is a schematic flowchart of a method for pushing a media slice according to an embodiment of the present invention;
图5是本发明实施例提供的一种取消推送媒体分片的方法的流程示意图;FIG. 5 is a schematic flowchart of a method for canceling push media segmentation according to an embodiment of the present invention; FIG.
图6为本发明实施例提供的服务器的结构示意图;FIG. 6 is a schematic structural diagram of a server according to an embodiment of the present disclosure;
图7为本发明实施例提供的客户端的结构示意图。FIG. 7 is a schematic structural diagram of a client according to an embodiment of the present invention.
具体实施方式detailed description
本发明的实施方式部分使用的术语仅用于对本发明的具体实施例进行解释,而非旨在限定本发明。下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述。The terms used in the embodiments of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention. The technical solutions in the embodiments of the present invention will be clearly described below with reference to the accompanying drawings in the embodiments of the present invention.
图2为本发明实施例提供的一种媒体分片推送系统200的架构示意图,包括:服务器201、客户端202以及网络203。客户端202通过网络203,与服务器201通信。2 is a schematic structural diagram of a media sharding push system 200 according to an embodiment of the present invention, including: a server 201, a client 202, and a network 203. Client 202 communicates with server 201 over network 203.
其中,客户端负责向服务器发送分片请求消息,用于向服务器请求获取分片,其中分片包括初始化分片和媒体分片。初始化分片包括媒体资源播放所需要的元数据,媒体分片包括媒体资源的真实数据。分片请求消息中包含请求分片标识,用于请求获取某个分片的数据。分片请求消息中还可包含推送指令,推送指令中包含客户端希望服务器推送的分片的标识。客户端希望服务器推送的分片标识可以是通过列表或模板的形式描述分片的下载地址,也可以是指定了所请求的分片之后连续的几个分片。分片请求消息中还可以包括待定推送参数。待定推送参数用于指示服务器每次发送的推送承诺的数量或者何时发送待定推送的分片的推送承诺。待定推送参数具体可以是每次最多发送几个推送承诺,或者每次最少发送几个推送承诺,或者在第一批推送承诺的发送时间以后后续每一批推送承诺的发送间隔,或者是其他任何可以用于决策推送承诺的发送个数或者何时进行推送承诺的发送的信息,如客户端缓存中的分片的数量等。客户端还用于接收服务器发送或推送的分片,且负责分片的解码、解密、渲染和呈现等。服务器负责分片的存储和分发,接收客户端的分片请求消息,解析分片请求消息中的推送指令,根据推送指令将客户端请求推送的分片划分成两组,一组是可推送分片,另一组是待定推送分片。服务器首先向客户端发送可推送分片中每个分片对应的推送承诺,在后续推送分片的过程中,再将待定推送分片的推送承诺分批次地发送给客户端,以保证每次发送的推送承诺的数量不至于过多,从而客户端在接收推送的分片时,避免出现因接收过多的推送承诺导致延迟较大的问题。并且,服务器还可以根据客户端发送的待定推送参数,确定推送承诺的发送数量及发送时机,进而按照发送数量及发送时机发送推送承诺至客户端。The client is responsible for sending a fragmentation request message to the server for requesting the acquisition of the fragment, wherein the fragment includes the initialization fragment and the media fragment. The initialization fragment includes metadata required for media resource playback, and the media fragment includes real data of the media resource. The fragment request message includes a request fragment identifier for requesting data of a certain fragment. The fragmentation request message may further include a push instruction, where the push instruction includes an identifier of a fragment that the client wishes the server to push. The fragment identifier that the client wants to push the server may be a download address describing the fragment in the form of a list or a template, or may be a consecutive fragment after the requested fragment is specified. The slice request message may also include a pending push parameter. The pending push parameter is used to indicate the number of push commitments sent by the server each time or when to send a push commitment for the slice to be pushed. The pending push parameter may specifically be that a maximum of several push commitments are sent at a time, or at least a few push commitments are sent at a time, or a subsequent interval of each batch of push commitments after the first batch of push commitments is sent, or any other It can be used to decide the number of sent push promises or when to send the push promise, such as the number of fragments in the client cache. The client is also used to receive fragments sent or pushed by the server, and is responsible for decoding, decrypting, rendering, and rendering of the fragments. The server is responsible for storing and distributing the fragment, receiving the fragment request message of the client, parsing the push instruction in the fragment request message, and dividing the fragment pushed by the client request into two groups according to the push instruction, and one group is pushable fragment. The other group is pending push shards. The server first sends a push commitment corresponding to each fragment in the pushable fragment to the client, and in the process of subsequently pushing the fragment, the push commitment of the pending push fragment is sent to the client in batches to ensure that each The number of push commitments sent at a time is not excessive, so that the client avoids the problem of large delay caused by receiving too many push commitments when receiving the pushed fragments. Moreover, the server may further determine the number of transmission commitments and the transmission timing according to the pending push parameters sent by the client, and then send the push commitment to the client according to the number of transmissions and the sending timing.
需要说明的是,本发明实施例中的方法不仅支持基于HTTP的动态自适应流(DASH)技术,也同样适用于其它HTTP流技术,包括HTTP直播流(英文:HTTP Live Streaming,简称:HLS),HTTP动态流(HTTP Dynamic Streaming,HDS)和HTTP平滑流(英文:HTTP Smooth Streaming,简称:HSS)。系统中,客户端202的数量也可以是多个,本发明实施例对此不作限定。具体的,客户端202可以为诸如手机、平板电脑、台式电脑或者笔记本电脑之类的任意终端。It should be noted that the method in the embodiment of the present invention not only supports the HTTP-based dynamic adaptive stream (DASH) technology, but also applies to other HTTP stream technologies, including HTTP live stream (English: HTTP Live Streaming, referred to as HLS). , HTTP Dynamic Streaming (HDS) and HTTP Smooth Streaming (English: HTTP Smooth Streaming, referred to as HSS). In the system, the number of the clients 202 may also be multiple, which is not limited by the embodiment of the present invention. Specifically, the client 202 can be any terminal such as a mobile phone, a tablet computer, a desktop computer, or a notebook computer.
如图3所示,图2中的服务器201或者客户端202可以以图3中的计算机设备(或系统) 的方式来实现。As shown in FIG. 3, the server 201 or the client 202 in FIG. 2 may be the computer device (or system) in FIG. The way to achieve it.
图3所示为本发明实施例提供的计算机设备示意图。计算机设备300包括至少一个处理器301,通信总线302,存储器303以及至少一个通信接口304。FIG. 3 is a schematic diagram of a computer device according to an embodiment of the present invention. Computer device 300 includes at least one processor 301, a communication bus 302, a memory 303, and at least one communication interface 304.
处理器301可以是一个通用中央处理器(英文:Central Process ing Unit,简称:CPU),微处理器,特定应用集成电路(英文:Application-Specific Integrated Circuit,简称:ASIC),或一个或多个用于控制本发明方案程序执行的集成电路。The processor 301 can be a general-purpose central processing unit (English: Central Process ing Unit, CPU for short), a microprocessor, an application-specific integrated circuit (ASIC), or one or more An integrated circuit for controlling the execution of the program of the present invention.
通信总线302可包括一通路,在上述组件之间传送信息。所述通信接口304,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网,无线接入网(英文:Radio Access Technology,简称:RAN),无线局域网(英文:Wireless Local Area Networks,简称:WLAN)等。Communication bus 302 can include a path for communicating information between the components described above. The communication interface 304 uses a device such as any transceiver for communicating with other devices or communication networks, such as an Ethernet, a radio access network (English: Radio Access Technology, RAN), and a wireless local area network (English: Wireless Local Area Networks, referred to as WLAN).
存储器303可以是只读存储器(英文:Read-Only Memory,简称:ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(英文:Random Access Memory,简称:RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(英文:Electrical ly Erasable Programmable Read-Only Memory,简称:EEPROM)、只读光盘(英文:Compact Disc Read-Only Memory,简称:CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The memory 303 may be a read-only memory (English: Read-Only Memory, ROM for short) or other types of static storage devices that can store static information and instructions, a random access memory (English: Random Access Memory, RAM for short). Other types of dynamic storage devices that can store information and instructions, or can be electrically readable Erasable Programmable Read-Only Memory (EEPROM) or read-only discs (English: Compact Disc Read) -Only Memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or can be used to carry Or any other medium having a desired program code in the form of an instruction or data structure and accessible by a computer, but is not limited thereto. The memory can exist independently and be connected to the processor via a bus. The memory can also be integrated with the processor.
其中,所述存储器303用于存储执行本发明方案的程序代码,并由处理器301来控制执行。所述处理器301用于执行所述存储器303中存储的程序代码。The memory 303 is used to store program code for executing the solution of the present invention, and is controlled by the processor 301 for execution. The processor 301 is configured to execute program code stored in the memory 303.
在具体实现中,作为一种实施例,处理器301可以包括一个或多个CPU,例如图3中的CPU0和CPU1。In a particular implementation, as an embodiment, processor 301 may include one or more CPUs, such as CPU0 and CPU1 in FIG.
在具体实现中,作为一种实施例,计算机设备300可以包括多个处理器,例如图3中的处理器301和处理器308。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a particular implementation, as an embodiment, computer device 300 can include multiple processors, such as processor 301 and processor 308 in FIG. Each of these processors can be a single-CPU processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data, such as computer program instructions.
在具体实现中,作为一种实施例,计算机设备300还可以包括输出设备305和输入设备306。输出设备305和处理器301通信,可以以多种方式来显示信息。例如,输出设备305可以是液晶显示器(英文:Liquid Crystal Display,简称:LCD),发光二级管(英文:Light Emitting Diode,简称:LED)显示设备,阴极射线管(英文:Cathode Ray Tube,简称:CRT)显示设备,或投影仪(projector)等。输入设备306和处理器301通信,可以以多种方式接受用户的输入。例如,输入设备406可以是鼠标、键盘、触摸屏设备或传感设备等。In a particular implementation, as an embodiment, computer device 300 may also include an output device 305 and an input device 306. Output device 305 is in communication with processor 301 and can display information in a variety of ways. For example, the output device 305 can be a liquid crystal display (English: Liquid Crystal Display, abbreviated as: LCD), a light emitting diode (English: Light Emitting Diode, abbreviated as: LED) display device, a cathode ray tube (English: Cathode Ray Tube, referred to as : CRT) Display device, or projector (projector), etc. Input device 306 is in communication with processor 301 and can accept user input in a variety of ways. For example, input device 406 can be a mouse, keyboard, touch screen device, or sensing device, and the like.
上述的计算机设备300可以是一个通用计算机设备或者是一个专用计算机设备。在具体实现中,计算机设备300可以是台式机、便携式电脑、网络服务器、掌上电脑(英文:Personal Digital Assistant,简称:PDA)、移动手机、平板电脑、无线终端设备、通信设备、嵌入式设备或有图3中类似结构的设备。本发明实施例不限定计算机设备300的类型。The computer device 300 described above can be a general purpose computer device or a special purpose computer device. In a specific implementation, the computer device 300 can be a desktop computer, a portable computer, a network server, a handheld computer (English: Personal Digital Assistant, PDA for short), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, or There are devices of similar construction in Figure 3. Embodiments of the invention do not limit the type of computer device 300.
如图2中的服务器201可以为图3所示的设备,服务器201的存储器中存储了一个或多个软件模块(如交互模块和处理模块)。如图2中的客户端202也可以为图3所示的设备,客 户端的存储器中存储了一个或多个软件模块(如交互模块和处理模块)。服务器或者客户端可以通过处理器以及存储器中的程序代码来实现软件模块,实现分片的推送。The server 201 in FIG. 2 may be the device shown in FIG. 3, and one or more software modules (such as an interaction module and a processing module) are stored in the memory of the server 201. The client 202 in FIG. 2 can also be the device shown in FIG. One or more software modules (such as interaction modules and processing modules) are stored in the memory of the client. The server or the client can implement the software module through the processor and the program code in the memory to implement the push of the slice.
基于上述图2所述的系统架构示意图,图4为本发明实施例提供的一种媒体分片的推送方法的流程图,包括如下步骤。Based on the schematic diagram of the system architecture described in FIG. 2, FIG. 4 is a flowchart of a method for pushing a media slice according to an embodiment of the present invention, including the following steps.
S401:客户端向服务器发送获取分片1的分片请求消息,该分片请求消息中包括推送指令。S401: The client sends a fragment request message for obtaining the fragment 1 to the server, where the fragment request message includes a push instruction.
具体的,该分片请求消息中携带分片1的标识以及推送指令。该推送指令用于确定客户端期望服务器推送分片的标识,为便于描述,本发明实施例中以客户端希望服务器推送分片2、分片3、分片4以及分片5为例。本发明实施例中,分片的标识包括但不限于:统一资源定位符(英文:Uniform Resoure Locator,简称:URL)。Specifically, the fragment request message carries the identifier of the fragment 1 and a push instruction. The push command is used to determine the identifier that the client expects the server to push the shards. For the convenience of description, in the embodiment of the present invention, the client wants the server to push the shard 2, the shard 3, the shard 4, and the shard 5 as an example. In the embodiment of the present invention, the identifier of the fragment includes, but is not limited to, a uniform resource locator (English: Uniform Resoure Locator, abbreviated as: URL).
例如,客户端向服务器发送携带推送指令的分片请求消息可以如下面的代码1所示:For example, the client sends a fragment request message carrying a push instruction to the server as shown in the following code 1:
代码1Code 1
Figure PCTCN2017105714-appb-000001
Figure PCTCN2017105714-appb-000001
其中,“:method=GET”表示请求方法为GET,用于获取内容。“:path=/example/rendition1/segment001”表示请求分片的URL(即本发明实施例中的分片1的URL),accept-push-policy=“urn:mpeg:dash:fdh:2016:push-template”;“http://example/rendition1/segment{%03d}:{2-51}”表示客户端希望服务器能够按照URL模板http://example/rendition1/segment{%03d},推送分片1之后的分片2至分片51,也即是说,推送URL地址从http://example/rendition1/segment002到http://example/rendition1/segment051的50个分片。Where ":method=GET" indicates that the request method is GET and is used to obtain content. ":path=/example/rendition1/segment001" indicates the URL of the requested fragment (ie, the URL of the fragment 1 in the embodiment of the present invention), accept-push-policy="urn:mpeg:dash:fdh:2016:push -template"; "http://example/rendition1/segment{%03d}:{2-51}" means that the client wants the server to push the URL according to the URL template http://example/rendition1/segment{%03d} Slice 2 to slice 51 after slice 1, that is, push the URL address from http://example/rendition1/segment002 to 50 slices of http://example/rendition1/segment051.
需要说明的是,这里只是列出了分片请求消息中必要的一些参数,其他与本发明实施例无关的参数不在这里列出说明。It should be noted that only some parameters necessary in the fragment request message are listed here, and other parameters not related to the embodiment of the present invention are not listed here.
S402:服务器接收客户端发送的分片请求消息,将客户端请求推送的分片划分为可推送分片和待定推送分片。S402: The server receives the fragment request message sent by the client, and divides the fragment that the client requests to push into a pushable fragment and a pending push fragment.
可选的,服务器根据第一待定推送参数,将客户端请求推送的分片划分为可推送分片和待定推送分片。该第一待定推送参数可以是服务器本地配置的。该第一待定推送参数可以根据具体的应用场景设定,用于将客户端端请求推送的分片分为可推送分片和待定推送分片,从而使得可以分批发送客户端请求推送的分片的推送承诺,避免一次发送过多的推送承诺, 导致客户端的播放延迟。第一待定推送参数包括但不限于:推送阈值(例如一次最多发送推送承诺的数量、一次最少发送推送承诺的数量)、随机指示符。该推送阈值用于指示服务器将多少分片确定为可推送分片。该随机指示符用于指示服务器将当前本地缓存的分片确定为可推送分片。Optionally, the server divides the fragment that the client requests to push into a pushable slice and a pending push slice according to the first pending push parameter. The first pending push parameter may be locally configured by the server. The first pending push parameter may be set according to a specific application scenario, and is used to divide the slice that the client requests to push into a pushable slice and a pending push slice, so that the client may request to send the segment in batches. The push promise of the film avoids sending too many push promises at once. Causes the client to play delayed. The first pending push parameters include, but are not limited to, a push threshold (eg, a maximum number of push commitments sent at a time, a minimum number of push commitments sent at a time), a random indicator. The push threshold is used to indicate how many shards the server determines as pushable shards. The random indicator is used to instruct the server to determine the currently locally cached slice as a pushable slice.
例如,该第一待定推送参数为一次最多发送推送承诺的数量为4个,则服务器根据数量4将客户端请求推送的50个分片中的按序从第一个分片(即分片2)至第四个分片(即分片5)确定为可推送分片,将其余46个分片确定为待定推送分片。或者,该第一待定推送参数为随机指示符时,服务器当前缓存的分片只有分片2至分片5,则服务器将分片2至分片5确定为可推送分片,将其余46个分片确定为待定推送分片。For example, if the first pending push parameter is that the maximum number of push commitments sent at one time is four, the server sequentially sorts the 50 fragments of the client request from the first slice according to the quantity 4 (ie, the slice 2 The fourth slice (ie, slice 5) is determined to be a pushable slice, and the remaining 46 slices are determined as pending push slices. Alternatively, when the first pending push parameter is a random indicator, the server currently caches only the fragment 2 to the fragment 5, and the server determines the fragment 2 to the fragment 5 as pushable fragments, and the remaining 46 The slice is determined to be a push slice to be determined.
S403:服务器响应客户端的请求,依次发送分片2的推送承诺、分片3的推送承诺、分片4的推送承诺、分片5的推送承诺、待定推送指示信息以及分片1至客户端。S403: The server sends the push commitment of the slice 2, the push commitment of the slice 3, the push commitment of the slice 4, the push commitment of the slice 5, the pending push indication information, and the slice 1 to the client in response to the request of the client.
具体的,推送承诺表示服务器将会在哪个流标识(StreamID)指示的流中推送分片。本发明实施例中,服务器会针对分片2、分片3、分片4以及分片5分别发送推送承诺。并且,这4个推送承诺都是在发送分片1之前发送给客户端的。具体实现中,分片2的推送承诺、分片3的推送承诺、分片4的推送承诺、分片5的推送承诺、待定推送指示信息以及分片1可以是同一条响应消息中的部分内容,携带相同的流标识。例如,服务器向客户端发送推送承诺和分片1如下面的代码2-6所示:Specifically, the push commitment indicates that the server will push the fragment in the stream indicated by the stream ID. In the embodiment of the present invention, the server sends a push commitment for the slice 2, the slice 3, the slice 4, and the slice 5 respectively. Moreover, these four push commitments are sent to the client before sending the fragment 1. In a specific implementation, the push commitment of the slice 2, the push commitment of the slice 3, the push commitment of the slice 4, the push commitment of the slice 5, the pending push indication information, and the slice 1 may be part of the same response message. , carrying the same stream ID. For example, the server sends push commitments and shards 1 to the client as shown in the following code 2-6:
代码2分片2的推送承诺Code 2 slice 2 push promise
Figure PCTCN2017105714-appb-000002
Figure PCTCN2017105714-appb-000002
代码3分片3的推送承诺Code 3 slice 3 push promise
Figure PCTCN2017105714-appb-000003
Figure PCTCN2017105714-appb-000003
代码4分片4的推送承诺Code 4 slice 4 push promise
Figure PCTCN2017105714-appb-000004
Figure PCTCN2017105714-appb-000004
代码5分片5的推送承诺 Code 5 Fragment 5 Push Commitment
Figure PCTCN2017105714-appb-000005
Figure PCTCN2017105714-appb-000005
代码6分片1Code 6 slice 1
Figure PCTCN2017105714-appb-000006
Figure PCTCN2017105714-appb-000006
如代码2所示,“Stream ID=1”表示当前消息体是在Stream ID=1的流中传输的,“Stream ID=2”表示服务器将在StreamID=2的流中推送分片2,“:path=/example/rendition1/segment002”表示分片2的URL。代码3-5与代码2的格式类似,此处不再说明。服务器发送客户端请求的分片1的消息格式如代码6所示,其中,“status=200”表示服务器已成功处理了客户端的分片请求消息,push-policy=“urn:mpeg:dash:fdh:2016:push-template”;“http://example/rendition1/segment{%03d}:{2-5}”表示服务器此次的推送策略为推送分片2至分片5。在另一种可能的设计中,也可以将push-policy设置为“urn:mpeg:dash:fdh:2016:push-template”;http://example/rendition1/segment{%03d}:{2-51},表示服务器接受了客户端的推送请求,可以确定能够推送分片1之后的分片2至分片51个。“pending-push=true”为待定推送指示信息,表示服务器后续会对待定推送分片(即本例中的分片6至分片51)发送推送承诺,本发明实施例中待定推送指示信息的格式是布尔型,在其他可实现的方式中,待定推送指示信息的格式还可以是其他类型。“{binary data for segment 1}”即是客户端所请求的分片1的数据。As shown in the code 2, "Stream ID=1" indicates that the current message body is transmitted in the stream with Stream ID=1, and "Stream ID=2" indicates that the server will push the fragment 2 in the stream with StreamID=2," :path=/example/rendition1/segment002" indicates the URL of slice 2. Codes 3-5 are similar to the format of Code 2 and will not be explained here. The message format of the fragment 1 of the server sending the client request is as shown in the code 6, where "status=200" indicates that the server has successfully processed the fragment request message of the client, push-policy="urn:mpeg:dash:fdh :2016:push-template"; "http://example/rendition1/segment{%03d}:{2-5}" means that the server's push policy this time is to push slice 2 to slice 5. In another possible design, you can also set the push-policy to "urn:mpeg:dash:fdh:2016:push-template"; http://example/rendition1/segment{%03d}:{2- 51}, indicating that the server accepts the push request of the client, and can determine that the slice 2 to the slice 51 after the slice 1 can be pushed. The "pending-push=true" is a pending push indication information, which indicates that the server will send a push commitment to the push shard (ie, the shard 6 to the shard 51 in this example), and the push indication information is to be determined in the embodiment of the present invention. The format is a Boolean type. In other implementable manners, the format of the pending push indication information may also be other types. "{binary data for segment 1}" is the data of slice 1 requested by the client.
需要说明的是,本发明实施例中,以服务器将待定推送指示信息携带在返回的响应消息中的报头(HEADERS)帧中为例进行说明,在其他可实现的方式中,还可以将待定推送指示信息携带在服务器发送的某个推送承诺中,或者携带在新定义的某一条消息或者某个帧中,本发明实施例不作具体限定。It should be noted that, in the embodiment of the present invention, the HEADERS frame in which the server pushes the pending push indication information in the returned response message is taken as an example. In other implementable manners, the pending push may also be performed. The indication information is carried in a certain push commitment sent by the server, or is carried in a newly defined certain message or a certain frame, which is not specifically limited in the embodiment of the present invention.
可选的,服务器还可以维护一已发送推送承诺且未推送的分片列表,该列表中记录有已发送推送承诺且未推送的分片的标识以及对应的流标识。例如,服务器将客户端请求推送的分片划分为可推送分片和待定推送分片之后,服务器向客户端发送针对每一个可推送分片的推送承诺。本例中,服务器向客户端发送分片2至分片5的推送承诺后,该已发送推送承诺 且未推送的分片列表中记录有分片2至分片5的URL以及相应的流标识。例如,已发送推送承诺且未推送的分片列表的格式可如表1所示。Optionally, the server may further maintain a fragment list that has sent the push commitment and is not pushed, and the identifier of the fragment that has sent the push commitment and is not pushed and the corresponding stream identifier are recorded in the list. For example, after the server divides the fragment requested by the client into pushable fragments and pending push fragments, the server sends a push commitment for each pushable fragment to the client. In this example, after the server sends a push commitment from slice 2 to slice 5 to the client, the pushed push commitment is sent. The URL of the slice 2 to the slice 5 and the corresponding stream identifier are recorded in the un-pushed slice list. For example, the format of the slice list that has sent the push commitment and is not pushed can be as shown in Table 1.
表1已发送推送承诺且未推送的分片列表Table 1 lists of fragments that have been sent push commitments and have not been pushed
分片的标识Fragment identification 流标识Flow identification
http://example/rendition1/segment002Http://example/rendition1/segment002 22
http://example/rendition1/segment003Http://example/rendition1/segment003 44
http://example/rendition1/segment004Http://example/rendition1/segment004 66
http://example/rendition1/segment005Http://example/rendition1/segment005 88
服务器还可以维护一待定推送分片列表,该列表中记录有客户端请求推送且服务器尚未发送推送承诺的分片的标识。例如,服务器将客户端请求推送的分片划分为可推送分片和待定推送分片之后,待定推送分片列表中记录有分片6至分片51的URL。The server can also maintain a list of pending push fragments, which record the identity of the fragment that the client requested to push and that the server has not sent the push commitment. For example, after the server divides the fragment requested by the client into the pushable slice and the pending push slice, the URL of the slice 6 to the slice 51 is recorded in the pending push slice list.
例如,待定推送分片列表的格式可如表2所示。For example, the format of the pending push slice list can be as shown in Table 2.
表2待定推送分片列表Table 2 list of pending push fragments
分片的标识Fragment identification
http://example/rendition1/segment006Http://example/rendition1/segment006
http://example/rendition1/segment007Http://example/rendition1/segment007
……......
http://example/rendition1/segment051Http://example/rendition1/segment051
S404:客户端接收服务器依次发送的分片2的推送承诺、分片3的推送承诺、分片4的推送承诺、分片5的推送承诺、待定推送指示信息以及分片1,处理并播放分片1。S404: The client receives the push commitment of the slice 2 sent by the server, the push commitment of the slice 3, the push commitment of the slice 4, the push commitment of the slice 5, the pending push indication information, and the slice 1, processing and playing the score Slice 1.
具体的,客户端首先接收到可推送分片中每一个分片对应的推送承诺,根据推送承诺客户端可获知后续服务器将在哪个流中推送哪个分片,根据推送承诺中携带的分片标识以及对应的流标识,客户端可以维护一已发送推送承诺且未推送的分片列表,该列表中记录有服务器已发送推送承诺且未推送给客户端的分片的标识以及对应的流标识。例如,已发送推送承诺且未推送的分片列表中记录有分片2至分片5的URL以及相应的流标识,则已发送推送承诺且未推送的分片列表的格式可参见表1。Specifically, the client first receives the push commitment corresponding to each fragment in the pushable fragment, and according to the push commitment client, the client can know which stream the subsequent server will push, according to the fragment identifier carried in the push commitment. And the corresponding flow identifier, the client can maintain a fragment list that has sent the push commitment and has not been pushed. The list records the identifier of the fragment that the server has sent the push commitment and has not pushed to the client, and the corresponding stream identifier. For example, if the URL of the slice 2 to the slice 5 and the corresponding stream identifier are recorded in the slice list that has been sent and the push is not pushed, the format of the slice list that has sent the push commitment and is not pushed can be seen in Table 1.
之后,客户端根据接收到的待定推送指示信息获知需要等待接收客户端请求推送的分片中其他尚未发送推送承诺的分片的推送承诺。具体的,客户端还可以根据自身请求推送的分片以及服务器已发送推送承诺的分片确定出尚未发送推送承诺的分片,并维护一待定推送分片列表,该列表中记录有客户端请求推送且服务器尚未发送推送承诺的分片的标识。例如,待定推送分片列表中记录有分片6至分片51的URL。待定推送分片列表的格式可参见表2。Afterwards, the client learns, according to the received push indication information, that it needs to wait for the push commitment of the other fragments in the fragment that the client requests to push to send the push commitment. Specifically, the client may further determine, according to the fragment that is pushed by the request and the fragment that the server has sent the push commitment, the fragment that has not sent the push commitment, and maintain a pending push fragment list, where the client request is recorded in the list. The identity of the shard that was pushed and the server has not sent a push commitment. For example, the URL of the slice 6 to the slice 51 is recorded in the pending push slice list. See Table 2 for the format of the pending push slice list.
之后,客户端接收到分片1的数据,处理并播放分片1,等待接收服务器推送的分片。After that, the client receives the data of the slice 1, processes and plays the slice 1, and waits for the slice pushed by the server.
S405:服务器向客户端推送分片2。S405: The server pushes the fragment 2 to the client.
本发明实施例中,服务器将分片2通过StreamID=2的流推送至客户端。例如,服务器向 客户端发送分片2如下面的代码7所示:In the embodiment of the present invention, the server pushes the fragment 2 to the client through the stream of StreamID=2. For example, the server is The client sends the fragment 2 as shown in the following code 7:
代码7分片2Code 7 slice 2
Figure PCTCN2017105714-appb-000007
Figure PCTCN2017105714-appb-000007
服务器在向客户端推送了分片2之后,将分片2的标识以及流标识2从服务器中的已发送推送承诺且未推送的分片列表中删除,从而更新该列表。After the server pushes the fragment 2 to the client, the identifier of the fragment 2 and the stream identifier 2 are deleted from the sent push promised and unpushed fragment list in the server, thereby updating the list.
S406:客户端接收服务器发送的分片2,处理并播放分片2。S406: The client receives the fragment 2 sent by the server, and processes and plays the fragment 2.
本发明实施例中,客户端接收到分片2对应的响应消息后,根据响应消息中携带的StreamID=2确定收到的是分片2的数据,进而处理并播放分片2。In the embodiment of the present invention, after receiving the response message corresponding to the fragment 2, the client determines that the data of the fragment 2 is received according to the StreamID=2 carried in the response message, and then processes and plays the fragment 2.
客户端在接收到服务器发送的分片2后,将分片2的标识以及流标识2从客户端中的已发送推送承诺且未推送的分片列表中删除,从而更新该列表。After receiving the fragment 2 sent by the server, the client deletes the identifier of the fragment 2 and the stream identifier 2 from the sent push promised and unpushed fragment list in the client, thereby updating the list.
可选的,客户端接收到分片2对应的响应消息后,还可以判断该响应消息中是否包含推送承诺。Optionally, after receiving the response message corresponding to the fragment 2, the client may further determine whether the response message includes a push commitment.
之后,服务器向客户端推送分片3以及分片4,客户端接收服务器推送的分片3和分片4,该过程可以参考步骤S405和步骤S406,此处不再赘述。服务器每向客户端推送一个分片,都需要从服务器的已发送推送承诺且未推送的分片列表中删除相应的分片标识及对应的流标识,从而更新服务器的已发送推送承诺且未推送的分片列表。客户端每收到一个推送的分片,需要从客户端的已发送推送承诺且未推送的分片列表中将相应的分片标识及对应的流标识删除,更新客户端的已发送推送承诺且未推送的分片列表。Then, the server pushes the fragment 3 and the fragment 4 to the client, and the client receives the fragment 3 and the fragment 4 pushed by the server. For the process, reference may be made to step S405 and step S406, and details are not described herein again. Each time the server pushes a fragment to the client, it needs to delete the corresponding fragment identifier and the corresponding stream identifier from the server's sent push promised and unpushed fragment list, thereby updating the server's sent push commitment and not pushing. The shard list. Each time the client receives a push fragment, the client needs to delete the corresponding fragment identifier and the corresponding stream identifier from the fragment list of the client that has sent the push commitment and does not push, and updates the sent push commitment of the client and does not push. The shard list.
S407:服务器确定待定推送分片中的可推送的分片。S407: The server determines a pushable slice in the pending push slice.
可选的,服务器根据第一待定推送参数,确定待定推送分片中的可推送分片。第一待定推送参数的具体形式参考步骤402所述,这里不再赘述。例如,第一待定推送参数为一次最多发送推送承诺的数量为4个,则服务器在发送了分片2至分片5对应的推送承诺之后,按序将其余的46个分片中的第一个分片(即分片6)至第四个分片(即分片9)确定为可推送分片。或者,该第一待定推送参数为随机指示符时,服务器当前缓存的分片只有分片6至分片9,则服务器将分片6至分片9确定为可推送分片。Optionally, the server determines, according to the first pending push parameter, the pushable slice in the pending push slice. The specific form of the first pending push parameter is described in step 402, and details are not described herein again. For example, if the first pending push parameter is the maximum number of push commitments sent at one time, the server sends the first of the remaining 46 fragments after sending the push commitment corresponding to the slice 2 to the slice 5 The slices (ie, slice 6) to the fourth slice (ie, slice 9) are determined to be pushable slices. Alternatively, when the first pending push parameter is a random indicator, the server currently caches only the fragment 6 to the fragment 9, and the server determines the fragment 6 to the fragment 9 as pushable fragments.
S408:服务器依次发送分片6的推送承诺、分片7的推送承诺、分片8的推送承诺、分片9的推送承诺以及分片5至客户端。S408: The server sequentially sends the push commitment of the slice 6, the push commitment of the slice 7, the push commitment of the slice 8, the push commitment of the slice 9, and the slice 5 to the client.
具体的,服务器根据第二待定推送参数,确定向客户端发送待定推送分片中的可推送分片的推送承诺的条件,当条件满足时,服务器将待定推送分片中的可推送分片对应的推送承诺发送给客户端。Specifically, the server determines, according to the second pending push parameter, a condition for sending a push commitment of the pushable slice in the pending push slice to the client, and when the condition is met, the server corresponds to the pushable slice in the pending push slice. The push promise is sent to the client.
其中,第二待定推送参数可以由服务器本地配置。第二待定推送参数包括但不限于:已发送推送承诺且未推送的分片的剩余数量的最小值或服务器当前缓存的分片的数量阈值。The second pending push parameter may be locally configured by the server. The second pending push parameters include, but are not limited to, a minimum value of the remaining number of fragments that have sent the push commitment and are not pushed, or a threshold number of fragments of the server currently buffered.
例如,当已发送推送承诺且未推送的分片的剩余数量小于2个时,确定将待定推送分片中包括的可推送分片对应的推送承诺发送给客户端。也即是说,当服务器确定当前已发送推 送承诺且未推送的分片列表中只剩一个记录时,确定将待定推送分片中包括的可推送分片对应的推送承诺发送给客户端。例如,待定推送分片中的可推送分片为分片6至分片9,当服务器确定当前已发送推送承诺且未推送的分片列表中只剩下分片5时,剩余数量小于2个,服务器将分片6至分片9各自对应的推送承诺发送给客户端。优选地,服务器可以在向客户端发送分片5之前,将分片6至分片9各自对应的推送承诺发送给客户端。For example, when the remaining number of shards that have been sent and not pushed is less than two, it is determined that the push commitment corresponding to the pushable shards included in the pending push shard is sent to the client. That is, when the server determines that the push has been sent When there is only one record left in the slice list that is delivered and not pushed, it is determined that the push commitment corresponding to the pushable slice included in the pending push slice is sent to the client. For example, the pushable slice in the pending push slice is slice 6 to slice 9. When the server determines that only the slice 5 is left in the slice list that has been sent and not pushed, the remaining number is less than 2 The server sends the corresponding push commitments of each of the fragments 6 to 9 to the client. Preferably, the server may send a push commitment corresponding to each of the fragments 6 to 9 to the client before sending the fragment 5 to the client.
或者,服务器本地配置每缓存4个分片,就可以发送这4个分片各自对应的推送承诺。例如,当服务器向客户端推送分片2至分片5期间,服务器又缓存了更多的分片,比如获取到了待定推送分片列表中的分片6至分片9,缓存的分片数量满足4个,则服务器将分片6至分片9各自对应的推送承诺发送给客户端。Alternatively, if the server locally configures 4 slices per cache, the corresponding push commitments of the 4 segments can be sent. For example, when the server pushes the fragment 2 to the fragment 5 to the client, the server caches more fragments, for example, the fragment 6 to the fragment 9 in the pending push fragment list, and the number of cached fragments. If four are satisfied, the server sends the corresponding push commitment of each of the fragments 6 to 9 to the client.
在本实施例中,当满足第二待定推送参数所指示的条件时,服务器就需要再发送一部分推送承诺,一方面避免每次发送过多的推送承诺,导致客户端的播放时延;另一方面及时的将后续分片的推送承诺发送给客户端,避免客户端由于没有及时收到服务器推送的分片导致的播放时延。In this embodiment, when the condition indicated by the second pending push parameter is met, the server needs to send a part of the push commitment again, on the one hand, avoiding sending too many push commitments each time, causing the client to play the delay; The push commitment of the subsequent fragments is sent to the client in time to avoid the playback delay caused by the client not receiving the fragment pushed by the server in time.
需要说明的是,这里只是举例说明了可能的第二待定推送参数,本发明对于第二待定推送参数的具体形式不做限定。It should be noted that the second pending push parameter is only exemplified herein, and the specific form of the second pending push parameter is not limited by the present invention.
其中,服务器向客户端发送的分片6至分片9的推送承诺的代码格式可以参考上述分片2至分片5的推送承诺的代码格式,此处不再赘述。服务器向客户端发送分片5如下面的代码8所示:The code format of the push commitment of the fragment 6 to the fragment 9 sent by the server to the client may refer to the code format of the push commitment of the fragment 2 to the fragment 5, and details are not described herein again. The server sends the fragment 5 to the client as shown in the following code 8:
代码8分片5Code 8 slice 5
Figure PCTCN2017105714-appb-000008
Figure PCTCN2017105714-appb-000008
如代码8所示,push-policy=“urn:mpeg:dash:fdh:2016:push-template”;“http://example/rendition1/segment{%03d}:{6-9}”表示服务器此次的推送策略为推送分片6至分片9。As shown in code 8, push-policy=“urn:mpeg:dash:fdh:2016:push-template”; “http://example/rendition1/segment{%03d}:{6-9}” means the server The next push strategy is to push slice 6 to slice 9.
可选的,服务器在向客户端发送分片5时,还可以携带待定推送指示信息,告知客户端会在后续发送剩余尚未发送推送承诺的分片的推送承诺。例如,若服务器在向客户端发送分片1时,指示本次推送的是分片2至分片5,同时携带了待定推送指示信息,那么服务器在向客户端发送分片5时,除了需要携带用于指示本次推送的是分片6至分片9的信息以外,还可以携带待定推送指示信息,已告知客户端继续等待接收剩余尚未发送推送承诺的分片的推送承诺。这种情况下,服务器向客户端发送分片5如下面的代码9所示:Optionally, when the server sends the fragment 5 to the client, the server may also carry the pending push indication information, and notify the client to send the push commitment of the remaining fragments that have not yet sent the push commitment. For example, if the server sends the fragment 1 to the client, indicating that the current push is the fragment 2 to the fragment 5, and carries the pending push indication information, the server sends the fragment 5 to the client, in addition to the need. In addition to the information indicating that the push is from slice 6 to slice 9, the push push indication information may be carried, and the client has been notified to continue to wait for the push commitment of the remaining slice that has not yet sent the push commitment. In this case, the server sends the fragment 5 to the client as shown in the following code 9:
代码9分片5 Code 9 slice 5
Figure PCTCN2017105714-appb-000009
Figure PCTCN2017105714-appb-000009
其中,“pending-push=true”为待定推送指示信息,表示服务器后续会对剩余尚未发送推送承诺的分片(即本例中的分片10至分片51)发送推送承诺。The "pending-push=true" is the pending push indication information, indicating that the server subsequently sends a push commitment to the remaining fragments that have not yet sent the push commitment (ie, the fragment 10 to the fragment 51 in this example).
此外,服务器还需要从待定推送分片列表中删除分片6至分片9的标识,同时将分片6至分片9的标识以及相应的流标识添加到已发送推送承诺且未推送的分片列表中。服务器在向客户端推送了分片5之后,将分片5的标识从已发送推送承诺且未推送的分片列表中删除,从而更新该列表。需要说明的是,当服务器中的待定推送分片列表中为空时,表明客户端请求推送的分片的推送承诺已经全部发送完,此时,服务器将无需再向客户端发送待定推送指示信息。In addition, the server also needs to delete the identifier of the fragment 6 to the fragment 9 from the pending push fragment list, and simultaneously add the identifier of the fragment 6 to the fragment 9 and the corresponding stream identifier to the score that has been sent and not pushed. In the slice list. After the server pushes the fragment 5 to the client, the server deletes the identifier of the fragment 5 from the fragment list that has sent the push commitment and has not been pushed, thereby updating the list. It should be noted that when the pending push fragment list in the server is empty, it indicates that the push commitment of the fragment requested by the client has been completely transmitted. At this time, the server will not need to send the pending push indication information to the client. .
需要说明的是,服务器向客户端依次发送分片6至分片9各自对应的推送承诺与服务器向客户端发送分片5这两个步骤的执行顺序不作具体限定。It should be noted that the order in which the server sends the corresponding push commitments from the fragment 6 to the fragment 9 to the client and the server sends the fragment 5 to the client is not specifically limited.
S409:客户端接收服务器依次发送的分片6对应的推送承诺、分片7对应的推送承诺、分片8对应的推送承诺、分片9对应的推送承诺以及分片5,处理并播放分片5。S409: The client receives the push commitment corresponding to the fragment 6 sent by the server, the push commitment corresponding to the fragment 7, the push commitment corresponding to the fragment 8, the push commitment corresponding to the fragment 9, and the fragment 5, and processes and plays the fragment. 5.
客户端首先接收到待推送分片中可推送分片中的每一个分片对应的推送承诺,根据推送承诺客户端可获知后续服务器将在哪个流中推送哪个分片,根据推送承诺中携带的分片标识以及分片对应的流标识,客户端可以更新已发送推送承诺且未推送的分片列表。例如,将分片6至分片9的标识以及分片6至分片9对应的流标识添加到客户端的已发送推送承诺且未推送的分片列表中,同时,将分片6至分片9的标识从客户端的待定推送分片列表中删除。The client first receives the push commitment corresponding to each of the pushable fragments in the to-be-pushed slice, and according to the push commitment client, the client can know which stream the subsequent server will push, according to the push commitment. The fragment identifier and the stream identifier corresponding to the fragment, the client can update the fragment list that has sent the push commitment and has not been pushed. For example, the identifier of the fragment 6 to the fragment 9 and the stream identifier corresponding to the fragment 6 to the fragment 9 are added to the fragment list of the client that has sent the push commitment and is not pushed, and at the same time, the fragment 6 to the fragment is segmented. The identity of 9 is removed from the client's pending push slice list.
之后,客户端处理并播放分片5,并等待接收服务器推送的分片6至分片9。Thereafter, the client processes and plays the slice 5 and waits for the slice 6 to slice 9 pushed by the receiving server.
可选的,若服务器发送了待定推送指示信息,客户端根据待定推送指示信息获知需要等待接收其他尚未发送推送承诺的分片的推送承诺。Optionally, if the server sends the pending push indication information, the client learns, according to the pending push indication information, that it needs to wait for receiving the push commitment of the other fragments that have not sent the push commitment.
S410:服务器向客户端推送最后一个已发送推送承诺且未推送的分片。S410: The server pushes the last fragment that has sent the push commitment and has not been pushed to the client.
需要说明的是,在步骤S410之前,服务器和客户端之间在一直重复步骤S407至步骤S409,直到满足步骤S410的条件。在本实施例中,最后一个已发送推送承诺且未推送的的分片应为分片51。It should be noted that, before step S410, steps S407 to S409 are repeated between the server and the client until the condition of step S410 is satisfied. In this embodiment, the last slice that has sent the push commitment and has not been pushed should be the slice 51.
S411:客户端接收服务器发送的最后一个已发送推送承诺且未推送的分片,处理并播放该分片,播放结束。S411: The client receives the last fragment that has been sent by the server and has not been pushed, and processes and plays the fragment, and the playback ends.
需要说明的是,如果分片51之后仍存在其他的分片并且客户端希望继续播放这部分分片时,可以重复本发明实施例中的步骤S401至S411即可,直到所有分片播放结束,这里不再进行重复描述。It should be noted that, if other fragments are still present after the fragment 51 and the client wishes to continue playing the partial fragment, the steps S401 to S411 in the embodiment of the present invention may be repeated until all the fragmentation ends. Repeated descriptions are not repeated here.
通过实施本发明实施例,服务器将客户端请求推送的分片划分为可推送分片和待定推送分片两部分,首先将可推送分片对应的推送承诺、待定推送指示信息以及客户端请求的分片发送给客户端,在后续推送分片的过程中,再将待定推送分片的推送承诺分批次地发送给客户端,以保证每次发送的推送承诺的数量不至于过多,避免了因为客户端请求推送的分片较 多而导致在接收请求的分片之前接收大量的推送承诺导致的时延较大的问题,因此减少了客户端的播放延迟。By implementing the embodiment of the present invention, the server divides the slice that the client requests to push into two parts: a pushable slice and a pending push slice, and firstly pushes the push commitment corresponding to the pushable slice, the pending push indication information, and the client request. The fragment is sent to the client, and in the process of subsequently pushing the fragment, the push commitment of the pending push fragment is sent to the client in batches to ensure that the number of push commitments sent each time is not excessive, avoiding Because the client requests to push the fragmentation There are many problems that result in a large delay caused by receiving a large number of push commitments before receiving the requested fragment, thus reducing the playback delay of the client.
按照现有技术,如果服务器上可以发送推送承诺的分片数量少于客户端请求推送的分片数量时,服务器只能发送可以发送推送承诺的分片的推送承诺,即使在可以发送推送承诺的分片全部推送之前,服务器上已经有更多的分片可推送时,这部分分片也不会再主动推送给客户端。客户端只能在接收完所有推送的分片之后再次发送分片请求消息去获取更多的分片。而在本发明实施例中,服务器根据当前缓存的分片分批次地向客户端发送推送承诺,并且客户端可以根据服务器发送的待定推送指示信息确定在后续过程中继续接收待定推送分片对应的推送承诺,因此无需再次针对已经请求推送的分片再次发送分片请求消息,节省了客户端再次发送分片请求消息的开销。According to the prior art, if the number of fragments on the server that can send push commitments is less than the number of fragments that the client requests to push, the server can only send push commitments for fragments that can send push commitments, even if a push commitment can be sent. Before the shards are all pushed, when there are more shards on the server that can be pushed, this part of the shards will not be actively pushed to the client. The client can only send the fragment request message again after receiving all the pushed fragments to obtain more fragments. In the embodiment of the present invention, the server sends a push commitment to the client according to the currently cached fragment, and the client may determine, according to the pending push indication information sent by the server, to continue to receive the pending push fragment in the subsequent process. Push commitment, so there is no need to send the fragment request message again for the fragment that has requested the push, which saves the overhead of the client sending the fragment request message again.
在一种可能的设计中,上述第一待定推送参数也可以由客户端设置,并且客户端将第一待定推送参数携带在分片1的分片请求消息中发送给服务器。服务器接收客户端发送的携带第一待定推送参数的分片请求消息,根据该第一待定推送参数将客户端请求推送的分片分为可推送分片和待定推送分片,且划分方式可以参见上述步骤S402的描述,此处不再赘述。In a possible design, the first pending push parameter may also be set by the client, and the client sends the first pending push parameter to the server in the slice request message of the slice 1. The server receives the fragment request message that is sent by the client and carries the first pending push parameter, and divides the fragment that the client requests to push into the pushable slice and the pending push slice according to the first pending push parameter, and the division manner can be referred to The description of the above step S402 will not be repeated here.
例如,客户端向服务器发送携带第一待定推送参数的分片请求消息可以如下面的代码10所示:For example, the client sends a fragment request message carrying the first pending push parameter to the server as shown in the following code 10:
代码10Code 10
Figure PCTCN2017105714-appb-000010
Figure PCTCN2017105714-appb-000010
其中,maxTotalNum=5作为第一待定推送参数,即客户端希望服务器立即发送推送承诺的可推送分片的数量最大为5个。Among them, maxTotalNum=5 is the first pending push parameter, that is, the maximum number of pushable fragments that the client wants the server to immediately send the push promise is five.
在一种可能的设计中,第二待定推送参数也可以由客户端设置,并且客户端将第二待定推送参数携带在分片1的分片请求消息中发送给服务器。服务器接收客户端发送的携带第二待定推送参数的分片请求消息,根据该第二待定推送参数确定何时将待定推送分片中的可推送分片对应的推送承诺发送给客户端,且确定方式可以参见上述步骤S407的描述,此处不再赘述。In a possible design, the second pending push parameter may also be set by the client, and the client sends the second pending push parameter in the slice request message of the slice 1 and sends it to the server. The server receives a fragmentation request message that is sent by the client and carries a second pending push parameter, and determines, according to the second pending push parameter, when to send the push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client, and determines For the manner, refer to the description of step S407 above, and details are not described herein again.
例如,客户端向服务器发送携带第一待定推送参数的分片请求消息可以如下面的代码9所示,其中,latestPush作为第二待定推送参数,即客户端希望服务器在推送最后一个已发送推送承诺且未推送的分片时再发送下一批可推送分片的推送承诺。For example, the client sends a fragment request message carrying the first pending push parameter to the server, as shown in the following code 9, wherein the latestPush is used as the second pending push parameter, that is, the client wants the server to push the last sent push promise. And the unsubmitted shards are sent the next batch of push promises that can push the shards.
需要说明的是,如果服务器本地配置有第一待定推送参数,则服务器需要结合本地的第一待定推送参数以及客户端发送的第一待定推送参数共同确定可推送分片。如服务器本地配置为一次最多发送4个推送承诺,而客户端发送的第一待定推送参数指示每次最少发送推送承诺的数量为5个,则服务器优先考虑自身的可推送能力,将可推送分片的数量确定为4个。 同样的,如果服务器本地配置有第二待定推送参数,则服务器需要结合本地的第二待定推送参数以及客户端发送的第二待定推送参数共同确定何时将待定推送分片中的可推送分片的推送承诺发送给客户端。It should be noted that if the server is configured with the first pending push parameter locally, the server needs to determine the pushable slice jointly by combining the first first pending push parameter and the first pending push parameter sent by the client. If the server is locally configured to send up to 4 push commitments at a time, and the first pending push parameter sent by the client indicates that the minimum number of push commitments sent each time is 5, the server prioritizes its own pushability and will be able to push points. The number of pieces is determined to be four. Similarly, if the server is configured with the second pending push parameter locally, the server needs to determine, together with the local second pending push parameter and the second pending push parameter sent by the client, when to push the sliceable slice in the pending push slice. The push promise is sent to the client.
针对步骤S403,服务器向客户端发送分片1时还可以携带第一待定推送参数和/或第二待定推送参数。例如,服务器向客户端发送分片1如代码11所示:For the step S403, when the server sends the fragment 1 to the client, the server may further carry the first pending push parameter and/or the second pending push parameter. For example, the server sends a slice 1 to the client as shown in code 11:
代码11分片1Code 11 slice 1
Figure PCTCN2017105714-appb-000011
Figure PCTCN2017105714-appb-000011
其中,pending-push-policy=“maxTotalNum=5&latestPush”为待定推送指示信息,用于指示客户端等待接收其他尚未发送推送承诺的分片各自对应的推送承诺,同时指示客户端服务器实际采用的第一待定推送参数和/或第二待定推送参数,即每次发送推送承诺帧的数量最大为5个,并且在推送最后一个已发送推送承诺且未推送的分片时发送下一批可推送分片的推送承诺。The pending-push-policy=“maxTotalNum=5&latestPush” is the pending push indication information, which is used to indicate that the client waits to receive the push commitment corresponding to the other fragments that have not sent the push commitment, and indicates that the client server actually uses the first The pending push parameter and/or the second pending push parameter, that is, the maximum number of push commitment frames per transmission is five, and the next batch of pushable fragments is sent when the last slice that has sent the push commitment and is not pushed is pushed. Push promise.
本发明实施例中,由客户端来设置第一待定推送参数和/或第二待定推送参数,与由服务器设置第一待定推送参数和/或第二待定推送参数的方式相比,可以提供更加灵活的推送方式,从而更加符合用户的实际体验需求。In the embodiment of the present invention, the first pending push parameter and/or the second pending push parameter are set by the client, and can be provided more than the method of setting the first pending push parameter and/or the second pending push parameter by the server. Flexible push method to better meet the user's actual experience needs.
上述实施例中是以正常播放完媒体资源中的全部分片的过程为例进行的说明,实际应用中,除了正常播放完整个媒体资源外,还会涉及中途取消播放的应用场景,例如用户中途不想继续收看,需要取消播放某个分片及之后的分片。在该场景中,以客户端处理并播放分片3,之后取消播放分片4以及分片4之后的全部分片为例进行说明,请参见图5,是本发明实施例提供的一种取消推送媒体分片的方法的流程示意图,该过程包括步骤S501-S510,其中步骤S501-S506可参见图4所示实施例中的步骤S401-S406,此处不再赘述。In the above embodiment, the process of normally playing all the pieces in the media resource is taken as an example. In the actual application, in addition to playing a complete media resource normally, an application scenario in which the mediation is cancelled in the middle is also involved, for example, the user is halfway. If you don't want to continue watching, you need to cancel playing a certain shard and subsequent shards. In this scenario, the client processes and plays the slice 3, and then cancels the playback of the slice 4 and the full-part slice after the slice 4 as an example. Referring to FIG. 5, it is a cancellation provided by the embodiment of the present invention. The flowchart of the method for pushing the media shards, the process includes the steps S501-S510, wherein the steps S501-S506 can refer to the steps S401-S406 in the embodiment shown in FIG. 4, and details are not described herein again.
S507:客户端向服务器发送针对分片4的取消推送请求消息。S507: The client sends a cancel push request message for the fragment 4 to the server.
具体的,客户端可以根据客户端的已发送推送承诺且未推送的分片列表中记录的分片4的流标识6发送取消推送请求消息。例如,服务器向客户端发送分片4的取消推送请求消息如下面的代码12所示:Specifically, the client may send a cancel push request message according to the stream identifier 6 of the fragment 4 recorded in the fragment list of the client that has sent the push commitment and is not pushed. For example, the server sends a cancel push request message for the slice 4 to the client as shown in the following code 12:
代码12分片4的取消推送请求消息 Code 12 slice 4 cancel push request message
Figure PCTCN2017105714-appb-000012
Figure PCTCN2017105714-appb-000012
其中,错误码CANCEL用于指示取消推送分片。Among them, the error code CANCEL is used to indicate that the push fragment is canceled.
可选的,客户端在确定取消推送分片4之后,还可以将客户端的已发送推送承诺且未推送的分片列表中记录的分片4的标识以及对应的流标识进行删除。Optionally, after determining that the push fragment 4 is canceled, the client may further delete the identifier of the fragment 4 recorded in the fragment list of the client that has sent the push commitment and is not pushed, and the corresponding stream identifier.
S508:服务器接收客户端发送的针对分片4的取消推送请求消息,取消向客户端推送分片4。S508: The server receives the cancel push request message sent by the client for the fragment 4, and cancels pushing the fragment 4 to the client.
服务器根据取消推送请求消息中携带的流标识6,确定客户端要取消推送与流标识6对应的分片http://example/rendition1/segment004,因此取消向客户端推送分片4。具体的,服务器从服务器的已发送推送承诺且未推送的分片列表中删除分片4的标识以及相应的流标识。The server determines that the client wants to cancel pushing the fragment corresponding to the stream identifier 6 http://example/rendition1/segment004 according to the stream identifier 6 carried in the cancel push request message, so the fragment 4 is pushed to the client. Specifically, the server deletes the identifier of the fragment 4 and the corresponding stream identifier from the fragment list of the server that has sent the push commitment and is not pushed.
S509:客户端向服务器发送针对分片5的取消推送请求消息。S509: The client sends a cancel push request message for the fragment 5 to the server.
具体的,客户端可以根据客户端的已发送推送承诺且未推送的分片列表中记录的分片5的流标识8发送取消推送请求消息。例如,服务器向客户端发送分片5的取消推送请求消息如下面的代码13所示:Specifically, the client may send a cancel push request message according to the flow identifier 8 of the fragment 5 recorded in the fragment list of the client that has sent the push commitment and is not pushed. For example, the server sends a cancel push request message for the slice 5 to the client as shown in the following code 13:
代码13分片5的取消推送请求消息Code 13 slice 5 cancel push request message
Figure PCTCN2017105714-appb-000013
Figure PCTCN2017105714-appb-000013
可选的,客户端在确定取消推送分片5之后,还可以将客户端的已发送推送承诺且未推送的分片列表中记录的分片5的标识以及对应的流标识进行删除。Optionally, after determining that the push fragment 5 is canceled, the client may also delete the identifier of the fragment 5 recorded in the fragment list of the client that has been sent and not pushed, and the corresponding stream identifier.
至此,客户端已经取消了所有已发送推送承诺且未推送的分片,同时已将客户端的已发送推送承诺且未推送的分片列表清空或删除。At this point, the client has canceled all the shards that have sent the push promise and have not been pushed, and has cleared or deleted the client's sent push promised and unpushed shard list.
此外,由于客户端不再继续播放媒体资源,因此客户端还需要将待定推送分片列表清空或删除。In addition, since the client does not continue to play media resources, the client also needs to clear or delete the pending push fragment list.
S510:服务器接收客户端发送的针对分片5的取消推送请求消息,取消向客户端推送分片5。S510: The server receives the cancel push request message sent by the client for the fragment 5, and cancels pushing the fragment 5 to the client.
服务器根据取消推送请求消息中携带的流标识8,确定客户端要取消推送与流标识8对应的分片http://example/rendition1/segment005,因此取消向客户端推送分片5。具体的,服务器从已发送推送承诺且未推送的分片列表中删除分片5的标识以及相应的流标识。The server determines that the client wants to cancel pushing the fragment corresponding to the flow identifier 8 http://example/rendition1/segment005 according to the flow identifier 8 carried in the cancel push request message, so the fragment 5 is pushed to the client. Specifically, the server deletes the identifier of the fragment 5 and the corresponding stream identifier from the fragment list that has sent the push commitment and has not been pushed.
至此,服务器的已发送推送承诺且未推送的分片列表中已为空。At this point, the server's sent push commitments and the unpushed fragment list are empty.
S511:服务器根据服务器的已发送推送承诺且未推送的分片列表中已为空,确定需要取消向客户端推送尚未发送推送承诺的分片。S511: The server determines that it is necessary to cancel the fragment that has not sent the push commitment to the client according to the server's sent push commitment and the unpushed fragment list is empty.
具体的,服务器在判断出服务器的已发送推送承诺且未推送的分片列表中为空后,确定客户端不想再继续播放媒体资源,因此同时取消向客户端推送尚未发送推送承诺的分片。具体的,服务器将待定推送分片列表清空或删除,从而不再向客户端推送尚未发送推送承诺的 分片。Specifically, after the server determines that the server has sent the push commitment and the un-pushed fragment list is empty, it is determined that the client does not want to continue playing the media resource, and therefore, the fragment that has not sent the push commitment is pushed to the client at the same time. Specifically, the server clears or deletes the pending push fragment list, so that the push commitment is not sent to the client yet. Fragmentation.
在本发明实施例中,服务器端可以通过客户端取消了所有已发送推送承诺且未推送的分片来间接确定取消向客户端推送尚未发送推送承诺的分片。In the embodiment of the present invention, the server may indirectly determine to cancel the fragment that has not sent the push commitment to the client by canceling all the fragments that have been sent and not pushed by the client.
现有技术中,服务器一次性将客户端请求的分片的推送承诺都发送给客户端,因此,当客户端如果想要取消服务器已发送推送承诺的分片时,需要针对每个分片发送一次取消推送请求消息,请求消息中携带要取消的分片所对应的流标识。当用户观看一部电影时,如果服务器端已发送推送承诺的分片比较多,但是用户突然不想继续观看时,客户端需要针对已发送推送承诺且未推送的分片逐个发送取消推送请求消息,开销比较大。而在本发明实施例中,由于服务器是分批次地发送推送承诺,因此客户端中途取消播放时,只需要针对已发送推送承诺且未推送的分片逐一发送取消推送请求消息即可,而不需要针对尚未发送推送承诺的分片发送取消推送请求消息,节省了客户端发送大量取消推送请求消息的开销。In the prior art, the server sends the push commitment of the fragment requested by the client to the client at one time. Therefore, when the client wants to cancel the fragment that the server has sent the push commitment, it needs to send for each fragment. The push request message is canceled once, and the request message carries the flow identifier corresponding to the fragment to be cancelled. When a user watches a movie, if the server has sent a lot of push commitments, but the user suddenly does not want to continue watching, the client needs to send a cancel push request message one by one for the slice that has been sent and not pushed. The cost is relatively large. In the embodiment of the present invention, since the server sends the push commitment in batches, when the client cancels the play midway, only the cancel push request message needs to be sent one by one for the fragments that have been pushed and not pushed. There is no need to send a cancel push request message for a slice that has not yet sent a push commitment, which saves the overhead of the client sending a large number of cancel push request messages.
此外,客户端也可以通过在某个取消推送请求消息中增加取消待定推送指示信息来指示服务器在取消推送某个分片时,同时取消推送尚未发送推送承诺的分片。其中取消待定推送指示信息的格式在本发明实施例中不作具体限定。此时需要定义一种新的状态码,Error Code=CANCEL PENDING,该状态码作为一种示例,而非限定。以客户端在分片4的取消推送请求消息中携带取消待定推送指示信息为例进行说明,服务器向客户端发送分片4的取消推送请求消息如下面的代码14所示:In addition, the client may also instruct the server to cancel pushing a fragment of the push commitment when canceling pushing a certain fragment by adding a cancellation pending push indication message to a cancel push request message. The format of the canceling the push indication information is not specifically limited in the embodiment of the present invention. At this point, you need to define a new status code, Error Code=CANCEL PENDING, which is an example and not a limitation. The client sends the cancel push push indication information in the cancel push request message of the fragment 4 as an example. The server sends the cancel push request message of the fragment 4 to the client as shown in the following code 14:
代码14分片4的取消推送请求消息Code 14 slice 4 cancel push request message
Figure PCTCN2017105714-appb-000014
Figure PCTCN2017105714-appb-000014
其中,错误码CANCEL PENDING用于指示取消推送尚未发送推送承诺的分片。Among them, the error code CANCEL PENDING is used to indicate that the shard that has not yet sent the push promise is canceled.
服务器收到错误码为CANCEL PENDING的取消推送请求消息后,不仅需要取消推送STREAM ID=6对应的分片http://example/rendition1/segment004,同时还要取消向客户端推送尚未发送推送承诺的分片。After receiving the cancel push request message with the error code CANCEL PENDING, the server not only needs to cancel the push of the fragment corresponding to STREAM ID=6, http://example/rendition1/segment004, but also cancels pushing the push promise to the client. Fragmentation.
具体的,服务器取消向客户端推送尚未发送推送承诺的分片具体为:服务器将服务器的待定推送分片列表清空或删除。Specifically, the server cancels the fragment that has not sent the push commitment to the client, specifically: the server clears or deletes the pending push fragmentation list of the server.
本发明实施例中,客户端可以在发送的某一取消推送请求消息中携带取消待定推送指示信息,服务器根据取消待定推送指示信息,确定需要取消向客户端推送尚未发送推送承诺的分片。相较于服务器根据客户端取消推送所有已发送推送承诺且未推送的分片,来间接确定取消向客户端推送尚未发送推送承诺的分片的方式,本发明实施例可以避免服务器在接收最后一个已发送推送承诺且未推送的分片的取消推送请求消息之前,服务器就已将待定推送分片中可推送的分片对应的推送承诺发送给客户端造成的开销,使得取消操作更加的及时In the embodiment of the present invention, the client may carry the cancel pending push indication information in a certain cancel push request message, and the server determines, according to the cancel pending push indication information, that the fragment that has not yet sent the push commitment to be pushed to the client needs to be canceled. The embodiment of the present invention can prevent the server from receiving the last one, as compared with the manner in which the server cancels the push of all the sent push promises that have not been pushed by the client, and indirectly determines the manner of canceling the push of the fragment that has not yet sent the push commitment to the client. Before the cancel push request message of the slice that has been pushed and not pushed, the server has sent the push commitment corresponding to the pushable slice in the pending push slice to the client, so that the cancel operation is more timely.
本发明实施例还描述了与上述图4所述方法实施例属于同一发明构思下的一种服务器的结构示意图。如图6所示,该服务器600用于执行图4上述方法实施例中服务器的功能,包括:接收单元601,处理单元602和发送单元603。 The embodiment of the invention also describes a schematic structural diagram of a server under the same inventive concept as the method embodiment shown in FIG. 4 above. As shown in FIG. 6, the server 600 is configured to perform the functions of the server in the foregoing method embodiment of FIG. 4, and includes: a receiving unit 601, a processing unit 602, and a sending unit 603.
其中,接收单元601,用于接收客户端发送的分片请求消息,所述分片请求消息包括请求分片标识和推送指令,所述推送指令用于指示所述客户端请求推送的分片;处理单元602,用于根据所述客户端请求推送的分片,确定可推送分片和待定推送分片;发送单元603,用于向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息,所述待定推送指示信息用于指示所述客户端等待接收所述待定推送分片的推送承诺。The receiving unit 601 is configured to receive a fragment request message sent by the client, where the fragment request message includes a request fragment identifier and a push instruction, where the push instruction is used to indicate that the client requests the pushed fragment; The processing unit 602 is configured to determine, according to the slice that the client requests to push, the pushable slice and the pending push slice, and the sending unit 603 is configured to send, to the client, each of the pushable segments. The push commitment corresponding to the slice, the fragment corresponding to the request fragment identifier, and the pending push indication information, where the pending push indication information is used to indicate that the client waits to receive the push commitment of the pending push slice.
可选的,所述处理单元602,用于根据所述客户端请求推送的分片,确定可推送分片和待定推送分片,具体为:根据第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片;其中,所述第一待定推送参数为所述服务器本地配置的或者所述分片请求消息中携带的。Optionally, the processing unit 602 is configured to determine, according to the fragment that is sent by the client, the pushable fragment and the pending push fragment, where the client sends a request according to the first pending push parameter. The shards are divided into the pushable shards and the to-be-scheduled shards; wherein the first pending push parameters are carried locally in the server or carried in the fragment request message.
可选的,所述处理单元602,用于根据第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片,具体为:Optionally, the processing unit 602 is configured to divide, according to the first pending push parameter, the slice that the client requests to push into the pushable slice and the to-be-sent push slice, specifically:
所述第一待定推送参数为推送阈值,确定所述客户端请求推送的分片中第1个分片至第N个分片为所述可推送分片,并将所述客户端请求推送的分片中除所述可推送分片以外的其他分片确定为所述待定推送分片,其中N为由所述推送阈值确定的正整数;或者,The first pending push parameter is a push threshold, and determining that the first slice to the Nth slice of the slice that the client requests to push are the pushable slice, and the client requests the push The other fragments in the slice other than the pushable slice are determined as the pending push slice, where N is a positive integer determined by the push threshold; or
所述第一待定推送参数为随机指示符,根据所述随机指示符,将所述客户端请求推送的分片中已缓存的分片确定为所述可推送分片,并将所述客户端请求推送的分片中除所述可推送分片以外的其他分片确定为所述待定推送分片。The first pending push parameter is a random indicator, and according to the random indicator, the cached slice in the slice that the client requests to push is determined as the pushable slice, and the client is The slice other than the pushable slice in the slice requested to be pushed is determined as the pending push slice.
可选的,在所述发送单元603向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,Optionally, after the sending unit 603 sends, to the client, the push commitment corresponding to each fragment in the pushable fragment, the fragment corresponding to the requested fragment identifier, and the pending push indication information,
所述处理单元602,还用于根据所述第一待定推送参数,确定所述待定推送分片中的可推送分片;The processing unit 602 is further configured to determine, according to the first pending push parameter, a pushable slice in the pending push slice;
所述发送单元603,还用于根据所述第二待定推送参数,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端,所述待定推送分片中的可推送分片为所述待定推送分片中的部分或全部分片;其中,所述第二待定推送参数用于指示所述服务器向所述客户端发送所述待定推送分片中的可推送分片的推送承诺的条件,且所述第二待定推送参数为所述服务器本地配置的或者所述分片请求消息中携带的。The sending unit 603 is further configured to send, according to the second pending push parameter, a push commitment corresponding to the pushable slice in the to-be-sent push slice to the client, where the pending push slice is in the The pushable fragment is a partial or full partial slice of the pending push slice; wherein the second pending push parameter is used to instruct the server to send the pushable in the pending push slice to the client The conditions of the push commitment of the fragment, and the second pending push parameter is carried in the server or configured in the fragment request message.
可选的,所述发送单元603,用于根据第二待定推送参数,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端,具体为:Optionally, the sending unit 603 is configured to send, according to the second pending push parameter, a push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client, specifically:
当已发送推送承诺且未推送的分片的剩余数量小于第一预设数量时,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端;或者,Sending, to the client, a push commitment corresponding to the pushable slice in the to-be-sent push slice when the remaining number of the shards that have been pushed and not pushed is less than the first preset number; or
当所述待定推送分片中包含满足第二预设数量的已缓存分片时,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端。And sending, to the client, a push commitment corresponding to the pushable slice in the to-be-sent push slice, when the to-be-scheduled push slice includes the cached slice that meets the second preset number.
可选的,在所述发送单元603向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,Optionally, after the sending unit 603 sends, to the client, the push commitment corresponding to each fragment in the pushable fragment, the fragment corresponding to the requested fragment identifier, and the pending push indication information,
所述接收单元601,还用于接收所述客户端针对已发送推送承诺且未推送的分片逐一发送的取消推送请求消息;The receiving unit 601 is further configured to receive, by the client, a cancel push request message that is sent one by one for the fragment that has sent the push commitment and is not pushed;
所述处理单元602,还用于根据所述取消推送请求消息,取消向所述客户端推送所述已发送推送承诺且未推送的分片;当所述处理单元602取消所有向所述客户端推送所述已发送 推送承诺且未推送的分片之后,所述处理单元602还用于取消向所述客户端推送尚未发送推送承诺的分片。The processing unit 602 is further configured to cancel, according to the cancel push request message, a slice that is pushed to the client and that is not pushed, and when the processing unit 602 cancels all the Push the sent After the shard that is committed and not pushed, the processing unit 602 is further configured to cancel pushing the shard that has not sent the push commitment to the client.
可选的,在所述发送单元603向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,Optionally, after the sending unit 603 sends, to the client, the push commitment corresponding to each fragment in the pushable fragment, the fragment corresponding to the requested fragment identifier, and the pending push indication information,
所述接收单元601,还用于接收所述客户端针对目标分片发送的取消推送请求消息,所述目标分片为任一已发送推送承诺且未推送的分片,所述取消推送请求消息中包括取消待定推送指示信息,所述取消待定推送指示信息用于指示所述服务器取消向所述客户端推送尚未发送推送承诺的分片;The receiving unit 601 is further configured to receive a cancel push request message sent by the client for the target fragment, where the target fragment is any fragment that has sent a push commitment and is not pushed, and the cancel push request message The canceling the push indication information is used to indicate that the server cancels pushing the shard that has not sent the push commitment to the client;
所述处理单元602,还用于根据所述取消推送请求消息,取消向所述客户端推送所述目标分片,以及取消向所述客户端推送尚未发送推送承诺的分片。The processing unit 602 is further configured to cancel pushing the target fragment to the client according to the cancel push request message, and cancel pushing, to the client, a fragment that has not sent a push commitment.
在本实施例中,服务器600是以功能单元的形式来呈现。这里的“单元”可以指ASIC电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到服务器600可以采用图3所示的形式。接收单元601、处理单元602和发送单元603可以通过图3的处理器和存储器来实现。In the present embodiment, the server 600 is presented in the form of a functional unit. A "unit" herein may refer to an ASIC circuit, a processor and memory that executes one or more software or firmware programs, integrated logic circuits, and/or other devices that provide the functionality described above. In a simple embodiment, those skilled in the art will appreciate that server 600 can take the form shown in FIG. The receiving unit 601, the processing unit 602, and the transmitting unit 603 can be implemented by the processor and memory of FIG.
本发明实施例还描述了与上述图4所述方法实施例属于同一发明构思下的一种客户端的结构示意图。如图7所示,该客户端700用于执行图4上述方法实施例中客户端的功能,包括:发送单元701和接收单元702。The embodiment of the present invention further describes a structure of a client according to the same inventive concept as the method embodiment shown in FIG. 4 above. As shown in FIG. 7, the client 700 is configured to perform the functions of the client in the foregoing method embodiment of FIG. 4, including: a sending unit 701 and a receiving unit 702.
其中,发送单元701,用于向服务器发送分片请求消息,所述分片请求消息包括请求分片标识和推送指令,所述推送指令用于指示所述客户端请求推送的分片;接收单元702,用于接收所述服务器发送的可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息,所述待定推送指示信息用于指示所述客户端等待接收所述客户端请求推送的分片中除所述可推送分片以外的待定推送分片的推送承诺。The sending unit 701 is configured to send a fragmentation request message to the server, where the fragmentation request message includes a request fragment identifier and a push instruction, where the push instruction is used to indicate that the client requests the pushed fragment; the receiving unit 702. The device is configured to receive a push commitment corresponding to each of the shards sent by the server, a shard corresponding to the request shard identifier, and a pending push indication information, where the pending push indication information is used to indicate The client waits to receive a push commitment of the pending push slice other than the pushable slice in the slice requested by the client.
可选的,所述分片请求消息中还包括第一待定推送参数,所述第一待定推送参数用于指示所述服务器根据所述第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片。Optionally, the fragment request message further includes a first pending push parameter, where the first pending push parameter is used to instruct the server to send the fragment requested by the client according to the first pending push parameter. Divided into the pushable slice and the pending push slice.
可选的,所述第一待定推送参数包括用于指示可推送分片数量的推送阈值或者用于指示所述服务器将已缓存的分片确定为可推送分片的随机指示符。Optionally, the first pending push parameter includes a push threshold for indicating a number of pushable slices or a random indicator for indicating that the server determines the cached slice as a pushable slice.
可选的,在所述接收单元702接收所述服务器发送的可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,Optionally, after the receiving unit 702 receives the push commitment corresponding to each of the pushable fragments sent by the server, the fragment corresponding to the requested fragment identifier, and the pending push indication information,
所述接收单元702,还用于接收所述服务器发送的所述待定推送分片中的可推送分片对应的推送承诺,所述待定推送分片中的可推送分片为所述待定推送分片中的部分或全部分片。The receiving unit 702 is further configured to receive a push commitment corresponding to the pushable slice in the to-be-sent push slice sent by the server, where the pushable slice in the pending push slice is the to-be-sent push score Part or all of the pieces in the film.
可选的,所述分片请求消息中还包括第二待定推送参数,所述第二待定推送参数用于指示所述服务器根据所述第二待定推送参数确定发送所述待定推送分片中的可推送分片对应的推送承诺的条件。Optionally, the fragment request message further includes a second pending push parameter, where the second pending push parameter is used to indicate that the server determines to send the pending push slice according to the second pending push parameter. The conditions of the push commitment corresponding to the slice can be pushed.
可选的,在所述接收单元702接收所述服务器发送的可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,Optionally, after the receiving unit 702 receives the push commitment corresponding to each of the pushable fragments sent by the server, the fragment corresponding to the requested fragment identifier, and the pending push indication information,
所述发送单元701,还用于针对目标分片向所述服务器发送取消推送请求消息,所述目标分片为任一已发送推送承诺且未推送的分片,所述取消推送请求消息中包括取消待定推送 指示信息,所述取消待定推送指示信息用于指示所述服务器取消向所述客户端推送尚未发送推送承诺的分片。The sending unit 701 is further configured to send, to the server, a cancel push request message, where the target fragment is any fragment that has sent a push commitment and is not pushed, and the cancel push request message includes Cancel pending push Instructing information, the cancel pending push indication information is used to instruct the server to cancel pushing a slice that has not sent a push commitment to the client.
在本实施例中,客户端700是以功能单元的形式来呈现。这里的“单元”可以指ASIC电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到客户端700可以采用图3所示的形式。发送单元701和接收单元702可以通过图3的处理器和存储器来实现。In this embodiment, client 700 is presented in the form of a functional unit. A "unit" herein may refer to an ASIC circuit, a processor and memory that executes one or more software or firmware programs, integrated logic circuits, and/or other devices that provide the functionality described above. In a simple embodiment, those skilled in the art will appreciate that client 700 can take the form shown in FIG. The transmitting unit 701 and the receiving unit 702 can be implemented by the processor and the memory of FIG.
本发明实施例还提供了一种计算机存储介质,用于储存为上述图6所示的服务器所用的计算机软件指令,其包含用于执行上述方法实施例所设计的程序。通过执行存储的程序,可以实现推送承诺的发送。The embodiment of the present invention further provides a computer storage medium for storing computer software instructions used by the server shown in FIG. 6 above, which includes a program designed to execute the foregoing method embodiments. The delivery of the push promise can be achieved by executing the stored program.
本发明实施例还提供了另一种计算机存储介质,用于储存为上述图7所述的客户端所用的计算机软件指令,其包含用于执行上述方法实施例所设计的程序。通过执行存储的程序,可以实现推送承诺的接收。The embodiment of the present invention further provides another computer storage medium for storing computer software instructions used by the client described in FIG. 7 above, which includes a program designed to execute the foregoing method embodiments. The reception of the push promise can be achieved by executing the stored program.
尽管在此结合各实施例对本发明进行了描述,然而,在实施所要求保护的本发明过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。Although the present invention has been described herein in connection with the embodiments of the present invention, it will be understood by those skilled in the <RTIgt; Other variations of the disclosed embodiments are achieved. In the claims, the <RTI ID=0.0>"comprises" </ RTI> </ RTI> does not exclude other components or steps. A single processor or other unit may fulfill several of the functions recited in the claims. Certain measures are recited in mutually different dependent claims, but this does not mean that the measures are not combined to produce a good effect.
本领域技术人员应明白,本发明的实施例可提供为方法、装置(设备)、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机程序存储/分布在合适的介质中,与其它硬件一起提供或作为硬件的一部分,也可以采用其他分布形式,如通过因特网(Internet)或其它有线或无线电信系统。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code. The computer program is stored/distributed in a suitable medium, provided with other hardware or as part of hardware, or in other distributed forms, such as through the Internet or other wired or wireless telecommunication systems.
本发明是参照本发明实施例的方法、装置(设备)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of the methods, apparatus, and computer program products of the embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管结合具体特征及其实施例对本发明进行了描述,显而易见的,在不脱离本发明的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利 要求所界定的本发明的示例性说明,且视为已覆盖本发明范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 While the invention has been described with respect to the specific embodiments and embodiments thereof, various modifications and combinations may be made without departing from the spirit and scope of the invention. Accordingly, the specification and drawings are only attached The exemplifications of the present invention are intended to be illustrative, and are intended to cover any and all modifications, variations, It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims (26)

  1. 一种媒体分片的推送方法,其特征在于,包括:A method for pushing a media slice, characterized in that it comprises:
    服务器接收客户端发送的分片请求消息,所述分片请求消息包括请求分片标识和推送指令,所述推送指令用于指示所述客户端请求推送的分片;Receiving, by the server, a fragmentation request message sent by the client, where the fragmentation request message includes a request fragment identifier and a push instruction, where the push instruction is used to indicate that the client requests the pushed fragment;
    所述服务器根据所述客户端请求推送的分片,确定可推送分片和待定推送分片;Determining, by the server, the pushable slice and the pending push slice according to the slice that the client requests to push;
    所述服务器向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息,所述待定推送指示信息用于指示所述客户端等待接收所述待定推送分片的推送承诺。The server sends, to the client, a push commitment corresponding to each of the shards, a shard corresponding to the request shard identifier, and a pending push indication information, where the pending push indication information is used to indicate The client waits to receive a push commitment of the pending push slice.
  2. 根据权利要求1所述的方法,其特征在于,所述服务器根据所述客户端请求推送的分片,确定可推送分片和待定推送分片,包括:The method according to claim 1, wherein the server determines the pushable slice and the pending push slice according to the slice that the client requests to push, including:
    所述服务器根据第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片;其中,所述第一待定推送参数为所述服务器本地配置的或者所述分片请求消息中携带的。The server divides the fragment that the client requests to push into the pushable fragment and the pending push fragment according to the first pending push parameter; wherein the first pending push parameter is the server local configuration Or carried in the fragment request message.
  3. 根据权利要求2所述的方法,其特征在于,所述服务器根据第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片,具体为:The method according to claim 2, wherein the server divides the slice that the client requests to push into the pushable slice and the pending push slice according to the first pending push parameter, specifically :
    所述第一待定推送参数为推送阈值,所述服务器确定所述客户端请求推送的分片中第1个分片至第N个分片为所述可推送分片,并将所述客户端请求推送的分片中除所述可推送分片以外的其他分片确定为所述待定推送分片,其中N为由所述推送阈值确定的正整数;或者,The first pending push parameter is a push threshold, and the server determines that the first slice to the Nth slice of the slice that the client requests to push are the pushable slice, and the client is The other pieces of the slice requested to be pushed except the pushable slice are determined as the pending push slice, where N is a positive integer determined by the push threshold; or
    所述第一待定推送参数为随机指示符,所述服务器根据所述随机指示符,将所述客户端请求推送的分片中已缓存的分片确定为所述可推送分片,并将所述客户端请求推送的分片中除所述可推送分片以外的其他分片确定为所述待定推送分片。The first pending push parameter is a random indicator, and the server determines, according to the random indicator, the cached slice in the slice that the client requests to push as the pushable slice, and The slice other than the pushable slice in the slice requested by the client is determined as the pending push slice.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述服务器向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,还包括:The method according to any one of claims 1 to 3, wherein the server sends, to the client, a push commitment corresponding to each fragment of the pushable fragment, and the request fragment identifier corresponds to After the sharding and pending push instructions, it also includes:
    所述服务器根据所述第一待定推送参数,确定所述待定推送分片中的可推送分片;Determining, by the server, the pushable fragments in the pending push slice according to the first pending push parameter;
    所述服务器根据第二待定推送参数,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端,所述待定推送分片中的可推送分片为所述待定推送分片中的部分或全部分片;其中,所述第二待定推送参数用于指示所述服务器向所述客户端发送所述待定推送分片中的可推送分片的推送承诺的条件,且所述第二待定推送参数为所述服务器本地配置的或者所述分片请求消息中携带的。Sending, by the server, a push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client according to the second pending push parameter, where the pushable slice in the pending push slice is the to-be-determined Pushing a partial or full partial slice in the slice; wherein the second pending push parameter is used to instruct the server to send, to the client, a condition of a push commitment of the pushable slice in the pending push slice, And the second pending push parameter is carried locally in the server or carried in the fragment request message.
  5. 根据权利要求4所述的方法,其特征在于,所述服务器根据第二待定推送参数,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端,具体为:The method according to claim 4, wherein the server sends a push commitment corresponding to the pushable slice in the pending push slice to the client according to the second pending push parameter, specifically:
    确定已发送推送承诺且未推送的分片的剩余数量小于第一预设数量,所述服务器将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端;或者, Determining that the remaining number of the shards that have been sent and not pushed is less than the first preset number, the server sends the push commitment corresponding to the pushable shards in the pending push shards to the client; or
    确定所述待定推送分片中包含满足第二预设数量的已缓存分片,所述服务器将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端。Determining that the pending push slice includes a cached slice that meets a second preset number, and the server sends a push commitment corresponding to the pushable slice in the pending push slice to the client.
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述服务器向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,还包括:The method according to any one of claims 1 to 5, wherein the server sends a push commitment corresponding to each fragment of the pushable fragment to the client, and the request fragment identifier corresponds to After the sharding and pending push instructions, it also includes:
    所述服务器接收所述客户端针对已发送推送承诺且未推送的分片逐一发送的取消推送请求消息;Receiving, by the server, a cancel push request message sent by the client one by one for a fragment that has sent a push commitment and is not pushed;
    所述服务器根据所述取消推送请求消息,取消向所述客户端推送所述已发送推送承诺且未推送的分片;The server cancels, according to the cancel push request message, a slice that has pushed the pushed push commitment and is not pushed to the client;
    所述服务器确定取消所有向所述客户端推送所述已发送推送承诺且未推送的分片之后,所述服务器取消向所述客户端推送尚未发送推送承诺的分片。After the server determines to cancel all the shards that have pushed the sent push commitment to the client and has not pushed, the server cancels pushing the shard that has not sent the push commitment to the client.
  7. 根据权利要求1至5任一项所述的方法,其特征在于,所述服务器向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,还包括:The method according to any one of claims 1 to 5, wherein the server sends a push commitment corresponding to each fragment of the pushable fragment to the client, and the request fragment identifier corresponds to After the sharding and pending push instructions, it also includes:
    所述服务器接收所述客户端针对目标分片发送的取消推送请求消息,所述目标分片为任一已发送推送承诺且未推送的分片,所述取消推送请求消息中包括取消待定推送指示信息,所述取消待定推送指示信息用于指示所述服务器取消向所述客户端推送尚未发送推送承诺的分片;The server receives the cancel push request message sent by the client for the target fragment, where the target fragment is any fragment that has sent the push commitment and is not pushed, and the cancel push request message includes canceling the pending push indication. Information, the cancel pending push indication information is used to instruct the server to cancel pushing a slice that has not sent a push commitment to the client;
    所述服务器根据所述取消推送请求消息,取消向所述客户端推送所述目标分片,以及取消向所述客户端推送尚未发送推送承诺的分片。The server cancels pushing the target shard to the client according to the cancel push request message, and cancels pushing the shard that has not sent the push commitment to the client.
  8. 一种媒体分片的推送方法,其特征在于,包括:A method for pushing a media slice, characterized in that it comprises:
    客户端向服务器发送分片请求消息,所述分片请求消息包括请求分片标识和推送指令,所述推送指令用于指示所述客户端请求推送的分片;The client sends a fragmentation request message to the server, where the fragmentation request message includes a request fragment identifier and a push instruction, where the push instruction is used to indicate that the client requests the pushed fragment;
    所述客户端接收所述服务器发送的可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息,所述待定推送指示信息用于指示所述客户端等待接收待定推送分片的推送承诺,其中,所述待定推送分片为所述客户端请求推送的分片中除所述可推送分片以外的分片。The client receives a push commitment corresponding to each of the shards sent by the server, a shard corresponding to the request shard identifier, and a pending push indication information, where the pending push indication information is used to indicate The client waits to receive a push commitment of a pending push slice, wherein the pending push slice is a slice other than the pushable slice in the slice that the client requests to push.
  9. 根据权利要求8所述的方法,其特征在于,所述分片请求消息中还包括第一待定推送参数,所述第一待定推送参数用于指示所述服务器根据所述第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片。The method according to claim 8, wherein the fragment request message further includes a first pending push parameter, wherein the first pending push parameter is used to indicate that the server is to be based on the first pending push parameter The slice requested by the client is divided into the pushable slice and the pending push slice.
  10. 根据权利要求9所述的方法,其特征在于,所述第一待定推送参数包括用于指示可推送分片数量的推送阈值或者用于指示所述服务器将已缓存的分片确定为可推送分片的随机指示符。The method according to claim 9, wherein said first pending push parameter comprises a push threshold for indicating a number of pushable slices or for instructing said server to determine a cached slice as a pushable score A random indicator of the slice.
  11. 根据权利要求8至10任一项所述的方法,其特征在于,所述客户端接收所述服务器 发送的可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,还包括:The method according to any one of claims 8 to 10, wherein the client receives the server After the push commitment corresponding to each of the sent shards, the shard corresponding to the request shard identifier, and the pending push indication information, the method further includes:
    所述客户端接收所述服务器发送的所述待定推送分片中的可推送分片对应的推送承诺,所述待定推送分片中的可推送分片为所述待定推送分片中的部分或全部分片。Receiving, by the client, a push commitment corresponding to the pushable slice in the pending push slice sent by the server, where the pushable slice in the pending push slice is part of the pending push slice or Full part of the film.
  12. 根据权利要求11所述的方法,其特征在于,所述分片请求消息中还包括第二待定推送参数,所述第二待定推送参数用于指示所述服务器根据所述第二待定推送参数确定发送所述待定推送分片中的可推送分片对应的推送承诺的条件。The method according to claim 11, wherein the fragment request message further includes a second pending push parameter, wherein the second pending push parameter is used to instruct the server to determine according to the second pending push parameter. Sending a condition of the push commitment corresponding to the pushable slice in the pending push slice.
  13. 根据权利要求8至12任一项所述的方法,其特征在于,所述客户端接收所述服务器发送的可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,还包括:The method according to any one of claims 8 to 12, wherein the client receives a push commitment corresponding to each of the shards sent by the server, and the request fragment identifier corresponds to After the sharding and the pending push information, it also includes:
    所述客户端针对目标分片向所述服务器发送取消推送请求消息,所述目标分片为任一已发送推送承诺且未推送的分片,所述取消推送请求消息中包括取消待定推送指示信息,所述取消待定推送指示信息用于指示所述服务器取消向所述客户端推送尚未发送推送承诺的分片。The client sends a cancel push request message to the server for the target fragment, where the target fragment is any fragment that has sent a push commitment and is not pushed, and the cancel push request message includes canceling the pending push indication information. And the cancel pending push indication information is used to instruct the server to cancel pushing the fragment that has not sent the push commitment to the client.
  14. 一种服务器,其特征在于,包括:A server, comprising:
    接收单元,用于接收客户端发送的分片请求消息,所述分片请求消息包括请求分片标识和推送指令,所述推送指令用于指示所述客户端请求推送的分片;a receiving unit, configured to receive a fragmentation request message sent by the client, where the fragmentation request message includes a request fragment identifier and a push instruction, where the push instruction is used to indicate that the client requests the pushed fragment;
    处理单元,用于根据所述客户端请求推送的分片,确定可推送分片和待定推送分片;a processing unit, configured to determine a pushable slice and a pending push slice according to the slice that the client requests to be pushed;
    发送单元,用于向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息,所述待定推送指示信息用于指示所述客户端等待接收所述待定推送分片的推送承诺。a sending unit, configured to send, to the client, a push commitment corresponding to each fragment of the pushable fragment, a fragment corresponding to the requested fragment identifier, and a pending push indication information, where the pending push indication information is used And instructing the client to wait for receiving the push commitment of the pending push slice.
  15. 根据权利要求14所述的服务器,其特征在于,所述处理单元,用于根据所述客户端请求推送的分片,确定可推送分片和待定推送分片,具体为:The server according to claim 14, wherein the processing unit is configured to determine a pushable slice and a pending push slice according to the slice that the client requests to push, specifically:
    根据第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片;其中,所述第一待定推送参数为所述服务器本地配置的或者所述分片请求消息中携带的。Dividing the fragment that the client requests to push into the pushable fragment and the pending push fragment according to the first pending push parameter; wherein the first pending push parameter is locally configured or The fragmentation request message is carried in the message.
  16. 根据权利要求15所述的服务器,其特征在于,所述处理单元,用于根据第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片,具体为:The server according to claim 15, wherein the processing unit is configured to divide, according to the first pending push parameter, the slice that the client requests to push into the pushable slice and the to-be-sent push The film is specifically:
    所述第一待定推送参数为推送阈值,确定所述客户端请求推送的分片中第1个分片至第N个分片为所述可推送分片,并将所述客户端请求推送的分片中除所述可推送分片以外的其他分片确定为所述待定推送分片,其中N为由所述推送阈值确定的正整数;或者,The first pending push parameter is a push threshold, and determining that the first slice to the Nth slice of the slice that the client requests to push are the pushable slice, and the client requests the push The other fragments in the slice other than the pushable slice are determined as the pending push slice, where N is a positive integer determined by the push threshold; or
    所述第一待定推送参数为随机指示符,根据所述随机指示符,将所述客户端请求推送的分片中已缓存的分片确定为所述可推送分片,并将所述客户端请求推送的分片中除所述可推送分片以外的其他分片确定为所述待定推送分片。The first pending push parameter is a random indicator, and according to the random indicator, the cached slice in the slice that the client requests to push is determined as the pushable slice, and the client is The slice other than the pushable slice in the slice requested to be pushed is determined as the pending push slice.
  17. 根据权利要求13至16任一项所述的服务器,其特征在于,在所述发送单元向所述 客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,A server according to any one of claims 13 to 16, wherein said transmitting unit is said to said After the client sends the push commitment corresponding to each fragment in the pushable fragment, the fragment corresponding to the requested fragment identifier, and the pending push indication information,
    所述处理单元,还用于根据所述第一待定推送参数,确定所述待定推送分片中的可推送分片;The processing unit is further configured to determine, according to the first pending push parameter, a pushable slice in the pending push slice;
    所述发送单元,还用于根据所述第二待定推送参数,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端,所述待定推送分片中的可推送分片为所述待定推送分片中的部分或全部分片;其中,所述第二待定推送参数用于指示所述服务器向所述客户端发送所述待定推送分片中的可推送分片的推送承诺的条件,且所述第二待定推送参数为所述服务器本地配置的或者所述分片请求消息中携带的。The sending unit is further configured to: send, according to the second pending push parameter, a push commitment corresponding to the pushable slice in the to-be-scheduled slice to the client, where the pending push slice can be Pushing a slice into a partial or full-part slice in the to-be-scheduled slice; wherein the second pending push parameter is used to instruct the server to send the pushable segment in the pending push slice to the client The condition of the push commitment of the slice, and the second pending push parameter is carried in the server locally configured or in the fragment request message.
  18. 根据权利要求17所述的服务器,其特征在于,所述发送单元,用于根据第二待定推送参数,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端,具体为:The server according to claim 17, wherein the sending unit is configured to send, according to the second pending push parameter, a push commitment corresponding to the pushable slice in the pending push slice to the client ,Specifically:
    当已发送推送承诺且未推送的分片的剩余数量小于第一预设数量时,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端;或者,Sending, to the client, a push commitment corresponding to the pushable slice in the to-be-sent push slice when the remaining number of the shards that have been pushed and not pushed is less than the first preset number; or
    当所述待定推送分片中包含满足第二预设数量的已缓存分片时,将所述待定推送分片中的可推送分片对应的推送承诺发送给所述客户端。And sending, to the client, a push commitment corresponding to the pushable slice in the to-be-sent push slice, when the to-be-scheduled push slice includes the cached slice that meets the second preset number.
  19. 根据权利要求14至18任一项所述的服务器,其特征在于,在所述发送单元向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,The server according to any one of claims 14 to 18, wherein the sending unit sends, to the client, a push commitment corresponding to each of the shardable fragments, the request fragmentation After identifying the corresponding shard and the pending push indication information,
    所述接收单元,还用于接收所述客户端针对已发送推送承诺且未推送的分片逐一发送的取消推送请求消息;The receiving unit is further configured to receive a cancel push request message sent by the client one by one for a slice that has sent a push commitment and is not pushed;
    所述处理单元,还用于根据所述取消推送请求消息,取消向所述客户端推送所述已发送推送承诺且未推送的分片;当所述处理单元取消所有向所述客户端推送所述已发送推送承诺且未推送的分片之后,所述处理单元还用于取消向所述客户端推送尚未发送推送承诺的分片。The processing unit is further configured to cancel, according to the cancel push request message, a slice that is pushed to the client and that is not pushed; and when the processing unit cancels all push to the client After the fragment that has sent the push commitment and is not pushed, the processing unit is further configured to cancel pushing the fragment that has not sent the push commitment to the client.
  20. 根据权利要求14至18任一项所述的服务器,其特征在于,在所述发送单元向所述客户端发送所述可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,The server according to any one of claims 14 to 18, wherein the sending unit sends, to the client, a push commitment corresponding to each of the shardable fragments, the request fragmentation After identifying the corresponding shard and the pending push indication information,
    所述接收单元,还用于接收所述客户端针对目标分片发送的取消推送请求消息,所述目标分片为任一已发送推送承诺且未推送的分片,所述取消推送请求消息中包括取消待定推送指示信息,所述取消待定推送指示信息用于指示所述服务器取消向所述客户端推送尚未发送推送承诺的分片;The receiving unit is further configured to receive a cancel push request message sent by the client for the target fragment, where the target fragment is any fragment that has sent a push commitment and is not pushed, and the cancel push request message is The canceling the push indication information is used to indicate that the server cancels pushing the fragment that has not sent the push commitment to the client;
    所述处理单元,还用于根据所述取消推送请求消息,取消向所述客户端推送所述目标分片,以及取消向所述客户端推送尚未发送推送承诺的分片。The processing unit is further configured to cancel pushing the target fragment to the client according to the cancel push request message, and cancel pushing a fragment that has not sent a push commitment to the client.
  21. 一种客户端,其特征在于,包括:A client, comprising:
    发送单元,用于向服务器发送分片请求消息,所述分片请求消息包括请求分片标识和推送指令,所述推送指令用于指示所述客户端请求推送的分片;a sending unit, configured to send a fragmentation request message to the server, where the fragmentation request message includes a request fragment identifier and a push instruction, where the push instruction is used to indicate that the client requests the pushed fragment;
    接收单元,用于接收所述服务器发送的可推送分片中每一个分片对应的推送承诺、所述 请求分片标识对应的分片以及待定推送指示信息,所述待定推送指示信息用于指示所述客户端等待接收待定推送分片的推送承诺,其中,所述待定推送分片为所述客户端请求推送的分片中除所述可推送分片以外的分片。a receiving unit, configured to receive a push commitment corresponding to each of the shards sent by the server, and the And the pending push indication information is used to indicate that the client waits to receive a push commitment of the pending push slice, where the pending push slice is the client A slice other than the pushable slice in the slice requested to be pushed.
  22. 根据权利要求21所述的客户端,其特征在于,所述分片请求消息中还包括第一待定推送参数,所述第一待定推送参数用于指示所述服务器根据所述第一待定推送参数将所述客户端请求推送的分片分为所述可推送分片和所述待定推送分片。The client according to claim 21, wherein the fragment request message further includes a first pending push parameter, and the first pending push parameter is used to instruct the server to perform the first pending push parameter according to the first pending push parameter. Dividing the slice requested by the client into the pushable slice and the pending push slice.
  23. 根据权利要求22所述的客户端,其特征在于,所述第一待定推送参数包括用于指示可推送分片数量的推送阈值或者用于指示所述服务器将已缓存的分片确定为可推送分片的随机指示符。The client according to claim 22, wherein said first pending push parameter comprises a push threshold for indicating a number of pushable slices or for instructing said server to determine a cached slice as pushable A random indicator of the slice.
  24. 根据权利要求21至23任一项所述的客户端,其特征在于,在所述接收单元接收所述服务器发送的可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,The client according to any one of claims 21 to 23, wherein the receiving unit receives a push commitment corresponding to each of the pushable fragments sent by the server, and the request fragment identifier After the corresponding shard and the pending push indication information,
    所述接收单元,还用于接收所述服务器发送的所述待定推送分片中的可推送分片对应的推送承诺,所述待定推送分片中的可推送分片为所述待定推送分片中的部分或全部分片。The receiving unit is further configured to receive a push commitment corresponding to the pushable slice in the to-be-sent push slice sent by the server, where the pushable slice in the pending push slice is the pending push slice Part or all of the pieces.
  25. 根据权利要求24所述的客户端,其特征在于,所述分片请求消息中还包括第二待定推送参数,所述第二待定推送参数用于指示所述服务器根据所述第二待定推送参数确定发送所述待定推送分片中的可推送分片对应的推送承诺的条件。The client according to claim 24, wherein the fragment request message further includes a second pending push parameter, and the second pending push parameter is used to instruct the server to perform the second pending push parameter according to the second pending push parameter. Determining a condition for transmitting a push commitment corresponding to the pushable slice in the pending push slice.
  26. 根据权利要求21至25任一项所述的客户端,其特征在于,在所述接收单元接收所述服务器发送的可推送分片中每一个分片对应的推送承诺、所述请求分片标识对应的分片以及待定推送指示信息之后,The client according to any one of claims 21 to 25, wherein the receiving unit receives a push commitment corresponding to each of the pushable fragments sent by the server, and the request fragment identifier After the corresponding shard and the pending push indication information,
    所述发送单元,还用于针对目标分片向所述服务器发送取消推送请求消息,所述目标分片为任一已发送推送承诺且未推送的分片,所述取消推送请求消息中包括取消待定推送指示信息,所述取消待定推送指示信息用于指示所述服务器取消向所述客户端推送尚未发送推送承诺的分片。 The sending unit is further configured to send a cancel push request message to the server for the target fragment, where the target fragment is any fragment that has sent a push commitment and is not pushed, and the cancel push request message includes cancellation. Pending push indication information, the cancel pending push indication information is used to instruct the server to cancel pushing a slice that has not sent a push commitment to the client.
PCT/CN2017/105714 2016-10-18 2017-10-11 Media fragment push method, server and client WO2018072629A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610908973.4A CN107959667B (en) 2016-10-18 2016-10-18 Media fragment pushing method, server and client
CN201610908973.4 2016-10-18

Publications (1)

Publication Number Publication Date
WO2018072629A1 true WO2018072629A1 (en) 2018-04-26

Family

ID=61954270

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105714 WO2018072629A1 (en) 2016-10-18 2017-10-11 Media fragment push method, server and client

Country Status (2)

Country Link
CN (1) CN107959667B (en)
WO (1) WO2018072629A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109660587A (en) * 2018-10-22 2019-04-19 平安科技(深圳)有限公司 Data push method, device, storage medium and server based on random number
CN114640711A (en) * 2020-12-15 2022-06-17 深圳Tcl新技术有限公司 TLV data packet pushing method, intelligent terminal and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111193684B (en) * 2018-11-14 2021-12-21 北京开广信息技术有限公司 Real-time delivery method and server of media stream
CN111526379B (en) * 2019-02-03 2021-06-29 华为技术有限公司 Data transmission method and data transmission device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7287087B1 (en) * 1999-11-01 2007-10-23 General Electric Company Communications network for dynamic reprioritization
CN104581374A (en) * 2014-12-31 2015-04-29 深圳市同洲电子股份有限公司 Methods for obtaining slicing files and generating sub m3u8 files, node and server
CN104918072A (en) * 2014-03-14 2015-09-16 奥多比公司 Low latency live video streaming
CN105532013A (en) * 2013-07-12 2016-04-27 佳能株式会社 Adaptive data streaming method with push messages control
WO2016120089A1 (en) * 2015-01-28 2016-08-04 Canon Kabushiki Kaisha Improved client-driven push of resources by a server device
CN105979277A (en) * 2016-04-25 2016-09-28 乐视控股(北京)有限公司 File transfer method and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7287087B1 (en) * 1999-11-01 2007-10-23 General Electric Company Communications network for dynamic reprioritization
CN105532013A (en) * 2013-07-12 2016-04-27 佳能株式会社 Adaptive data streaming method with push messages control
CN104918072A (en) * 2014-03-14 2015-09-16 奥多比公司 Low latency live video streaming
CN104581374A (en) * 2014-12-31 2015-04-29 深圳市同洲电子股份有限公司 Methods for obtaining slicing files and generating sub m3u8 files, node and server
WO2016120089A1 (en) * 2015-01-28 2016-08-04 Canon Kabushiki Kaisha Improved client-driven push of resources by a server device
CN105979277A (en) * 2016-04-25 2016-09-28 乐视控股(北京)有限公司 File transfer method and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109660587A (en) * 2018-10-22 2019-04-19 平安科技(深圳)有限公司 Data push method, device, storage medium and server based on random number
CN109660587B (en) * 2018-10-22 2022-07-29 平安科技(深圳)有限公司 Data pushing method and device based on random number, storage medium and server
CN114640711A (en) * 2020-12-15 2022-06-17 深圳Tcl新技术有限公司 TLV data packet pushing method, intelligent terminal and storage medium
CN114640711B (en) * 2020-12-15 2023-08-01 深圳Tcl新技术有限公司 TLV data packet pushing method, intelligent terminal and storage medium

Also Published As

Publication number Publication date
CN107959667B (en) 2020-10-09
CN107959667A (en) 2018-04-24

Similar Documents

Publication Publication Date Title
WO2018072629A1 (en) Media fragment push method, server and client
US20210360079A1 (en) Unified end user notification platform
US9699260B2 (en) Scalable, real-time messaging system
EP2783490B1 (en) Time-sensitive data delivery
US11496546B2 (en) File download manager
US9721616B2 (en) Playback of content pre-delivered to a user device
TWI590085B (en) Apparatuses and methods for policy awareness in hardware accelerated video systems
WO2015165395A1 (en) Video playback method and apparatus
EP2698730B1 (en) Data acquisition method, device and system
CN104581374B (en) A kind of method, node and server for obtaining section file and generating sub- m3u8 files
JP2018525760A (en) Scalable real-time messaging system
US20160028646A1 (en) Push-based transmission of resources and correlated network quality estimation
JP2018532201A (en) System and method for transferring message data
JP2018531472A6 (en) Scalable real-time messaging system
CN110933517A (en) Code rate switching method, client and computer readable storage medium
US10178431B2 (en) Hybrid stream delivery
CN112565907A (en) Video acquisition method, electronic device and storage medium
CN107920108A (en) A kind of method for pushing of media resource, client and server
CN107920042B (en) Optimized transmission method and server for live broadcast room page
JP2017126983A (en) Method and system for sharing live broadcast data
WO2012028033A1 (en) Method and device for message updating
US20160359946A1 (en) Techniques for promoting and viewing social content written by nearby people
US9401953B2 (en) Intelligent high-volume cloud application programming interface request caching
CN111193684B (en) Real-time delivery method and server of media stream
CN115297095A (en) Return source processing method and device, computing equipment and storage medium

Legal Events

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

Ref document number: 17863190

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17863190

Country of ref document: EP

Kind code of ref document: A1