Method and device for loading video track

By using fast tables for secondary memory search and preloading in video track loading methods, the memory pressure, disk I/O bottlenecks and loading delays in high-resolution video processing are solved, and a more efficient video track loading and improved user experience is achieved.

CN119729101AActive Publication Date: 2025-03-28SHANGHAI BILIBILI TECH CO LTD
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202411874872.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-28
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

During high-resolution video processing, the existing video frame loading methods have problems such as excessive memory pressure, disk I/O bottlenecks and loading delays, especially when the video track is sliding, which affects the user experience.

Method used

By determining the frame identification of the target video frame based on the sliding position of the video track, a secondary memory search is performed using a fast table, the existence of the frame storage address is judged, and the frame identification and frame storage address are preloaded. If it exists, the video frame is retrieved from memory, and if it does not exist, the fast table is loaded asynchronously from disk and updated.

Benefits of technology

This method improves the efficiency and user experience of video track loading by reducing memory storage pressure and frequent disk I/O operations, and reduces loading latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729101A_ABST
    Figure CN119729101A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for loading a video track, and the method comprises the steps: determining a frame identifier of a target video frame according to a sliding position of the video track; according to the frame identifier, performing secondary memory lookup on the fast table, and judging whether a frame storage address corresponding to the frame identifier exists in the fast table or not; the fast table preloads a frame identifier of a video frame and a corresponding frame storage address; the secondary memory comprises a memory and a virtual memory; if yes, obtaining a corresponding target video frame from the memory according to the frame storage address and returning; and if not, asynchronously loading the target video frame from the disk to the memory, updating the fast table according to the frame storage address of the memory, and returning the target video frame. The storage frame identifier and the frame storage address are preloaded in the fast table, the target video frame can be conveniently and quickly obtained by searching the fast table, the fast table can be stored by adopting a secondary memory, data storage between the memory and a virtual memory of a disk is dynamically adjusted, and frequent disk I / O operation is reduced while memory storage pressure is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method and device for loading a video track. Background Art

[0002] As video resolution continues to increase (such as 4K and 8K videos), the memory and disk I / O requirements during video editing and playback have increased significantly. In the process of high-resolution video processing, especially when performing track sliding, real-time loading of video frame data has become a major challenge. Existing video frame loading methods usually have the following problems:

[0003] 1. Excessive memory pressure: Due to the huge amount of video frame data, directly loading all frames into the memory may cause memory overflow, especially when processing high-resolution videos and multi-track videos.

[0004] 2. Disk I / O bottleneck: Frequent disk I / O operations will cause loading delays, especially during the sliding of video tracks. If a new video frame needs to be loaded from the disk every time you slide, it will seriously affect the user experience.

[0005] 3. Loading delay: Due to the huge amount of video frame data, the existing loading strategy may cause loading delays, especially when the user slides the track quickly, it takes time to load the frame data, which will cause playback jams. Summary of the invention

[0006] In view of the above problems, embodiments of the present application are proposed to provide a method and device for loading video tracks that overcome the above problems or at least partially solve the above problems.

[0007] According to a first aspect of an embodiment of the present application, a method for loading a video track is provided, which includes:

[0008] Determine the frame identifier of the target video frame according to the sliding position of the video track;

[0009] According to the frame identifier, the secondary memory search is performed on the fast table to determine whether there is a frame storage address corresponding to the frame identifier in the fast table; the fast table preloads the frame identifier of the video frame and the corresponding frame storage address; the secondary memory includes the internal memory and the virtual memory;

[0010] If yes, get the corresponding target video frame from the memory according to the frame storage address and return it;

[0011] If not, asynchronously load the target video frame from disk to memory, update the cache table according to the frame storage address in memory, and return the target video frame.

[0012] Optionally, before performing a secondary memory search on the fast table according to the frame identifier, the method further includes:

[0013] Predict the video frame to be viewed based on the sliding information of the video track;

[0014] Loading the video frame to be viewed into the memory, determining the frame identifier of the video frame to be viewed and the corresponding memory frame storage address;

[0015] The frame identifier and the corresponding memory frame storage address are stored in the fast table.

[0016] Optionally, predicting the video frame to be viewed according to the sliding information of the video track further includes:

[0017] Determine a predicted sliding position of the video track according to the sliding direction and sliding speed of the track, and determine a video frame to be viewed according to the predicted sliding position;

