Video caching method, device, electronic device and storage medium

By setting video cache parameters by users and downloading videos from the network for pre-cache, the balance between smooth short video playback and low overhead for cellular data traffic in different network environments is solved, and diversified short video playback needs are achieved.

CN115002539BActive Publication Date: 2025-04-11NANJING VIVO SOFTWARE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210779856.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-04
Publication Date
2025-04-11
Estimated Expiration
2042-07-04

AI Technical Summary

Technical Problem

The prior art cannot achieve a balance between smooth playback of short videos and low overhead of cellular data traffic in different network environments, and cannot meet users' diverse needs for electronic devices to play short videos.

Method used

By setting the video size and cached video failure time of pre-cache from the network, downloading videos from the network for pre-cache, and reading the cached video from the electronic device in a timely and appropriate amount according to the network status of the user's environment for playback.

Benefits of technology

It realizes smooth playback of short videos in different network environments, while saving cellular data traffic overhead, meeting users' diverse needs for playing short videos with electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115002539B_ABST
    Figure CN115002539B_ABST
Patent Text Reader

Abstract

The present application discloses a video caching method, device, electronic device and storage medium, belonging to the field of multimedia technology. The method comprises: receiving a first input from a user; in response to the first input, setting a video size pre-cached from a network and a cached video expiration time; and downloading a video from a network for pre-caching according to the set video size and cached video expiration time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of multimedia technology, and specifically relates to a video caching method, device, electronic device and storage medium. Background Art

[0002] In recent years, with the rapid development of Internet technology and the upgrade of electronic equipment hardware configuration, the functions of electronic equipment have become more and more abundant, and more and more users use electronic equipment for entertainment activities, such as watching short videos. At present, the network conditions of different environments in which users watch short videos are usually different. For example, in some environments there is no network, in some environments there is a network but the network signal is unstable, or in some environments there is only a cellular network but no wireless network. Users hope that electronic devices can play videos smoothly in various network environments while saving cellular data traffic expenses.

[0003] However, in the related art, when the user is in an environment without a network, or with a network but unstable network signal, the electronic device cannot successfully or smoothly play the short video; when the user is in an environment with only a cellular network but no wireless network, the electronic device will consume more cellular data traffic when playing short videos. It can be seen that the related art cannot achieve a balance between smooth short video playback and low cellular data traffic overhead, and cannot meet the diverse needs of users for electronic devices to play short videos. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a video caching method, device, electronic device and storage medium, which can solve the problem in the prior art that it is impossible to achieve a balance between smooth playback of short videos and low overhead of cellular data traffic, and cannot meet users' diverse needs for playing short videos on electronic devices.

[0005] In a first aspect, an embodiment of the present application provides a video caching method, including:

[0006] receiving a first input from a user;

[0007] In response to the first input, setting the size of the video pre-cached from the network and the expiration time of the cached video;

[0008] Download the video from the network for pre-caching based on the set video size and cached video expiration time.

[0009] In a second aspect, an embodiment of the present application provides a video caching device, including:

[0010] A first receiving module, used to receive a first input from a user;

[0011] A setting module, configured to set the size of the video pre-cached from the network and the expiration time of the cached video in response to the first input;

[0012] The cache module is used to download videos from the network for pre-caching according to the set video size and cache video expiration time.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0017] In an embodiment of the present application, the user can set the size of the video to be pre-cached from the network and the expiration time of the cached video. According to the set video size and expiration time of the cached video, the video is downloaded from the network for pre-caching, so that when the user subsequently uses the electronic device to watch the video, the electronic device can read the cached video from the electronic device in a timely and appropriate manner for playback based on the network status of the user's environment, so as to achieve a balance between smooth playback of short videos and low overhead of cellular data traffic, and can meet the diverse needs of users for playing short videos on electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a video caching method provided by an embodiment of the present application;

[0019] Figure 2 is an example diagram of a video cache setting interface provided in an embodiment of the present application;

