Resource switching playing method and device, electronic equipment and storage medium
By pre-caching the playback content of switched resources during online video playback, the problem of excessively long playback waiting time when switching videos in online video playback is solved, and fast resource switching playback is achieved.
Patent Information
- Application Number
- CN202411216358.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
In online video playback scenarios, when switching to a new video, the network data loading and playback of the new video can cause excessively long waiting times before playback begins.
When switching to the first resource, the playback content corresponding to the playback progress of the second resource is obtained and cached in advance, so as to ensure that the playback content can be directly retrieved from the cache for playback when switching to the second resource.
It shortens the waiting time for resources to start playing, speeds up resource playback, and reduces the waiting time for network requests.
Smart Images

Figure CN121644915A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of media data processing, and in particular to a resource switching playing method and device, an electronic device and a storage medium. BACKGROUND
[0002] With the development of vehicle technology, a vehicle machine supports online video playing. A user on the vehicle can switch videos to obtain a desired video to watch.
[0003] At present, in the existing online video playing scenario, when switching to a new video, network data of the new video is loaded and played. This way of starting the new video causes a long waiting time for starting. SUMMARY
[0004] The present application provides a resource switching playing method, device, electronic device and storage medium, which can shorten the starting waiting time of resources and speed up the resource caching speed.
[0005] In a first aspect, the present application provides a resource switching playing method, comprising:
[0006] When switching to a first resource, acquiring and caching switching playing content corresponding to a playing progress of a second resource switchable by the first resource;
[0007] When switching to the second resource, playing the switching playing content corresponding to the playing progress of the second resource.
[0008] In a second aspect, the present application further provides a resource switching playing device, comprising:
[0009] A resource caching module, configured to, when switching to a first resource, acquire and cache switching playing content corresponding to a playing progress of a second resource switchable by the first resource;
[0010] A resource playing module, configured to, when switching to the second resource, play the switching playing content corresponding to the playing progress of the second resource.
[0011] In a third aspect, the present application further provides an electronic device, comprising:
[0012] At least one processor; and
[0013] A memory in communication connection with the at least one processor; wherein
[0014] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the resource switching playing method provided by any embodiment of the present application.
[0015] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores computer instructions for causing a processor to implement the resource switching playing method of any of the embodiments of the present application.
[0016] The embodiments of the present application can acquire the second resource switchable to the first resource when switching to the first resource for playing, download the playing content of the second resource in advance, and directly acquire the playing content of the second resource from the cache for fast playing when switching to the second resource for playing, so that the second resource can be played without network request, the start waiting time of the resource is shortened, and the playing speed of the resource is accelerated.
[0017] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0019] Figure 1 is a flowchart of a resource switching playing method according to an embodiment of the present application;
[0020] Figure 2 is a flowchart of a resource switching playing method according to an embodiment of the present application;
[0021] Figure 3 is a flowchart of a resource switching playing method according to an embodiment of the present application;
[0022] Figure 4 is an application scenario diagram of a resource switching playing method according to an embodiment of the present application;
[0023] Figure 5 is a schematic diagram of a resource switching playing device according to an embodiment of the present application;
[0024] Figure 6 is a structural schematic diagram of an electronic device for implementing the resource switching playing method of the embodiments of the present application. DETAILED DESCRIPTION
[0025] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work should belong to the protection scope of the present application.
[0026] It should be noted that the terms "first" and "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] In the technical solutions of the embodiments of the present application, the acquisition, storage and application of user information and the like conform to the relevant legal regulations and do not violate public order and good customs.
[0028] Figure 1 A flowchart of a resource switching playing method provided by the embodiments of the present application, the present embodiment can be applied to the case that the playing content of the subsequent switchable resource is downloaded in advance when switching the playing resource in the process of online playing of the resource. The method can be executed by a resource switching playing device, which can be realized in the form of hardware and / or software and be specifically configured in an electronic device. The electronic device can be a terminal device, which can include a mobile phone, a computer, a car machine or a wearable device, etc. The wearable device can be smart glasses or a smart watch, etc.
[0029] Referring to Figure 1 The resource switching playing method includes the following steps.
[0030] S101, when switching to a first resource, acquiring and caching switching playing content corresponding to a playing progress of a second resource switchable by the first resource.
[0031] The resource can refer to data that changes over time, specifically dynamically changing media data. Exemplarily, the resource can be a video or an audio. After an application that plays the resource is started and runs on the electronic device, the application can acquire resource information of a plurality of resources and a resource order of the plurality of resources, the plurality of resources forming a resource list. The resource list includes a plurality of resources that are played in order. The resource information can include an identifier of the resource and a resource address of the resource. The resource address of the resource is used to acquire the playing content. The resource player loads the playing content and plays on the display screen, and the user can watch the playing resource on the display screen, wherein the resource is an audio, and the display screen displays the current playing progress and the total duration of the audio, and the like. In the embodiments of the present application, the playing and switching resources can be resources of any length, and optionally, the playing and switching resources are short resources. A short resource is generally a resource with a total duration less than a preset time threshold, and the preset time threshold can be 5 minutes. The playing form of the resource in the resource list is on-demand, and the playing form of the resource is not live.
[0032] The user can select any one resource from the resource list to play. In the process of playing, the user can constantly switch the playing resource.
[0033] The first resource is a resource that has been switched in the resource list and is to be played, and is also a resource that the user wants to switch to play. The user inputs a switching instruction to instruct the resource application to switch to the first resource to play. Specifically, the user can input the switching instruction in multiple ways, exemplarily, the switching instruction can be input in a voice input manner; the switching instruction can be input in a user gesture manner; the switching instruction can be input in an image input manner, for example, by collecting facial expressions of the user; the switching instruction can be input in an interactive instruction of the user on the display screen, and the interactive instruction can include sliding, clicking, touching or pressing, and the like. The user information collected by the switching instruction input by the user is authorized by the user, and the acquisition, storage and application of the user information involved are in line with relevant laws and regulations and do not violate public order and good customs.
[0034] The second resource can refer to a resource whose resource order is close to that of the first resource. Alternatively, the second resource can refer to a resource whose resource order is adjacent to that of the first resource. The first resource and the second resource are different, the number of the first resource is one, and the number of the second resource is at least one. Generally, the resource list is an ordered list, and the resources in the resource list are arranged in sequence according to the resource order. The resource order can be consistent with the switching direction of the second resource of the user. Generally, the switching direction is a straight line direction. For example, the switching direction is the direction of up and down sliding, and the resource order of the resources in the resource list can be from top to bottom or from bottom to top; for another example, the switching direction is the direction of left and right sliding, and the resource order of the resources in the resource list can be from left to right or from right to left; for another example, the switching direction is the direction of left-up and right-down sliding, and the resource order of the resources in the resource list can be from left-up to right-down or from right-down to left-up. In addition, the switching direction can also be a curved direction, and the corresponding resource order is the order from the starting point of the curve to the ending point of the curve or the order from the ending point of the curve to the starting point. There can be other switching directions and resource orders, which are not specifically limited.
[0035] When switching to the first resource in the resource list, the playing content of the first resource is obtained and played. At the same time, it is detected whether there is a second resource in the resource list that can be switched from the first resource.
[0036] The existence of the second resource indicates that the first resource can be switched to other resources for playing. When the second resource exists, it is detected whether there is switching playing content corresponding to the playing progress. The playing progress can refer to a position or a time point at which the second resource has played to in the historical time. The switching playing content corresponding to the playing progress can refer to the playing content starting from the playing progress. The switching playing content corresponding to the playing progress of the second resource can be the remaining complete content of the second resource from the playing progress to the end, or can be the remaining part of data between a certain time point before the end of the second resource from the playing progress. Whether there is switching playing content corresponding to the playing progress can be queried in the associated data of the second resource cached locally. If there is no playing progress cached, the playing progress is determined to be 0.
[0037] The switching playing content corresponding to the playing progress can refer to switching playing content greater than or equal to a preset time length. If there is data corresponding to the playing progress in the cache, but the time length of the cached data is less than the preset time length, it is determined that there is no switching playing content corresponding to the playing progress. In one example, the playing progress of the second resource is 2 seconds, and the preset time length is 5 seconds. There is playing content from 2 seconds to 4 seconds in the cache, but the time length of the playing content from 2 seconds to 4 seconds is less than the preset time length of 5 seconds, so it is determined that there is no switching playing content corresponding to the playing progress of the second resource. In addition, the preset time length can be 0 seconds, which can be set as needed.
[0038] If the corresponding playback transition content for the second resource's playback progress does not exist in the local cache, then the corresponding playback transition content for the second resource's playback progress is retrieved. If the corresponding playback transition content for the second resource's playback progress does not exist in the local cache, it indicates that the required playback transition content for the second resource to start playing from the previous playback position is empty. The required playback transition content needs to be downloaded from the network. Only after the download is complete can the second resource start playing normally from the previous playback progress. In practice, users can switch to resources already played in the resource list. In this case, the user does not want to start playback from the beginning but expects to continue playing from the last position. The last playback position is used as the playback progress of the resource and stored locally. This way, when the user plays a previously played resource again, they can continue playback from the last viewed progress, satisfying the user's need to continue watching historical resources. For example, if the playback progress of the second resource is 10 seconds, the playback transition content for 10 seconds later can be requested from the resource address.
[0039] It can obtain the resource address of the second resource and request the corresponding playback content to be switched from that resource address. Upon receiving the switched playback content, it is cached locally.
[0040] If the playback progress of the second resource corresponds to the switching playback content in the local cache, it is not necessary to download and cache the switching playback content corresponding to the second resource, and wait for the switching instruction or other control instruction.
[0041] If a second resource is not available, the playback progress of the second resource is not queried to determine the corresponding playback content. Instead, the system waits for user control commands. If the user's command is to close the resource application, playback stops and the resource application is closed. If the user's command is to switch to a new resource, a new resource list is retrieved, containing resources completely different from those in the previous resource list. For the new resource list, monitoring continues to detect whether to switch to the first resource in the new list. When switching to the first resource in the new list, it is checked whether a second resource is available to switch to from the first resource, and subsequent steps are executed. Furthermore, while playing resources from the new resource list, it is also possible to switch to resources from the historical resource list, continuously monitoring all resource lists to detect whether to switch to the first resource of any given resource list.
[0042] S102. When switching to the second resource, play the switching playback content corresponding to the playback progress of the second resource.
[0043] If there is pre-downloaded cached content for switching playback, the playback progress of the second resource can be retrieved directly from the cache for playback.
[0044] This invention provides an embodiment where, when switching to a first resource for playback, a switchable second resource is obtained, the playback content of the second resource is downloaded in advance, and when switching to the second resource for playback, the playback content of the second resource is directly retrieved from the cache for fast playback. This eliminates the need to request the second resource from the network, thereby shortening the start-up waiting time of the resource and speeding up the resource caching process.
[0045] Optionally, switching to the first resource includes: obtaining the switching direction of the first resource; obtaining the resource order of each resource in the resource list and obtaining the currently playing resource; determining an adjacent resource in the switching direction that is adjacent to the resource order of the current resource according to the resource order of each resource in the resource list; taking the adjacent resource in the switching direction as the first resource in the resource list and updating the currently playing resource to the first resource; and determining to switch to the first resource when it is detected that the currently playing resource has been updated to the first resource.
[0046] The switching direction can refer to the direction of the swipe input by the user for switching between resources in the resource list. The switching direction of the first resource can be extracted from its resource switching command. The first resource switching command can be an instruction to switch from the currently playing resource in the resource list to the first resource in the list for playback.
[0047] In another example, a resource switching command could refer to a user's command to swipe in a specific direction from the resource list. For instance, the switching direction could be an upward swipe or a downward swipe, and the resource switching command could be either a user's command to swipe upwards or a user's command to swipe downwards.
[0048] In one example, a resource switching instruction could be a resource switching instruction generated when the currently playing resource finishes playing.
[0049] Resource order refers to the playback order of resources in a resource list. Resources in a resource list are arranged in an ordered manner; resource order refers to the arrangement of resources. Typically, resources in the resource list are played sequentially according to their resource order.
[0050] The resource order can be determined based on user information and resource information, or it can be determined randomly. User information may include at least one of the following: user attribute information, user interest information, and user historical behavior. User attribute information may include at least one of the following: age and gender. User historical behavior may include at least one of the following: resource switching behavior and user interaction behavior in the resource list. Resource information may include at least one of the following: resource release time, resource popularity, resource duration, and resource playback progress. A score can be calculated for each item included in the user information and resource information. Then, a weighted sum of the scores can be calculated according to the weight of each item. The resulting weighted sum is then used to sort the resources, and this sorted result is determined as the resource order.
[0051] In one example, resources nearing their end time are listed first in the resource order; resources nearing their start time are listed later. Similarly, resources with high popularity are listed first, while those with low popularity are listed later. Furthermore, resources matching the user's interests are listed first, while resources matching less interesting information are listed later. Finally, resources the user has played are listed first, while resources the user hasn't played are listed later.
[0052] The timing for updating the resource order can be either after a resource switch or in real time based on resource and user information.
[0053] In fact, the switching direction can be the same as or different from the preset resource order in the resource list.
[0054] For example, the resource list is a vertically sorted list, and the resources in the resource list are in a top-to-bottom order. If the switching direction is downward, the resource order follows the top-to-bottom arrangement of the resources in the resource list, so the switching direction is consistent with the resource order; if the switching direction is upward, the switching direction is opposite to the resource order.
[0055] The resource order of adjacent resources is adjacent to the resource order of the current resource. Adjacent resources in the switching direction can refer to the resources that correspond to the direction of the resource order and the switching direction among at least one resource that is adjacent to the current resource in the resource order.
[0056] The order in which adjacent resources are arranged with the current resource can be the same as or different from the preset resource order in the resource list. When the switching direction is the same as the resource order, the arrangement order from the current resource to adjacent resources is the same as the resource order; when the switching direction is different from the resource order, the arrangement order from the current resource to adjacent resources is the reverse of the resource order.
[0057] For example, the resource order is the top-to-bottom arrangement of resources in the resource list, with the switching direction being the downward swipe direction, consistent with the resource order direction. An adjacent resource can be the next resource adjacent to the current resource in the resource order. Conversely, if the switching direction is the upward swipe direction, the adjacent resource can be the previous resource adjacent to the current resource in the resource order. Similarly, the resource order is the bottom-to-top arrangement of resources in the resource list, with the switching direction being the downward swipe direction, opposite to the resource order direction. An adjacent resource can be the previous resource adjacent to the current resource in the resource order. Similarly, if the switching direction is the upward swipe direction, the adjacent resource can be the previous resource adjacent to the current resource in the resource order.
[0058] In a specific example, the resource list is arranged from top to bottom as follows: resource a, resource b, resource c, resource d, and resource e, and the resource order in this list is the aforementioned top-to-bottom arrangement. The current resource is resource c. If the swipe direction is upward, the resource order is reversed, and the adjacent resource of resource c is resource b; if the swipe direction is downward, the resource order is the same, and the adjacent resource of resource c is resource d.
[0059] The resource list is configured with a management module. When the management module receives confirmation of an adjacent resource, it updates the currently playing resource to that adjacent resource, making it the first resource. Upon detecting that the currently playing resource has been updated to the first resource, it determines to trigger the first resource in the second resource list. Furthermore, when the player detects an update to the currently playing resource, it retrieves the updated resource and plays it.
[0060] Specifically, an index field can be preset in the resource list to indicate the currently playing resource. The attribute value of the index field can be set to the identifier of the currently playing resource. A change in the attribute value of the index field indicates an update to the currently playing resource. When a resource switching command points to a first resource, the attribute value of the index field is updated to the identifier of the first resource. Upon detecting a change in the index field, the second resource of the first resource is retrieved and pre-downloaded. Furthermore, upon detecting a change in the index field, the player retrieves the new attribute value, i.e., the identifier of the first resource, and retrieves the resource for playback based on this identifier.
[0061] This invention, through its embodiments, determines the adjacent resources of the current resource based on the resource order, designates them as the first resource to be switched, and determines the switch to the first resource. This allows for the pre-downloading of the second resource in the resource list after the first resource in the resource list has started playing, thereby improving the efficiency of resource switching during the playback process and shortening the waiting time for the second resource to start playing.
[0062] Figure 2 This is a flowchart of a resource switching playback method provided by an embodiment of the present invention. The embodiment of the present invention is an optimization and improvement based on the technical solution of the above embodiment.
[0063] Furthermore, the step of "obtaining and caching the switching playback content corresponding to the playback progress of the second resource that can be switched by the first resource" is further refined as follows: obtaining the resource order among the resources in the resource list; and when it is determined that there is a second resource in the resource list that can be switched by the first resource along a specified direction based on the resource order among the resources in the resource list, obtaining and caching the switching playback content corresponding to the playback progress of the second resource that can be switched by the first resource.
[0064] See Figure 2 The resource switching playback method shown includes:
[0065] S201. When switching to the first resource, obtain the resource order among the resources in the resource list.
[0066] Optionally, when switching to the first resource in the resource list, the method further includes: obtaining the switching playback content of the first resource; playing the switching playback content of the first resource on the vehicle's display screen, wherein the vehicle's display screen includes at least one of the following: a central control screen, a passenger-side screen, and a rear-seat screen.
[0067] The resource switching playback method disclosed in this invention can be applied in vehicle scenarios. At least one display screen on a vehicle can implement the resource switching playback method disclosed in this invention.
[0068] The system checks locally whether there is any playback content for the first resource. If such content exists, it is retrieved from the local machine and played on the vehicle's display screen. If not, the system obtains the resource address of the first resource, requests the playback content from that address, receives the playback content, and plays it on the vehicle's display screen. The vehicle is equipped with at least one display screen. The central control screen is used by the driver, the passenger-side screen is used by the passenger in the front passenger seat, and the rear-seat screen is used by the passengers in the rear seats.
[0069] Normally, when the vehicle is not moving, the resource applications on the central control screen, passenger-side screen, and rear-seat screens can display resource lists and play resources from those lists. When the vehicle is moving, the resource applications on the passenger-side screen and rear-seat screens can still display and play resource lists, but the central control screen cannot run applications or display its interface. The applications on the passenger-side screen and rear-seat screens are independent of each other; the resource lists on the passenger-side screen may differ from those on the rear-seat screens, and the resources played on the passenger-side screen may differ from those played on the rear-seat screens, or the passenger-side screen may play resources synchronously with the rear-seat screens.
[0070] By preloading switchable resources locally when switching to the first resource during the playback of resources in the resource list on the vehicle's display screen, the switchable resources can be retrieved directly from the local cache without requesting the resources over the network. This shortens the waiting time for resources to start playing on the vehicle's display screen and speeds up the switching playback of resources on the vehicle's display screen.
[0071] S202. When it is determined that there is a second resource in the resource list that can be switched along a specified direction based on the resource order among the resources in the resource list, the switching playback content corresponding to the playback progress of the second resource that can be switched by the first resource is obtained and cached.
[0072] The specified direction is the direction of the switchable playback order, and there can be at least one specified direction. The specified direction can include the direction of the resource order and / or the reverse direction of the resource order. The second resource that switches from the first resource along the specified direction can refer to determining the switching order based on the resource order and the specified direction; according to the switching order, checking whether there is a resource that plays after the first resource; if it exists, determining that there is a second resource; if it does not exist, determining that there is no second resource.
[0073] For example, the resource list is ordered as follows: resource a, resource b, resource c, resource d, and resource e. For instance, if the specified direction is the same as the resource order (i.e., the specified direction is resource a, resource b, resource c, resource d, and resource e), and the first resource is resource a, then the next switchable resource along the resource order is resource b. Therefore, resource b is the second resource that resource a switches to along the specified direction. Conversely, if the specified direction is opposite to the resource order (i.e., the specified direction is resource e, resource d, resource c, resource b, and resource a), and the first resource is resource a, then the next switchable resource along the resource order is empty. Therefore, the second resource that resource a switches to along the specified direction is empty, or in other words, resource a does not have a second resource.
[0074] Optionally, determining, based on the resource order among the resources in the resource list, that there exists a second resource in the resource list that is sequentially switched along a specified direction for the first resource includes: obtaining the switching direction of the first resource; obtaining the direction of the resource order; when the switching direction is opposite to the direction of the resource order, determining the switching direction and the direction of the resource order as a specified direction; when the switching direction is the same as the direction of the resource order, determining the direction of the resource order as a specified direction; and when at least one resource exists for the first resource along the specified direction, determining that there exists a second resource in the resource list that is sequentially switched along the specified direction for the first resource.
[0075] The specified direction is at least one, and correspondingly, the number of second resources is at least one. The specified direction can include the direction of the resource order and / or the reverse direction of the resource order. The first resource can have at least one resource along the direction of the resource order, and the first resource can have at least one resource along the reverse direction of the resource order. Accordingly, when the specified direction is the direction of the resource order and / or the reverse direction of the resource order, it can be queried whether the first resource has at least one resource. Thus, the first resource may or may not have any resources. The existence of at least one resource constitutes a second resource. When the first resource can have multiple second resources, for each second resource, the switching playback content corresponding to the playback progress of each second resource can be queried, and further filtering can be performed using cached content to determine whether to download the switching playback content of each second resource.
[0076] In one example, as in the previous example, if the specified direction is the direction of the resource order, and the first resource is resource a, then the next switchable resource along the direction of the resource order is resource b. Resources c, d, and e exist along the direction of the resource order. The second resource may consist only of resource b, i.e., the resource following the first resource. Alternatively, the second resource may include at least one of resource b, resource c, resource d, and resource e.
[0077] When multiple second resources exist in a specified direction, the data volume of the switching playback content for each second resource can be determined based on playback progress, user information, and order differences. Order differences can refer to the difference in order between the first and second resources. In one example, the data volume of the downloaded second resource's switching playback content is determined based on the order differences between the first resources; the larger the order difference, the smaller the data volume; conversely, the smaller the order difference, the larger the data volume. The data volume of the switching playback content corresponding to the playback progress of a second resource with a large order difference can be less than the data volume of the switching playback content corresponding to the playback progress of a second resource with a small order difference. Furthermore, the data volume can be converted to duration; the data volume of the second resource's switching playback content can be expressed using the duration of the switching playback content. For example, a data volume of 10MB is equivalent to a 10-second switching playback content.
[0078] When the switching direction is opposite to the resource order direction, the direction of the resource order and its opposite are defined as the specified direction, and there are two specified directions in this case. When the switching direction is the same as the resource order direction, the direction of the resource order, which is also the switching direction, is defined as the specified direction, and there is only one specified direction in this case.
[0079] In one example, the user-input resource switching command points in the opposite or the same direction as the resource sequence; the resource switching command triggered when playback ends points in the same direction as the resource sequence.
[0080] By determining whether the specified direction includes the reverse of the resource order, based on whether the switching direction is opposite or the same as the resource order, and on the basis that the specified direction includes the direction of the resource order, the pre-downloaded resources can be flexibly adjusted according to the user's switching needs. The switching data that the user wants to play can be pre-downloaded in a timely manner according to the user's switching needs, so as to shorten the waiting time for the second resource requested by the user to start playing.
[0081] Optionally, the resource order includes the ascending order of the resource identifier values of the resources in the resource list; based on the ascending order of the resource identifier values of the resources in the resource list, if there is a resource in the resource list whose resource identifier value is greater than or equal to the resource identifier value of the first resource, it is determined that there is a second resource in the resource list that is switched sequentially along the specified direction by the first resource; if there is a resource in the resource list whose resource identifier value is less than the resource identifier value of the first resource, it is determined that there is no second resource in the resource list that is switched sequentially along the specified direction by the first resource.
[0082] The resource identifiers for each resource in the resource list can be numbers. These identifiers can be generated according to the resource order. For example, different resources may have different numerical values for their resource identifiers. The numerical ascending order can refer to the order in which the resource identifier values are from smallest to largest. For example, if the resource list includes three resources: Resource 1, Resource 2, and Resource 3, and the numerical ascending order is Resource 1, Resource 2, and Resource 3, then the corresponding resource order is Resource 1, Resource 2, and Resource 3.
[0083] The specified direction can include only the direction of resource order, i.e., the numerical ascending order. Since the specified direction is in ascending order, the second resource that the first resource switches to along the specified direction is actually the second resource whose resource identifier value is greater than the resource identifier value of the first resource. There can be at least one second resource whose value is greater than the resource identifier value of the first resource. If there is at least one second resource whose value is greater than the resource identifier value of the first resource, then the existence of a second resource of the first resource is confirmed.
[0084] By configuring the resource order to be numerically ascending and determining the next resource as one whose value is greater than that of the first resource, the operation of detecting the next resource can be simplified, the detection speed of the next resource can be accelerated, the accurate time between pre-downloads can be shortened, and thus the pre-download process can be shortened.
[0085] S203. When switching to the second resource, play the switching playback content corresponding to the playback progress of the second resource.
[0086] This invention, through configuring the resource order among resources in the resource list, determines whether there are switchable resources in the order of the first resource along a specified direction. Resources with a high probability of switching can be selected as switchable resources. Playback content of resources with a high probability of switching can be pre-downloaded, accurately targeting resource switching needs for pre-downloading. This improves the efficiency of resource caching while reducing cache resource consumption.
[0087] Figure 3 This is a flowchart of a resource switching playback method provided by an embodiment of the present invention. The embodiment of the present invention is an optimization and improvement based on the technical solution of the above embodiment.
[0088] Furthermore, the "switching playback content corresponding to the playback progress of the second resource" is further refined into: the resource segment of the second resource with the time point corresponding to the playback progress as the starting time point.
[0089] See Figure 3 The resource switching playback method shown includes:
[0090] S301. When switching to the first resource, obtain and cache the switching playback content corresponding to the playback progress of the second resource that can be switched to by the first resource. The switching playback content corresponding to the playback progress of the second resource includes: resource segments of the second resource with the time point corresponding to the playback progress as the starting time point.
[0091] A resource retrieval request can be sent to the resource address of the second resource to obtain it. Specifically, the resource retrieval request specifies the identifier of the resource to be retrieved and its content. A resource fragment can refer to a portion of the playback content of the second resource.
[0092] The length of a resource segment can be represented by at least one of the following: data volume, duration, and percentage of total duration. Typically, the length of a resource segment is specified by the data volume.
[0093] For example, a resource segment can be a segment with a data size of 10M. The start time of this segment is the time point corresponding to the playback progress, and the data size of the playback content between the end time and the start time of this segment is 10M.
[0094] For example, a resource segment can be a 10-second segment, with the start time being the time point corresponding to the playback progress and the end time being the time point 10 seconds after the start time.
[0095] For example, the ratio between the duration of the resource fragment and the duration of the second resource is 0.2, or the ratio between the data volume of the resource fragment and the data volume of the second resource is 0.2.
[0096] Optionally, the duration of the resource segment is determined based on the playback progress, user information, and the order difference between the second resource and the first resource.
[0097] If a second resource exists, query the playback progress of the second resource for the corresponding switching playback content. If the playback progress of the second resource for the corresponding switching playback content is empty, obtain the resource address of the second resource. The resource address of the second resource stores the playback progress of the second resource. Generate a resource acquisition request corresponding to the playback progress of the second resource and send it to the resource address of the second resource; the resource acquisition request is used to acquire the resource segment of the second resource with the time point corresponding to the playback progress as the starting time point. Receive the playback progress of the second resource for the corresponding switching playback content. Cache the playback progress of the second resource for the corresponding switching playback content.
[0098] Optionally, the duration of the resource segment is determined based on duration-related information, which includes at least one of the following: playback progress, user information, and order difference, wherein the order difference includes the difference between the order of the second resource and the order of the first resource.
[0099] In one example, generating a resource retrieval request corresponding to the playback progress of a second resource includes: obtaining duration-related information of the second resource; determining the duration of a resource segment based on the duration-related information of the second resource; and generating a resource retrieval request corresponding to the playback progress of the second resource based on the duration of the resource segment, wherein the resource retrieval request is used to retrieve a resource segment of the corresponding duration. Alternatively, it could involve determining the duration of a resource segment based on the duration-related information of the second resource, determining the data size of the resource segment based on the duration of the resource segment, and generating a resource retrieval request corresponding to the playback progress of the second resource based on the data size of the resource segment.
[0100] Duration-related information is used to determine the duration of the downloaded resource segment. User information may include user attributes and types of interest. User attributes may include age, gender, and location. Order difference can refer to the distance between the order of the second resource and the order of the first resource in the resource sequence.
[0101] Specifically, the closer the playback progress is to the end, the less playback content can be cached, and the shorter the duration of the corresponding resource segments can be; the further the playback progress is from the end, the more playback content can be cached, and the longer the duration of the corresponding resource segments can be.
[0102] Specifically, if the content of the second resource matches the user information, a longer resource segment can be set; conversely, if the content of the second resource does not match the user information, a shorter resource segment can be set. Specifically, matching resource content with user information can mean that the resource content is consistent with the user's interests, or that the resource content of the second resource matches the user's age; mismatching resource content with user information can mean that the resource content is inconsistent with the user's interests, or that the resource content does not match the user's age type.
[0103] The order difference refers to the difference between the order of the first resource and the order of the second resource in the resource sequence. There is one first resource and multiple second resources. The order difference between the first and second resources can be calculated separately for each second resource. The smaller the order difference, the closer the playback order of the second and first resources is; the larger the order difference, the further the playback order of the second and first resources is. A smaller order difference allows for caching of second resources with longer resource segments; a larger order difference allows for caching of second resources with shorter resource segments.
[0104] For example, the resources in the resource list played in resource order include: resource a, resource b, and resource c. The first resource is resource a, the next resource after the first resource is resource b, and the next resource after resource b is resource c. When switching to resource a, the playback content corresponding to the playback progress of resource b and resource c is retrieved and cached. The order difference between resource b and resource a is 1, and the order difference between resource c and resource a is 2. The duration of the resource segment of resource b can be greater than the duration of the resource segment of resource c. For example, the duration of the cached resource segment of resource b is 10 seconds, and the duration of the cached resource segment of resource c is 5 seconds.
[0105] In addition, users can directly set the length of the preloaded resource fragments. There are also other settings that can be configured as needed.
[0106] In one example, the duration of a resource segment can be calculated by weighted summation based on the distance between the playback progress and the end, the degree of matching between the resource content and user information, and the numerical value of the order difference.
[0107] The data volume of the second resource can be calculated based on the duration of the resource segment and the conversion relationship between the duration and data volume. A resource acquisition request is then generated based on this data volume. Typically, during a resource request, the data volume needs to be sent to the corresponding resource address. The duration of the resource segment can be converted into the corresponding data volume to generate a resource acquisition request, thus accurately acquiring the second resource with the specified duration.
[0108] Furthermore, when a first resource can have multiple second resources, the length of the resource fragments to be cached can be set differently for different second resources.
[0109] For example, the length of the resource segment of the next second resource in the current playback order direction is longer than the length of the resource segment of the next second resource in the opposite direction of the current playback order. The current playback order direction can be the direction of switching from the current resource to the first resource. For example, the resource order in the resource list is: resource a, resource b, resource c, resource d, and resource e. The current resource is resource c, and the user triggers a switch from resource c to resource b. The first resource is resource b, and the specified direction includes both the direction of the resource order and the reverse direction of the resource order. Correspondingly, the next second resource in the direction of the resource order is resource c, and the next second resource in the reverse direction of the resource order is resource a. When the switching playback content corresponding to the playback progress of resources a and c is empty, and the current playback order direction is from resource c to resource b, it is equivalent to the current playback order direction being the direction of resources e, resource d, resource c, resource b, and resource a. Relative to resource b, among resources a and c, the next second resource in the direction of the current playback order is resource a, and the next second resource in the reverse direction of the current playback order is resource c. Therefore, the length of the resource segment of resource a is longer than the length of the resource segment of resource c.
[0110] For example, the length of the resource fragment of the next second resource in the current resource sequence direction is longer than the length of the resource fragment of the next second resource in the opposite resource sequence direction. In a specific example, as in the previous example, when the switching playback content corresponding to the playback progress of resource a and resource c is empty, and the next second resource in the current resource sequence direction is resource c, and the next second resource in the opposite resource sequence direction is resource a, then the length of the resource fragment of resource c is longer than the length of the resource fragment of resource a.
[0111] By determining the duration of resource segments based on the duration-related information of the second resource, the amount of data in the downloaded resource segments can be flexibly adjusted. This allows for the download of segments of corresponding durations to meet different switching needs, and the rational use of storage resources can reduce redundant storage.
[0112] In an optional embodiment, the switching playback content is mapped and stored to the identifier of the second resource. The start and end times of the switching playback content can also be marked to facilitate subsequent determination of whether switching playback content corresponding to the playback progress exists.
[0113] Optionally, caching the switching playback content corresponding to the playback progress of the second resource includes: determining the caching time period of the switching playback content based on the playback progress of the second resource and the duration of the resource segment; caching the switching playback content corresponding to the playback progress of the second resource to a folder, wherein the folder name includes the caching time period.
[0114] The caching time period refers to the time interval within the downloaded resource segment of the second resource. The start time of the caching time period corresponds to the playback progress. The duration of the caching time period is the duration of the resource segment. The end time of the caching time period can be determined based on the playback progress and the duration of the resource segment. Based on the identifier of the second resource and the caching time period, a target name is determined, a folder with that target name is generated, and the resource segments of the second resource are cached in this folder. The existence of the folder with the target name can be directly checked to detect the presence of playback transition content corresponding to the playback progress of the second resource. For example, if the folder exists, it indicates the presence of playback transition content corresponding to the playback progress of the second resource; if the folder does not exist, it indicates the absence of playback transition content corresponding to the playback progress of the second resource.
[0115] For example, the identifier of the second resource is A, and the cache period is from 3 seconds to 10 seconds. The target name is A*3*10.
[0116] When checking if there is a switchable playback content corresponding to the playback progress of a certain resource, you can query based on the resource's identifier and playback progress to check if there is a folder whose name includes the identifier and contains the playback progress.
[0117] In one example, we check if there is cached content with the identifier A and a playback progress of 5. As in the previous example, the target name is A*3*10. The folder identifier is the same as the identifier in the target name, and the playback progress falls within the time range of 3-10, thus confirming the existence of cached content with the identifier A and a playback progress of 5.
[0118] By determining the caching time period based on the playback progress and the duration of the resource segment, and determining the caching directory based on the caching time period and the identifier of the second resource, and caching the switched playback content in this caching folder, the cached content of the playback progress can be quickly and easily located, improving the detection efficiency of cached content.
[0119] Optionally, switching to the first resource in the resource list includes: obtaining the resource list, which includes multiple resources and attribute information of each resource, wherein the attribute information of the resource includes the resource order and resource address of the resource in the resource list; receiving a playback instruction for the first resource in the resource list, determining the first resource as the first resource, and determining to switch to the first resource in the resource list.
[0120] The first resource is the first resource to be played in the resource list. Users can specify the first resource to play in the resource list. It should be noted that the first resource can be the first resource in the resource list in order, or it can be different from the first resource in the resource list. After the resource application runs, without manual intervention in the playback order, the resources in the resource list can be played sequentially according to their order.
[0121] After the resource application runs, it downloads a resource list from the corresponding network server. The resource list includes multiple resources and attribute information for each resource. Resource attribute information may include the resource's identifier, resource address, and resource order. The user inputs a playback command, which can be an instruction to select a specific resource from the resource list for playback. For example, the playback command can be automatically generated when navigating to the resource application's resource list page, or it can be generated when the user triggers the playback control for a specific resource.
[0122] The playback command indicates that the resource to be played is the first resource. Upon receiving the playback command, it is equivalent to determining to switch to the first resource in the resource list for playback, i.e., switching to the first resource in the resource list. It then checks whether a second resource exists for the first resource.
[0123] By limiting the first resource to be switched to in the resource list to the first resource that the user triggers playback in the resource list, the resources in the resource list can be pre-downloaded when the resource starts playing. This allows for timely pre-downloading of resources to be switched in the resource list, thereby improving the efficiency of resource switching after the first resource has started playing.
[0124] By downloading uncached line frequency data and downloading resource fragments, this embodiment of the invention can minimize the amount of cached data while maintaining pre-caching, thus reducing the excessive storage resources occupied by pre-downloading.
[0125] Optionally, while switching to the first resource, the method further includes: when there is switching playback content corresponding to the playback progress of the first resource, starting playback of the first resource according to the switching playback content corresponding to the playback progress of the first resource; after the switching playback content corresponding to the playback progress of the first resource has finished playing, playing the first resource online; and when there is no switching playback content corresponding to the playback progress of the first resource, playing the first resource online.
[0126] The system checks if the first resource contains playback content corresponding to its playback progress. Starting playback of the first resource can mean the player obtains the playback content corresponding to its playback progress and begins playing the corresponding cached content from that point. After starting playback, the playback of the first resource is independent of the cached content; it will not retrieve cached content for playback but will instead play the first resource online. Online playback of the first resource can refer to downloading and playing the first resource simultaneously. Specifically, it means downloading the first resource and playing it in real time, without pre-caching it. The player will not retrieve the content from the cache but will download the data from the network and play it.
[0127] By configuring the application scenario for online playback resources and using pre-cached data only when the resource starts playing, the start-up time in online playback scenarios can be shortened, while the resource continues to play online during subsequent playback. This reduces the operational complexity of shortening the start-up waiting time for online playback resources and reduces the maintenance cost of online playback resources.
[0128] S302. When switching to the second resource, play the switching playback content corresponding to the playback progress of the second resource.
[0129] Optionally, the resource switching playback method further includes: obtaining the cache time point of the second resource; calculating the time difference between the cache time point and the current time point; and deleting the switching playback content corresponding to the playback progress of the second resource when the time difference meets the time expiration condition.
[0130] After caching the playback content, to avoid excessive storage resource consumption, a time expiration condition can be set. This condition determines whether the time difference is greater than or equal to a timeout threshold. If the storage time for the second resource's playback content exceeds the timeout threshold, the second resource's playback content is deleted.
[0131] The second resource can store multiple playback options, each with different playback progress. Each playback option corresponds to a cached time point. The time difference indicates the freshness of the playback option in the second resource.
[0132] A time threshold can be set. When the time difference is greater than or equal to the time threshold, the playback content corresponding to the playback progress of the second resource will be deleted. When the time difference is less than the time threshold, the playback content corresponding to the playback progress of the second resource will not be deleted.
[0133] In addition, an excessive data volume threshold can be set. When the total cached data volume is greater than or equal to the data volume threshold, the playback transition content corresponding to the playback progress of the second resource is deleted. When the total cached data volume is less than the data volume threshold, the playback transition content corresponding to the playback progress of the second resource is not deleted.
[0134] By calculating the time difference between the cached content's cached time point and the current time point, and based on this time difference, detecting whether to delete the playback content corresponding to the playback progress of the second resource, redundant data can be deleted in a timely manner, and cached resources can be released.
[0135] In a specific application scenario, such as Figure 4 As shown, the resource is video. In the vehicle, at least one display receives a user's instruction to run the video application, and the video application is then executed. The video switching and playback method performed by the in-vehicle infotainment system is as follows:
[0136] S401. Monitor whether the video list playback index has changed. If it has, execute S402; otherwise, execute S411.
[0137] A change in the playback index indicates a video switch in the video list. When the playback index changes, the player determines to switch to the target video in the video list for playback. At this point, the player retrieves the switched playback content of the target video, parses the switched playback content, and resumes playback. Alternatively, playback can resume from the point in time corresponding to the target video's playback progress.
[0138] S402. Detect whether there is a next video to switch to. If yes, execute S403; otherwise, execute S411.
[0139] S403. Obtain the playback content corresponding to the playback progress of the next video to be switched.
[0140] S404. Does the next video playback progress correspond to the switching playback content? If yes, then execute S407; otherwise, execute S405.
[0141] S405. Request the playback content corresponding to the playback progress based on the video information.
[0142] Based on the video identifier of the next video to be switched in the video information and in combination with the playback progress, a video retrieval request is generated and sent to the resource address of the next video to be switched in the video information.
[0143] S406. Write the playback content corresponding to the playback progress to a local file.
[0144] The system receives the video segment corresponding to the playback progress of the next video to be switched and writes it to a local file, thereby caching the playback content of the next video to be switched.
[0145] S407, Switch to the next video to play.
[0146] Upon receiving a user's input command to switch to the next video, or after the target video has finished playing, the system automatically generates a command to switch to the next video and triggers the playback of that video.
[0147] At the same time, switching to the next switching video for playback will trigger a change in the video list playback index. At this time, the next switching video will be used as the new target video, and execution will continue from S402. It will check whether there is a new next switching video in the new target video and check whether the switching playback content of the new next switching video is cached.
[0148] S408. The player determines whether there is a cached next switching video playback content. If so, execute S409; otherwise, execute S410.
[0149] S409. Parse the locally cached switching playback content and start playback.
[0150] The player parses the locally cached content to switch playback and starts playing it.
[0151] S410, Start broadcasting by acquiring data from the network.
[0152] Based on the video identifier of the next video in the video information and the playback progress, a video retrieval request is generated and sent to the resource address of the next video in the video information. Upon receiving the video segment corresponding to the playback progress of the next video, data is retrieved from the network. The player parses the video segment and starts playback.
[0153] S411, End.
[0154] After S411 is executed, it returns to execute S401 to continue monitoring the video list. Furthermore, S401 can still be executed in parallel during the execution of S402-S411.
[0155] This invention, through monitoring changes in the playlist index, obtains the playback history of the next video, caches the video segment corresponding to the playback history position, and the video player uses the locally cached data to start playback. By increasing the monitoring of playlist index changes and caching the video segment of the next video in advance, the playback time of the new video after switching videos can be effectively shortened. This allows for the pre-downloading of video resources to the local machine, reducing the waiting time for video start-up and speeding up video switching and playback. At the same time, by caching undownloaded video resources and caching partial video resources, excessive storage resource consumption is reduced.
[0156] Figure 5This is a schematic diagram of a resource switching playback device provided in an embodiment of the present invention. This embodiment of the present invention is applicable to situations where playback resources are switched during online playback. The device can execute a resource switching playback method and can be implemented in hardware and / or software. The device can be configured in an electronic device.
[0157] See Figure 5 The resource switching playback device shown includes:
[0158] The resource caching module 501 is used to obtain and cache the switching playback content corresponding to the playback progress of the second resource that can be switched to by the first resource when switching to the first resource;
[0159] The resource playback module 502 is used to play the switching playback content corresponding to the playback progress of the second resource when switching to the second resource.
[0160] Optional, resource caching module 501 includes:
[0161] The resource order acquisition unit is used to acquire the resource order among the resources in the resource list.
[0162] The second resource caching unit is used to obtain and cache the switching playback content corresponding to the playback progress of the second resource that the first resource can switch to, when it is determined that there is a second resource in the resource list that the first resource can switch to in a specified direction according to the resource order among the resources in the resource list.
[0163] Optional, the second resource cache unit is specifically used for:
[0164] Obtain the switching direction of the first resource;
[0165] The direction of obtaining the resource order;
[0166] When the switching direction is opposite to the direction of the resource order, the switching direction and the direction of the resource order are determined as a specified direction;
[0167] When the switching direction is the same as the direction of the resource order, the direction of the resource order is determined as the specified direction;
[0168] Based on the specified direction, it is determined that there exists a second resource in the resource list that is switched sequentially along the specified direction from the first resource.
[0169] Optionally, the switching playback content corresponding to the playback progress of the second resource includes: resource segments of the second resource with the time point corresponding to the playback progress as the starting time point.
[0170] Optionally, the duration of the resource segment is determined based on the playback progress, user information, and the order difference between the second resource and the first resource.
[0171] Optionally, the resource caching module 501 includes:
[0172] A cache time period determination unit is used to determine the cache time period for switching playback content based on the playback progress of the second resource and the duration of the resource segment;
[0173] The corresponding directory caching unit is used to cache the switching playback content corresponding to the playback progress of the second resource in the cache space of the directory corresponding to the cache time period.
[0174] Optionally, the resource switching playback device also includes:
[0175] The first resource start-up module is used to start playback of the first resource when switching to the first resource in the resource list and when there is switching playback content corresponding to the playback progress of the first resource.
[0176] The first online playback module is used to play the first resource online after the playback content corresponding to the playback progress of the first resource has finished playing.
[0177] The second online playback module is used to play the first resource online when there is no switching playback content corresponding to the playback progress of the first resource.
[0178] The resource switching playback device provided in this embodiment of the invention can execute the resource switching playback method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the resource switching playback method.
[0179] Figure 6 A schematic diagram of an electronic device 600 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0180] like Figure 6As shown, the electronic device 600 includes at least one processor 601 and a memory, such as a read-only memory (ROM) 602 or a random access memory (RAM) 603, communicatively connected to the at least one processor 601. The memory stores computer programs executable by the at least one processor. The processor 601 can perform various appropriate actions and processes based on the computer program stored in the ROM 602 or loaded into the RAM 603 from storage unit 608. The RAM 603 may also store various programs and data required for the operation of the electronic device 600. The processor 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0181] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0182] Processor 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 601 performs the various methods and processes described above, such as the resource switching playback method.
[0183] In some embodiments, the resource switching playback method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by processor 601, one or more steps of the resource switching playback method described above may be performed. Alternatively, in other embodiments, processor 601 may be configured to perform the resource switching playback method by any other suitable means (e.g., by means of firmware).
[0184] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0185] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable resource switching playback device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0186] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0187] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0188] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0189] A computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability.
[0190] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0191] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A resource switching play method, characterized in that, The method comprises: When switching to a first resource, acquiring and caching switching playing content corresponding to a playing progress of a second resource switchable by the first resource; When switching to the second resource, playing the switching playing content corresponding to the playing progress of the second resource.
2. The method of claim 1, wherein, The acquiring and caching of the switching playing content corresponding to the playing progress of the second resource switchable by the first resource comprises: Acquiring resource order between resources in a resource list; When it is determined, according to the resource order between the resources in the resource list, that there is a second resource in the resource list that is sequentially switchable by the first resource along a specified direction, acquiring and caching the switching playing content corresponding to the playing progress of the second resource switchable by the first resource.
3. The method of claim 2, wherein, The determining, according to the resource order between the resources in the resource list, that there is a second resource in the resource list that is sequentially switchable by the first resource along a specified direction comprises: Acquiring a switching direction of the first resource; Acquiring a direction of the resource order; When the switching direction is opposite to the direction of the resource order, determining the switching direction and the direction of the resource order as the specified direction; When the switching direction is the same as the direction of the resource order, determining the direction of the resource order as the specified direction; When there is at least one resource along the specified direction of the first resource, determining that there is a second resource in the resource list that is sequentially switchable by the first resource along the specified direction.
4. The method of claim 1, wherein, The switching playing content corresponding to the playing progress of the second resource comprises a resource segment of the second resource with a time point corresponding to the playing progress as a starting time point.
5. The method of claim 4, wherein, The duration of the resource segment is determined according to duration-related information, and the duration-related information comprises at least one of the following: the playing progress, user information, and order difference, wherein the order difference comprises a difference between an order of the second resource and an order of the first resource.
6. The method of claim 5, wherein, The caching of the switching playing content corresponding to the playing progress of the second resource switchable by the first resource comprises: Determining a caching time period of the switching playing content according to the playing progress of the second resource and the duration of the resource segment; Caching the switching playing content corresponding to the playing progress of the second resource into a folder, wherein a folder name comprises the caching time period.
7. The method of claim 1, wherein, When switching to the first resource, the method further comprises: When there is switching playing content corresponding to a playing progress of the first resource, starting playing the first resource according to the switching playing content corresponding to the playing progress of the first resource; After the switching playing content corresponding to the playing progress of the first resource is played, playing the first resource online; When there is no switching playing content corresponding to a playing progress of the first resource, playing the first resource online.
8. A resource switching playing apparatus, characterized by comprising: The electronic device comprises: at least one processor; and 9. An electronic device, comprising: A memory connected in communication with the at least one processor; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the resource switching playing method in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing a processor to implement the resource switching playing method in any one of claims 1-7 when executed.