[0018] And / or, according to the current sliding position of the track, the video frames to be viewed are determined; the video frames to be viewed include video frames with a preset number of frames.

[0019] Optionally, loading the video frame to be viewed into the memory, and determining the frame identifier of the video frame to be viewed and the corresponding memory frame storage address further comprises:

[0020] Determine whether the number of video frames stored in the memory has reached a preset memory storage number; the preset memory storage number is dynamically adjusted according to the memory occupancy information;

[0021] If not, the video frame to be viewed is loaded into the memory, and the frame identifier of the video frame to be viewed and the corresponding memory frame storage address are determined;

[0022] If yes, the video frames stored in the memory are exchanged and stored in the virtual memory, the video frame to be viewed is loaded into the memory, and the frame identifier of the video frame to be viewed and the corresponding memory frame storage address are determined.

[0023] Optionally, exchanging the video frames stored in the memory to the virtual memory further comprises:

[0024] The video frames stored in the memory are used as exchange video frames, sorted by storage time, and the exchange video frames with the longest storage time are exchanged and stored in the virtual memory in turn until the memory stores all the video frames to be viewed;

[0025] The frame identifier of the exchanged video frame and the corresponding virtual memory frame storage address are stored in the fast table.

[0026] Optionally, the frame storage address includes a memory frame storage address and / or a virtual memory frame storage address;

[0027] According to the frame identifier, performing a secondary memory search on the fast table to determine whether there is a frame storage address corresponding to the frame identifier in the fast table further includes:

[0028] According to the frame identifier, determine whether there is a memory frame storage address corresponding to the frame identifier in the fast table;

[0029] If so, get the memory frame storage address;

[0030] If not, determine whether there is a virtual memory frame storage address corresponding to the frame identifier in the cache based on the frame identifier;

[0031] If so, obtain the virtual memory frame storage address;

[0032] Obtaining the corresponding target video frame from the memory according to the frame storage address and returning it further includes:

[0033] If the frame storage address is a memory frame storage address, obtain the corresponding video frame according to the memory frame storage address and return it;

[0034] If the frame storage address is a virtual memory frame storage address, the target video frame is located according to the virtual memory frame storage address, the target video frame is loaded into the memory, the cache is updated according to the memory frame storage address, and the target video frame is returned.

[0035] Optionally, the method further comprises:

[0036] Monitor whether the memory meets the preset memory swap condition; the preset memory swap condition is determined according to the memory usage information;

[0037] If so, the video frames satisfying the preset frame exchange condition are exchanged and stored in the virtual memory; the preset frame exchange condition is determined according to the historical access frequency and / or memory storage time of the video frame.

[0038] According to a second aspect of an embodiment of the present application, a device for loading a video track is provided, comprising:

[0039] A frame identification determination module, adapted to determine a frame identification of a target video frame according to a sliding position of a video track;

[0040] A search module is adapted to perform a secondary memory search on the fast table according to the frame identifier to determine whether a frame storage address corresponding to the frame identifier exists in the fast table; the fast table preloads the frame identifier of the video frame and the corresponding frame storage address; the secondary memory includes a memory and a virtual memory;

[0041] A memory return module, adapted to obtain a corresponding target video frame from the memory according to the frame storage address and return it if the search module determines that there is a frame storage address corresponding to the frame identifier;

[0042] The disk return module is suitable for asynchronously loading the target video frame from the disk to the memory if the search module determines that there is no frame storage address corresponding to the frame identifier, updating the cache according to the frame storage address of the memory, and returning the target video frame.

[0043] According to a third aspect of an embodiment of the present application, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0044] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned method for loading video tracks.

[0045] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to perform operations corresponding to the method for loading a video track as described above.

[0046] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the method for loading a video track as described above.

[0047] According to the method and device for loading video tracks provided by the present application, the quick table preloads the storage frame identifier and frame storage address, and the target video frame can be quickly located and obtained by searching the quick table for return. The quick table can use secondary memory storage to dynamically adjust the data storage between the memory and the disk virtual memory, while reducing the memory storage pressure, it also reduces frequent disk I / O operations.

[0048] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0050] Figure 1 A flowchart of a method for loading a video track according to an embodiment of the present application is shown;

[0051] Figure 2 A flowchart of a method for loading a video track according to another embodiment of the present application is shown;

[0052] Figure 3 A schematic structural diagram of a device for loading a video track according to an embodiment of the present application is shown;

