Picture switching method, device and equipment and computer medium
By reading and loading the differences in target formats in multi -frame material packages, the performance problems caused by resource loads during the existing technology in the existing technology are solved, and more efficient and smooth format switching is achieved.
Patent Information
- Application Number
- CN202411397289.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-08
AI Technical Summary
The existing technology requires the current material package to be completely unloaded and a complete set of material packages are reloaded during format switching, resulting in large computing resources consumption, high memory usage, lag in application 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, and these differential resources are loaded according to the incremental loading mechanism to achieve rapid frame switching.
Effectively reduce the consumption and memory occupation of computing resource, avoid the problem of application cards caused by the heavy load of resources, and improve the efficiency and fluency of format switching.
Smart Images

Figure CN119356781A_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 application that are recited in the claims. The description herein is not admitted to be prior art by 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 frame switching technologies mostly rely on overall update strategies. For example, when the user interface switches from landscape to portrait, the system needs to completely unload the current material package and reload a set of material packages optimized for the new frame. This process involves a comprehensive reload of resources such as pictures, audio and video, and keyframe animations, which not only consumes a lot of computing resources and time, but also significantly increases memory usage, causing application freezes or even crashes, especially on mobile devices with limited resources.
[0005] In view of the above problems, it is necessary to provide a technical solution for frame switching with higher switching efficiency and fluency. Summary of the invention
[0006] Multiple aspects of the present application provide a frame switching method, device, equipment 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 comprises:
[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 the multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources supporting 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;
[0010] The difference resource related to the target frame is loaded according to the 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 comprises:
[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 difference resource reading module, used for reading 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 supporting 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;
[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, the 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, and the instructions are executed by the at least one processor so that the at least one processor can perform the frame switching method as 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 the embodiment of the present application, by responding to the frame switching instruction for the target digital content, the target frame to be displayed is determined, and then the difference resources related to the target frame are read 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 difference resources for a single frame. Then, the difference resources related to the target frame are loaded according to the incremental loading mechanism, so that the target digital content can be switched to the target frame for display. Compared with the prior art that 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 the difference resources to achieve fast frame switching. Since only the difference resources required for the target frame are loaded instead of the whole set of materials, the computing resource consumption and memory occupation can be effectively reduced, and the application freeze problem caused by resource overloading can be avoided. Moreover, by reducing the amount of loaded resources, the frame switching efficiency can be effectively improved, thereby improving the smooth experience of users when switching between different frames. 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 the description 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 paying any creative labor.
[0022] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0023] Figure 1 A schematic diagram of a flow chart of a frame switching method provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of the structure of a material package provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of a horizontal screen frame referencing content resources in 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 diagram of the structure of a frame switching device provided in an 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] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work 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 (CPU), input / output interface, network interface and memory.
[0032] The 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. The memory is an example of a computer-readable medium.
[0033] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs 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, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0034] In view of the problem of low efficiency and poor fluency in the prior art that the current material package needs to be completely unloaded and a complete set of material packages needs to be reloaded when switching frames, 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, which 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 common resources for single frame. 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 that 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, the frame switching efficiency can be effectively improved by reducing the amount of loaded resources, thereby improving the smooth experience of users 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 the present 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, tablet computers, 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 sets. 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 sets.
[0037] Figure 1 The processing flow of a frame switching method provided by an embodiment of the present application is shown, and the method at least includes 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 a more efficient and smooth multi-frame switching effect based on the technical solution provided in the embodiments of the present 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. Among them, pre-defined layout rules or style sheets can be used to match the most suitable frame layout, that is, the target frame.
[0042] Step S102, reading 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, so as to obtain all content resources that can meet the multi-frame display requirements. In order to realize the cross-frame reuse of content resources, it is necessary to classify all content resources according to the characteristics of whether they can be reused. For example, the content resources that can be reused are classified as common resources, and the content resources that cannot be reused are classified as differential resources.
[0045] Among them, public resources can be shared between different frames, and only one copy is needed, without the need to prepare a separate copy for each frame. For example, some audio files or common background elements may be the same in different frames, so only one copy is needed. Differential resources are customized to adapt to specific frames. For example, the picture sizes of horizontal and vertical screens are different, and designers need to provide different picture versions for these two frames.
[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 the difference resources need to be read and loaded. In this way, when switching the frame, only the difference 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 the 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 proposed to improve the efficiency of data synchronization and updating. This mechanism allows the system to load only the data that has been changed since the last update, rather than loading the entire data set each time, which can significantly reduce the time and resource consumption of data processing. The embodiment of the present application applies the idea of incremental loading to the specific scene switching of the present application. Combined with the above steps, it can achieve the purpose of reducing the amount of resource reloading and improving the efficiency and smoothness of scene switching.
[0049] The above-mentioned frame switching method provided in the embodiment of the present application determines the target frame to be displayed by responding 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 difference resources for a single frame. Then, the difference resources related to the target frame are loaded according to the incremental loading mechanism, so that the target digital content can be switched to the target frame for display. Compared with the prior art that needs to completely unload the current material package and reload a complete set of material packages when switching frames, the technical solution of the present application only needs to load the difference resources to achieve fast frame switching. Since only the difference resources required for the target frame are loaded instead of the whole set of materials, the computing resource consumption and memory occupation can be effectively reduced, and the application freeze problem caused by resource overloading can be avoided. Moreover, by reducing the amount of loaded resources, the frame switching efficiency can be effectively improved, thereby improving the smooth experience of users when switching between different frames.
[0050] In some modified implementations, the multi-frame material package further includes a frame resource description file, and 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 frame resource reference information between frames and content resources, and the frame resource reference information refers to information that describes the reference relationship between frames and content resources. The embodiment of the present application uses a reference method to realize the association between frames and content resources, and then based on the reference relationship, when a certain frame needs to be displayed, the referenced content resources are 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 corresponding material packages for each frame separately, thereby simplifying the production steps of the material package, and being able to achieve efficient reuse of public resources across frames, reducing the workload of designers, improving the production efficiency of material packages and reducing production costs, and later maintenance only needs to maintain individual content resources and reference information in the material package, so it can also effectively improve maintenance efficiency and reduce maintenance costs.
[0054] When this embodiment is implemented, 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 therein need to be read and loaded.
[0055] In this embodiment, by introducing the frame resource description file and the frame resource reference information to manage the content resources and associate them with the frame, it can ensure that when the frame needs to be switched, the content resources related to the target frame can be directly located according to the reference information in the frame resource description file, thereby improving the positioning and reading efficiency of the content resources, and helping to improve the efficiency and fluency of frame switching. Moreover, by introducing the frame resource description file and the frame resource reference information, content management becomes simpler. Users can quickly understand the status of each frame and the relationship with the content resources by viewing the frame resource description file, making it easier to perform version control and resource management. In addition, by clearly recording the reference relationship between the frame and the resource, it can be ensured that no related resources will be missed during the update process, which helps to maintain the consistency and integrity of the data and avoid problems caused by missing certain resources. In addition, when it is necessary to add a new frame or modify an existing frame, 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 it easier for the system to adapt 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, and each frame resource description file records frame resource reference information corresponding to a frame;
[0057] The multi-frame resource package also 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, 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 from the multi-frame material package corresponding to the target digital content 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 frame resource description file obtained by querying, 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 embodiment, the multi-frame material package not only includes multiple frame resource description files and all content resources, but also includes an entry file. Such a design can further improve the efficiency and flexibility of frame switching. Specifically, since each frame resource description file records the frame resource reference information of a specific frame, the frame and the frame resource description file are one-to-one corresponding. For each frame (such as an image of different resolution or size), there is an independent file to describe all the relevant content resources and their locations required for it. This structure allows the system to independently handle the resource dependencies for 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 to help the system quickly locate the frame resource description file required for a specific frame.
[0063] Based on the above entry file and multiple frame resource description files, the frame resource description file corresponding to the target frame can be found 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 according to the frame resource reference information recorded therein.
[0064] Through this implementation, for each frame, the loading of the required resources can be controlled very accurately. When the client software needs to load the resources of a specific frame, it can directly read the description file corresponding to the frame, so as to quickly find and load the required resources, which effectively simplifies the resource loading process. There is no need to process the 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 is convenient for maintenance and updating.
[0065] In addition, by introducing the entry file, the organizational structure of the material package becomes clearer and easier to manage and maintain. At the same time, the entry file serves as a navigation directory, so that the rendering engine can quickly and accurately find the required frame resource description file according to 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 concentrating 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 particularly 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 improve 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, and it is easier to find the reuse of resources, which helps to further optimize the resource management strategy. In addition, the existence of the entry file makes the maintenance and update of the material package more convenient. When you need to add or delete frames, you only need to update the information in the entry file without manually adjusting the position 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 a corresponding frame resource description file without modifying the location information of other files.
[0066] Based on the aforementioned implementation manner, in other modified implementation manners, the multi-frame material package includes a frame resource description file, and the frame resource description file is an entry file of the multi-frame material package, and the frame resource reference information corresponding to the multiple frames is recorded in the file;
[0067] The step of reading, 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 from the multi-frame material package corresponding to the target digital content 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, 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.
[0070] In this implementation, all frames and their resource reference information are concentrated in a total frame resource description file. The aggregated frame resource description file serves as an entry file and acts as a navigation directory for the material package, so that the rendering engine can quickly locate the resource description information required for a specific frame, which is conducive to unified management and maintenance. In addition, regardless of the frame, all resource dependencies will be found in this single frame resource description file. The advantage of this is that it can simplify the file management and query process because there is no need to maintain multiple description files and additional entry files.
[0071] When a specific target frame needs to be processed, it will directly search for 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 difference 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, 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 from the multi-frame material package corresponding to the target digital content includes:
[0074] Determine, 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] According to the reusability identifier, identifying the annotation information of the difference resource used by the target frame from the annotation information of all the 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, which refers to some 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, especially to determine which resources are required for a specific frame and whether these resources can be reused. Among them, in addition to the identifier and reusability identifier of the content resource, the annotation information may also include at least one information such as resource path, resource type, and applicable frame. The above annotation information is explained below.
[0078] An identifier is a unique code or name assigned to each content resource, which is used to uniquely identify the resource. An identifier can be a string or a number, ensuring that each content resource will not be confused with other content resources in the entire material package. Through the identifier, the rendering engine can quickly locate a specific resource in the frame resource description file and load the corresponding file as needed.
[0079] The resource path refers to the specific location of the content resource in the material package, usually a file system path or a relative path, which is used to instruct the rendering engine how to find and load a specific resource. The path information enables the rendering engine to accurately extract the required resources from the material 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 ratio refers to the aspect ratio that the content resource is suitable for, such as 16:9 (widescreen), 9:16 (vertical screen), 4:3 (standard screen), etc. Applicable aspect ratio information can help the rendering engine determine when and how to use specific resources. For example, a picture suitable for 16:9 aspect ratio may not be loaded in 9:16 aspect ratio.
[0082] The reusability mark is a mark or label that indicates whether a content resource can be used in different frames. When a resource is marked as a public resource, it means that it can be used in multiple frames and there is no need to prepare a separate copy for each frame. On the contrary, if the resource is not a public resource, it means that it is designed specifically for a specific frame and cannot be used in other frames.
[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 flags of these resources; then, the system will check the reusability flags of these content resources to determine which resources are differential resources specifically for the target frame. For example, if the reusability flag of a content resource that has a reference relationship with the target frame is "false", it means 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 helps to more accurately manage the specific content resources required for each frame, avoiding loading unnecessary data, but also enables the same common resources to be shared between different frames through reusability identification, which can effectively reduce the demand for storage space. In summary, through this implementation, more precise control and management of frame resources can be achieved, which helps to improve system performance and optimize resource utilization.
[0085] Based on any of the foregoing implementations, in some modified implementations, loading the difference resource 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 common 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, remove the difference resources previously used to display the historical frame. 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 difference resources of the loaded historical frames, the difference resources related to the target frame can be read from the multi-frame material package according to the needs of the target frame and loaded into the system. These difference resources are specific to the target frame and may be new image layers, texts 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, the removal of historical difference resources and the loading of new difference 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, and is particularly suitable for application scenarios that require frequent updates to display content.
[0089] Based on any of the above implementations, in some modified implementations, before responding to the frame switching instruction for the target digital content and determining the target frame to be displayed, the method further includes:
[0090] In response to the initial display instruction for the target digital content, determining an initial display frame of the target digital content;
[0091] Read 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 no content resources of the target digital content have 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 when digital content is displayed for the first time, users can obtain a complete and correct initial experience. At the same time, it also lays the foundation for subsequent frame switching operations, because all resources loaded during the initial display include common resources, which helps to achieve incremental loading in future frame switching processes, thereby improving efficiency and reducing resource consumption. This method is very suitable for application scenarios that need to respond quickly to user requests and ensure the initial loading speed.
[0095] It should be noted that, in actual applications, an independent material package is currently generated for each frame. When the frame is switched, the current material package needs to be completely unloaded and a complete set of material packages needs to be reloaded. This practice not only has the problems of low frame switching efficiency and poor fluency, 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 according to the current screen direction for full loading, which increases the resource consumption of the program 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 public resources for reuse in multiple frames into the material package and reusing these resources in different frames, avoiding the redundancy caused by the need to independently prepare a complete set of resources for each frame in the traditional method, 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, thereby reducing resource waste. 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 implementation, reference may be made to Figures 2 to 4 To understand, Figure 2 A schematic diagram of the structure of a material package provided in an embodiment of the present application. Figure 3A schematic diagram of a horizontal screen frame referencing content resources in a material package provided in an embodiment of the present application, 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, such as Figure 2 As shown, the material package is used to support the display of two frame sizes, 16v9 and 9v16. The difference resources include the horizontal screen pictures corresponding to 16v9 and the vertical screen pictures corresponding to 9v16. The public 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 file and the content resource. Among them, 16v9.json references the public resource and the difference resource "horizontal screen picture", and 9v16.json references the public resource and the difference resource "vertical screen picture".
[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, 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 difference resources (landscape picture-vertical picture). Then, the landscape picture is unloaded and the vertical picture is loaded. During this process, there is no need to repeatedly load the public resource mask video, which saves this part of the overhead, thereby effectively improving the efficiency and smoothness of 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 aforementioned 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 aforementioned methods. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple, and the relevant parts may refer 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 used to determine the target frame to be displayed in response to the frame switching instruction for the target digital content;
[0101] The difference resource reading module 102 is used to read 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 supporting displaying 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 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.
[0103] In some modified implementations, the multi-frame material package further includes a frame resource description file, and 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 used 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 a plurality of frame resource description files, each of which records frame resource reference information corresponding to a frame;
[0107] The multi-frame resource package also 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, used for querying a frame resource description file corresponding to the target frame according to the entry file;
[0110] The first resource reading subunit is used 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 found.
[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 respectively;
[0112] The difference resource reading unit includes:
[0113] A reference information query subunit, used for querying the frame resource reference information corresponding to the target frame in the frame resource description file;
[0114] The second resource reading subunit is used 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 found.
[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] The annotation information determination subunit is used to determine the annotation 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, according to the reusability identifier, annotation information of the difference resource used by the target frame from the annotation information of all the content resources;
[0119] The difference resource reading subunit is used 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 common resources, and load the newly read difference resources related to the target frame, so as 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] A first resource determination module, configured to read all content resources related to the first 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 and the frame switching method provided in the aforementioned embodiment of the present application are based on the same inventive concept and have the same beneficial effects.
[0127] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, and the method corresponding to the electronic device may be the frame switching method in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The electronic device provided in an embodiment of the present application includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can 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 through a network, or may be an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, 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 sets, which can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[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, and the electronic device 1200 includes a central processing unit (CPU, Central Processing Unit) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM, Random Access Memory) 1203. In RAM 1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM1203 are connected to each other through bus 1204. Input / output (I / O, Input / Output) 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, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker, etc.; a storage section 1208 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet.
[0131] In particular, the methods and / or embodiments in the embodiments of the present application may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes 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 functions defined in the method of the present application are executed.
[0132] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application described above.
[0133] Specifically, the present embodiment may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination therewith.
[0134] Computer readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit 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] Computer program code for performing the operation 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 an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of 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., using an Internet service provider to connect through the Internet).
[0137] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0138] Those skilled in the art can 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 the present 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0141] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit 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, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[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 it. 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] In addition, 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 stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate 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 the multi-frame material package corresponding to the target digital content, wherein the multi-frame material package includes all content resources supporting 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; The difference resource related to the target frame is loaded according to the 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 also includes a frame resource description file, and 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 a plurality of frame resource description files, each of which records frame resource reference information corresponding to a frame; The multi-frame resource package also 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, 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 from the multi-frame material package corresponding to the target digital content 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 frame resource description file obtained by querying, 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 an entry file of the multi-frame material package and contains frame resource reference information corresponding to multiple frames respectively; The step of reading, 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 from the multi-frame material package corresponding to the target digital content 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, 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.
5. The frame switching method according to claim 2, wherein: The frame resource reference information includes the annotation information of the content resource referenced by the target frame, and the annotation information includes the identifier and reusability mark of the content resource; The step of reading, 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 from the multi-frame material package corresponding to the target digital content includes: Determine, 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; According to the reusability identifier, identifying the annotation information of the difference resource used by the target frame from the annotation information of all the 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 resource 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 common 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 the initial display instruction for the target digital content, determining an initial display frame of the target digital content; Read 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 difference resource reading module, used for reading 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 supporting 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; 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 processing method and device, electronic equipment and storage medium
CN112230982A
Display method, terminal, equipment and storage medium
CN113126845A
Server-based material preview method, device and system, equipment and medium
CN114697710A
Media content editing method and device, electronic equipment and storage medium
CN116668418A
Material package generation method and device, equipment and computer medium
CN119356668A
Cited By
Material package generation method and device, equipment and computer medium
CN119356668A
Material package generation method, device, equipment and computer medium
CN119356668B