CN114257879B - Method and system for playing video - Google Patents

Method and system for playing video Download PDF

Info

Publication number
CN114257879B
CN114257879B CN202111556753.7A CN202111556753A CN114257879B CN 114257879 B CN114257879 B CN 114257879B CN 202111556753 A CN202111556753 A CN 202111556753A CN 114257879 B CN114257879 B CN 114257879B
Authority
CN
China
Prior art keywords
played
video information
information
video
identification information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111556753.7A
Other languages
Chinese (zh)
Other versions
CN114257879A (en
Inventor
李皆俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ruiyun Technology Co ltd
Original Assignee
Shenzhen Rayvision Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Rayvision Technology Co ltd filed Critical Shenzhen Rayvision Technology Co ltd
Priority to CN202111556753.7A priority Critical patent/CN114257879B/en
Publication of CN114257879A publication Critical patent/CN114257879A/en
Application granted granted Critical
Publication of CN114257879B publication Critical patent/CN114257879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream
    • 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/41Structure of client; Structure of client peripherals
    • H04N21/414Specialised client platforms, e.g. receiver in car or embedded in a mobile appliance
    • H04N21/41415Specialised client platforms, e.g. receiver in car or embedded in a mobile appliance involving a public display, viewable by several users in a public space outside their home, e.g. movie theatre, information kiosk
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4331Caching operations, e.g. of an advertisement for later insertion during playback
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application relates to a method and a system for playing video, and relates to the technical field of cloud playing; if the playing information comprises the video information to be played and the identification information to be played corresponding to the video information to be played, storing the video information to be played into a storage unit; storing the identification information to be played into a receiving cache queue, wherein the receiving cache queue is a queue for caching the identification information; if the playing information only comprises the identification information to be played, extracting corresponding video information to be played from the storage unit based on the identification information to be played; and playing the video information to be played. The method and the device can reduce bandwidth flow during cyclic playing.

Description

Method and system for playing video
Technical Field
The application relates to the technical field of cloud playing, in particular to a method and a system for playing video.
Background
In recent years, cloud playing is vigorously developed in China, and a traditional personal computer, such as propaganda video clips for epidemic situation protection on subways, is replaced by adopting a cloud playing technology, such as buses, subways and elevators. Cloud play is a revolution of enterprise IT architecture, and meets the needs of many specific industries while bringing mobile computing experiences.
In the existing cloud video playing process, the video is required to be transmitted to the mobile television equipment from a server of a remote computer room through a network to be played, when the video is repeatedly played, the total network flow is increased along with the increase of the playing period, and if the video is played in multiple ways, the network flow cost is increased by multiple times.
Disclosure of Invention
In order to reduce bandwidth flow during cyclic playing, the application provides a method and a system for playing video.
The application provides a video playing method, which adopts the following technical scheme:
in a first aspect, a method of playing video, performed by an electronic device, includes:
receiving playing information sent by a server;
if the playing information comprises the video information to be played and the identification information to be played corresponding to the video information to be played, storing the video information to be played into a storage unit;
storing the identification information to be played into a receiving cache queue, wherein the receiving cache queue is a queue for caching the identification information;
if the playing information only comprises the identification information to be played, extracting the corresponding video information to be played from the storage unit based on the identification information to be played;
And playing the video information to be played.
By adopting the technical scheme, the electronic equipment receives the playing information sent by the server, if the playing information received by the electronic equipment comprises the video information to be played and the identification information to be played corresponding to the video information to be played, the video information to be played is stored in the storage unit, and the identification information to be played is stored in the receiving buffer queue. If the playing information received by the electronic equipment only comprises the identification information to be played, extracting corresponding video information to be played from the storage unit based on the identification information to be played. When the electronic equipment needs to circularly play the video information to be played, the video information to be played is only required to be extracted from the storage unit based on the identification information to be played corresponding to the video information to be played, so that the video information to be played can be circularly played, a server is not required to send the video information to the electronic equipment again, repeated video information to be played is reduced, and the bandwidth flow required by the electronic equipment when the video information to be played is circularly played is effectively reduced.
In another possible implementation manner, the storing the video information to be played in a storage unit further includes:
Judging whether the video information to be played is complete video information or not;
if the received video information to be played is not the complete video information, a resending signal is sent to the server, so that the server resends the complete video information to be played according to the resending signal;
and obtaining the video information to be played which is resent by the server.
By adopting the technical scheme, the electronic equipment receives the video information to be played sent by the server and judges whether the video information to be played is complete video information or not. If the received video information to be played is not the complete video information, the video information to be played cannot be played normally, and the electronic equipment sends a retransmission signal to the server so that the server retransmits the complete video information to be played, and therefore the video information to be played can be played normally, and no clamping occurs in the playing process.
In another possible implementation manner, the sending a retransmission signal to the server, obtaining the video information to be played retransmitted by the server, includes:
determining the retransmitted video information to be played as new video information to be played;
Executing the step of judging whether the video information to be played is complete video information or not until the video information to be played is the complete video information,
or when the number of times of sending the retransmission signal reaches a preset number of times and the video information to be played is not the complete video information, sending a damage signal to the server, wherein the damage signal is used for repairing the video information to be played by the server;
and receiving the repaired video information sent by the server, wherein the repaired video information is the complete video information.
By adopting the technical scheme, the electronic equipment resends the video information to be played as new video information to be played, and executes the step of judging whether the video information to be played is complete video information again until the video information to be played is complete video information or sends resending signals to reach the preset times, but the received video information to be played is not complete video information at the moment, a damage signal is sent to the server, so that the server determines that the video information to be played is damaged. The method is used for judging the integrity of the video information to be played, so that the situation that the video information to be played is damaged due to the existence of other factors is reduced. If the electronic equipment determines that the video information to be played is damaged, the video information to be played can be fed back to the server in time, and the server repairs the video to be played, so that the video information to be played can be normally played on the electronic equipment.
In another possible implementation manner, the extracting the corresponding video information to be played from the storage unit based on the identification information to be played includes:
determining whether the identification information to be played exists in the receiving cache queue;
and if the identification information to be played exists in the receiving cache queue, acquiring the video information to be played corresponding to the identification information to be played from the storage unit.
By adopting the technical scheme, after the electronic equipment receives the playing information only comprising the identification information to be played, the electronic equipment determines whether the identification information to be played exists in the receiving cache queue. If the to-be-played identification information exists in the receiving cache queue, determining that the to-be-played video information corresponding to the to-be-played identification information is stored in the storage unit before, and acquiring the corresponding to-be-played video information from the storage unit according to the to-be-played identification information.
In a second aspect, a method for playing video, performed by a server, includes:
acquiring video information to be played, and determining identification information to be played corresponding to the video information to be played;
judging whether the identification information to be played exists in a sending cache queue, wherein the sending cache queue is used for caching the identification information corresponding to the video information which is successfully sent to the electronic equipment;
If the identification information to be played does not exist in the sending cache queue, determining that the playing information comprises the identification information to be played and the video information to be played;
storing the identification information to be played into the sending cache queue;
if the identification information to be played exists in the sending cache queue, determining that the playing information only comprises the identification information to be played;
and sending the playing information to the electronic equipment so that the electronic equipment plays the video information to be played based on the playing information.
By adopting the technical scheme, the server acquires the video information to be played and determines the identification information to be played corresponding to the video information to be played, and judges whether the identification information to be played exists in a transmission buffer queue of the server so as to determine whether the video information to be played corresponding to the identification information to be played is repeated video information. If the to-be-played identification information does not exist in the sending cache queue, determining that the to-be-played video information is not the repeated video information, and storing the to-be-played identification information into the sending cache queue so as to facilitate the next receiving of the to-be-played video information corresponding to the to-be-played identification information, and determining that the to-be-played video information is the repeated video information through the to-be-played identification information. After the identification information to be played is stored in the sending buffer queue, the playing information sent to the electronic equipment comprises the video information to be played and the identification information to be played. If the identification information to be played exists in the sending cache queue, determining that the video information to be played is repeated video information. The playing information sent to the electronic equipment only comprises the identification information to be played, so that the number of times of sending repeated video information to be played to the electronic equipment is reduced. If the video information to be played is the repeated video information, the server only needs to send the identification information to be played to the electronic equipment, and the bandwidth flow required by the electronic equipment when the video information to be played is circularly played is effectively reduced.
In another possible implementation manner, the sending the playing information to the electronic device further includes:
if a retransmission signal sent by the electronic equipment is received, retransmitting the video information to be played to the electronic equipment;
if the number of times of resending the video information to be played reaches a preset number of times and a damage signal sent by the electronic equipment is received, repairing the video information to be played to obtain repaired video information;
and sending the repaired video information to the electronic equipment.
By adopting the technical scheme, after the server sends the playing information to the electronic equipment, if the server receives the retransmission signal sent by the mobile television, the server determines that the video information to be played received by the electronic equipment is not complete video information, and the video information to be played is sent to the electronic equipment again, so that the situation that the video information to be played is damaged due to the existence of other factors is reduced. If the number of times of resending the video information to be played reaches the preset number of times and the damage signal sent by the electronic equipment is received, the fact that the video information to be played is damaged is determined, and damage is not caused by other factors. The server repairs the video to be played and sends the repaired video to the electronic equipment, so that the electronic equipment can normally play the video information to be played.
In another possible implementation manner, the repairing the video information to be played includes:
and replacing the video information to be played with the video information to be played acquired next time.
By adopting the technical scheme, the server replaces damaged video information to be played with video information to be played acquired next time, and the video information to be played is repaired by adopting the method, so that the duration of the whole video is not influenced.
In another possible implementation manner, the obtaining the video information to be played and the identification information to be played corresponding to the video information to be played includes:
converting the format of the video information to be played to obtain a portable network graph;
and calculating an MD5 value based on the portable network graph, and determining the MD5 value as the identification information to be played.
By adopting the technical scheme, after the server acquires the video information to be played, the video information to be played is converted into the portable network graph. And calculating MD5 values of the video information to be played based on the portable network graphics, wherein each video information to be played corresponds to one MD5 value, and determining the MD5 value as the identification information to be played. And according to the MD5 value, corresponding video information to be played can be determined in the storage unit, and if the video information to be played exists in the electronic equipment, the corresponding video information to be played is obtained by sending the MD5 value.
In another possible implementation manner, the storing the identification information to be played in the sending buffer queue includes:
receiving a video information storage completion signal sent by the electronic equipment;
and storing the identification information to be played into the sending cache queue according to the video information storage completion signal.
By adopting the technical scheme, if the electronic equipment stores the video information to be played sent by the server to the storage unit, and stores the identification information to be played to the receiving buffer queue, a video information storage completion signal is sent to the server. After receiving the video information storage completion signal, the server stores the identification information to be played into a sending cache queue, and ensures the consistency of the identification information in the sending cache queue and the receiving cache queue.
In a third aspect, the present application provides a device for playing video, which adopts the following technical scheme:
an apparatus for playing video, comprising:
the first receiving module is used for receiving the playing information sent by the server;
the first storage module is used for storing the video information to be played to the storage unit when the playing information comprises the video information to be played and the identification information to be played corresponding to the video information to be played;
The second storage module is used for storing the identification information to be played into a receiving cache queue, wherein the receiving cache queue is a queue for caching the identification information;
the extraction module is used for extracting the corresponding video information to be played from the storage unit based on the identification information to be played when the play information only comprises the identification information to be played;
and the playing module is used for playing the video information to be played.
By adopting the technical scheme, the first receiving module receives the playing information sent by the server, and if the received playing information comprises the video information to be played and the identification information to be played corresponding to the video information to be played, the video information to be played is stored into the storage unit through the first storage module, and the identification information to be played is stored into the receiving buffer queue through the second storage module. If the received playing information only comprises the identification information to be played, the corresponding video information to be played is extracted from the storage unit through the extraction module based on the identification information to be played. When the video information to be played needs to be circularly played, the video information to be played is only required to be extracted from the storage unit based on the identification information to be played corresponding to the video information to be played, so that the video information to be played can be circularly played through the playing module, repeated video information to be played is reduced from the server to the electronic equipment, and the bandwidth flow required by the electronic equipment when the video information to be played is circularly played is effectively reduced.
In another possible implementation, the apparatus further includes:
the first judging module is used for judging whether the video information to be played is complete video information or not;
the first sending module is used for sending a resending signal to the server when the received video information to be played is not the complete video information, so that the server resends the complete video information to be played according to the resending signal;
the first acquisition module is used for acquiring the video information to be played which is resent by the server.
In another possible implementation manner, the first sending module is specifically configured to, when sending a retransmission signal to the server and when the first obtaining module obtains the video information to be played that is retransmitted by the server:
determining the retransmitted video information to be played as new video information to be played;
executing the step of judging whether the video information to be played is complete video information or not until the video information to be played is the complete video information,
or when the number of times of sending the retransmission signal reaches a preset number of times and the video information to be played is not the complete video information, sending a damage signal to the server, wherein the damage signal is used for repairing the video information to be played by the server;
And receiving the repaired video information sent by the server, wherein the repaired video information is the complete video information.
In another possible implementation manner, the extracting module is specifically configured to, when extracting the corresponding video information to be played from the storage unit based on the identification information to be played:
determining whether the identification information to be played exists in the receiving cache queue;
and if the identification information to be played exists in the receiving cache queue, acquiring the video information to be played corresponding to the identification information to be played from the storage unit.
In a fourth aspect, the present application provides a server device for playing video, which adopts the following technical scheme:
a server apparatus for playing video, comprising:
the second acquisition module is used for acquiring video information to be played and determining identification information to be played corresponding to the video information to be played;
the second judging module is used for judging whether the identification information to be played exists in a sending cache queue, wherein the sending cache queue is a queue for caching the identification information;
the first determining module is used for determining that the playing information comprises the identification information to be played and the video information to be played when the identification information to be played does not exist in the sending cache queue;
The third storage module is used for storing the identification information to be played into the sending cache queue;
the second determining module is used for determining that the playing information only comprises the identification information to be played when the identification information to be played exists in the sending cache queue;
and the second sending module is used for sending the playing information to the electronic equipment so that the electronic equipment plays the video information to be played based on the playing information.
By adopting the technical scheme, the second acquisition module acquires the video information to be played, determines the identification information to be played corresponding to the video information to be played, and judges whether the identification information to be played exists in the sending buffer queue or not through the second judgment module. If the to-be-played identification information does not exist in the sending cache queue, the to-be-played video information is determined not to be the repeated video information, the first determining module determines that the to-be-played information comprises the to-be-played video information and the to-be-played identification information, and the third storing module stores the to-be-played identification information into the sending cache queue so as to be convenient for receiving the to-be-played video information corresponding to the to-be-played identification information next time, and the to-be-played video information can be determined to be the repeated video information. And after the identification information to be played is stored in the transmission buffer queue, the playing information is transmitted to the electronic equipment through the second transmission module. If the to-be-played identification information exists in the sending cache queue, the to-be-played video information is determined to be the repeated video information, the second determining module determines that the to-be-played information only comprises the to-be-played identification information, and the second sending module sends the to-be-played information to the electronic equipment, so that the number of times of sending the repeated to-be-played video information to the electronic equipment is reduced. If the video information to be played is the repeated video information, the server only needs to send the identification information to be played to the electronic equipment, and the bandwidth flow required by the electronic equipment when the video information to be played is circularly played is effectively reduced.
In another possible implementation manner, the server apparatus further includes:
the third sending module is used for resending the video information to be played to the electronic equipment when receiving a resending signal sent by the electronic equipment;
the repair module is used for repairing the video information to be played when the number of times of resending the video information to be played reaches a preset number of times and a damage signal sent by the electronic equipment is received, so as to obtain repaired video information;
and the fourth sending module is used for sending the repaired video information to the electronic equipment.
In another possible implementation manner, the repair module is specifically configured to, when repairing the video information to be played:
and replacing the video information to be played with the video information to be played acquired next time.
In another possible implementation manner, when determining the to-be-played identification information corresponding to the to-be-played video information, the first determining module is specifically configured to:
converting the format of the video information to be played to obtain a portable network graph;
and calculating an MD5 value based on the portable network graph, and determining the MD5 value as the identification information to be played.
In another possible implementation manner, the third storage module is specifically configured to, when storing the identifier information to be played in the sending buffer queue:
receiving a video information storage completion signal sent by the electronic equipment;
and storing the identification information to be played into the sending cache queue according to the video information storage completion signal.
In a fifth aspect, the present application provides an electronic device, which adopts the following technical scheme:
an electronic device, the electronic device comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: a method of playing video according to any one of the possible implementations of the first aspect is performed.
In a sixth aspect, the present application provides a server, which adopts the following technical scheme:
a server, the server comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to: a method of playing video according to any one of the possible implementations of the second aspect is performed.
In a seventh aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
a computer-readable storage medium, comprising: a computer program is stored that can be loaded and executed by a processor to implement a method of playing video as shown in any one of the possible implementations of the first aspect.
In an eighth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
a computer-readable storage medium, comprising: a computer program is stored which can be loaded by a processor and which performs a method of playing video as shown in any one of the possible implementations of the second aspect.
In a ninth aspect, the present application provides a system for playing video, including: electronic equipment and server, wherein:
the electronic equipment performs information interaction with the server;
the server is used for acquiring video information to be played and determining identification information to be played corresponding to the video information to be played; judging whether the identification information to be played exists in a sending cache queue or not; if not, determining that the playing information comprises the identification information to be played and the video information to be played; storing the identification information to be played into the sending cache queue; if yes, determining that the playing information only comprises the identification information to be played; sending the playing information to the electronic equipment;
The electronic equipment is used for receiving the playing information; when the playing information comprises video information to be played and identification information to be played corresponding to the video information to be played, storing the video information to be played into a storage unit; storing the identification information to be played into a receiving cache queue; when the playing information only comprises the identification information to be played, extracting the corresponding video information to be played from the storage unit based on the identification information to be played; and playing the video information to be played.
In summary, the present application includes at least one of the following beneficial technical effects:
1. and the electronic equipment receives the playing information sent by the server, if the playing information received by the electronic equipment comprises the video information to be played and the identification information to be played corresponding to the video information to be played, the video information to be played is stored in the storage unit, and the identification information to be played is stored in the receiving buffer queue. If the playing information received by the electronic equipment only comprises the identification information to be played, extracting corresponding video information to be played from the storage unit based on the identification information to be played. When the electronic equipment needs to circularly play the video information to be played, the video information to be played is only extracted from the storage unit based on the identification information to be played corresponding to the video information to be played, and the server is not required to send the video information to the electronic equipment again, so that the video information to be played can be circularly played. The repeated video information to be played is sent to the electronic equipment repeatedly by the server, so that the bandwidth flow required by the electronic equipment when the video information to be played is played circularly is effectively reduced;
2. The electronic equipment receives the video information to be played sent by the server and judges whether the video information to be played is complete video information or not. If the received video information to be played is not the complete video information, the video information to be played cannot be played normally, and the electronic equipment sends a retransmission signal to the server so that the server retransmits the complete video information to be played, and therefore the video information to be played can be played normally, and no clamping occurs in the playing process.
Drawings
Fig. 1 is a flowchart of a method for playing video according to an embodiment of the present application.
Fig. 2 is a schematic flow chart of an apparatus for playing video according to an embodiment of the present application.
Fig. 3 is a flowchart of a server device for playing video according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application
Fig. 5 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
The present application is described in further detail below in conjunction with figures 1-5.
Modifications of the embodiments which do not creatively contribute to the invention may be made by those skilled in the art after reading the present specification, but are protected by patent laws only within the scope of claims of the present application.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In addition, the term "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In this context, unless otherwise specified, the term "/" generally indicates that the associated object is an "or" relationship.
Embodiments of the present application are described in further detail below with reference to the drawings attached hereto.
The embodiment of the application provides a method for playing video, which is executed by an electronic device, as shown in fig. 1, and includes a step S101, a step S102, a step S103, a step S104, and a step S105, where,
Step S101, receiving the play information sent by the server.
The playing information comprises to-be-played identification information and to-be-played identification information corresponding to the to-be-played video information, or only comprises to-be-played identification information. The identification information to be played can be an MD5 value uniquely corresponding to the video information to be played, and also can be an Arabic number uniquely corresponding to the video information to be played.
For the embodiment of the application, a receiving buffer queue is provided in the electronic device, and is used for buffering the identification information corresponding to the received video information, and a sending buffer queue is provided in the server, and is used for buffering the identification information corresponding to the video information successfully sent to the electronic device. In the embodiment of the application, the electronic equipment receives the playing information sent by the server through the message receiving interface, and when the identification information to be played exists in the sending cache queue, the playing information sent by the server to the electronic equipment only comprises the identification information to be played; when the to-be-played identification information does not exist in the sending cache queue, the playing information sent to the electronic equipment by the server comprises the to-be-played identification information and the to-be-played identification information corresponding to the to-be-played video information.
Step S102, if the playing information comprises the video information to be played and the identification information to be played corresponding to the video information to be played, the video information to be played is stored in the storage unit.
For the embodiment of the application, storing video information to be played to a storage unit includes:
naming the video information to be played based on the identification information to be played corresponding to the video information to be played;
and naming the video information to be played and storing the named video information into a storage unit.
It can be understood that the video information to be played, the identification information to be played and the naming correspond. When the video information to be played is played circularly, the server is not required to send the video information to be played again, and only the video information to be played named with the identification information to be played is required to be extracted from the storage unit based on the identification information to be played, so that the frequency of sending the video information to be played to the electronic equipment by the server is reduced, and the bandwidth required when the video information to be played is played circularly is effectively reduced. The storage unit may be a specific folder in the electronic device or a folder in a removable storage medium, which is not limited herein.
Further, in another implementation manner of the embodiment of the present application, the storing process of the video information to be played includes: and converting the video information to be played into a picture format for storage, wherein the picture format comprises a portable network graphic or a JPEG format. The memory occupied by the picture format is smaller than the memory occupied by the video information, and the video information to be played is converted into the picture format for storage, so that the occupation of the video information to be played to the storage space of the electronic equipment is effectively reduced. It is noted that, when the portable network graphics are in a lossless compressed bit-picture format, the video information to be played is converted into the portable network graphics, so that not only can the occupation of the storage space of the electronic device be effectively reduced, but also the damage to the video information to be played can be reduced in the conversion process compared with the JPEG format.
Further, when the video information to be played or the portable network graphic is named, the video information to be played or the portable network graphic can be named as other specific names based on the identification information to be played corresponding to the video information to be played or the portable network graphic. For example:
the identification information to be played is assumed to be:
7B63529D04BF53C812981F711591477C;
the portable network graph after format conversion based on the video information to be played is named as follows:
7B63529D04BF53C812981F711591477C.png;
or the video information to be played is named as:
1001.bitmap。
step S103, storing the identification information to be played in a receiving buffer queue.
The receiving cache queue is a queue for caching the identification information.
For the embodiment of the application, the electronic device establishes a receiving buffer queue, and after the electronic device establishes the receiving buffer queue, the electronic device receives the playing information. If the playing information comprises the video information to be played and the identification information to be played corresponding to the video information to be played, the identification information to be played is inserted into the tail of the receiving buffer queue. The receiving buffer queue buffers the to-be-played identification information corresponding to each to-be-played video information, and when the electronic equipment circularly plays the to-be-played video information, whether the to-be-played video information is stored in the storage unit of the electronic equipment can be judged only by detecting whether the identification information corresponding to the to-be-played video information exists in the receiving buffer queue.
Step S104, if the playing information only includes the identification information to be played, extracting the corresponding video information to be played from the storage unit based on the identification information to be played.
For the embodiment of the application, the electronic device receives the playing information, and if the playing information only includes the identification information to be played, it is determined that the video information to be played corresponding to the identification information to be played is already stored in the storage unit of the electronic device. And extracting the corresponding video information to be played from the storage unit based on the identification information to be played, and playing the video information to be played.
Step S105, playing the video information to be played.
For the embodiment of the application, if the received playing information includes the video information to be played and the identification information to be played corresponding to the video information to be played, the electronic device stores the video information to be played to the storage unit, and plays the video information to be played directly.
If the received playing information only comprises the to-be-played identification information, the electronic equipment extracts the corresponding to-be-played video information from the storage unit based on the to-be-played identification information, and plays the extracted to-be-played video information.
The video information to be played is stored in the storage unit, so that when the video information to be played is played circularly, the server is not required to send the video information to be played again, and only the corresponding video information to be played is required to be extracted from the storage unit based on the identification information to be played, thereby reducing the frequency of sending the video information to be played to the electronic equipment by the server, and effectively reducing the bandwidth required when the video information to be played is played circularly.
In another implementation manner of the embodiment of the present application, if the video information to be played is converted into the portable network graphic and stored in the storage unit, the corresponding portable network graphic is extracted from the storage unit based on the identification information to be played, format conversion is performed on the extracted portable network graphic, and after the portable network graphic is converted into the video information to be played, the video information to be played is played.
In one possible implementation manner of the embodiment of the present application, the method further includes step S106 (not shown in the figure), step S107 (not shown in the figure), and step S108 (not shown in the figure), where step S106 may be performed before step S102,
step S106, judging whether the video information to be played is complete video information.
For the embodiment of the application, the electronic device receives the to-be-played video information and the to-be-played identification information corresponding to the to-be-played video information, judges whether the to-be-played video information is complete video information or not, if the to-be-played video information is not complete video information, the electronic device cannot normally play the to-be-played video information, and determines that the to-be-played video information is damaged due to other factors. For example:
The server partially loses the video information to be played in the process of sending the video information to be played to the electronic equipment, and the video information to be played received by the electronic equipment is not complete video information.
In this embodiment of the present application, the server may encode and package the video information to be played when sending the video information to be played, and send the encoded and packaged video information to be played to the electronic device. After receiving the coded and packaged video information to be played, the electronic equipment decompresses the coded and packaged video information to be played, and damages the video to be played in the decompression process, so that the video information to be played is not complete video information.
In step S107, if the received video information to be played is not the complete video information, a retransmission signal is sent to the server, so that the server retransmits the complete video information to be played according to the retransmission signal.
For the embodiment of the application, if the video information to be played received by the electronic device is not complete video information, the video information to be played cannot be played normally, and the electronic device sends a retransmission signal to the server so that the server retransmits the video to be played.
Step S108, obtaining the complete video information to be played which is resent by the server.
In the embodiment of the application, after receiving the resending signal, the server resends the complete video information to be played to the electronic equipment, and the electronic equipment acquires the video information to be played sent by the server, so that the electronic equipment acquires the complete video information, and the electronic equipment can normally play the video information to be played.
In one possible implementation manner of the embodiment of the present application, the step S107 of sending the retransmission signal to the server and the step S108 of obtaining the complete video information to be played, which is retransmitted by the server, specifically include the step S1071 (not shown in the figure), the step S1072 (not shown in the figure), and the step S1073 (not shown in the figure), where,
step S1071, the retransmitted video information to be played is determined as new video information to be played.
For the embodiment of the application, the retransmitted video information to be played is determined to be new video information to be played, so as to judge whether the retransmitted video information to be played is complete video information or not again.
Step S1072, execute the step of judging whether the video information to be played is the complete video information or not until the video information to be played is the complete video information,
Or when the number of times of sending the retransmission signal reaches the preset number of times and the video information to be played is not the complete video information, sending a damage signal to the server, wherein the damage signal is used for repairing the video information to be played by the server.
For the embodiment of the application, assuming that the preset times are two, the electronic device judges the video information to be played received for the first time, and sends a resending signal to the server if the video information to be played is determined not to be the complete video information. The server resends the video information to be played to the electronic equipment, and determines the resent video information to be played as new video information to be played.
And the electronic equipment judges the video information to be played received for the second time, and sends a retransmission signal to the server if the video information to be played is not the complete video information. The server resends the video information to be played to the electronic equipment, and determines the resent video information to be played as new video information to be played.
The electronic equipment judges the video information to be played received for the third time, determines that the video information to be played is not complete video information, sends retransmission signals to the server twice, and sends damage signals to the server when the retransmission signals reach the preset times twice, so that the server is informed of damage to the video information to be played, and the server repairs the video information to be played.
The method is used for judging the integrity of the video information to be played, so that the situation that the video information to be played is damaged due to the existence of other factors is reduced. And if the electronic equipment determines that the video information to be played is damaged, the electronic equipment can timely feed back to the server.
Step S1073, the repaired video information sent by the server is received.
The repaired video information is complete video information.
For the embodiment of the application, after the electronic device sends the damage signal to the server, the server repairs the video information to be played so that the video information to be played can be normally played on the electronic device, the electronic device receives the repaired video information sent by the server, and the repaired video information is stored.
In another possible implementation manner of the embodiment of the present application, step S107 of sending the retransmission signal to the server may also be that the electronic device sends the retransmission signal to the server, the server retransmits the video information to be played to the electronic device, and the electronic device stores and plays the received video information to be played.
In one possible implementation manner of the embodiment of the present application, step S104 extracts the corresponding video information to be played from the storage unit based on the identification information to be played, which specifically includes step S1041 (not shown in the figure) and step S1042 (not shown in the figure), where,
Step S1041, determining whether there is identification information to be played in the receiving buffer queue.
For the embodiment of the application, after receiving the play information only including the identification information to be played, the electronic device matches the identification information to be played with the receiving buffer queue, and determines whether the video information to be played corresponding to the identification information to be played exists in the receiving buffer queue, so as to determine whether the identification information in the receiving buffer queue is consistent with the identification information in the sending buffer queue. If the to-be-played identification information exists in the receiving cache queue, determining that to-be-played video information corresponding to the to-be-played identification information exists in the storage unit, and keeping the identification information in the receiving cache queue consistent with the identification information in the sending cache queue. If the to-be-played identification information does not exist in the receiving cache queue, but the electronic equipment does not receive the to-be-played video information corresponding to the to-be-played identification information, determining that the server is abnormal in the transmission process, enabling the identification information in the receiving cache queue and the identification information in the sending cache queue not to be consistent, enabling the server to send the to-be-played video information and the to-be-played identification information corresponding to the to-be-played video information to the electronic equipment again, enabling the electronic equipment to store the to-be-played identification information into the receiving cache queue, and enabling the identification information in the receiving cache queue and the identification information in the sending cache queue to be consistent.
In step S1042, if the to-be-played identification information exists in the receive buffer queue, to-be-played video information corresponding to the to-be-played identification information is obtained from the storage unit.
For the embodiment of the application, if it is determined that the to-be-played identification information exists in the receiving buffer queue, because the to-be-played video information is named based on the to-be-played identification information, the to-be-played video information corresponding to the to-be-played identification information is extracted from the storage unit based on the name of the to-be-played video information.
In another possible implementation manner of the embodiment of the present application, step S104 may further include extracting the corresponding video information to be played from the storage unit based on the identifier information to be played, and searching whether the video information to be played with the corresponding name exists from the storage unit based on the name of the video information to be played, because the video information to be played is named based on the identifier information to be played. If the storage unit has the video information to be played with the corresponding name, acquiring the video information to be played; and if the storage unit does not have the video information to be played with the corresponding name, sending a resending signal to the server so that the server resends the video information to be played.
The embodiment of the application provides a method for playing video, which is executed by a server and includes a step S201 (not shown in the figure), a step S202 (not shown in the figure), a step S203 (not shown in the figure), a step S204 (not shown in the figure), a step S205 (not shown in the figure), and a step S206 (not shown in the figure), wherein,
step S201, obtaining video information to be played, and determining identification information to be played corresponding to the video information to be played.
For the embodiment of the application, the server acquires the video information to be played, the identification information to be played is calculated based on the video information to be played, and each piece of video information to be played corresponds to one piece of identification information to be played.
Step S202, judging whether the identification information to be played exists in the sending buffer queue.
The sending buffer queue is a queue for buffering identification information corresponding to video information which is successfully sent to the electronic equipment.
For the embodiment of the application, the server establishes a sending buffer queue, after the server establishes the sending buffer queue, the server obtains the identification information to be played for the first time, and stores the identification information to be played obtained for the first time into the sending buffer queue. And when the server acquires the identification information to be played again, the identification information to be played is matched with the sending cache queue. Judging whether the to-be-played identification information exists in the sending cache queue, thereby determining whether the server acquires the same to-be-played video information, and further determining whether to-be-played identification information and to-be-played video information corresponding to the to-be-played identification information are stored in the electronic equipment.
Step S203, if the transmission buffer queue does not have the identification information to be played, determining that the playing information includes the identification information to be played and the video information to be played.
For the embodiment of the application, if the to-be-played identification information does not exist in the sending cache queue, and it is determined that the to-be-played video information needs to be stored in the storage unit of the electronic device, the server sends the to-be-played video information and the to-be-played identification information to the electronic device.
Step S204, storing the identification information to be played in a sending buffer queue.
For the embodiment of the application, if the to-be-played identification information does not exist in the sending buffer queue, the to-be-played identification information is added to the tail of the sending buffer queue, so that when the server acquires the same to-be-played identification information and the to-be-played video information corresponding to the to-be-played identification information, the server can determine that the to-be-played video information is stored in the electronic device, and the consistency with the receiving buffer queue is maintained.
In step S205, if the to-be-played identification information exists in the transmission buffer queue, it is determined that the play information only includes the to-be-played identification information.
For the embodiment of the application, if the to-be-played identification information exists in the sending cache queue, it is determined that to-be-played video information corresponding to the to-be-played identification information is stored in the storage unit of the electronic device, the to-be-played identification information only needs to be sent to the electronic device, and the electronic device can extract the corresponding to-be-played video information according to the to-be-played identification information.
Step S206, sending playing information to the electronic equipment, so that the electronic equipment plays the video information to be played based on the playing information.
For the embodiment of the application, if the to-be-played identification information does not exist in the sending cache queue, sending playing information including the to-be-played video information and the to-be-played identification information to the electronic device. If the identification information to be played exists in the sending cache queue, sending playing information only containing the identification information to be played to the electronic equipment. When the video information to be played is played circularly, the server can extract the video information to be played only by sending the identification information to be played corresponding to the video information to be played, and the server does not need to send the video information to be played again, so that the frequency of repeatedly sending the video information to be played is reduced, and the bandwidth required by circularly playing the video information to be played is reduced. For example:
the bandwidth required by the server for sending the video information to be played and the identification information to be played to the electronic equipment is 6MB, and the bandwidth required by the server for sending the identification information to be played to the electronic equipment is 1KB.
Assuming that the playing period is 30 days, if the video information to be played is played circularly, when the server repeatedly sends the video information to be played to the electronic device, wherein,
30 for 30 days, 24 for 24 hours a day, 60 for minutes, seconds, 6 for the required bandwidth 6MB,1024 for MB to GB to TB capacity conversion, 8 for bit to Byte conversion, the total network traffic for the required bandwidth for a single pass is:
30*24*60*60*6/1024/1024/8≈2TB。
if the method is adopted to circularly play the video information to be played, the server only needs to send the video information to be played to the electronic equipment for the first time, and only needs to send the identification information to be played corresponding to the video information to be played after sending the video information to be played, and the total network flow of the bandwidth required by the single channel is as follows:
30*24*60*60*0.01/1024/8≈3GB。
when the video information to be played is played in a fixed cycle, the total network flow of the bandwidth required by 667 times is saved, and the bandwidth required by the video information to be played in a cycle is effectively reduced.
In the embodiment of the present application, the execution sequence of step S203, step S204, and step S205 is not limited herein.
In one possible implementation manner of the embodiment of the present application, the method further includes step S207 (not shown in the figure), step S208 (not shown in the figure), and step S209 (not shown in the figure), where step S207 may be performed after step S206,
in step S207, if a retransmission signal sent by the electronic device is received, the video information to be played is retransmitted to the electronic device.
For the embodiment of the application, if the server receives the retransmission signal sent by the electronic device, it is determined that the video information to be played received by the electronic device is not complete video information, the video information to be played is retransmitted to the electronic device, and the situation that the video information to be played is damaged due to existence of other factors is reduced, so that the video information to be played cannot be played normally.
Step S208, if the number of times of resending the video information to be played reaches the preset number of times and the damage signal sent by the electronic equipment is received, the video information to be played is repaired, and the repaired video information is obtained.
For the embodiment of the application, assuming that the preset times are two times, if the server receives the retransmission signal sent by the electronic device after sending the video information to be played for the first time, the server sends the video information to be played for the second time. If the resending signal sent by the electronic equipment is received again, the server sends the video information to be played for the third time, if the damage signal sent by the electronic equipment is received, the video information to be played is determined to be damaged, and the server repairs the video information to be played. According to the embodiment, the video information to be played is enabled to be the complete video information by repeatedly sending the video information to be played, so that the situation that the video information to be played is damaged due to the existence of other factors is reduced. If the electronic equipment determines that the video information to be played is damaged, the video information to be played is fed back to the server in time, and the server repairs the video information to be played, so that the video information to be played can be normally played on the electronic equipment, and no clamping and stopping occur in the playing process.
Step S209, the repaired video information is sent to the electronic equipment.
For the embodiment of the application, after repairing damaged video information to be played, the server sends the repaired video information to the electronic equipment, so that the electronic equipment can normally play the video information to be played.
In one possible implementation manner of the embodiment of the present application, the repairing the video information to be played in step S208 specifically includes step S2081 (not shown in the figure), where,
step S2081, replacing the video information to be played with the next acquired video information to be played.
For the embodiment of the application, when the server repairs the damaged video information to be played, the damaged video information to be played is replaced by the video information to be played acquired next time by the server. And sending the replaced video information to be played to the electronic equipment, and storing the video information to be played by the electronic equipment. For example;
the method comprises the steps that a server receives a damage signal sent by electronic equipment, the fact that the video information A to be played is damaged is determined, the video information A to be played acquired next time by the server is B, the video information A to be played is replaced by the video information B to be played and sent to the electronic equipment, the electronic equipment stores the video information B to be played into a storage unit, and the video information B to be played is played. After the electronic equipment plays the video information B to be played, the video information B to be played is acquired again, the server sends identification information to be played corresponding to the video information B to be played to the electronic equipment, and the electronic equipment continues to play the video information B to be played. The video information B to be played is used for replacing the video information A to be played so that the duration of the whole video is not changed, and the content of the video information B to be played is similar to that of the video information A to be played, so that the influence on the video content is effectively reduced.
In this embodiment of the present application, when the server repairs the damaged video information to be played, the damaged video information to be played may be replaced with the video information to be played obtained last time.
In another implementation manner in this embodiment, when the server repairs the damaged video information to be played, the damaged video information to be played may also be replaced with blank video information, where the blank video information includes video information displayed as a white picture or a black picture by the electronic device. For example:
the method comprises the steps that a server receives a damage signal sent by electronic equipment, the fact that the video information A to be played is damaged is determined, the video information A to be played is replaced by blank video information, the blank video information is stored in a storage unit, the electronic equipment plays the blank video information, and white pictures are displayed on the electronic equipment when the blank video information is played. The blank video information is used for replacing the video information A to be played so that the duration of the whole video is not changed, and the blank video information can be preset, if the fact that the video information to be played is not the complete video information is determined to be directly replaced, the efficiency of processing damaged video information to be played is improved.
In one possible implementation manner of the embodiment of the present application, the step S201 of obtaining the video information to be played and the identification information to be played corresponding to the video information to be played specifically includes a step S2011 (not shown in the figure) and a step S2012 (not shown in the figure), where,
in step S2011, format conversion is performed on the video information to be played to obtain first video information.
Wherein the first video information comprises video information of a portable network graphic.
For the embodiment of the application, the server acquires the video information to be played, and converts the format of the video information to be played into the portable network graphics, so that the identification information to be played can be calculated based on the portable network graphics.
In step S2012, an MD5 value is calculated based on the first video information, and the MD5 value is determined as the identification information to be played.
For the embodiment of the application, the server calculates the MD5 value corresponding to the portable network graphic based on the video information to be played converted into the portable network graphic, and determines the MD5 value as the identification information to be played. And the video information to be played is uniquely corresponding to the MD5 value, and can be determined through the MD5 value. For example:
the video information A is converted into a portable network graph A;
The MD5 value corresponding to the video information A is calculated based on the portable network graph A and is as follows: 7B63529D04BF53C812981F711591477C, the calculated MD5 value is used as the to-be-played identification information of the to-be-played video information, the corresponding portable network graphic A can be extracted from the storage unit based on the MD5 value, the server is not required to repeatedly send the to-be-played video information to the electronic equipment, and the frequency of sending the to-be-played video information corresponding to the to-be-played identification information to the electronic equipment by the server is reduced.
In another possible implementation manner of the embodiment of the present application, step S201 may further include obtaining the video information to be played and the identification information to be played corresponding to the video information to be played, where the server obtains the video information to be played, and determines the identification information to be played based on the order of obtaining the video information to be played.
In one possible implementation manner of this embodiment of the present application, the step S203 of storing the identification information to be played in the transmission buffer queue specifically includes a step S2031 (not shown in the figure) and a step S2032 (not shown in the figure), where,
in step S2031, a video information storage completion signal transmitted by the electronic apparatus is received.
For the embodiment of the application, if the to-be-played identification information acquired by the server does not exist in the sending cache queue, the to-be-played identification information and to-be-played video information corresponding to the to-be-played identification information are sent to the electronic device. The electronic equipment stores the identification information to be played in the receiving buffer queue, stores the video information to be played in the storage unit, and when the video information to be played and the identification information to be played are both stored in the electronic equipment, the electronic equipment sends a storage completion signal to the server, and the server receives the storage completion signal, so that the fact that the sent video information to be played and the sent identification information to be played are both stored is determined.
Step S2032, storing the identification information to be played in the transmission buffer queue according to the video information storage completion signal.
For the embodiment of the application, if the server receives the storage completion signal, the identification information to be played is added to the tail of the sending buffer queue, so that consistency of the identification information in the sending buffer queue and the receiving buffer queue is ensured, and therefore, when the video information to be played is played in a circulating mode, whether the video information to be played is stored in the electronic equipment can be accurately judged, if the video information to be played is stored in the electronic equipment, the server sends the identification information to be played corresponding to the video information to be played to the electronic equipment, and the required bandwidth when the video information to be played is played in a circulating mode is effectively reduced.
The above embodiments describe a method for playing video from the perspective of a method flow, and the following embodiments describe an apparatus for playing video from the perspective of a virtual module or a virtual unit, which are described in detail in the following embodiments.
An embodiment of the present application provides a device 30 for playing video, as shown in fig. 2, the device 30 for playing video may specifically include:
the first receiving module 301 is configured to receive the play information sent by the server.
The first storage module 302 is configured to store the video information to be played to the storage unit when the playing information includes the video information to be played and the identification information to be played corresponding to the video information to be played.
The second storage module 303 is configured to store the identification information to be played in a receive buffer queue, where the receive buffer queue is a queue for buffering the identification information.
The extracting module 304 is configured to extract, when the playing information only includes the identification information to be played, the corresponding video information to be played from the storage unit based on the identification information to be played.
A playing module 305, configured to play the video information to be played.
For the embodiment of the application, the first receiving module 301 receives the playing information sent by the server, and if the received playing information includes the video information to be played and the identifier information to be played corresponding to the video information to be played, the video information to be played is stored in the storage unit through the first storage module 302, and the identifier information to be played is stored in the receiving buffer queue through the second storage module 303. If the received playing information only includes the identification information to be played, the corresponding video information to be played is extracted from the storage unit through the extraction module 304 based on the identification information to be played. When the video information to be played needs to be circularly played, the video information to be played is only required to be extracted from the storage unit based on the identification information to be played corresponding to the video information to be played, so that the video information to be played can be circularly played through the playing module 305, repeated video information to be played is reduced from the server to the electronic equipment, and the bandwidth flow required by the electronic equipment when the video information to be played is circularly played is effectively reduced.
In one possible implementation manner of the embodiment of the present application, the apparatus 30 further includes:
the first judging module is used for judging whether the video information to be played is complete video information or not.
And the first sending module is used for sending a retransmission signal to the server when the received video information to be played is not the complete video information, so that the server retransmits the video information to be played according to the retransmission signal.
The first acquisition module is used for acquiring the complete video information to be played which is resent by the server.
In one possible implementation manner of the embodiment of the present application, when the first sending module sends a retransmission signal to the server and when the first obtaining module obtains the video information to be played, which is retransmitted by the server, the first sending module is specifically configured to:
determining the retransmitted video information to be played as new video information to be played;
a step of judging whether the video information to be played is complete video information is executed until the video information to be played is complete video information,
or when the number of times of sending the retransmission signal reaches the preset number of times and the video information to be played is not the complete video information, sending a damage signal to the server, wherein the damage signal is used for repairing the video information to be played by the server;
And receiving the repaired video information sent by the server, wherein the repaired video information is complete video information.
In one possible implementation manner of the embodiment of the present application, when extracting corresponding video information to be played from the storage unit based on the identification information to be played, the extracting module 304 is specifically configured to:
determining whether identification information to be played exists in a receiving cache queue;
and if the to-be-played identification information exists in the receiving cache queue, acquiring to-be-played video information corresponding to the to-be-played identification information from the storage unit.
The embodiment of the present application provides a server device 40 for playing video, as shown in fig. 3, a server device 40 for playing video may specifically include:
the second obtaining module 401 is configured to obtain video information to be played, and determine identification information to be played corresponding to the video information to be played.
The second determining module 402 is configured to determine whether the to-be-played identification information exists in a sending buffer queue, where the sending buffer queue is a queue for buffering the identification information.
The first determining module 403 is configured to determine that the play information includes the identification information to be played and the video information to be played when the identification information to be played does not exist in the sending buffer queue.
And a third storage module 404, configured to store the identification information to be played in the sending buffer queue.
The second determining module 405 is configured to determine that the play information only includes the identification information to be played when the identification information to be played exists in the sending buffer queue.
The second sending module 406 is configured to send playing information to the electronic device, so that the electronic device plays the video information to be played based on the playing information.
For the embodiment of the present application, the second obtaining module 401 obtains the video information to be played, determines the identifier information to be played corresponding to the video information to be played, and determines, by the second determining module 402, whether the identifier information to be played exists in the sending buffer queue. If the to-be-played identification information does not exist in the sending buffer queue, it is determined that the to-be-played video information is not the repeated video information, the first determining module 403 determines that the to-be-played information includes the to-be-played video information and the to-be-played identification information, and the third storing module 404 stores the to-be-played identification information into the sending buffer queue so as to facilitate receiving the to-be-played video information corresponding to the to-be-played identification information next time, so that it can be determined that the to-be-played video information is the repeated video information. After the identification information to be played is stored in the sending buffer queue, the playing information is sent to the electronic device through the second sending module 406. If the to-be-played identification information exists in the sending cache queue, the to-be-played video information is determined to be the repeated video information, the second determining module 405 determines that the to-be-played information only includes the to-be-played identification information, and sends the to-be-played information to the electronic device through the second sending module 406, so that the number of times of sending the repeated to-be-played video information to the electronic device is reduced. If the video information to be played is the repeated video information, the server only needs to send the identification information to be played to the electronic equipment, and the bandwidth flow required by the electronic equipment when the video information to be played is circularly played is effectively reduced.
In one possible implementation manner of the embodiment of the present application, the apparatus 40 further includes:
and the third sending module is used for resending the video information to be played to the electronic equipment when receiving the resending signal sent by the electronic equipment.
And the repair module is used for repairing the video information to be played when the number of times of retransmitting the video information to be played reaches the preset number of times and the damage signal sent by the electronic equipment is received, so as to obtain repaired video information.
And the fourth sending module is used for sending the repaired video information to the electronic equipment.
In one possible implementation manner of the embodiment of the present application, when repairing video information to be played, the repairing module is specifically configured to:
and replacing the video information to be played with the video information to be played acquired next time.
In one possible implementation manner of this embodiment of the present application, when determining the to-be-played identification information corresponding to the to-be-played video information, the first determining module 403 is specifically configured to:
converting the format of the video information to be played to obtain a portable network graph;
and calculating an MD5 value based on the portable network graph, and determining the MD5 value as identification information to be played.
In one possible implementation manner of this embodiment of the present application, when the identifier information to be played is stored in the sending buffer queue, the third storage module 404 is specifically configured to:
Receiving a video information storage completion signal sent by electronic equipment;
and storing the identification information to be played into a transmission buffer queue according to the video information storage completion signal.
In this embodiment of the present application, the first acquisition module and the second acquisition module 401 may be the same acquisition module or may be different acquisition modules. The first storage module 302, the second storage module 303, and the third storage module 404 may be the same storage module, may be different storage modules, or may be partially the same storage module. The first determining module 403 and the second determining module 405 may be the same determining module, different determining modules, or partially the same determining module. The first judgment module and the second judgment module 402 may be the same judgment module or different judgment modules. The first transmitting module, the second transmitting module 406, the third transmitting module, and the fourth transmitting module may be the same transmitting module, may be different transmitting modules, or may be partially the same transmitting module.
The embodiment of the present application provides a device 30 for playing video and a server device 40 for playing video, which are applicable to the above embodiment of the method, and are not described herein in detail.
In an embodiment of the present application, as shown in fig. 4, an electronic device 50 shown in fig. 4 includes: a processor 501 and a memory 503. The processor 501 is coupled to a memory 503, such as via a bus 502. Optionally, the electronic device 50 may also include a transceiver 504. It should be noted that, in practical applications, the transceiver 504 is not limited to one, and the structure of the electronic device 50 is not limited to the embodiment of the present application.
The processor 501 may be a CPU (Central Processing Unit ), general purpose processor, DSP (Digital Signal Processor, data signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 501 may also be a combination that implements computing functionality. For example, comprising one or more combinations of microprocessors, a combination of a DSP and a microprocessor, and the like.
Bus 502 may include a path to transfer information between the components. Bus 502 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect Standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. The bus 502 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus.
The Memory 503 may be, but is not limited to, ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, EEPROM (Electrically Erasable Programmable Read Only Memory ), CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 503 is used to store application code for executing the present application and is controlled by the processor 501 for execution. The processor 501 is configured to execute the application code stored in the memory 503 to implement what is shown in the foregoing method embodiments.
Among them, electronic devices include, but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. But may also be a server or the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
In an embodiment of the present application, as shown in fig. 5, a server 60 is provided, where the server 60 shown in fig. 5 includes: a processor 601 and a memory 603. The processor 601 is coupled to a memory 603, such as via a bus 602. Optionally, the server 60 may also include a transceiver 604. It should be noted that, in practical applications, the transceiver 604 is not limited to one, and the structure of the server 60 is not limited to the embodiment of the present application.
The processor 601 may be a CPU (Central Processing Unit ), general purpose processor, DSP (Digital Signal Processor, data signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 601 may also be a combination of computing functions. For example, comprising one or more combinations of microprocessors, a combination of a DSP and a microprocessor, and the like.
Bus 602 may include a path to transfer information between the components. Bus 602 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect Standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. The bus 602 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 5, but not only one bus or one type of bus.
The Memory 603 may be, but is not limited to, ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, EEPROM (Electrically Erasable Programmable Read Only Memory ), CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 603 is used for storing application program codes for executing the present application and is controlled to be executed by the processor 601. The processor 601 is arranged to execute application code stored in the memory 603 for implementing what is shown in the foregoing method embodiments.
Wherein the server includes, but is not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The server illustrated in fig. 5 is merely an example, and should not be construed as limiting the functionality and scope of use of the disclosed embodiments.
Embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when run on an electronic device, enables the electronic device to perform the corresponding content of the foregoing method embodiments. Compared with the related art, in the embodiment of the application, the electronic device resends the video information to be played as new video information to be played, and executes the step of judging whether the video information to be played is complete video information again until the video information to be played is complete video information or sends a resending signal to reach the preset times, but the received video information to be played is not complete video information at the moment, a damage signal is sent to the server, so that the server determines that the video information to be played is damaged. The method is used for judging the integrity of the video information to be played, so that the situation that the video information to be played is damaged due to the existence of other factors is reduced. If the electronic equipment determines that the video information to be played is damaged, the video information to be played can be fed back to the server in time, and the server repairs the video to be played, so that the video information to be played can be normally played on the electronic equipment.
Embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when run on a server, enables the server to perform the corresponding content of the foregoing method embodiments. Compared with the related art, in the embodiment of the application, the server acquires the video information to be played and determines the identification information to be played corresponding to the video information to be played, and judges whether the identification information to be played exists in a sending cache queue of the server so as to determine whether the video information to be played corresponding to the identification information to be played is repeated video information. If the to-be-played identification information does not exist in the sending cache queue, determining that the to-be-played video information is not the repeated video information, and storing the to-be-played identification information into the sending cache queue so as to facilitate the next receiving of the to-be-played video information corresponding to the to-be-played identification information, and determining that the to-be-played video information is the repeated video information through the to-be-played identification information. After the identification information to be played is stored in the sending buffer queue, the playing information sent to the electronic equipment comprises the video information to be played and the identification information to be played. If the identification information to be played exists in the sending cache queue, determining that the video information to be played is repeated video information. The playing information sent to the electronic equipment only comprises the identification information to be played, so that the number of times of sending repeated video information to be played to the electronic equipment is reduced. If the video information to be played is the repeated video information, the server only needs to send the identification information to be played to the electronic equipment, and the bandwidth flow required by the electronic equipment when the video information to be played is circularly played is effectively reduced.
The embodiment of the application provides a system for playing video, which comprises: an electronic device 50 and a server 60, wherein:
the electronic device 50 interacts with the server 60;
the server 60 is configured to obtain video information to be played and determine identification information to be played corresponding to the video information to be played; judging whether the identification information to be played exists in the sending cache queue; if not, determining that the playing information comprises the identification information to be played and the video information to be played; storing the identification information to be played into a transmission buffer queue; if yes, determining that the playing information only comprises the identification information to be played; sending the play information to the electronic device 50;
the electronic device 50 is configured to receive playing information; when the playing information comprises the video information to be played and the identification information to be played corresponding to the video information to be played, storing the video information to be played into a storage unit; storing the identification information to be played into a receiving buffer queue; when the playing information only comprises the identification information to be played, extracting corresponding video information to be played from the storage unit based on the identification information to be played; and playing the video information to be played.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present application and it should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method of playing video, comprising: is executed by an electronic device, comprising:
receiving playing information sent by a server;
if the playing information comprises the video information to be played and the identification information to be played corresponding to the video information to be played, storing the video information to be played into a storage unit;
storing the identification information to be played into a receiving cache queue, wherein the receiving cache queue is a queue for caching the identification information;
if the playing information only comprises the identification information to be played, extracting the corresponding video information to be played from the storage unit based on the identification information to be played;
and playing the video information to be played.
2. The method for playing video according to claim 1, wherein storing the video information to be played to a storage unit further comprises:
Judging whether the video information to be played is complete video information or not;
if the received video information to be played is not the complete video information, a resending signal is sent to the server, so that the server resends the complete video information to be played according to the resending signal;
and obtaining the video information to be played which is resent by the server.
3. The method for playing video according to claim 2, wherein the sending a retransmission signal to the server, obtaining the video information to be played retransmitted by the server, includes:
determining the retransmitted video information to be played as new video information to be played;
executing the step of judging whether the video information to be played is complete video information or not until the video information to be played is the complete video information,
or when the number of times of sending the retransmission signal reaches a preset number of times and the video information to be played is not the complete video information, sending a damage signal to the server, wherein the damage signal is used for repairing the video information to be played by the server;
And receiving the repaired video information sent by the server, wherein the repaired video information is the complete video information.
4. The method according to claim 1, wherein the extracting the corresponding video information to be played from the storage unit based on the identification information to be played comprises:
determining whether the identification information to be played exists in the receiving cache queue;
and if the identification information to be played exists in the receiving cache queue, acquiring the video information to be played corresponding to the identification information to be played from the storage unit.
5. A method of playing video, performed by a server, comprising:
acquiring video information to be played, and determining identification information to be played corresponding to the video information to be played;
judging whether the identification information to be played exists in a sending cache queue, wherein the sending cache queue is used for caching the identification information corresponding to the video information which is successfully sent to the electronic equipment;
if the identification information to be played does not exist in the sending cache queue, determining that the playing information comprises the identification information to be played and the video information to be played;
Storing the identification information to be played into the sending cache queue;
if the identification information to be played exists in the sending cache queue, determining that the playing information only comprises the identification information to be played;
and sending the playing information to the electronic equipment so that the electronic equipment plays the video information to be played based on the playing information.
6. The method of playing video according to claim 5, wherein said sending said playing information to said electronic device further comprises:
if a retransmission signal sent by the electronic equipment is received, retransmitting the video information to be played to the electronic equipment;
if the number of times of resending the video information to be played reaches a preset number of times and a damage signal sent by the electronic equipment is received, repairing the video information to be played to obtain repaired video information;
and sending the repaired video information to the electronic equipment.
7. The method for playing video according to claim 6, wherein the repairing the video information to be played comprises:
and replacing the video information to be played with the video information to be played acquired next time.
8. The method for playing video according to claim 5, wherein determining the identification information to be played corresponding to the video information to be played comprises:
converting the format of the video information to be played to obtain a portable network graph;
and calculating an MD5 value based on the portable network graph, and determining the MD5 value as the identification information to be played.
9. The method for playing video according to claim 5, wherein storing the identification information to be played in the transmission buffer queue comprises:
receiving a video information storage completion signal sent by the electronic equipment;
and storing the identification information to be played into the sending cache queue according to the video information storage completion signal.
10. A system for playing video, comprising: electronic equipment and server, wherein:
the electronic equipment performs information interaction with the server;
the server is used for acquiring video information to be played and determining identification information to be played corresponding to the video information to be played; judging whether the identification information to be played exists in a sending cache queue or not; if not, determining that the playing information comprises the identification information to be played and the video information to be played; storing the identification information to be played into the sending cache queue; if yes, determining that the playing information only comprises the identification information to be played; sending the playing information to the electronic equipment;
The electronic equipment is used for receiving the playing information; when the playing information comprises video information to be played and identification information to be played corresponding to the video information to be played, storing the video information to be played into a storage unit; storing the identification information to be played into a receiving cache queue; when the playing information only comprises the identification information to be played, extracting the corresponding video information to be played from the storage unit based on the identification information to be played; and playing the video information to be played.
CN202111556753.7A 2021-12-17 2021-12-17 Method and system for playing video Active CN114257879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111556753.7A CN114257879B (en) 2021-12-17 2021-12-17 Method and system for playing video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111556753.7A CN114257879B (en) 2021-12-17 2021-12-17 Method and system for playing video

Publications (2)

Publication Number Publication Date
CN114257879A CN114257879A (en) 2022-03-29
CN114257879B true CN114257879B (en) 2023-05-12

Family

ID=80792928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111556753.7A Active CN114257879B (en) 2021-12-17 2021-12-17 Method and system for playing video

Country Status (1)

Country Link
CN (1) CN114257879B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277704B (en) * 2022-09-27 2022-12-27 美冠(北京)科技有限公司 Cloud playing system based on distributed preloading

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102111685A (en) * 2011-02-24 2011-06-29 深信服网络科技(深圳)有限公司 Acceleration method, equipment and system for network video loading
CN102143192A (en) * 2010-01-28 2011-08-03 ***通信集团江西有限公司 Method, terminal and server for transmitting peer-to-peer video file
CN104320707A (en) * 2014-09-19 2015-01-28 小米科技有限责任公司 Playback method and device of network video
CN105491395A (en) * 2015-12-09 2016-04-13 福建天晴数码有限公司 Server video management method and system
CN108965910A (en) * 2018-08-09 2018-12-07 网宿科技股份有限公司 A kind of video cache method and player
CN108989907A (en) * 2018-08-22 2018-12-11 深圳市网心科技有限公司 Live data streams processing method and system, electronic device and computer readable storage medium
CN110809167A (en) * 2018-08-06 2020-02-18 ***通信有限公司研究院 Video playing method and device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188574B (en) * 2011-12-28 2017-04-19 华为技术有限公司 method and system for transmitting network video
CN110740353B (en) * 2018-07-20 2021-07-09 阿里巴巴(中国)有限公司 Request identification method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143192A (en) * 2010-01-28 2011-08-03 ***通信集团江西有限公司 Method, terminal and server for transmitting peer-to-peer video file
CN102111685A (en) * 2011-02-24 2011-06-29 深信服网络科技(深圳)有限公司 Acceleration method, equipment and system for network video loading
CN104320707A (en) * 2014-09-19 2015-01-28 小米科技有限责任公司 Playback method and device of network video
CN105491395A (en) * 2015-12-09 2016-04-13 福建天晴数码有限公司 Server video management method and system
CN110809167A (en) * 2018-08-06 2020-02-18 ***通信有限公司研究院 Video playing method and device, electronic equipment and storage medium
CN108965910A (en) * 2018-08-09 2018-12-07 网宿科技股份有限公司 A kind of video cache method and player
CN108989907A (en) * 2018-08-22 2018-12-11 深圳市网心科技有限公司 Live data streams processing method and system, electronic device and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Distributed Content Based Video Identification in Peer-to-Peer Networks: Requirements and Solutions";Alper Koz等;《IEEE Transactions on Multimedia ( Volume: 19, Issue: 3, March 2017)》;全文 *
王静."基于客户端的视频重复数据删除方案设计".《中国优秀硕士学位论文全文数据库》.2020,全文. *

Also Published As

Publication number Publication date
CN114257879A (en) 2022-03-29

Similar Documents

Publication Publication Date Title
CN201075279Y (en) Image display device with image buffer memory storing device
EP4329323A3 (en) Dynamic conditionaladvertisement insertion
RU2011142772A (en) SYSTEM AND METHOD FOR SELECTING A VIDEO CODING FORMAT BASED ON FEEDBACK
RU2011142767A (en) SYSTEM AND METHOD OF VIDEO COMPRESSION USING FEEDBACK, INCLUDING DATA CONNECTED TO SUCCESSFUL RECEPTION OF VIDEO CONTENT
JP2017519467A5 (en)
JP2008065834A (en) Fusion memory device and method
US20090073007A1 (en) Decoding variable length codes in media applications
CN114257879B (en) Method and system for playing video
US20060203908A1 (en) Method and apparatus for loading image data
GB2507554A (en) Encoding diagnostic data in an error message for a computer program
US7689047B2 (en) Reduced buffer size for JPEG encoding
CN111669577A (en) Hardware decoding detection method and device, electronic equipment and storage medium
CN112138376A (en) Cloud game archiving method and device and electronic equipment
US20160335734A1 (en) Memory subsystem synchronization primitives
CN110225399B (en) Streaming media processing method and device, computer equipment and storage medium
CN1984228A (en) Image forming system and method
US20090074314A1 (en) Decoding variable lenght codes in JPEG applications
WO2023083213A1 (en) Data decoding method and apparatus, electronic device and readable storage medium
CN113747063B (en) Video transmission method and device, electronic equipment and readable storage medium
KR101539260B1 (en) Apparatus and method for lossless coding and decoding image selectively
CN111279694A (en) GDR code stream encoding method, terminal device and machine readable storage medium
US8280177B2 (en) Encoding device using parallelized encoding, decoding device using parallelized decoding, and image forming device, method, and program storage medium including the same
CN110795405B (en) Fragment data restoration method, terminal device and storage medium
US20170099350A1 (en) Apparatus and method for transmitting mass data
CN1984339A (en) Method and system for storing data packets

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 518051 floor 17, block B, sunshine science and innovation center, No. 2, Shanghua Road, Nanshan street, Nanshan District, Shenzhen, Guangdong Province

Patentee after: Shenzhen Ruiyun Technology Co.,Ltd.

Address before: 518051 floor 17, block B, sunshine science and innovation center, No. 2, Shanghua Road, Nanshan street, Nanshan District, Shenzhen, Guangdong Province

Patentee before: SHENZHEN RAYVISION TECHNOLOGY CO.,LTD.

CP01 Change in the name or title of a patent holder