[0053] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0054] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0055] First, the terms involved in one or more embodiments of the present application are explained.

[0056] Video Track: A linear data stream consisting of video frame data, used to represent the content of a video. During video editing or playback, a video track stores multiple video frames, each of which usually represents a frame of an image in the video.

[0057] Video Frame: A video frame is the basic unit of a video, representing a still picture in the video. A video is composed of several consecutive video frames, which are played at a certain time interval to produce a dynamic effect.

[0058] Track Scrubbing: During video playback or editing, track scrubbing is a method of quickly browsing video content by adjusting the playback progress bar. Track scrubbing usually requires the system to load video frames in real time and display them in the editor or player.

[0059] Lookup Table (LUT): A lookup table is a data structure used to cache video frame indexes or preload information, usually used to accelerate data access.

[0060] Virtual Memory: Virtual memory is a technology used by the operating system to expand the capacity of physical memory by storing part of the data on the hard disk to avoid insufficient memory. The use of virtual memory requires the use of a swap mechanism to move infrequently used data from the memory to the hard disk.

[0061] Memory swapping: Memory swapping refers to the operating system swapping infrequently used data or pages in memory to the hard disk, thereby freeing up memory space. In video playback or editing, memory swapping is used to dynamically load video frame data.

[0062] Frame-by-frame Loading: Frame-by-frame loading refers to the process of gradually loading and displaying video frames as needed based on the user's track sliding operation and the current playback progress when the video is playing or editing.

[0063] Figure 1 A flow chart of a method for loading a video track according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:

[0064] Step S101, determining a frame identifier of a target video frame according to a sliding position of a video track.

[0065] A video is composed of multiple video frames, each of which has a unique frame ID, which is determined by the order of the video frames in the video track. For example, if a video contains 1000 video frames, the frame IDs can be from 1 to 1000 according to the order of the video track.

[0066] When the editor is editing the video, it needs to load the video frames into the editor. This embodiment adopts a frame-by-frame loading method, so that all video frames do not need to be loaded into the memory at one time, reducing the memory storage pressure. When loading frame by frame, the frame identifier of the target video frame to be loaded is first determined according to the sliding position of the video track, so as to obtain the target video frame stored in the memory according to the frame identifier.

[0067] Step S102: perform a secondary memory search on the cache table according to the frame identifier to determine whether there is a frame storage address corresponding to the frame identifier in the cache table.

[0068] The quick table is stored in the memory, which includes the frame identifier and the corresponding frame storage address, which can be stored in a key-value pair, such as frame identifier 01-frame storage address 0x0100, frame identifier 02-frame storage address 0x0200, etc. The frame storage address can be a memory frame storage address. By searching the quick table through the frame identifier, the frame storage address of the target video frame can be quickly located, and then the target video frame can be obtained.

[0069] The fast table is stored according to the video frames preloaded into the memory. According to the frame identifier of the video frame loaded into the memory and the frame storage address of the video frame in the memory, it can be preloaded into the fast table. The fast table stores the frame identifier of the video frame and the corresponding frame storage address, manages the fast access path of the video frame, and optimizes the loading process of the video frame.

[0070] According to the frame identifier of the target video frame, by performing a secondary memory search on the fast table, it is determined whether there is a frame storage address corresponding to the frame identifier in the fast table, so as to quickly read the target video frame from the memory and return it to the editor. Here, the secondary memory includes the internal memory and the virtual memory. The virtual memory can expand the physical memory capacity. The internal memory and the virtual memory can exchange memory to realize the storage of dynamic video frames between the internal memory and the virtual memory. Correspondingly, the frame storage address recorded in the fast table can be a memory frame storage address or a virtual memory frame storage address. By searching the frame identifier stored in the fast table, the frame storage address corresponding to the frame identifier is searched. If it exists, step S103 is executed to obtain the corresponding target video frame. If it does not exist, it means that the target video frame is not stored in the internal memory or the virtual memory, and it needs to be read from the disk, and step S104 is executed.

[0071] Step S103, obtaining the corresponding target video frame from the memory according to the frame storage address and returning it.

[0072] When the quick table is searched and it is determined that there is a frame storage address corresponding to the frame identifier, the corresponding target video frame can be obtained based on the frame storage address and returned to the editor for display.

