CN115002539A - Video caching method and device, electronic equipment and storage medium - Google Patents

Video caching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115002539A
CN115002539A CN202210779856.8A CN202210779856A CN115002539A CN 115002539 A CN115002539 A CN 115002539A CN 202210779856 A CN202210779856 A CN 202210779856A CN 115002539 A CN115002539 A CN 115002539A
Authority
CN
China
Prior art keywords
video
network
downloading
user
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210779856.8A
Other languages
Chinese (zh)
Inventor
林翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Weiwo Software Technology Co ltd
Original Assignee
Nanjing Weiwo Software 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 Nanjing Weiwo Software Technology Co ltd filed Critical Nanjing Weiwo Software Technology Co ltd
Priority to CN202210779856.8A priority Critical patent/CN115002539A/en
Publication of CN115002539A publication Critical patent/CN115002539A/en
Pending legal-status Critical Current

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/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/485End-user interface for client configuration

Landscapes

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

Abstract

The application discloses a video caching method, a video caching device, electronic equipment and a storage medium, which belong to the technical field of multimedia, and the method comprises the following steps: receiving a first input of a user; setting a video size and a cache video expiration time previously cached from a network in response to the first input; and downloading the video from the network for pre-caching according to the set video size and the cache video expiration time.

Description

Video caching method and device, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of multimedia, and particularly relates to a video caching method and device, electronic equipment and a storage medium.
Background
In recent years, with the rapid development of internet technology and the upgrade of hardware configuration of electronic devices, the functions of electronic devices are becoming more and more rich, and more users use electronic devices to carry out entertainment activities, for example, watching short videos. At present, network conditions of different environments where a user is located when watching a short video are usually different, for example, in some environments, there is no network, in some environments, there is a network but a network signal is unstable, or in some environments, only a cellular network has no wireless network, and the user wants to save cellular data traffic overhead while the electronic device can smoothly play the video in various network environments.
However, in the related art, when a user is in an environment without a network or in an environment with a network but unstable network signals, the electronic device cannot successfully or smoothly play the short video; when a user is in an environment with only a cellular network and no wireless network, the electronic device may consume more cellular data traffic to play the short video. Therefore, the related technology cannot balance smooth playing of short videos and low cost of cellular data flow, and cannot meet the diversified requirements of users on playing of short videos by electronic equipment.
Disclosure of Invention
The embodiment of the application aims to provide a video caching method, a video caching device, electronic equipment and a storage medium, and solves the problems that in the prior art, the balance between smooth playing of short videos and low cost of cellular data flow cannot be achieved, and diversified requirements of users for playing the short videos by the electronic equipment cannot be met.
In a first aspect, an embodiment of the present application provides a video caching method, including:
receiving a first input of a user;
setting a video size and a cache video expiration time previously cached from a network in response to the first input;
and downloading the video from the network for pre-caching according to the set video size and the cache video expiration time.
In a second aspect, an embodiment of the present application provides a video caching apparatus, including:
the first receiving module is used for receiving a first input of a user;
the setting module is used for responding to the first input and setting the size of the video cached from the network in advance and the invalidation time of the cached video;
and the cache module is used for downloading the video from the network for pre-caching according to the set video size and the cache video failure time.
In a third aspect, embodiments of the present application provide an electronic device, which includes a processor and a memory, where the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product, stored on a storage medium, for execution by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, the video size and the cache video expiration time cached from the network in advance can be set by a user, and the video is downloaded from the network for caching in advance according to the set video size and the cache video expiration time, so that when a subsequent user uses the electronic device to watch the video, the electronic device can read the cached video from the electronic device to play in due time and in due amount based on the network state of the environment where the user is located, so as to achieve the balance between the smooth playing of the short video and the low cost of the cellular data flow, and meet the diversified requirements of the user on the playing of the short video by the electronic device.
Drawings
Fig. 1 is a flowchart of a video caching method according to an embodiment of the present application;
fig. 2 is an exemplary diagram of a video cache setting interface provided in an embodiment of the present application;
fig. 3 is an exemplary diagram of software and hardware modules of an electronic device related to a video caching method according to an embodiment of the present application;
fig. 4 is an exemplary diagram of a play mode selection interface provided in an embodiment of the present application;
fig. 5 is a block diagram illustrating a structure of a video caching apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 7 is a hardware structure diagram of an electronic device implementing various embodiments of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived from the embodiments in the present application by a person skilled in the art, are within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/", and generally means that the former and latter related objects are in an "or" relationship.
Along with the development of science and technology, the functions and applications of electronic devices such as mobile phones are more and more abundant, and meanwhile, with the increasing strength of Artificial Intelligence (AI) algorithms, short video Application programs (APPs) have several advantages: the video that fragmentation time was watched, was understood your hobby and was interested in of automatic propelling movement your receives more and more multi-user's liking, and more users spend the time on short video APP more than traditional long video APP, and it becomes the most general hobby in vast electronic equipment user to brush short video at idle time.
In the related art, many users like to brush short videos on planes, high-speed rails or subways on and off duty, and at this time, because there is no network or there is a network but the signal is unstable, many short videos cannot be played successfully or smoothly. In addition, the short video consumes a large amount of traffic, most of the users have their operators with a limited amount of traffic, and watching the short video with the cellular data traffic for a long time also results in insufficient traffic of the electronic device, which requires additional cost to charge the traffic. Therefore, the related technology cannot balance smooth playing of short videos and low cost of cellular data flow, and cannot meet the diversified requirements of users on playing of short videos by electronic equipment.
In order to solve the foregoing technical problem, embodiments of the present application provide a video caching method and apparatus, an electronic device, and a storage medium.
The video caching method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
It should be noted that the video caching method provided in the embodiment of the present application is applicable to an electronic device, and in practical application, the electronic device may include: the mobile terminal includes a smart phone, a tablet computer, a personal digital assistant, and the like, which is not limited in the embodiment of the present application.
Fig. 1 is a flowchart of a video caching method according to an embodiment of the present application, and as shown in fig. 1, the method may include the following steps: step 101, step 102 and step 103, wherein,
in step 101, a first input of a user is received.
In step 102, in response to a first input, a video size and a cache video expiration time previously cached from a network are set.
In the embodiment of the present application, the video cached from the network may be a short video, a medium-length video, or a long video. For ease of understanding, the following description will be given by taking short videos as an example.
In order to ensure that the electronic device can smoothly play the short videos in various network environments, the electronic device may support a user to cache some short videos from the network to the local electronic device in advance.
In the embodiment of the application, a user can set the video size cached from the network and the cache video expiration time by inputting a first input on the electronic device, wherein the first input may be gesture-related input such as click input, slide input or text input, and may also be voice input.
In some embodiments, the electronic device may provide a video cache setting interface, wherein the video cache setting interface may include: the user sets the video size cached from the network and the cache video dead time by carrying out first input on the above controls.
In an example, a short video cache setting control may be added to a video playing interface of the electronic device, and the user may click the control when going out or about to leave a WiFi area, and after the electronic device detects that the user clicks the control, the video cache setting interface shown in fig. 2 is displayed, so that the user selects the size of the target cache video and the cache video expiration time (the cached short video occupies a memory, and is set to be automatically deleted after a period of time, and releases the memory). The user can select the corresponding video cache size and the video failure time according to the own requirements, and can also customize. After the user finishes checking, the electronic equipment can automatically cache videos with corresponding sizes for the user according to the preference of the user for watching the short videos, and starts a timer to automatically delete the corresponding short videos after the time point set by the user.
In the embodiment of the application, in order to reduce the occupancy rate of the storage space of the electronic device, the cached videos in the electronic device reaching the video failure time can be deleted, so that the memory occupied by the videos is released to avoid occupying the storage space of the electronic device for a long time.
In another example, the electronic device may implement pre-caching of the short video by using a combination of software and hardware as shown in fig. 3, and as shown in fig. 3, the electronic device may include: the video recommendation method comprises a processor, a storage and a timer, wherein a video recommendation algorithm and a short video APP are run in the processor, the video recommendation algorithm is an algorithm formed according to the preference of a user when the user watches short videos, the timer is used for informing the storage to delete cached videos after the time according to the short video dead time (also called video release time) set by the user, and the storage is used for storing the cached videos and can be a memory specifically. After the user finishes the cache setting, the processor caches videos with corresponding sizes in the background to the memory according to the setting of the user, the videos start in the WiFi mode by default, the user is reminded whether to use flow to download in the non-WiFi mode, and the main page of the electronic equipment can prompt the user that the downloading is finished after the downloading is finished. After the video downloading is completed, when a user opens the corresponding short video APP, the electronic equipment can detect the network state of the electronic equipment, and a short video playing strategy matched with the current network state is adopted according to the current network state of the electronic equipment.
In step 103, downloading the video from the network for pre-caching according to the set video size and the cache video expiration time.
It can be seen from the above embodiments that, in this embodiment, the video size and the cache video expiration time that are cached from the network in advance can be set by the user, and the video is downloaded from the network to be cached in advance according to the set video size and the cache video expiration time, so that when a subsequent user uses the electronic device to watch the video, the electronic device can read the cached video from the electronic device to play in due time and in due amount based on the network state of the environment where the user is located, so as to achieve the balance between the smooth play of the short video and the low overhead of the cellular data traffic, and can meet the diversified demands of the user on the electronic device to play the short video.
In another embodiment provided by the present application, the video caching method provided may add the following steps (not shown in the figure) after step 103 in the embodiment shown in fig. 1: step 104, step 105 and step 106, wherein,
in step 104, in case that the network status of the electronic device is a cellular network connection status, a second input of the user is received.
In this embodiment, the second input may be a click input, for example, a click input to the video playing control.
In step 105, in response to the second input, a target push ratio of the cached video to the network downloaded video is determined.
In the embodiment of the application, the target push proportion carries the proportion of the cached video in the video pushed to the user and the proportion of the network downloaded video.
In some embodiments, the target push ratio of the cached video to the network-downloaded video may be determined according to a play mode selected by a user, and accordingly, the step 105 may include the following steps (not shown in the figure): sub-steps 1051 and 1052, wherein,
in sub-step 1051, in response to a second input, a user selected playback mode is determined.
In the embodiment of the application, in order to ensure that the electronic device can smoothly play the short video while reducing the cellular data traffic overhead in the cellular network environment, the electronic device can support a user to set multiple play modes. For example, when the network state of the electronic device is the cellular network connection state, a play mode selection interface is displayed, where the play mode selection interface includes a plurality of play mode selection controls, and different play mode selection controls correspond to different play modes; a user selection input to a playback mode selection control is received, and a playback mode selected by the user is determined in response to the selection input. Wherein the selection input may be a click input or a slide input.
In one example, when the user turns on the short video APP, if the short video APP is detected to be in a cellular network connection state, a play mode selection interface as shown in fig. 4 is displayed to ask the user whether to enter a traffic-free mode, a low traffic mode, or a normal traffic mode.
In the sub-step 1052, determining a target push ratio of the cached video and the network downloaded video according to the play mode; when the play mode is a traffic-free mode, the target push ratio is 1: 0; when the play mode is a low-flow mode, the target push proportion is M to N, wherein M is greater than N, and M and N are positive integers; when the play mode is the normal traffic mode, the target push ratio is 1: 1.
When the play mode selected by the user is the traffic-free mode, the target push ratio is 1:0, that is, after the user selects the traffic-free mode, the short video APP only pushes out the video from the buffered video for the user to watch, and a new video cannot be downloaded.
When the play mode selected by the user is the low-flow mode, the target push ratio is M: N, wherein M is larger than N, and M and N are positive integers, that is, after the user selects the low-flow mode, the number of the cached videos in the played short videos is pushed to the user and is larger than the number of videos downloaded from the network in real time.
When the play mode selected by the user is the normal flow mode, the target push ratio is 1: 1. That is, when the user selects the low traffic mode or the normal traffic mode, the electronic device may simultaneously download and push new videos (e.g., some users like to pay attention to first hand news or messages) while pushing the cached videos to the user. The ratio of the pushed new video to the buffered video is different depending on the selection mode, e.g. 1:5 in low traffic mode and 1:1 in normal traffic mode.
In some embodiments, in addition to the three play modes, at least one of the following two play modes may be included: the target push ratio of the cache video to the network download video is P: Q, P is less than Q, P and Q are positive integers, and the target push ratio of the cache video to the network download video is 0: 1.
In step 106, according to the target push ratio, reading the cache video of the first ratio from the electronic device and downloading the video of the second ratio from the network for playing.
In some embodiments, in consideration of the network speed of the cellular network fluctuating, for example, the network speed fluctuates at different times of the same location, or the network speed fluctuates as the electronic device moves from one location to another location, for this case, during the process of playing the video, the speed of the network may be detected in real time, the push proportion of the buffered video is dynamically adjusted according to the speed of the network, and accordingly, after the step 106, the following steps (not shown in the figure) may be added: step 107, in which the step of determining the position of the target,
in step 107, the download rate of the cellular network is detected, and when the download rate of the cellular network is detected to be lower than the first preset rate threshold, the push proportion of the cached video is increased until the download rate of the cellular network is detected to be not lower than the first preset rate threshold, and the push proportion of the cached video is reduced to the first proportion.
That is, when the rate of the network is low, the percentage of the cached video in the video pushed to the user is increased, and when the rate of the network returns to normal, the percentage of the cached video in the video pushed to the user is reduced to the first ratio, so that smooth playing of the video in the playing process is ensured.
In this embodiment, the first preset rate threshold may be a minimum download rate required for smoothly downloading the video in the cellular network connection state.
For example, in the low traffic mode or the normal traffic mode, when the electronic device detects that the download rate of the cellular network is low (the low download rate easily causes a jam during downloading a new video), the push ratio of the cached video is gradually increased until the download rate of the cellular network returns to normal, and then the electronic device gradually returns to the previous push ratio of the new video and the cached video.
Therefore, in the embodiment of the application, when the user is in an environment where only the cellular network does not have the wireless network, the electronic device can synchronously download and push new videos while pushing the short videos cached in the electronic device to the user according to the user requirement, so that the electronic device can smoothly play the short videos, and meanwhile, the cellular data traffic overhead of the electronic device is saved.
In yet another embodiment provided by the present application, the video caching method provided may add the following steps (not shown in the figure) after step 103 in the embodiment shown in fig. 1: step 108, wherein the step of,
in step 108, under the condition that the network state of the electronic device is the wireless network WiFi connection state and the download rate of the WiFi is lower than the second preset rate threshold, reading the cache video from the electronic device for playing, until the download rate of the WiFi is not lower than the second preset rate threshold, stopping reading the cache video from the electronic device, and downloading the video from the network for playing.
In this embodiment of the application, the second preset rate threshold may be a minimum download rate required for smoothly downloading a video in the WiFi connection state.
In an example, when the user turns on the short video APP, the electronic device detects whether WiFi is connected locally in real time, and if it is detected that WiFi is connected and the download rate of WiFi is normal (that is, the download rate of WiFi is not lower than the second preset rate threshold), the cached video is not played, but a new video is continuously downloaded through WiFi to the user for watching. When the downloading rate of the WiFi is lower than a certain downloading rate (the downloading rate of the WiFi is low, so that the situation that a user is stuck when downloading a new video is easy to occur), a part of cache video is called to be watched by the user, and the new video is downloaded again for the user to watch until the downloading rate of the WiFi returns to normal. And after the watched cache video is finished for 1 minute, the cache video is automatically deleted (the situation that the user repeatedly watches is prevented), and the storage space of the electronic equipment is released.
Therefore, in the embodiment of the application, when the network state of the electronic device is the WiFi connection state but the downloading rate of the WiFi is low, the electronic device downloads the video from the network and the video is stuck, and in order to ensure that the electronic device can smoothly play the short video for the user, the cached video in the electronic device can be read to play until the WiFi downloading rate returns to normal.
In yet another embodiment provided by the present application, the video caching method provided may add the following steps (not shown in the figure) after step 103 in the embodiment shown in fig. 1: in step 109, the process, wherein,
in step 109, in the case that the network status of the electronic device is the non-networking status, the cached video is read from the electronic device for playing.
Therefore, in the embodiment of the application, when the network state of the electronic device is the non-networking state, the electronic device cannot access the internet, and in order to ensure that the electronic device can smoothly play the short video for the user, the cached video in the electronic device can be read for playing.
To sum up, in the embodiment of the application, when the electronic device plays the short video, different playing strategies can be adopted according to different network states of the environment where the user is located, and when the user is in an environment without a network or in an environment with a network but unstable network signals, the short video cached in the electronic device in advance can be played, so that the electronic device can smoothly play the short video. When the user is in an environment where only the cellular network does not have the wireless network, the electronic device can synchronously download and push new videos while pushing the short videos cached in the electronic device to the user according to the requirements of the user, so that the electronic device can smoothly play the short videos, and meanwhile, the cost of cellular data flow of the electronic device is saved. Therefore, in the prior art, the balance between smooth playing of short videos and low cost of cellular data flow can be achieved, and the diversified requirements of users on playing of the short videos by the electronic equipment can be met.
According to the video caching method provided by the embodiment of the application, the execution main body can be a video caching device. In the embodiment of the present application, a video caching method executed by a video caching apparatus is taken as an example, and the video caching apparatus provided in the embodiment of the present application is described.
Fig. 5 is a block diagram of a video buffering apparatus according to an embodiment of the present disclosure, and as shown in fig. 5, the video buffering apparatus 500 may include: a first receiving module 501, a setting module 502 and a caching module 503, wherein,
a first receiving module 501, configured to receive a first input of a user;
a setting module 502, configured to set, in response to the first input, a video size and a cache video expiration time that are cached from a network in advance;
the caching module 503 is configured to download the video from the network for caching in advance according to the set video size and the set cache video expiration time.
It can be seen from the above embodiments that, in this embodiment, the video size and the cache video expiration time that are cached from the network in advance can be set by the user, and the video is downloaded from the network to be cached in advance according to the set video size and the cache video expiration time, so that when a subsequent user uses the electronic device to watch the video, the electronic device can read the cached video from the electronic device to play in due time and in due amount based on the network state of the environment where the user is located, so as to achieve the balance between the smooth play of the short video and the low overhead of the cellular data traffic, and can meet the diversified demands of the user on the electronic device to play the short video.
Optionally, as an embodiment, the video caching apparatus 500 may further include:
the second receiving module is used for receiving a second input of the user under the condition that the network state of the electronic equipment is a cellular network connection state;
the determining module is used for responding to the second input, and determining a target push proportion of the cache video and the network downloading video;
and the first playing module is used for reading the cache video with the first proportion from the electronic equipment and downloading the video with the second proportion from the network for playing according to the target push proportion.
Optionally, as an embodiment, the determining module may include:
a first determining sub-module for determining the user-selected play mode in response to the second input;
the second determining submodule is used for determining the target push proportion of the cached video and the network downloaded video according to the play mode;
when the play mode is a traffic-free mode, the target push proportion is 1: 0;
when the play mode is a low-flow mode, the target push proportion is M to N, wherein M is larger than N, and M and N are positive integers;
and when the play mode is a normal flow mode, the target push proportion is 1: 1.
Optionally, as an embodiment, the video caching apparatus 500 may further include:
the adjustment module is configured to detect a download rate of the cellular network after reading the cached video of the first ratio from the electronic device and downloading the video of the second ratio from the network for playing, increase a push ratio of the cached video until the download rate of the cellular network is detected to be not lower than a first preset rate threshold when detecting that the download rate of the cellular network is lower than the first preset rate threshold, and decrease the push ratio of the cached video to the first ratio.
Optionally, as an embodiment, the video caching apparatus 500 may further include:
and the second playing module is used for reading the cache video from the electronic equipment to play under the condition that the network state of the electronic equipment is a wireless network WiFi connection state and the downloading rate of WiFi is lower than a second preset rate threshold value until the downloading rate of WiFi is not lower than the second preset rate threshold value, stopping reading the cache video from the electronic equipment, and downloading the video from the network to play.
Optionally, as an embodiment, the video caching apparatus 500 may further include:
and the third playing module is used for reading the cache video from the electronic equipment to play the cache video under the condition that the network state of the electronic equipment is the non-networking state.
The video caching apparatus in the embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The electronic Device may be, for example, a Mobile phone, a tablet Computer, a notebook Computer, a palm top Computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an Ultra-Mobile Personal Computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (Television, TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The video caching apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, which is not specifically limited in the embodiment of the present application.
The video caching apparatus provided in the embodiment of the present application can implement each process implemented in the embodiment of the method in fig. 1, and is not described here again to avoid repetition.
Optionally, as shown in fig. 6, an electronic device 600 is further provided in this embodiment of the present application, and includes a processor 601 and a memory 602, where a program or an instruction that can be executed on the processor 601 is stored in the memory 602, and when the program or the instruction is executed by the processor 601, the steps of the above-mentioned embodiment of the video caching method are implemented, and the same technical effects can be achieved, and are not repeated here to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a hardware structure diagram of an electronic device implementing various embodiments of the present application.
The electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power supply (e.g., a battery) for powering the various components, and the power supply may be logically coupled to the processor 710 via a power management system, such that the functions of managing charging, discharging, and power consumption may be performed via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
In one embodiment, a user input unit 707 for receiving a first input by a user;
a processor 710 for setting a video size and a cache video expiration time previously cached from a network in response to the first input; and downloading the video from the network for pre-caching according to the set video size and the cache video expiration time.
Therefore, in the embodiment of the application, the video size and the cache video expiration time cached from the network in advance can be set by the user, and the video is downloaded from the network for caching in advance according to the set video size and the cache video expiration time, so that when a subsequent user uses the electronic device to watch the video, the electronic device can read the cached video from the electronic device to play in due time and in due amount based on the network state of the environment where the user is located, so as to achieve the balance between the smooth playing of the short video and the low cost of the cellular data flow, and meet the diversified requirements of the user on the electronic device for playing the short video.
Optionally, as an embodiment, the user input unit 707 is further configured to receive a second input of the user if the network state of the electronic device is a cellular network connection state;
a processor 710, further configured to determine a target push ratio of the cached video to the network downloaded video in response to the second input; and reading the cache video with the first proportion from the electronic equipment and downloading the video with the second proportion from the network for playing according to the target push proportion.
Optionally, as an embodiment, the processor 710 is further configured to determine, in response to the second input, a play mode selected by the user; determining a target push proportion of the cached video and the network downloaded video according to the play mode; when the play mode is a traffic-free mode, the target push proportion is 1: 0; when the play mode is a low-flow mode, the target push proportion is M to N, wherein M is larger than N, and M and N are positive integers; and when the play mode is a normal flow mode, the target push ratio is 1: 1.
Optionally, as an embodiment, the processor 710 is further configured to detect a download rate of the cellular network after reading the first ratio of the cached video from the electronic device and downloading the second ratio of the video from the network for playing, and in a case that the download rate of the cellular network is detected to be lower than a first preset rate threshold, increase a push ratio of the cached video until the download rate of the cellular network is detected to be not lower than the first preset rate threshold, and decrease the push ratio of the cached video to the first ratio.
Optionally, as an embodiment, the processor 710 is further configured to, when the network state of the electronic device is a wireless network WiFi connection state and a download rate of WiFi is lower than a second preset rate threshold, read the cached video from the electronic device to play, stop reading the cached video in the electronic device until the download rate of WiFi is not lower than the second preset rate threshold, and download the video from the network to play.
Optionally, as an embodiment, the processor 710 is further configured to, in a case that the network status of the electronic device is an unconnected state, read the cached video from the electronic device for playing.
It should be understood that in the embodiment of the present application, the input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics Processing Unit 7041 processes image data of still pictures or videos obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts of a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 709 may be used to store software programs as well as various data. The memory 709 may mainly include a first storage area for storing a program or an instruction and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or an instruction (such as a sound playing function, an image playing function, and the like) required by at least one function, and the like. Further, the memory 709 may include volatile memory or nonvolatile memory, or the memory 709 may include both volatile and nonvolatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (PROM), an erasable programmable Read-only memory (erasabprom, EPROM), an electrically erasable programmable Read-only memory (EEPROM), or a flash memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous Link DRAM (SLDRAM), and a Direct bus RAM (DRRAM). The memory 709 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
Processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor, which primarily handles operations involving the operating system, user interface, and applications, and a modem processor, which primarily handles wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into processor 710.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the video caching method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the above video caching method embodiment, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
Embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the above-mentioned video caching method embodiments, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for buffering video, comprising:
receiving a first input of a user;
setting a video size and a cache video expiration time previously cached from a network in response to the first input;
and downloading the video from the network for pre-caching according to the set video size and the cache video expiration time.
2. The method according to claim 1, wherein after the downloading the video from the network for pre-buffering according to the set video size and the set video expiration time, the method further comprises:
receiving a second input of the user in case that the network status of the electronic device is a cellular network connection status;
in response to the second input, determining a target push ratio of the cached video to the network downloaded video;
and reading the cache video with the first proportion from the electronic equipment and downloading the video with the second proportion from the network for playing according to the target push proportion.
3. The method of claim 2, wherein determining a target push ratio of the cached video to the network downloaded video in response to the second input comprises:
determining, in response to the second input, a play mode selected by the user;
determining a target push ratio of the cached video to the network downloaded video according to the play mode;
when the play mode is a traffic-free mode, the target push proportion is 1: 0;
when the play mode is a low-flow mode, the target push proportion is M to N, wherein M is larger than N, and M and N are positive integers;
and when the play mode is a normal flow mode, the target push proportion is 1: 1.
4. The method of claim 2, wherein after reading the first ratio of the buffered video from the electronic device and downloading the second ratio of the video from the network for playing according to the target push ratio, the method further comprises:
detecting the download rate of the cellular network, and under the condition that the download rate of the cellular network is detected to be lower than a first preset rate threshold, increasing the push proportion of the cached video until the download rate of the cellular network is detected to be not lower than the first preset rate threshold, and reducing the push proportion of the cached video to the first proportion.
5. The method according to claim 1, wherein after the downloading the video from the network for pre-buffering according to the set video size and the set video expiration time, the method further comprises:
and under the condition that the network state of the electronic equipment is a wireless network WiFi connection state and the downloading rate of WiFi is lower than a second preset rate threshold value, reading the cache video from the electronic equipment for playing until the downloading rate of the WiFi is not lower than the second preset rate threshold value, stopping reading the cache video from the electronic equipment, and downloading the video from the network for playing.
6. The method according to claim 1, wherein after the downloading the video from the network for pre-buffering according to the set video size and the set video expiration time, the method further comprises:
and reading the cache video from the electronic equipment to play when the network state of the electronic equipment is the non-networking state.
7. A video buffering apparatus, comprising:
the first receiving module is used for receiving a first input of a user;
the setting module is used for responding to the first input and setting the size of the video cached from the network in advance and the invalidation time of the cached video;
and the cache module is used for downloading the video from the network for pre-caching according to the set video size and the cache video failure time.
8. The apparatus of claim 7, further comprising:
the second receiving module is used for receiving a second input of the user under the condition that the network state of the electronic equipment is a cellular network connection state;
the determining module is used for responding to the second input and determining a target push proportion of the cache video and the network downloading video;
and the first playing module is used for reading the cache video with the first proportion from the electronic equipment and downloading the video with the second proportion from the network for playing according to the target push proportion.
9. An electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions when executed by the processor implementing the steps of the video caching method of any one of claims 1 to 6.
10. A readable storage medium, on which a program or instructions are stored, which program or instructions, when executed by the processor, carry out the steps of the video caching method according to any one of claims 1 to 6.
CN202210779856.8A 2022-07-04 2022-07-04 Video caching method and device, electronic equipment and storage medium Pending CN115002539A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210779856.8A CN115002539A (en) 2022-07-04 2022-07-04 Video caching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210779856.8A CN115002539A (en) 2022-07-04 2022-07-04 Video caching method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115002539A true CN115002539A (en) 2022-09-02

Family

ID=83019493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210779856.8A Pending CN115002539A (en) 2022-07-04 2022-07-04 Video caching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115002539A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150256583A1 (en) * 2015-05-01 2015-09-10 Elemental Technologies, Inc. Content delivery network video content invalidation through adaptive bitrate manifest manipulation
CN108337554A (en) * 2018-02-28 2018-07-27 平潭诚信智创科技有限公司 Smart mobile phone browser video buffer method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150256583A1 (en) * 2015-05-01 2015-09-10 Elemental Technologies, Inc. Content delivery network video content invalidation through adaptive bitrate manifest manipulation
CN108337554A (en) * 2018-02-28 2018-07-27 平潭诚信智创科技有限公司 Smart mobile phone browser video buffer method

Similar Documents

Publication Publication Date Title
CN107659828B (en) Video image quality adjusting method and device, terminal equipment and storage medium
CN107608561B (en) Touch screen control method and device
CN113360238A (en) Message processing method and device, electronic equipment and storage medium
CN105554550A (en) Video playing method and device
CN107613315B (en) Video image quality adjusting method and device, terminal equipment and storage medium
CN107633172B (en) Malicious webpage monitoring method and electronic equipment
EP4351149A1 (en) Display control method and apparatus, and device and storage medium
US20220286740A1 (en) Method and apparatus for video playing
WO2023061358A1 (en) Cache method and apparatus, and electronic device
CN111163504A (en) Power-saving processing method, mobile terminal and computer storage medium
CN110100424B (en) Streaming media data processing method and mobile terminal
US20230328181A1 (en) Video call method and apparatus
CN107608744B (en) Application process management method and device and mobile terminal
CN108073610B (en) Method and device for realizing webpage loading
CN112565870B (en) Content caching and reading method, client and storage medium
CN115002539A (en) Video caching method and device, electronic equipment and storage medium
CN114327714A (en) Application program control method, device, equipment and medium
CN115017433A (en) Data preloading method, device, terminal and storage medium
CN111767136B (en) Process management method, terminal and device with storage function
CN114501566A (en) Network switching method and device
CN113849721A (en) Buffer processing method and device
CN111857871A (en) Application starting method, terminal and computer storage medium
CN111880912A (en) Method and device for controlling electronic equipment and electronic equipment
CN109413128B (en) Data processing method and device and electronic equipment
CN114337872B (en) Network signal measurement method and device

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