Frame switching method, device, equipment and computer medium
By only loading the difference resources of the target frame when switching frames, the problems of low frame switching efficiency and poor fluency in the existing technology are solved, and computing resources are saved and the user experience is improved.
Patent Information
- Application Number
- CN202411397289.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-10-08
AI Technical Summary
The existing technology requires completely unloading the current material package and reloading a complete set of material packages when switching frames, resulting in high consumption of computing resources and large memory usage, causing application lag and low switching efficiency.
By responding to the frame switching command, the target frame is determined, and the differential resources related to the target frame are read from the multi-frame material package. The incremental loading mechanism is used to load only the differential resources instead of the entire set of material packages to achieve fast frame switching.
Effectively reduce computing resource consumption and memory usage, avoid application lag, improve the efficiency and smoothness of frame switching, and enhance the user experience when switching between different frames.
Smart Images

Figure CN119356781B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a frame switching method, device, equipment, and computer-readable medium. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the present application that are recited in the claims. Nothing herein is admitted to be prior art by virtue of its inclusion in this section.
[0003] In the field of digital content creation and distribution, with the popularization of mobile devices and diversified display platforms, the smooth switching of special effects materials between different frames has become a key issue that needs to be solved urgently.
[0004] Traditional aspect switching technologies mostly rely on a holistic update strategy. For example, when the user interface switches from landscape to portrait, the system must completely unload the current asset pack and reload a set optimized for the new aspect. This process involves a comprehensive reload of resources such as images, audio and video, and keyframe animations. This not only consumes a large amount of computing resources and time, but also significantly increases memory usage, causing app lag or even crashes, especially on resource-constrained mobile devices.
[0005] In view of the above problems, it is necessary to provide a technical solution for frame switching with higher switching efficiency and smoothness. Summary of the Invention
[0006] Various aspects of the present application provide a frame switching method, apparatus, device, and computer-readable storage medium to improve the efficiency and smoothness of frame switching.
[0007] In one aspect of the present application, a frame switching method is provided, wherein the method includes:
[0008] In response to an image frame switching instruction for target digital content, determining a target image frame to be displayed;
[0009] Reading differential resources related to the target frame from a multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources supporting display of the target digital content in multiple frames, and the content resources include common resources for multiple frames and differential resources for a single frame;
[0010] The difference resources related to the target frame are loaded according to an incremental loading mechanism, so as to switch the target digital content to the target frame for display.
[0011] Another aspect of the present application provides a frame switching device, wherein the device includes:
[0012] a target frame determination module, configured to determine a target frame to be displayed in response to a frame switching instruction for target digital content;
[0013] a differential resource reading module, configured to read differential resources associated with the target frame from a multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources supporting display of the target digital content in multiple frames, and the content resources include common resources for multiple frames and differential resources for a single frame;
[0014] The difference resource loading module is used to load the difference resource related to the target frame according to the incremental loading mechanism, so as to switch the target digital content to the target frame for display.
[0015] Another aspect of the present application provides an electronic device, comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the frame switching method described above.
[0019] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the frame switching method as described above.
[0020] In the solution provided by an embodiment of the present application, in response to an image switching instruction for target digital content, a target image to be displayed is determined. Then, differential resources associated with the target image are read from a multi-image material package corresponding to the target digital content. The multi-image material package includes all content resources supporting display of the target digital content in multiple images, including common resources reused by multiple images and differential resources used by a single image. The differential resources associated with the target image are then loaded according to an incremental loading mechanism, thereby enabling the target digital content to be switched to the target image for display. Compared to the prior art practice of completely unloading the current material package and reloading a complete set of material packages when switching images, the technical solution of the present application only requires loading differential resources to achieve rapid image switching. Since only the differential resources required for the target image are loaded instead of the entire set of materials, computing resource consumption and memory usage can be effectively reduced, avoiding application lag caused by resource overloading. By reducing the amount of loaded resources, the image switching efficiency can be effectively improved, thereby improving the user's smooth experience when switching between different images. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0023] Figure 1 A flowchart of a frame switching method provided in one embodiment of the present application;
[0024] Figure 2 A schematic diagram of the structure of a material package provided in one embodiment of the present application;
[0025] Figure 3 A schematic diagram of a horizontal screen frame referencing content resources within a material package provided in an embodiment of the present application;
[0026] Figure 4 A schematic diagram of a vertical screen frame referencing content resources in a material package provided in an embodiment of the present application;
[0027] Figure 5 A schematic structural diagram of a frame switching device provided in one embodiment of the present application;
[0028] Figure 6A schematic diagram of the structure of an electronic device suitable for implementing the solution in the embodiments of the present application;
[0029] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0030] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0031] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPUs), input / output interfaces, network interfaces and memories.
[0032] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0033] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. The information can be computer program instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc-read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0034] In response to the problems of low efficiency and poor fluency in the prior art when switching frames, the current material package needs to be completely unloaded and a complete set of material packages needs to be reloaded. The embodiments of the present application provide a frame switching method, device, equipment and computer-readable storage medium to improve the efficiency and fluency of frame switching. It determines the target frame to be displayed in response to the frame switching instruction for the target digital content, and then reads the difference resources related to the target frame from the multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources that support displaying the target digital content in multiple frames, and the content resources include common resources for multiple frames and resources for single frame use. The target digital content can be switched to the target frame for display by loading the differential resources used, and then loading the differential resources related to the target frame according to the incremental loading mechanism. Compared with the prior art which requires completely unloading the current material package and reloading a complete set of material packages when switching frames, the technical solution of the present application only needs to load differential resources to achieve fast frame switching. Since only the differential resources required for the target frame are loaded instead of the entire set of materials, the computing resource consumption and memory usage can be effectively reduced, and the application freeze problem caused by resource overloading can be avoided. In addition, by reducing the amount of loaded resources, the frame switching efficiency can be effectively improved, thereby improving the user's smooth experience when switching between different frames.
[0035] The following is an exemplary description of the frame switching method, device, equipment and computer-readable storage medium provided in this application.
[0036] In actual scenarios, the execution subject of the frame switching method provided in the embodiment of the present application can be a user device, or a device formed by integrating a user device and a network device through a network, or an application (such as a rendering engine, system software, etc.) running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablets, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer collections. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer collections.
[0037] Figure 1 The following is a processing flow of a frame switching method provided by an embodiment of the present application, wherein the method includes at least the following processing steps:
[0038] Step S101 : In response to an image frame switching instruction for target digital content, a target image frame to be displayed is determined.
[0039] Among them, the target digital content can be any digital content that can be displayed through multiple frames, including but not limited to visual effects (such as video effects, game effects, photography effects, etc.), applications, web pages, games, etc. The above digital content can all achieve more efficient and smooth multi-frame switching effects based on the technical solution provided in the embodiments of this application.
[0040] The above-mentioned frame switching instruction can be triggered when a display environment change is detected. The display environment change refers to a change in the screen orientation, resolution or size of the user device, which requires adaptive adjustment of the content being displayed. The above-mentioned display environment changes may include but are not limited to screen rotation (from landscape to portrait or vice versa), resolution change, window size adjustment, display ratio adjustment, and device sensor feedback. When these changes are detected, the system will trigger the frame switching instruction.
[0041] After detecting the above-mentioned frame switching instruction, it is necessary to determine the target frame to be displayed, that is, to determine which frame to switch to for display. Specifically, the target frame to be displayed can be determined by the following steps: first, identify the current display environment information, confirm the screen orientation (landscape or portrait), resolution and any factors that may affect the layout of the current device, such as screen size and other display environment information, and parse the frame switching instruction to understand the user or system's instruction intention. For example, the user may issue a switching instruction through gesture operation (such as rotating the device) or menu selection, and then determine the target frame to be displayed by searching the frame configuration information according to the current display environment information and the requirements of the frame switching instruction. Predefined layout rules or style sheets can be used to match the most appropriate frame layout, that is, the target frame.
[0042] Step S102: Read differential resources related to the target frame from the multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources that support displaying the target digital content in multiple frames, and the content resources include common resources for multiple frames and differential resources for a single frame.
[0043] Among them, the above-mentioned multi-frame material package is a collection of content resources that support multiple frame displays, including all images, videos and other multimedia content required to support different display environments (such as horizontal screen, vertical screen, etc.), which can help content creators efficiently cover multiple platforms and devices, and ensure that the display effects under different frames are consistent and high-quality. The multi-frame material package of the embodiment of the present application realizes efficient and smooth frame switching through an incremental loading mechanism, ensuring the consistency and high quality of content display under different display conditions.
[0044] The above-mentioned content resources refer to various materials used in the process of digital content creation and distribution, including but not limited to multimedia elements such as images, videos, and audio. In order to meet the multi-frame display requirements of the target digital content, the embodiment of the present application needs to determine the content resources required for each of the multiple frames, thereby obtaining all content resources that can meet the multi-frame display requirements. In order to achieve cross-frame reuse of content resources, it is necessary to classify all content resources according to their reusability. For example, content resources that can be reused are classified as common resources, and content resources that cannot be reused are classified as differential resources.
[0045] Common resources can be shared across different frames, requiring only one copy, rather than a separate one for each frame. For example, certain audio files or common background elements may be the same across frames, so only one copy is needed. Differential resources are tailored to fit specific frames. For example, if an image has different dimensions for landscape and portrait screens, designers need to provide separate versions for each.
[0046] Since the above-mentioned step S101 is executed under the trigger of the frame switching instruction, it means that before step S101, the target digital content has been loaded and displayed through the historical frame. Since the public resources are shared by the historical frame and the target frame, based on the technical concept of public resource reuse and incremental loading of the present application, the public resources can be directly reused without repeated reading and loading. Only differential resources need to be read and loaded. In this way, when switching frames, only the differential resources related to the new frame need to be loaded without reloading all resources, thereby effectively improving the loading efficiency and the smoothness of the display.
[0047] Step S103 : loading the difference resources related to the target frame according to an incremental loading mechanism, so as to switch the target digital content to the target frame for display.
[0048] The incremental loading mechanism is a data loading technology designed to improve the efficiency of data synchronization and updates. This mechanism allows the system to only load data that has changed since the last update, rather than loading the entire dataset each time, significantly reducing data processing time and resource consumption. This embodiment of the present application applies the concept of incremental loading to the specific frame switching scenario of this application. Combined with the aforementioned steps, this reduces the amount of resource reloaded and improves the efficiency and smoothness of frame switching.
[0049] The above-mentioned frame switching method provided in an embodiment of the present application determines a target frame to be displayed in response to a frame switching instruction for target digital content, and then reads differential resources related to the target frame from a multi-frame material package corresponding to the target digital content. The multi-frame material package includes all content resources that support displaying the target digital content in multiple frames, including common resources for multiple frames and differential resources for use in a single frame. The differential resources related to the target frame are then loaded according to an incremental loading mechanism, thereby switching the target digital content to the target frame for display. Compared to the prior art method of completely unloading the current material package and reloading a complete set of material packages when switching frames, the technical solution of the present application only needs to load differential resources to achieve fast frame switching. Since only the differential resources required for the target frame are loaded instead of the entire set of materials, computing resource consumption and memory usage can be effectively reduced, avoiding application lag caused by resource overloading. By reducing the amount of loaded resources, the frame switching efficiency can be effectively improved, thereby improving the user's smooth experience when switching between different frames.
[0050] In some modified implementations, the multi-frame material package further includes a frame resource description file, wherein the frame resource description file records frame resource reference information between frames and content resources;
[0051] The above step S102 of reading the difference resources related to the target frame from the multi-frame material package corresponding to the target digital content may include:
[0052] According to the frame resource reference information recorded in the frame resource description file, the difference resource having a reference relationship with the target frame is read from the multi-frame material package corresponding to the target digital content.
[0053] In this embodiment, a multi-frame material package may include a frame resource description file and all content resources that support displaying target digital content in multiple frames, wherein the frame resource description file records the frame resource reference information between the frame and the content resource, and the frame resource reference information refers to information that describes the reference relationship between the frame and the content resource. The embodiment of the present application adopts a reference method to realize the association between the frame and the content resource, and then based on the reference relationship, when a certain frame needs to be displayed, the referenced content resource is directly called for loading and display. Based on this technical concept, when making a material package, all content resources can be added to a total material package without having to make a corresponding material package for each frame separately, thereby simplifying the material package production steps and realizing efficient reuse of common resources across frames, reducing the workload of designers, improving the production efficiency of the material package and reducing production costs, and later maintenance only needs to maintain the individual content resources and reference information within the material package, so it can also effectively improve maintenance efficiency and reduce maintenance costs.
[0054] During implementation of this embodiment, it is possible to determine which content resources are related to the target frame according to the frame resource reference information in the frame resource description file, and only the difference resources need to be read and loaded.
[0055] This embodiment manages content resources and associates them with frames by introducing frame resource description files and frame resource reference information. This ensures that when frame switching is required, the content resources related to the target frame can be directly located based on the reference information in the frame resource description file, improving the efficiency of locating and reading content resources, and helping to improve the efficiency and smoothness of frame switching. Moreover, by introducing frame resource description files and frame resource reference information, content management becomes simpler. Users can quickly understand the status of each frame and its relationship with content resources by viewing the frame resource description file, making version control and resource management easier. In addition, by clearly recording the reference relationship between frames and resources, it can be ensured that no related resources are missed during the update process, which helps maintain data consistency and integrity and avoids problems caused by missing certain resources. In addition, when adding new frames or modifying existing frames, it is only necessary to update the frame resource description file and add the updated content resources to the multi-frame material package. This flexibility makes the system more adaptable to future changes in demand and simplifies maintenance.
[0056] Based on the above implementation, in some modified implementations, the multi-frame material package includes multiple frame resource description files, each of which records frame resource reference information corresponding to a frame;
[0057] The multi-frame resource package further includes an entry file, wherein the entry file records the correspondence between multiple frames and multiple frame resource description files in the multi-frame material package;
[0058] The step of reading, from the multi-frame material package corresponding to the target digital content, differential resources having a reference relationship with the target frame according to the frame resource reference information recorded in the frame resource description file, includes:
[0059] Querying a frame resource description file corresponding to the target frame according to the entry file;
[0060] According to the frame resource reference information recorded in the retrieved frame resource description file, the difference resource having a reference relationship with the target frame is read from the multi-frame material package corresponding to the target digital content.
[0061] In this implementation, the multi-frame resource package not only includes multiple frame resource description files and all content resources, but also an entry file. This design can further improve the efficiency and flexibility of frame switching. Specifically, because each frame resource description file records the frame resource reference information of a specific frame, there is a one-to-one correspondence between frames and frame resource description files. For each frame (for example, an image of different resolution or size), there is a separate file that describes all the relevant content resources and their locations. This structure allows the system to independently handle the resource dependencies of each frame.
[0062] The role of the entry file is to record the correspondence between all frames and their respective frame resource description files. It can be regarded as an index of a multi-frame material package, helping the system to quickly locate the frame resource description file required for a specific frame.
[0063] Based on the above-mentioned entry file and multiple frame resource description files, the frame resource description file corresponding to the target frame can be searched according to the entry file. Once the correct frame resource description file is found, the difference resources that have a reference relationship with the target frame can be located and read based on the frame resource reference information recorded therein.
[0064] Through this implementation, the loading of required resources for each frame can be controlled very precisely. When the client software needs to load resources for a specific frame, it can directly read the description file corresponding to the frame, thereby quickly finding and loading the required resources, effectively simplifying the resource loading process. There is no need to process information of multiple frames, only the description file of the currently required frame needs to be processed. In addition, when the resources of a certain frame change, only the description file of the corresponding frame needs to be updated without affecting the description files of other frames, which facilitates maintenance and updating.
[0065] In addition, by introducing the entry file, the organizational structure of the material package becomes clearer, making it easier to manage and maintain. At the same time, the entry file serves as a navigation directory, allowing the rendering engine to quickly and accurately find the required frame resource description file based on the entry file, avoiding the process of traversing the entire material package to find the resource description file, thereby improving loading efficiency and reducing user waiting time. In addition, by centralizing the information of all frame resource description files in one entry file, the resources of the entire material package can be managed more efficiently, which is especially beneficial for large-scale projects or scenes that require frequent updates. It is particularly suitable for application scenarios that require frequent updates and management of multiple versions of resources. It can not only increase the speed of data processing, but also reduce the demand for storage space while ensuring data consistency and integrity. For example, developers or maintenance personnel can quickly understand the overall structure of the material package by viewing the entry file, making it easier to discover the reuse of resources, which helps to further optimize resource management strategies. In addition, the existence of the entry file makes the maintenance and updating of the material package more convenient. When you need to add or delete a frame, you only need to update the information in the entry file, without having to manually adjust the location of each frame resource description file. For example, if you need to add a new frame, you only need to add a new record in the entry file and create the corresponding frame resource description file, without having to modify the location information of other files.
[0066] Based on the aforementioned embodiment, in some other modified embodiments, the multi-frame material package includes a frame resource description file, which is an entry file of the multi-frame material package and records frame resource reference information corresponding to multiple frames respectively;
[0067] The step of reading, from the multi-frame material package corresponding to the target digital content, differential resources having a reference relationship with the target frame according to the frame resource reference information recorded in the frame resource description file, includes:
[0068] Querying the frame resource reference information corresponding to the target frame in the frame resource description file;
[0069] According to the retrieved frame resource reference information, differential resources having a reference relationship with the target frame are read from the multi-frame material package corresponding to the target digital content.
[0070] This implementation centralizes all frames and their resource reference information into a single, centralized frame resource description file. This aggregated frame resource description file serves as the entry point for the navigation directory of the asset package, enabling the rendering engine to quickly locate the resource description information required for a specific frame, facilitating unified management and maintenance. Furthermore, regardless of the frame type, all resource dependencies are found within this single frame resource description file, simplifying file management and querying by eliminating the need to maintain multiple description files and additional entry points.
[0071] When it is necessary to process a specific target frame, it will directly search for the resource reference information related to the target frame in the frame resource description file. After finding the corresponding reference information, it can accurately read the differential resources associated with the target frame in the multi-frame material package based on this information. The advantage of this implementation method is its simplicity, which reduces the number and complexity of files and simplifies the query logic. However, this also requires that the frame resource description file itself must be powerful and flexible enough to clearly record the resource requirements of each frame, so as to facilitate efficient resource retrieval and loading. This implementation method is suitable for application scenarios that require unified management of multiple frame resources, especially when these frames share similar resources or the resource reference information does not change frequently. This approach can improve the response speed of the system and is easy to maintain.
[0072] Based on any of the foregoing implementations, in some modified implementations, the frame resource reference information includes annotation information of the content resource referenced by the target frame, and the annotation information includes an identifier and a reusability identifier of the content resource;
[0073] The step of reading, from the multi-frame material package corresponding to the target digital content, differential resources having a reference relationship with the target frame according to the frame resource reference information recorded in the frame resource description file, includes:
[0074] Determining, according to the frame resource reference information recorded in the frame resource description file, the annotation information of all content resources referenced by the target frame;
[0075] identifying, according to the reusability identifier, annotation information of the difference resource used for the target frame from the annotation information of all content resources;
[0076] According to the identified annotation information of the difference resource, the difference resource having a reference relationship with the target frame is read from the multi-frame material package corresponding to the target digital content.
[0077] This embodiment further refines the information content in the frame resource description file and introduces the concept of annotation information. This annotation information refers to additional information related to the content resources recorded in the frame resource description file. This information is used to help the system understand and process resources, particularly to determine which resources are required for a specific frame and whether these resources can be reused. In addition to the content resource identifier and reusability indicator, the annotation information may also include at least one item of information, such as the resource path, resource type, and applicable frame. The following describes each of these annotation information.
[0078] An identifier is a unique code or name assigned to each content asset, used to uniquely identify that asset. An identifier can be a string or a number, ensuring that each content asset cannot be confused with other content assets within the entire asset package. This identifier allows the rendering engine to quickly locate a specific asset within the frame asset description file and load the corresponding file as needed.
[0079] The resource path refers to the specific location of the content resource within the asset package, typically a file system path or a relative path. It instructs the rendering engine how to find and load a specific resource. This path information enables the rendering engine to accurately extract the required resources from the asset package based on the reference information in the description file.
[0080] Resource type refers to the specific type of content resource, such as image (JPEG, PNG), video (MP4, AVI), audio (MP3, WAV), etc. Resource type information is used to tell the rendering engine how to handle specific resources. For example, image files may need to be decoded and displayed, while audio files need to be played.
[0081] Applicable aspect ratios refer to the aspect ratio or ratios that a content resource is suitable for, such as 16:9 (widescreen), 9:16 (portrait), and 4:3 (standard screen). Applicable aspect ratio information helps the rendering engine determine when and how to use specific resources. For example, an image suitable for a 16:9 aspect ratio may not be loaded in a 9:16 aspect ratio.
[0082] A reusability indicator is a tag or label that indicates whether a content resource can be used across different formats. When a resource is marked as public, it means it can be used in multiple formats, eliminating the need for a separate copy for each format. Conversely, if a resource is not public, it means it is designed specifically for a specific format and cannot be used in other formats.
[0083] When the system needs to process a specific target frame, it will first determine the annotation information of all content resources referenced by the target frame based on the information in the frame resource description file, and obtain the identifiers and reusability identifiers of these resources; then, the system will check the reusability identifiers of these content resources to determine which resources are differential resources specifically for use by the target frame. For example, if the reusability identifier of a content resource that has a reference relationship with the target frame is "false", it indicates that the content resource is specific to the target frame and needs to be loaded; then, based on the resource path and other information in the annotation information of the identified differential resources, these differential resources that have a reference relationship with the target frame are located and read from the multi-frame material package.
[0084] This implementation, by introducing annotation information, not only facilitates more precise management of the specific content resources required for each frame, avoiding unnecessary data loading, but also enables the sharing of common resources across different frames through reusability identification, effectively reducing storage space requirements. In summary, this implementation enables more refined control and management of frame resources, helping to improve system performance and optimize resource utilization.
[0085] Based on any of the foregoing embodiments, in some modified embodiments, loading the difference resources related to the target frame according to the incremental loading mechanism to switch the target digital content to the target frame for display includes:
[0086] While retaining the loaded public resources, the loaded difference resources applicable to the historical frame are removed, and the newly read difference resources related to the target frame are loaded, so as to switch the target digital content to the target frame for display.
[0087] This embodiment illustrates the specific implementation of the incremental loading mechanism in the frame switching scenario provided in this application, wherein, since common resources refer to resources that can be reused in multiple frames, such as background images, common fonts or other basic components, these resources do not need to be reloaded each time the frame is switched, because they are common in different frames. Therefore, retaining these common resources can reduce repeated loading, save bandwidth and processing time. Before switching to a new target frame, the difference resources previously used to display the historical frame must be removed. These difference resources are specific to the historical frame and are no longer applicable to the new target frame. Removing these resources can free up memory space and ensure that the old frame content does not interfere with the display of the new frame. After removing the differential resources of the loaded historical frames, the related differential resources can be read from the multi-frame material package according to the needs of the target frame and loaded into the system. These differential resources are specific to the target frame and may be new image layers, text or other elements. They will be used to replace or supplement the public resources to form a complete new frame content. After completing the retention of public resources, removal of historical differential resources and loading of new differential resources, the target digital content can be smoothly switched to the target frame for display.
[0088] Through this implementation, the frame content can be updated efficiently, ensuring that each switch is a minimized data change, thereby improving performance and reducing unnecessary resource waste. It is particularly suitable for application scenarios that require frequent updates to display content.
[0089] Based on any of the foregoing embodiments, in some modified embodiments, before determining the target frame to be displayed in response to the frame switching instruction for the target digital content, the process further includes:
[0090] In response to an initial display instruction for target digital content, determining an initial display frame of the target digital content;
[0091] Reading all content resources related to the first display frame from the multi-frame material package corresponding to the target digital content;
[0092] All content resources related to the initial display frame are loaded to display the target digital content in the initial display frame.
[0093] Among them, the initial display instruction is triggered when the target digital content is displayed for the first time. After detecting the initial display instruction, it is first necessary to determine in which frame the target digital content should be displayed. Based on the display environment information at this time, such as device information, preference settings or other factors, it can be decided which frame to use as the initial display version, thereby determining the initial display frame. Since any content resources of the target digital content have not been loaded at this time, it is necessary to read all content resources related to the initial display frame for loading, and combine them to form a complete initial display frame to display the target digital content. It is not just about loading difference resources, but loading all necessary resources to ensure that the user can see a complete and correct initial display screen.
[0094] This implementation ensures that users receive a complete and correct initial experience when digital content is first displayed. It also lays the foundation for subsequent frame switching operations, as all resources loaded during the initial display include common resources. This facilitates incremental loading during future frame switching processes, thereby improving efficiency and reducing resource consumption. This approach is ideal for application scenarios that require rapid response to user requests and ensure initial loading speed.
[0095] It should be noted that in actual applications, an independent material package is currently generated for each frame. When switching frames, the current material package needs to be completely unloaded and a complete set of material packages needs to be reloaded. This practice not only causes problems of low frame switching efficiency and poor smoothness, but also forces the client to re-download the complete material every time it switches, resulting in unnecessary network traffic consumption and storage space occupation. In addition, the client software needs to select the corresponding material package for full loading according to the current screen direction, which increases the program's resource consumption and prolongs the response time. The material package generation method provided in any of the above embodiments of the present application significantly reduces the overall size of the material package by incorporating common resources for reuse by multiple frames into the material package and reusing these resources in different frames, avoiding the redundancy caused by the traditional method of preparing a complete set of resources for each frame independently, optimizing the utilization of storage space, and the client only needs to download a multi-frame material package to support switching between different frames, without the need to frequently download different material packages, reducing resource waste, and the intelligent loading mechanism provided by the solution of the present application can only load new or changed resources when switching between different frames, rather than reloading the entire set of materials, thereby reducing the delay in the switching process, improving the smoothness when switching between different frames, and improving the user experience.
[0096] In a specific embodiment, reference may be made to Figures 2 to 4 To understand, Figure 2 This is a schematic diagram of the structure of the material package provided in one embodiment of the present application. Figure 3This is a schematic diagram of a horizontal screen frame referencing content resources in a material package provided in an embodiment of the present application. Figure 4 This is a schematic diagram of a vertical screen frame referencing content resources in a material package provided in an embodiment of the present application, such as Figure 2 As shown, this material package is used to support the display of two frame sizes, 16v9 and 9v16. The differential resources include horizontal screen images corresponding to 16v9 and vertical screen images corresponding to 9v16. The common resources include mask videos and background music. It also includes two frame resource description files 16v9.json and 9v16.json, and schematically marks the reference relationship between the frame resource description files and content resources. Among them, 16v9.json references the common resource and differential resource "horizontal screen images", and 9v16.json references the common resource and differential resource "vertical screen images".
[0097] Please refer to Figure 3 If the initial display frame is horizontal, the rendering engine reads the frame resource description file 16v9.json according to the initial display frame, and then loads the horizontal screen image and mask video according to the content resources referenced by 16v9.json.
[0098] Please continue to refer to Figure 4 When the user device switches from landscape to portrait mode, the rendering engine reads the frame resource description file 9v16.json according to the frame switching instruction, and compares it with 16v9.json to find the different resources (landscape image - portrait image). Then, the landscape image is unloaded and the portrait image is loaded. During this process, there is no need to repeatedly load the public resource mask video, saving this part of the overhead, thereby effectively improving the efficiency and smoothness of the frame switching.
[0099] Based on the same inventive concept, an image switching device is also provided in an embodiment of the present application. The method corresponding to the device may be the image switching method in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The image switching device provided in an embodiment of the present application can implement the above-mentioned image switching method, and the image switching device can be implemented by software, hardware, or a combination of software and hardware. For example, the image switching device may include integrated or separate functional modules or units to perform the corresponding steps in the above-mentioned methods. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described below is merely illustrative. Please refer to Figure 5 , the frame switching device may include:
[0100] The target frame determination module 101 is configured to determine a target frame to be displayed in response to a frame switching instruction for target digital content;
[0101] The difference resource reading module 102 is configured to read difference resources associated with the target frame from the multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources supporting the display of the target digital content in multiple frames, and the content resources include common resources for multiple frames and difference resources for a single frame;
[0102] The difference resource loading module 103 is configured to load the difference resource related to the target frame according to an incremental loading mechanism, so as to switch the target digital content to the target frame for display.
[0103] In some modified implementations, the multi-frame material package further includes a frame resource description file, wherein the frame resource description file records frame resource reference information between frames and content resources;
[0104] The difference resource reading module 102 includes:
[0105] The difference resource reading unit is configured to read the difference resource having a reference relationship with the target frame from the multi-frame material package corresponding to the target digital content according to the frame resource reference information recorded in the frame resource description file.
[0106] In some modified implementations, the multi-frame material package includes multiple frame resource description files, each of which records frame resource reference information corresponding to a frame;
[0107] The multi-frame resource package further includes an entry file, wherein the entry file records the correspondence between multiple frames and multiple frame resource description files in the multi-frame material package;
[0108] The difference resource reading unit includes:
[0109] A description file query subunit, configured to query a frame resource description file corresponding to the target frame according to the entry file;
[0110] The first resource reading sub-unit is configured to read, according to the frame resource reference information recorded in the frame resource description file found, the difference resource having a reference relationship with the target frame from the multi-frame material package corresponding to the target digital content.
[0111] In some modified implementations, the multi-frame material package includes a frame resource description file, which is an entry file of the multi-frame material package and contains frame resource reference information corresponding to multiple frames.
[0112] The difference resource reading unit includes:
[0113] A reference information query subunit, configured to query the frame resource reference information corresponding to the target frame in the frame resource description file;
[0114] The second resource reading sub-unit is configured to read, according to the retrieved frame resource reference information, differential resources having a reference relationship with the target frame from the multi-frame material package corresponding to the target digital content.
[0115] In some modified implementations, the frame resource reference information includes annotation information of the content resource referenced by the target frame, and the annotation information includes an identifier and a reusability identifier of the content resource;
[0116] The difference resource reading unit includes:
[0117] a marking information determining subunit, configured to determine the marking information of all content resources referenced by the target frame according to the frame resource reference information recorded in the frame resource description file;
[0118] a difference resource identification subunit, configured to identify, based on the reusability identifier, annotation information of the difference resource used for the target frame from the annotation information of all the content resources;
[0119] The difference resource reading subunit is configured to read the difference resource having a reference relationship with the target frame from the multi-frame material package corresponding to the target digital content according to the identified annotation information of the difference resource.
[0120] In some modified implementations, the difference resource loading module 103 includes:
[0121] The difference resource loading unit is used to remove the loaded difference resources applicable to the historical frame while retaining the loaded public resources, and load the newly read difference resources related to the target frame to switch the target digital content to the target frame for display.
[0122] In some variations, the device further comprises:
[0123] An initial frame determination module, configured to determine an initial display frame of the target digital content in response to an initial display instruction for the target digital content;
[0124] An initial resource determination module, configured to read all content resources related to the initial display frame from the multi-frame material package corresponding to the target digital content;
[0125] The initial frame loading module is used to load all content resources related to the initial display frame to display the target digital content in the initial display frame.
[0126] The frame switching device provided in the embodiment of the present application is based on the same inventive concept as the frame switching method provided in the aforementioned embodiment of the present application and has the same beneficial effects.
[0127] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application. The method corresponding to the electronic device may be the frame switching method in the aforementioned embodiment, and the principle of solving the problem is similar to that of the aforementioned embodiment. The electronic device provided in an embodiment of the present application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein 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 frame switching methods and / or technical solutions of the aforementioned multiple embodiments of the present application.
[0128] The electronic device may be a user device, or a device formed by integrating a user device and a network device via a network, or an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablets, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer collections, and can be used to implement some of the processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computers.
[0129] Figure 6 The structure of an electronic device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown. The electronic device 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 into the random access memory (RAM) 1203. In RAM 1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM 1203 are connected to each other through a bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0130] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, and the like; an output section 1207 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, and a speaker; a storage section 1208 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, and a semiconductor memory; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 1209 performs communication processing via a network such as the Internet.
[0131] In particular, the methods and / or embodiments of the present application can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 1201, the above-mentioned functions defined in the method of the present application are performed.
[0132] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application.
[0133] Specifically, the present embodiment can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by an instruction execution system, device or device or used in combination with it.
[0134] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0135] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0136] The computer program code for performing the operations of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as C or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0137] The flow chart or block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the equipment, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code include one or more executable instructions for realizing the logical function of the specification. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs the function or operation of the specification, or can be implemented with a combination of dedicated hardware and computer instructions.
[0138] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0140] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0141] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0142] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0144] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. Terms such as "first" and "second" are used to indicate names and do not imply any particular order.
Claims
1. A frame switching method, wherein: The method comprises: In response to an image frame switching instruction for target digital content, determining a target image frame to be displayed; Reading differential resources related to the target frame from a multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources supporting display of the target digital content in multiple frames, and the content resources include common resources for multiple frames and differential resources for a single frame; The difference resources related to the target frame are loaded according to an incremental loading mechanism, so as to switch the target digital content to the target frame for display.
2. The frame switching method according to claim 1, wherein: The multi-frame material package further includes a frame resource description file, wherein the frame resource description file records frame resource reference information between frames and content resources; The step of reading difference resources related to the target frame from the multi-frame material package corresponding to the target digital content includes: According to the frame resource reference information recorded in the frame resource description file, the difference resource having a reference relationship with the target frame is read from the multi-frame material package corresponding to the target digital content.
3. The frame switching method according to claim 2, wherein: The multi-frame material package includes multiple frame resource description files, each of which records frame resource reference information corresponding to a frame; The multi-frame material package further includes an entry file, wherein the entry file records the correspondence between multiple frames and multiple frame resource description files in the multi-frame material package; The step of reading, from the multi-frame material package corresponding to the target digital content, differential resources having a reference relationship with the target frame according to the frame resource reference information recorded in the frame resource description file, includes: Querying a frame resource description file corresponding to the target frame according to the entry file; According to the frame resource reference information recorded in the retrieved frame resource description file, the difference resource having a reference relationship with the target frame is read from the multi-frame material package corresponding to the target digital content.
4. The frame switching method according to claim 2, wherein: The multi-frame material package includes a frame resource description file, which is the entry file of the multi-frame material package and contains frame resource reference information corresponding to multiple frames respectively; The step of reading, from the multi-frame material package corresponding to the target digital content, differential resources having a reference relationship with the target frame according to the frame resource reference information recorded in the frame resource description file, includes: Querying the frame resource reference information corresponding to the target frame in the frame resource description file; According to the retrieved frame resource reference information, differential resources having a reference relationship with the target frame are read from the multi-frame material package corresponding to the target digital content.
5. The frame switching method according to claim 2, wherein: The frame resource reference information includes annotation information of the content resource referenced by the target frame, and the annotation information includes an identifier and a reusability identifier of the content resource; The step of reading, from the multi-frame material package corresponding to the target digital content, differential resources having a reference relationship with the target frame according to the frame resource reference information recorded in the frame resource description file, includes: Determining, according to the frame resource reference information recorded in the frame resource description file, the annotation information of all content resources referenced by the target frame; identifying, according to the reusability identifier, annotation information of the difference resource used for the target frame from the annotation information of all content resources; According to the identified annotation information of the difference resource, the difference resource having a reference relationship with the target frame is read from the multi-frame material package corresponding to the target digital content.
6. The frame switching method according to claim 1, wherein: The step of loading the difference resources related to the target frame according to the incremental loading mechanism to switch the target digital content to the target frame for display includes: While retaining the loaded public resources, the loaded difference resources applicable to the historical frame are removed, and the newly read difference resources related to the target frame are loaded, so as to switch the target digital content to the target frame for display.
7. The frame switching method according to claim 1, wherein: Before determining the target frame to be displayed in response to the frame switching instruction for the target digital content, the method further includes: In response to an initial display instruction for target digital content, determining an initial display frame of the target digital content; Reading all content resources related to the first display frame from the multi-frame material package corresponding to the target digital content; All content resources related to the initial display frame are loaded to display the target digital content in the initial display frame.
8. A frame switching device, wherein: The device comprises: a target frame determination module, configured to determine a target frame to be displayed in response to a frame switching instruction for target digital content; a differential resource reading module, configured to read differential resources associated with the target frame from a multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources supporting display of the target digital content in multiple frames, and the content resources include common resources for multiple frames and differential resources for a single frame; The difference resource loading module is used to load the difference resource related to the target frame according to the incremental loading mechanism, so as to switch the target digital content to the target frame for display.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed 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 perform the method according to any one of claims 1 to 7.
10. A computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Material package generation method and device, equipment and computer medium
CN119356668A