[0020] Figure 3 is an example diagram of various software and hardware modules of an electronic device involved in the video caching method provided in an embodiment of the present application;

[0021] Figure 4is an example diagram of a playback mode selection interface provided in an embodiment of the present application;

[0022] Figure 5 is a structural block diagram of a video caching device provided in an embodiment of the present application;

[0023] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0024] Figure 7 It is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0027] With the development of science and technology, the functions and applications of electronic devices such as mobile phones are becoming more and more abundant. At the same time, with the increasing power of artificial intelligence (AI) algorithms, short video applications (APP) are becoming more and more popular with users due to their many advantages: watching in fragmented time, understanding your hobbies, and automatically pushing videos that you are interested in. More and more users spend more time on short video APPs than on traditional long video APPs. Watching short videos in free time has become the most common hobby of the majority of electronic device users.

[0028] In the related art, many users like to watch short videos while on airplanes, high-speed trains, or on the subway when commuting to get off work. At this time, due to the lack of network, or the network but unstable signal, many short videos cannot be successfully played or played smoothly. In addition, short videos consume a lot of traffic. Most users' operator packages have a traffic limit. Long-term use of cellular data traffic to watch short videos will also cause the electronic device to have insufficient traffic, and extra money will be needed to recharge the traffic. It can be seen that the related art cannot achieve a balance between smooth short video playback and low cellular data traffic overhead, and cannot meet users' diverse needs for playing short videos on electronic devices.

[0029] In order to solve the above technical problems, the embodiments of the present application provide a video caching method, device, electronic device and storage medium.

[0030] The video caching method provided in the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0031] It should be noted that the video caching method provided in the embodiment of the present application is applicable to electronic devices. In practical applications, the electronic devices may include: mobile terminals such as smart phones, tablet computers, personal digital assistants, etc., and the embodiment of the present application does not limit this.

[0032] Figure 1 is a flow chart of a video caching method provided by an embodiment of the present application, such as Figure 1 As shown, the method may include the following steps: step 101, step 102 and step 103, wherein:

[0033] In step 101, a first input from a user is received.

[0034] In step 102, in response to a first input, the size of a video pre-cached from a network and an expiration time of the cached video are set.

[0035] In the embodiment of the present application, the video cached from the network can be a short video, a medium-length video, or a long video. For ease of understanding, the following description will be made by taking a short video as an example.

[0036] In order to ensure that the electronic device can play short videos smoothly in various network environments, the electronic device can support users to cache some short videos from the network to the local electronic device in advance.

[0037] In an embodiment of the present application, a user can set the size of the video cached from the network and the expiration time of the cached video by inputting a first input on the electronic device, wherein the first input can be a gesture-related input such as a click input, a sliding input, or a text input, or can be a voice input.

[0038] In some embodiments, the electronic device may provide a video cache setting interface, wherein the video cache setting interface may include: a cached video size setting control and a cached video expiration time setting control, and the user sets the video size cached from the network and the cached video expiration time by making a first input to the above controls.

[0039] In one example, a short video cache setting control can be added to the video playback interface of the electronic device. When the user goes out or is about to leave the WiFi area, the user can click this control. When the electronic device detects that the user clicks this control, it displays the following Figure 2 The video cache setting interface shown allows users to select the size of the target cached video and the cached video expiration time (cached short videos occupy memory and are set to be automatically deleted after a period of time to free up memory). Users can select the corresponding video cache size and video expiration time according to their needs, or they can customize them. After the user has checked, the electronic device can automatically cache videos of the corresponding size for the user according to the user's preference for watching short videos, and start the timer to automatically delete the corresponding short video after the time point set by the user.

[0040] In an embodiment of the present application, in order to reduce the storage space occupancy rate of the electronic device, the cached videos in the electronic device that have reached the video expiration time can be deleted to release the memory occupied by these videos to avoid long-term occupation of the storage space of the electronic device.