[0073] For the frame storage address, it can be a memory frame storage address or a virtual memory frame storage address. If it is a memory frame storage address, the corresponding target video frame can be directly found from the memory according to the memory frame storage address and returned; if it is a virtual memory frame storage address, the target video frame stored in the virtual memory can be loaded into the memory through memory exchange according to the virtual memory frame storage address positioning, and the target video frame is returned. At the same time, the quick table is updated according to the new memory frame storage address loaded into the memory. Since the video track slides to the target video frame, it means that the target video frame is a video frame that has been viewed recently. The target video frame is loaded into the memory, which is convenient for the subsequent video track to slide back and forth, and the target video frame can be quickly obtained from the memory.

[0074] Furthermore, in order to avoid virtual memory swap conflicts, if virtual memory and internal memory are frequently swapped, it may cause longer loading time and affect the smoothness of video playback. In this embodiment, memory swapping is performed only when the video frame to be loaded is stored in the virtual memory, thereby avoiding virtual memory swap conflicts.

[0075] Step S104, asynchronously load the target video frame from the disk to the memory, update the cache table according to the frame storage address of the memory, and return the target video frame.

[0076] When searching the quick table and determining that the frame storage address corresponding to the frame identifier does not exist, since the secondary memory search is used, it means that the target video frame is not stored in the memory and virtual memory, and the target video frame needs to be searched from the disk. To speed up the loading of the target video frame, the target video frame can be asynchronously loaded from the disk to the memory and returned to the editor in an asynchronous manner. The quick table is updated according to the frame identifier of the target video frame in the memory and the frame storage address in the memory, so that the video frame can be quickly searched based on the quick table in the future.

[0077] When the editor initially displays video frames, you can preload some video frames into the memory, and update the quick table according to the memory frame storage address in the memory, so as to quickly locate and obtain the video frames according to the quick table. When preloading, load some video frames into the memory to avoid loading all video frames into the memory storage, which will cause excessive pressure on the memory storage. As the video track slides, the video frames stored in the memory can be stored in the virtual memory through memory swapping, and then loaded from the virtual memory to the memory through memory swapping when needed, reducing frequent disk I / O operations.

[0078] According to the method for loading video tracks provided by the present application, the quick table preloads the storage frame identifier and the frame storage address, and the target video frame can be quickly located and obtained by searching the quick table for return. The quick table can use secondary memory storage to dynamically adjust the data storage between the memory and the virtual memory of the disk, while reducing the pressure of memory storage and reducing frequent disk I / O operations.

[0079] Figure 2 A flow chart of a method for loading a video track according to an embodiment of the present application is shown. Figure 2 As shown, the method comprises the following steps:

[0080] Step S201: predicting a video frame to be viewed according to the sliding information of the video track.

[0081] During the video track sliding process, in order to reduce the video frame access delay, the subsequent video frames to be viewed can be predicted based on the sliding information of the video track, so that the video frames to be viewed can be loaded into the memory in advance and can be quickly accessed later.

[0082] When predicting the video frame to be viewed, the predicted sliding position of the video track can be predicted and determined based on the sliding direction and sliding speed of the track. Based on the predicted sliding position, the video frame to be viewed can be determined. For example, when sliding the video track to the right, the predicted sliding position is determined to be at the xx position on the right side of the video track based on the sliding speed and the behavior pattern. The frame identifier corresponding to the video track can be determined based on the position, thereby determining the video frame to be viewed. Alternatively, the frame identifier of the current position is determined based on the current sliding position of the track, and the video frame to be viewed located after the frame identifier is determined based on the frame identifier of the current position. The video frames to be viewed include video frames with a preset number of frames, such as the subsequent 50 frames of video frames to be viewed.

[0083] Step S202, loading the video frame to be viewed into the memory, determining the frame identifier of the video frame to be viewed and the corresponding memory frame storage address, and storing the frame identifier and the corresponding memory frame storage address into a cache.

[0084] After determining the video frames to be viewed, the video frames to be viewed can be loaded into the memory. When loading into the memory, in order to reduce the memory storage pressure, a preset memory storage quantity can be set to avoid loading all video frames into the memory. The preset memory storage quantity can also be dynamically adjusted according to the memory usage information. When there is more free memory, the preset memory storage quantity can be increased, and when the memory storage space is tight, the preset memory storage quantity can be reduced.