[0041] In another example, one may use Figure 3 The hardware and software combination shown in the figure enables electronic devices to pre-cache short videos, such as Figure 3 As shown, the electronic device may include: a processor, a memory 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 user's preferences when watching short videos, the timer is used to notify the memory to delete the cached video according to the short video expiration time set by the user (also known as the video release time) after the time is up, and the memory is used to store the cached video, which can be specifically a memory. After the user completes the cache setting, the processor will cache the video of the corresponding size to the memory in the background according to the user's settings. It will start in WiFi mode by default. In non-WiFi mode, the user will be reminded whether to use traffic to download. After the download is completed, the main page of the electronic device will prompt the user that the download has been completed. After the video is downloaded, when the user opens the corresponding short video APP, the electronic device will detect the network status of the electronic device, and adopt a short video playback strategy that matches the current network status according to the current network status of the electronic device.

[0042] In step 103, according to the set video size and cache video expiration time, the video is downloaded from the network for pre-caching.

[0043] As can be seen from the above embodiments, in this embodiment, the user can set the size of the video to be pre-cached from the network and the expiration time of the cached video. According to the set video size and expiration time of the cached video, the video is downloaded from the network for pre-caching, so that when the user subsequently uses the electronic device to watch the video, the electronic device can read the cached video from the electronic device in a timely and appropriate manner for playback based on the network status of the user's environment, so as to achieve a balance between smooth playback of short videos and low overhead of cellular data traffic, and can meet the diverse needs of users for playing short videos on electronic devices.

[0044] In another embodiment provided by the present application, the video caching method provided can be Figure 1 After step 103 in the illustrated embodiment, the following steps are added (not shown in the figure): step 104, step 105 and step 106, wherein:

[0045] In step 104, when the network state of the electronic device is a cellular network connection state, a second input of the user is received.

[0046] In the embodiment of the present application, the second input may be a click input, for example, a click input to a video playback control.

[0047] In step 105, in response to the second input, a target push ratio of cached videos to network downloaded videos is determined.

[0048] In the embodiment of the present application, the target push ratio carries the proportion of cached videos and the proportion of network downloaded videos in the videos pushed to the user.

[0049] In some embodiments, the target push ratio of cached videos to network downloaded videos can be determined according to the playback mode selected by the user. Accordingly, the above step 105 may include the following steps (not shown in the figure): sub-step 1051 and sub-step 1052, wherein:

[0050] In sub-step 1051, in response to the second input, a user-selected play mode is determined.

[0051] In an embodiment of the present application, in order to ensure that the electronic device can smoothly play short videos while reducing the cellular data traffic overhead in a cellular network environment, the electronic device can support users to set multiple play modes. For example, when the network state of the electronic device is a cellular network connection state, a play mode selection interface is displayed, wherein the play mode selection interface includes multiple play mode selection controls, and different play mode selection controls correspond to different play modes; a user's selection input for a play mode selection control is received, and in response to the selection input, the user's selected play mode is determined. The selection input can be a click input or a slide input.

[0052] In one example, when a user opens a short video app, if it is detected that the app is in a cellular network connection state, the following is displayed: Figure 4 The playback mode selection interface shown asks the user whether to enter free traffic mode, low traffic mode or normal traffic mode.

[0053] In sub-step 1052, the target push ratio of cached videos and network downloaded videos is determined according to the playback mode; when the playback mode is the free traffic mode, the target push ratio is 1:0; when the playback mode is the low traffic mode, the target push ratio is M:N, wherein M>N, and M and N are both positive integers; when the playback mode is the normal traffic mode, the target push ratio is 1:1.

[0054] When the user selects the free-traffic mode for playback, the target push ratio is 1:0. That is, after the user selects the free-traffic mode, the short video APP will only push videos from the cached videos for the user to watch, and will not download new videos.

[0055] When the playback mode selected by the user is the low-traffic mode, the target push ratio is M:N, where M>N, and M and N are both positive integers. That is, after the user selects the low-traffic mode, the number of cached videos in the short videos pushed to the user for playback is greater than the number of videos downloaded from the network in real time.

[0056] When the user selects the normal traffic 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 will simultaneously download and push new videos while pushing cached videos to the user (for example, some users like to pay attention to first-hand news or messages). Depending on the selected mode, the ratio of pushed new videos to cached videos is different. For example, in the low traffic mode, this ratio is 1:5, while in the normal traffic mode, this ratio is 1:1.

[0057] In some embodiments, in addition to the above three playback modes, at least one of the following two playback modes may also be included: a mode in which the target push ratio of cached video to network downloaded video is P:Q, P<Q, and P and Q are both positive integers, and a mode in which the target push ratio of cached video to network downloaded video is 0:1.

[0058] In step 106, according to the target push ratio, cached videos of a first ratio are read from the electronic device and videos of a second ratio are downloaded from the network for playback.

[0059] In some embodiments, considering that the network speed of the cellular network may fluctuate, for example, at different times in the same location, the network speed may fluctuate, or as the electronic device moves from one location to another, the network speed may also fluctuate. In view of this situation, during the video playback process, the network speed may be detected in real time, and the push ratio of the cached video may be dynamically adjusted according to the network speed. Accordingly, after the above step 106, the following steps (not shown in the figure) may be added: step 107, wherein,

[0060] In step 107, the download rate of the cellular network is detected. When it is detected that the download rate of the cellular network is lower than the first preset rate threshold, the push ratio of the cached video is increased until it is detected that the download rate of the cellular network is not lower than the first preset rate threshold, and the push ratio of the cached video is reduced to the first ratio.

[0061] That is, when the network rate is low, the proportion of cached videos in the videos pushed to users is increased. When the network rate returns to normal, the proportion of cached videos in the videos pushed to users is reduced to the first proportion to ensure smooth playback of the video during playback.

[0062] In the embodiment of the present application, the first preset rate threshold may be the minimum download rate required for smoothly downloading the video in a cellular network connection state.

[0063] For example, in low traffic mode or normal traffic mode, when the electronic device detects that the download rate of the cellular network is low (a low download rate can easily cause freezes when downloading new videos), it will gradually increase the push ratio of cached videos until the download rate of the cellular network returns to normal, and then gradually return to the previous push ratio of new videos and cached videos.

[0064] It can be seen that in the embodiment of the present application, when the user is in an environment where there is only a cellular network but no wireless network, the electronic device can, according to the user's needs, push short videos pre-cached in the electronic device to the user, and simultaneously download and push new videos to ensure that the electronic device can play short videos smoothly while saving the cellular data traffic overhead of the electronic device.

[0065] In another embodiment provided in the present application, the provided video caching method can be Figure 1 After step 103 in the illustrated embodiment, the following steps are added (not shown in the figure): step 108, wherein:

[0066] In step 108, when the network status of the electronic device is a wireless network WiFi connection status and the WiFi download rate is lower than a second preset rate threshold, the cached video is read from the electronic device for playback until the WiFi download rate is no lower than the second preset rate threshold, then the reading of the cached video in the electronic device is stopped and the video is downloaded from the network for playback.

[0067] In the embodiment of the present application, the second preset rate threshold may be the minimum download rate required for smoothly downloading the video in a WiFi connection state.

[0068] In one example, when a user opens a short video APP, the electronic device detects in real time whether the local area is connected to WiFi. 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 will not be played, but the new video will continue to be downloaded through WiFi for the user to watch. When it is detected that the download rate of WiFi is lower than a certain download rate (a low download rate of WiFi can easily cause freezes when downloading new videos), a part of the cached video will be called out for the user to watch until the download rate of WiFi returns to normal, and then the new video will be downloaded again for the user to watch. The cached video that has been watched will be automatically deleted after 1 minute (to prevent users from watching it repeatedly), freeing up storage space for the electronic device.