[0085] When loading, first determine whether the number of video frames stored in the memory has reached the preset memory storage number. If not, that is, the memory can continue to store video frames, then the video frames to be viewed are loaded into the memory in sequence, and the frame identifiers and corresponding memory frame storage addresses of the video frames to be viewed are determined after loading. When loading, it can be determined once for each video frame loaded, which is convenient for sequentially storing video frames. It can also be compared with the preset memory storage number based on the total number of video frames to be loaded and the number of video frames stored in the memory. If it does not exceed the preset memory storage number, the video frames to be viewed can be directly stored. If it is determined that the number of video frames stored in the memory has reached the preset memory storage number, or, based on the total number of video frames to be loaded and the number of video frames stored in the memory, the total number is compared with the preset memory storage number, and it exceeds the preset memory storage number, the memory cannot store all the video frames to be viewed, then it is necessary to first exchange the video frames stored in the memory and store them in the virtual memory, and then load the video frames to be viewed into the memory, and determine the frame identifiers and corresponding memory frame storage addresses of the video frames to be viewed.

[0086] When swapping and storing, the video frames stored in the memory can be used as swap video frames, and the swap video frames with the longest storage time are swapped and stored in the virtual memory in sequence according to the storage time. For example, the video frames stored in the memory include frame 01, frame 02, frame 03...frame 50, and the video frames to be viewed include frame 51, frame 52, frame 53...frame 60. According to the storage time, frame 01 with the longest storage time is swapped and stored in the virtual memory, and frame 51 is stored in the memory. Then frame 02 is swapped and stored in the virtual memory, and frame 52 is stored in the memory... The swap video frames are swapped and stored in the virtual memory in sequence until the memory stores all the video frames to be viewed. The swap video frames with the longest storage time have a low probability of being displayed again. The swapped and stored video frames in the virtual memory are mostly video frames with frame identifiers far away from the current video track position, video frames that are less used, etc.

[0087] According to the determined frame identifier of the video frame to be viewed and the corresponding memory frame storage address, they can be recorded in the fast table. At the same time, the frame identifier of the exchanged video frame and the corresponding virtual memory frame storage address are also stored in the fast table, that is, the frame identifier and memory frame storage address of the exchanged video frame originally stored in the fast table need to be updated to the frame identifier of the exchanged video frame and the corresponding virtual memory frame storage address.

[0088] Step S203: determining a frame identifier of a target video frame according to the sliding position of the video track.

[0089] According to the sliding position of the video track, the position of the target video frame in the track can be determined, thereby obtaining the frame identifier corresponding to the target video frame.

[0090] Step S204: perform a secondary memory search on the cache table according to the frame identifier to determine whether there is a frame storage address corresponding to the frame identifier in the cache table.

[0091] The frame storage addresses stored in the cache include memory frame storage addresses and virtual memory frame storage addresses. When checking the cache, determine whether there is a memory frame storage address corresponding to the frame identifier in the cache according to the frame identifier. If so, the memory frame storage address can be directly obtained. If not, it is necessary to further determine whether there is a virtual memory frame storage address corresponding to the frame identifier in the cache according to the frame identifier. If so, obtain the virtual memory frame storage address.

[0092] When it is determined that there is a frame storage address corresponding to the frame identifier in the cache, step S205 is executed; otherwise, step S206 is executed.

[0093] Step S205, obtaining the corresponding target video frame from the memory according to the frame storage address and returning it.

[0094] According to the frame storage address, if the frame storage address is a memory frame storage address, the corresponding video frame can be obtained according to the memory frame storage address and returned to the editor for display. If the frame storage address is a virtual memory frame storage address, the target video frame is located according to the virtual memory frame storage address, the target video frame is loaded into the memory, the cache is updated according to the memory frame storage address, and the target video frame is returned.

[0095] Step S206, asynchronously load the target video frame from the disk to the memory, update the cache table according to the frame storage address of the memory, and return the target video frame.

[0096] When the frame storage address of the target video frame does not exist in the fast table, the target video frame needs to be found from the disk. In order to facilitate fast loading, an asynchronous loading method is used to obtain the target video frame from the disk, asynchronously load it into the memory, and return the target video frame to the editor. After loading into the memory, the fast table is updated according to the frame storage address of the memory, and the frame identifier and corresponding frame storage address of the target video frame are recorded in the fast table, which is convenient for managing the target video frame using the fast table, as well as subsequent positioning and reading.

[0097] Step S207, monitoring whether the memory meets the preset memory exchange condition.

[0098] In order to reduce the storage pressure of the memory, the memory may be monitored. When it is detected that the memory meets the preset memory exchange condition, step S208 may be executed to exchange and store part of the video frames into the virtual memory.

[0099] The preset memory swap condition can be determined based on the memory occupancy information, such as when the memory occupancy reaches 80%. The memory is not only used to store video frames, but also occupied when running various applications. In order to reduce the memory storage pressure and increase the video frame acquisition speed, when the memory occupancy reaches 80%, the preset memory swap condition is met, and step S208 is executed.

[0100] Step S208: exchange and store the video frames satisfying the preset exchange frame condition into the virtual memory.

[0101] The video frames in the memory that meet the preset exchange frame conditions can be exchanged and stored in the virtual memory to reduce the storage pressure of the memory. The preset exchange frame conditions can be determined based on the historical access frequency of the video frames, the memory storage time, etc. For example, based on the historical access frequency of the video frames, the video frames can be classified, such as setting a classification threshold, and the frames above the classification threshold are high-frequency video frames, otherwise they are low-frequency video frames. Low-frequency video frames are video frames that are less accessed. The low-frequency video frames stored in the memory can be exchanged and stored in the virtual memory, and the frame storage address in the fast table is updated at the same time. Alternatively, based on the storage time of the video frames in the memory, the video frames with a longer storage time can be exchanged and stored in the virtual memory to reduce the storage occupancy of the memory.

[0102] There is no limitation on the execution order of steps S207-S208 and steps S201-S206, and they are executed according to the actual call.

[0103] According to the method for loading video tracks provided by the present application, the video frames to be viewed are loaded into the memory in a pre-loading manner, thereby reducing loading delays and playback jams. The memory frame storage address and frame identification record of the video frame are recorded in a quick table, the video frame is managed by the quick table, and the quick table is searched by the frame identification to quickly locate the video frame, so as to facilitate and quickly obtain the video frame, and efficiently obtain the video frame. Furthermore, by using the memory and virtual memory, the video frames stored in the memory can be exchanged and stored in the virtual memory according to the storage time of the video frame in the memory, the access frequency of the video frame, etc., and the video frames stored in the memory can be exchanged and stored in the virtual memory. When they need to be obtained, they are loaded from the virtual memory to the memory, and the data scheduling between the memory and the virtual memory of the disk is dynamically adjusted to reduce the memory storage pressure while improving the acquisition efficiency.

[0104] Figure 3 A schematic diagram of the structure of a device for loading a video track provided in an embodiment of the present application is shown.

[0105] like Figure 3 As shown, the device comprises:

[0106] A frame identification determination module 310, adapted to determine a frame identification of a target video frame according to a sliding position of a video track;

[0107] The search module 320 is adapted to perform a secondary memory search on the fast table according to the frame identifier to determine whether there is a frame storage address corresponding to the frame identifier in the fast table; the fast table preloads the frame identifier of the video frame and the corresponding frame storage address; the secondary memory includes the internal memory and the virtual memory;

[0108] A memory return module 330, adapted to obtain a corresponding target video frame from the memory according to the frame storage address and return it if the search module determines that there is a frame storage address corresponding to the frame identifier;

[0109] The disk return module 340 is adapted to asynchronously load the target video frame from the disk to the memory if the search module determines that there is no frame storage address corresponding to the frame identifier, update the cache according to the frame storage address in the memory, and return the target video frame.

[0110] Optionally, the device also includes: a preloading module 350, adapted to predict the video frame to be viewed according to the sliding information of the video track; load the video frame to be viewed into the memory, determine the frame identifier of the video frame to be viewed and the corresponding memory frame storage address; store the frame identifier and the corresponding memory frame storage address into the quick table.

[0111] Optionally, the preloading module 350 is further adapted to:

[0112] Determine a predicted sliding position of the video track according to the sliding direction and sliding speed of the track, and determine a video frame to be viewed according to the predicted sliding position;

[0113] And / or, according to the current sliding position of the track, the video frames to be viewed are determined; the video frames to be viewed include video frames with a preset number of frames.

[0114] Optionally, the preloading module 350 is further adapted to: determine whether the number of video frames stored in the memory reaches a preset memory storage number; the preset memory storage number is dynamically adjusted according to the memory occupancy information;

[0115] If not, the video frame to be viewed is loaded into the memory, and the frame identifier of the video frame to be viewed and the corresponding memory frame storage address are determined;