[0069] It can be seen that in the embodiment of the present application, when the network status of the electronic device is a WiFi connection status but the WiFi download rate is low, the electronic device may experience a lag problem when downloading videos from the network. In order to ensure that the electronic device can play short videos smoothly for users, the cached video in the electronic device can be read for playback until the WiFi download rate returns to normal.

[0070] In another embodiment provided in the present application, the provided video caching method can be Figure 1 After step 103 in the illustrated embodiment, the following steps are added (not shown in the figure): step 109, wherein:

[0071] In step 109, when the network status of the electronic device is not connected to the network, the cached video is read from the electronic device for playback.

[0072] It can be seen that in the embodiment of the present application, when the network status of the electronic device is not connected to the network, the electronic device cannot access the Internet. In order to ensure that the electronic device can play short videos smoothly for users, the cached video in the electronic device can be read for playback.

[0073] In summary, in the embodiments of the present application, when playing short videos, the electronic device can adopt different playback strategies according to the different network states of the user's environment. When the user is in an environment without a network, or with a network but an unstable network signal, the short video pre-cached in the electronic device can be played to ensure that the electronic device can play the short video smoothly. When the user is in an environment with only a cellular network and no wireless network, the electronic device can, according to the user's needs, push the short video pre-cached in the electronic device to the user, and also simultaneously download and push new videos to ensure that the electronic device can play the short video smoothly while saving the cellular data traffic overhead of the electronic device. It can be seen that the prior art can achieve a balance between smooth playback of short videos and low overhead of cellular data traffic, and can meet the diverse needs of users for electronic devices to play short videos.

[0074] The video caching method provided in the embodiment of the present application can be executed by a video caching device. In the embodiment of the present application, the video caching device provided in the embodiment of the present application is described by taking the video caching method executed by the video caching device as an example.

[0075] Figure 5 is a structural block diagram of a video caching device provided in an embodiment of the present application, such as Figure 5 As shown, the video caching device 500 may include: a first receiving module 501, a setting module 502 and a caching module 503, wherein:

[0076] A first receiving module 501, configured to receive a first input from a user;

[0077] A setting module 502, configured to set the size of the video pre-cached from the network and the expiration time of the cached video in response to the first input;

[0078] The cache module 503 is used to download the video from the network for pre-caching according to the set video size and cache video expiration time.

[0079] As can be seen from the above embodiments, in this embodiment, the user can set the size of the video to be pre-cached from the network and the expiration time of the cached video. According to the set video size and expiration time of the cached video, the video is downloaded from the network for pre-caching, so that when the user subsequently uses the electronic device to watch the video, the electronic device can read the cached video from the electronic device in a timely and appropriate manner for playback based on the network status of the user's environment, so as to achieve a balance between smooth playback of short videos and low overhead of cellular data traffic, and can meet the diverse needs of users for playing short videos on electronic devices.

[0080] Optionally, as an embodiment, the video caching device 500 may further include:

[0081] A second receiving module, configured to receive a second input from a user when the network state of the electronic device is a cellular network connection state;

[0082] A determination module, configured to determine a target push ratio of cached videos to network downloaded videos in response to the second input;

[0083] The first playback module is used to read cached videos of a first ratio from the electronic device and download videos of a second ratio from the network for playback according to the target push ratio.

[0084] Optionally, as an embodiment, the determining module may include:

[0085] A first determining submodule, configured to determine the play mode selected by the user in response to the second input;

[0086] A second determination submodule is used to determine a target push ratio of cached videos to network downloaded videos according to the playback mode;

[0087] Among them, when the playback mode is the free traffic mode, the target push ratio is 1:0;

[0088] When the playback mode is a low-traffic mode, the target push ratio is M:N, where M>N, and M and N are both positive integers;

[0089] When the playback mode is the normal traffic mode, the target push ratio is 1:1.

[0090] Optionally, as an embodiment, the video caching device 500 may further include:

[0091] The adjustment module is used to detect the download rate of the cellular network after reading a first proportion of cached videos from the electronic device and downloading a second proportion of videos from the network for playback, and when it is detected that the download rate of the cellular network is lower than a first preset rate threshold, increase the push ratio of the cached videos until it is detected that the download rate of the cellular network is not lower than the first preset rate threshold, and reduce the push ratio of the cached videos to the first proportion.

[0092] Optionally, as an embodiment, the video caching device 500 may further include:

[0093] The second playback module is used to read the cached video from the electronic device for playback when the network status of the electronic device is a wireless network WiFi connection status and the WiFi download rate is lower than a second preset rate threshold, and stop reading the cached video in the electronic device and download the video from the network for playback until the WiFi download rate is no lower than the second preset rate threshold.

[0094] Optionally, as an embodiment, the video caching device 500 may further include:

[0095] The third playing module is used to read the cached video from the electronic device for playing when the network status of the electronic device is not connected to the network.

[0096] The video caching device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR) / virtual reality (Virtual Reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (Ultra-Mobile Personal Computer, UMPC), a netbook or a personal digital assistant (Personal Digital Assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (Personal Computer, PC), a television (Television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0097] The video caching device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0098] The video caching device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented in the method embodiment will not be described again here.

[0099] Alternatively, if Figure 6 As shown, an embodiment of the present application further provides an electronic device 600, including a processor 601 and a memory 602, wherein the memory 602 stores a program or instruction that can be executed on the processor 601, and when the program or instruction is executed by the processor 601, each step of the above-mentioned video caching method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0100] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0101] Figure 7 It is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application.

[0102] 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.

[0103] Those skilled in the art will appreciate that the electronic device 700 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 710 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0104] In one embodiment, the user input unit 707 is used to receive a first input from a user;

[0105] The processor 710 is used to set the video size pre-cached from the network and the cached video expiration time in response to the first input; and download the video from the network for pre-caching according to the set video size and cached video expiration time.

[0106] It can be seen that in the embodiments of the present application, the user can set the size of the video pre-cached from the network and the expiration time of the cached video, and download the video from the network for pre-caching according to the set video size and the expiration time of the cached video, so that when the user subsequently uses the electronic device to watch the video, the electronic device can read the cached video from the electronic device in a timely and appropriate manner for playback based on the network status of the user's environment, so as to achieve a balance between smooth playback of short videos and low overhead of cellular data traffic, and can meet the diverse needs of users for playing short videos on electronic devices.

[0107] Optionally, as an embodiment, the user input unit 707 is further configured to receive a second input from the user when the network state of the electronic device is a cellular network connection state;

[0108] Processor 710 is also used to determine a target push ratio of cached videos to network downloaded videos in response to the second input; based on the target push ratio, read a first ratio of cached videos from the electronic device and download a second ratio of videos from the network for playback.

[0109] Optionally, as an embodiment, the processor 710 is also used to determine the playback mode selected by the user in response to the second input; determine the target push ratio of cached video and network downloaded video according to the playback mode; wherein, when the playback mode is a free traffic mode, the target push ratio is 1:0; when the playback mode is a low traffic mode, the target push ratio is M:N, wherein M>N, and M and N are both positive integers; when the playback mode is a normal traffic mode, the target push ratio is 1:1.

[0110] Optionally, as an embodiment, the processor 710 is further used to detect the download rate of the cellular network after reading a first proportion of cached videos from the electronic device and downloading a second proportion of videos from the network for playback, and when it is detected that the download rate of the cellular network is lower than a first preset rate threshold, increase the push ratio of the cached videos until it is detected that the download rate of the cellular network is not lower than the first preset rate threshold, and reduce the push ratio of the cached videos to the first proportion.

[0111] Optionally, as an embodiment, the processor 710 is also used to read the cached video from the electronic device for playback when the network status of the electronic device is a wireless network WiFi connection status and the WiFi download rate is lower than a second preset rate threshold, until the WiFi download rate is not lower than the second preset rate threshold, stop reading the cached video in the electronic device, and download the video from the network for playback.