[0116] If yes, the video frames stored in the memory are exchanged and stored in the virtual memory, the video frame to be viewed is loaded into the memory, and the frame identifier of the video frame to be viewed and the corresponding memory frame storage address are determined.

[0117] Optionally, the preloading module 350 is further adapted to:

[0118] The video frames stored in the memory are used as exchange video frames, sorted by storage time, and the exchange video frames with the longest storage time are exchanged and stored in the virtual memory in turn until the memory stores all the video frames to be viewed;

[0119] The frame identifier of the exchanged video frame and the corresponding virtual memory frame storage address are stored in the fast table.

[0120] Optionally, the frame storage address includes a memory frame storage address and / or a virtual memory frame storage address;

[0121] The search module 320 is further adapted to:

[0122] According to the frame identifier, determine whether there is a memory frame storage address corresponding to the frame identifier in the fast table;

[0123] If so, get the memory frame storage address;

[0124] If not, determine whether there is a virtual memory frame storage address corresponding to the frame identifier in the cache based on the frame identifier;

[0125] If so, obtain the virtual memory frame storage address;

[0126] The memory return module 330 is further adapted to:

[0127] If the frame storage address is a memory frame storage address, obtain the corresponding video frame according to the memory frame storage address and return it;

[0128] If the frame storage address is a virtual memory frame storage address, the target video frame is located according to the virtual memory frame storage address, the target video frame is loaded into the memory, the cache is updated according to the memory frame storage address, and the target video frame is returned.

[0129] Optionally, the device also includes: an exchange module 360, suitable for monitoring whether the memory meets the preset memory exchange conditions; the preset memory exchange conditions are determined based on the memory occupancy information; if so, the video frames that meet the preset exchange frame conditions are exchanged and stored in the virtual memory; the preset exchange frame conditions are determined based on the historical access frequency of the video frame and / or the memory storage time.

[0130] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.

[0131] According to the device for loading video tracks provided by the present application, the quick table preloads the storage frame identifier and the frame storage address, and the target video frame can be quickly located and obtained by searching the quick table for return. The quick table can use secondary memory storage to dynamically adjust the data storage between the memory and the virtual memory of the disk, while reducing the pressure of memory storage and the frequent disk I / O operations.

[0132] The present application also provides a non-volatile computer storage medium, which stores at least one executable instruction, and the executable instruction can execute operations corresponding to the method for loading a video track in any of the above method embodiments.

[0133] The present application also provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the method for loading a video track in any of the above method embodiments.

[0134] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.

[0135] like Figure 4 As shown, the computing device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0136] in:

[0137] The processor 402 , the communication interface 404 , and the memory 406 communicate with each other via a communication bus 408 .

[0138] The communication interface 404 is used to communicate with other devices such as clients or other servers.

[0139] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above-mentioned method embodiment for loading the video track.

[0140] Specifically, the program 410 may include program codes, which include computer operation instructions.

[0141] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0142] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0143] The program 410 can be specifically used to enable the processor 402 to execute the method for loading a video track in any of the above-mentioned method embodiments. The specific implementation of each step in the program 410 can refer to the corresponding descriptions in the corresponding steps and units in the above-mentioned embodiment of loading a video track, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-mentioned devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.

[0144] The algorithm or display provided here is not inherently related to any specific computer, virtual system or other device. Various general systems can also be used together with the teaching based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the application is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the application described here, and the above description of specific languages ​​is to disclose the preferred embodiment of the application.

[0145] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0146] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.

[0147] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0148] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0149] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components of the present application. The present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0150] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A method for loading a video track, comprising: Determine the frame identifier of the target video frame according to the sliding position of the video track; According to the frame identifier, a secondary memory search is performed on the fast table to determine whether a frame storage address corresponding to the frame identifier exists in the fast table; the fast table preloads the frame identifier of the video frame and the corresponding frame storage address; the secondary memory includes a memory and a virtual memory; If so, obtain the corresponding target video frame from the memory according to the frame storage address and return it; If not, asynchronously load the target video frame from the disk to the memory, update the cache table according to the frame storage address of the memory, and return the target video frame.

2. The method according to claim 1, wherein: Before performing a secondary memory search on the fast table according to the frame identifier, the method further includes: Predict the video frame to be viewed based on the sliding information of the video track; Loading the video frame to be viewed into a memory, and determining a frame identifier of the video frame to be viewed and a corresponding memory frame storage address; The frame identifier and the corresponding memory frame storage address are stored in the cache.