[0112] Optionally, as an embodiment, the processor 710 is further configured to read a cached video from the electronic device for playback when the network status of the electronic device is an offline state.

[0113] It should be understood that in the embodiment of the present application, the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture 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, etc. The user input unit 707 includes a touch panel 7071 and at least one of other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include two parts: a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0114] The memory 709 can be used to store software programs and various data. The memory 709 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 709 may include a volatile memory or a non-volatile memory, or the memory 709 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (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 (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 709 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0115] The processor 710 may include one or more processing units; optionally, the processor 710 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 710.

[0116] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned video caching method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0117] 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 disk or an optical disk.

[0118] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned video caching method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0119] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0120] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned video caching method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0121] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0123] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A video caching method, characterized in that: include: receiving a first input from a user; In response to the first input, setting the size of the video pre-cached from the network and the expiration time of the cached video; Download the video from the network for pre-caching according to the set video size and cached video expiration time; When the network state of the electronic device is a cellular network connection state, receiving a second input from the user; In response to the second input, determining a target push ratio of cached videos to network downloaded videos; According to the target push ratio, read the cached video of the first ratio from the electronic device and download the video of the second ratio from the network for playing; The step of determining a target push ratio of cached videos to network downloaded videos in response to the second input includes: In response to the second input, determining the play mode selected by the user; According to the playback mode, determining a target push ratio of cached videos to network downloaded videos; Among them, when the playback mode is the free traffic mode, the target push ratio is 1:0; When the playback mode is a low-traffic mode, the target push ratio is M:N, where M>N, and M and N are both positive integers; When the playback mode is the normal traffic mode, the target push ratio is 1:

1.

2. The method according to claim 1, characterized in that 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 according to the target push ratio, the method further includes: Detect the download rate of the cellular network, and when it is detected that the download rate of the cellular network is lower than a first preset rate threshold, increase the push ratio of the cached video until it is detected that the download rate of the cellular network is not lower than the first preset rate threshold, and reduce the push ratio of the cached video to the first ratio.

3. The method according to claim 1, characterized in that After downloading the video from the network for pre-caching according to the set video size and cache video expiration time, the method further includes: When the network status of the electronic device is a wireless network WiFi connection status and the WiFi download rate is lower than a second preset rate threshold, the cached video is read from the electronic device for playback until the WiFi download rate is no lower than the second preset rate threshold, then the reading of the cached video in the electronic device is stopped and the video is downloaded from the network for playback.

4. The method according to claim 1, characterized in that: After downloading the video from the network for pre-caching according to the set video size and cache video expiration time, the method further includes: When the network status of the electronic device is not connected to the network, the cached video is read from the electronic device for playing.

5. A video caching device, characterized in that: include: A first receiving module, used to receive a first input from a user; A setting module, configured to set the size of the video pre-cached from the network and the expiration time of the cached video in response to the first input; A cache module is used to download videos from the network for pre-caching according to the set video size and cache video expiration time; A second receiving module, configured to receive a second input from a user when the network state of the electronic device is a cellular network connection state; A determination module, configured to determine a target push ratio of cached videos to network downloaded videos in response to the second input; A first playback module, configured to read cached videos of a first ratio from the electronic device and download videos of a second ratio from the network for playback according to the target push ratio; Wherein, the determination module includes: A first determining submodule, configured to determine the play mode selected by the user in response to the second input; A second determination submodule is used to determine a target push ratio of cached videos to network downloaded videos according to the playback mode; Among them, when the playback mode is the free traffic mode, the target push ratio is 1:0; When the playback mode is a low-traffic mode, the target push ratio is M:N, where M>N, and M and N are both positive integers; When the playback mode is the normal traffic mode, the target push ratio is 1:

1.

6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the video caching method according to any one of claims 1 to 4 are implemented.

7. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the video caching method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Smartphone browser video buffering method

    CN108337554A