3. The method according to claim 2, wherein: The predicting of the video frame to be viewed according to the sliding information of the video track further comprises: Determine a predicted sliding position of the video track according to the sliding direction and sliding speed of the track, and determine a video frame to be viewed according to the predicted sliding position; And / or, according to the current sliding position of the track, the video frames to be viewed are determined; the video frames to be viewed include video frames with a preset number of frames.

4. The method according to claim 2, wherein: The step of loading the video frame to be viewed into a memory and determining a frame identifier of the video frame to be viewed and a corresponding memory frame storage address further comprises: Determine whether the number of video frames stored in the memory reaches a preset memory storage number; the preset memory storage number is dynamically adjusted according to the memory occupancy information; If not, loading the video frame to be viewed into the memory, and determining the frame identifier of the video frame to be viewed and the corresponding memory frame storage address; If yes, the video frames stored in the memory are exchanged and stored in the virtual memory, the video frame to be viewed is loaded into the memory, and the frame identifier of the video frame to be viewed and the corresponding memory frame storage address are determined.

5. The method according to claim 4, wherein: The step of exchanging the video frames stored in the memory to the virtual memory further comprises: The video frames stored in the memory are used as exchange video frames, and are sorted according to storage time, and the exchange video frames with the longest storage time are exchanged and stored in the virtual memory in turn, until the memory stores the video frames to be viewed; The frame identifier of the exchanged video frame and the corresponding virtual memory frame storage address are stored in the cache.

6. The method according to any one of claims 1 to 5, wherein: The frame storage address includes a memory frame storage address and / or a virtual memory frame storage address; The performing a secondary memory search on the fast table according to the frame identifier to determine whether a frame storage address corresponding to the frame identifier exists in the fast table further comprises: According to the frame identifier, determining whether there is a memory frame storage address corresponding to the frame identifier in the cache; If so, obtaining the memory frame storage address; If not, judging, based on the frame identifier, whether there is a virtual memory frame storage address corresponding to the frame identifier in the cache; If so, obtaining the virtual memory frame storage address; The step of obtaining the corresponding target video frame from the memory according to the frame storage address and returning it further comprises: If the frame storage address is a memory frame storage address, obtaining a corresponding video frame according to the memory frame storage address and returning it; If the frame storage address is a virtual memory frame storage address, the target video frame is located according to the virtual memory frame storage address, the target video frame is loaded into the memory, the cache is updated according to the memory frame storage address, and the target video frame is returned.

7. The method according to any one of claims 1 to 6, wherein: The method further comprises: Monitoring whether the memory satisfies a preset memory exchange condition; the preset memory exchange condition is determined according to memory occupancy information; If so, the video frames satisfying the preset frame exchange condition are exchanged and stored in the virtual memory; the preset frame exchange condition is determined according to the historical access frequency and / or memory storage time of the video frames.

8. A device for loading a video track, comprising: A frame identification determination module, adapted to determine a frame identification of a target video frame according to a sliding position of a video track; A search module is adapted to perform a secondary memory search on the fast table according to the frame identifier to determine whether a frame storage address corresponding to the frame identifier exists in the fast table; the fast table preloads the frame identifier of the video frame and the corresponding frame storage address; the secondary memory includes a memory and a virtual memory; A memory return module, adapted to obtain a corresponding target video frame from the memory according to the frame storage address and return it if the search module determines that there is a frame storage address corresponding to the frame identifier; The disk return module is adapted to asynchronously load the target video frame from the disk to the memory if the search module determines that there is no frame storage address corresponding to the frame identifier, update the cache according to the frame storage address of the memory, and return the target video frame.

9. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the method for loading a video track according to any one of claims 1 to 7.

10. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and wherein the executable instruction enables a processor to execute operations corresponding to the method for loading a video track according to any one of claims 1 to 8.

11. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the method for loading a video track according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • LBT (Listen Before Talk) mechanism which synchronously takes uplink and downlink into consideration in LAA (Licensed-Assisted Access) system

    CN105636233A

  • Random access method and device

    CN108702788A

  • Scheduling uplink transmissions

    CN109075914A

  • Storage space adjustment method and device for cloud storage resource pool and cloud storage system

    CN110300134A

  • Data lookup method and device based on lookup table and readable storage medium

    CN115617848A