Resource processing method and device, equipment, storage medium and program product
By generating resource path hash value query dependencies and downloading resource compression packages, the problem of time-consuming dependency query in application resource processing is solved, and resource processing efficiency is improved.
Patent Information
- Application Number
- CN202510444116.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-08
AI Technical Summary
In the prior art, dependency query of application resources takes a long time and takes up a large resource, resulting in low resource processing efficiency.
By generating resource path hash values, querying resource dependencies, reducing the resource usage of dependencies, and downloading resource compression packages based on the current running progress, optimizing resource processing flow.
This greatly reduces the resource usage of dependencies, saves query time, and improves resource processing efficiency.
Smart Images

Figure CN120276789A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing, and particularly to a resource processing method, apparatus, device, storage medium, and program product. Background Art
[0002] With the increase in the functions of various application programs, the amount of data corresponding to the application programs has increased sharply, resulting in a long time-consuming process for downloading and installing the application programs. In order to reduce the waiting time of users, some optional resources can be placed in the application for on-demand downloading, that is, these optional resources are silently downloaded during the process of users using the application.
[0003] Currently, for this processing method of a large number of application program resources, usually, the corresponding resources are divided into multiple resources according to the stages or functions of the application, and then the multiple resources are divided into installation resources and in-application download resources. However, whether divided by stages or by functions, the dependency relationship of its corresponding resources not only occupies a large amount of resources, but also takes a long time for dependency relationship query, which will lead to a low overall efficiency of resource processing. Summary of the Invention
[0004] To solve the above technical problems, embodiments of the present disclosure provide a resource processing method, apparatus, device, storage medium, and program product.
[0005] In a first aspect, embodiments of the present disclosure provide a resource processing method, the method including:
[0006] During the running of a target program, based on the current running progress of the target program, download a resource compression package corresponding to the current running progress as the current main resource; wherein, each resource compression package is pre-generated based on the program running progress of the target program;
[0007] Based on the resource path of the current main resource, generate a current path hash value, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource on which the current main resource depends; wherein, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource;
[0008] Download a resource compression package based on the resource download information as the current secondary resource;
[0009] Load the current main resource and the current secondary resource to continue running the target program.
[0010] In a second aspect, embodiments of the present disclosure further provide a resource processing apparatus, the apparatus including:
[0011] A main resource download module, which is used to download a resource compression package corresponding to the current running progress of the target program as the current main resource during the running process of the target program; wherein, each resource compression package is pre-generated based on the program running progress of the target program.
[0012] A resource download information determination module, which is used to generate a current path hash value based on the resource path of the current main resource, query the resource dependency relationship based on the current path hash value, and determine the resource download information of the current secondary resource depended on by the current main resource; wherein, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource.
[0013] A secondary resource download module, which is used to download a resource compression package as the current secondary resource based on the resource download information.
[0014] A program running module, which is used to load the current main resource and the current secondary resource to continue running the target program.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, which includes:
[0016] A processor;
[0017] A memory, which is used to store executable instructions;
[0018] Wherein, the processor is used to read the executable instructions from the memory and execute the executable instructions to implement the resource processing method described in any embodiment of the present disclosure.
[0019] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, enables the processor to implement the resource processing method described in any embodiment of the present disclosure.
[0020] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, and the computer program product is used to execute the resource processing method described in any embodiment of the present disclosure.
[0021] The resource processing method, apparatus, device, storage medium, and program product according to the embodiments of the present disclosure can, during the running of a target program, download a resource compression package corresponding to the current running progress of the target program as the current main resource based on the current running progress of the target program; wherein each resource compression package is pre-generated based on the program running progress of the target program; generate a current path hash value based on the resource path of the current main resource, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource on which the current main resource depends; wherein the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource; download the resource compression package as the current secondary resource based on the resource download information; and load the current main resource and the current secondary resource to continue running the target program. In this way, the resource download information of the secondary resource can be determined based on the resource path hash value of the main resource, and the secondary resource can be downloaded. That is to say, when storing the resource path, instead of storing the resource path itself, the hash value of the resource path is stored, and the length of the hash value is much smaller than the resource path string. Therefore, the resource occupation amount of the dependency relationship is greatly reduced, the query time is saved, and the resource processing efficiency is improved.
[0022] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present disclosure are all information and data that have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to select authorization or rejection. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the embodiments of the present disclosure will become more obvious. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the elements and elements are not necessarily drawn to scale.
[0024] Figure 1 One of the flow diagrams of the resource processing method provided by the embodiments of the present disclosure;
[0025] Figure 2 Another flow diagram of the resource processing method provided by the embodiments of the present disclosure;
[0026] Figure 3 The composition structure diagram of a test case provided by the embodiments of the present disclosure;
[0027] Figure 4 Another flow diagram of the resource processing method provided by the embodiments of the present disclosure;
[0028] Figure 5 The fourth flowchart of the resource processing method provided by the embodiments of the present disclosure;
[0029] Figure 6 The fifth flowchart of the resource processing method provided by the embodiments of the present disclosure;
[0030] Figure 7 The structural schematic diagram of a resource processing device provided by the embodiments of the present disclosure;
[0031] Figure 8 The structural schematic diagram of an electronic device provided by the embodiments of the present disclosure. Detailed implementation manners
[0032] The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0033] It should be understood that the various steps recorded in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0034] The term "including" and its variants used herein are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0035] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence relationship of the functions performed by these devices, modules or units.
[0036] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0037] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0038] As the amount of resources of applications grows larger, for example, the resource amount of certain game applications exceeds 10G, many developers have started to customize the update rules for application program resources. Starting from initially downloading all resources when launching the application, to later putting some optional resources in the application for on-demand downloading. These on-demand downloaded resources will be silently downloaded during the user's use of the application (subsequently referred to as downloading while playing), and will also be intercepted when the resources are needed but not available (subsequently referred to as blocking). For example, the skin resources of an undownloaded game character are displayed as the original skin of the character during the game session, and are displayed as downloading or waiting to download outside the game session according to the download progress.
[0039] Currently, the common way to divide such a large number of application program resources is usually by stage or by function. Among them, dividing by stage means dividing the application program into several stages according to the application's process. For example, when the application is a game application, stage 1 can correspond to the first chapter of the game, stage 2 can correspond to the second chapter of the game, and so on, and assign the corresponding stage of the game to each resource. When the user wants to enter the second chapter and the resources of stage 2 are missing, interception will be performed. Dividing by function means dividing the resources according to the functions of the application program. For example, when the application is a game application, it is divided according to functions such as fashion, map, and a certain gameplay. When the user needs the resources of a certain function but the resources are missing, interception will be performed.
[0040] However, when the resource processing method of dividing by stage is actually operated, the manual configuration cost is very high. Especially when trying to have as many resources as possible for downloading while playing, it is necessary to assign stage attributes to as many resources as possible and regularly maintain this configuration. And due to the limited energy of manual division and maintenance, this leads to a relatively coarse division granularity in the resource processing method of dividing by stage. For example, when the user enters the second chapter, it is necessary to check whether all the resource packages of the second chapter are downloaded completely. And the entire process of the second chapter may be very long, resulting in a relatively large amount of content that the user needs to download in advance and is more likely to encounter the blocking phenomenon. The probability of blocking can be reduced by refining the stages. For example, each chapter is further subdivided according to the progress, but this will lead to a further deterioration of the problems of manual division and maintenance. Obviously, this resource processing method is not reasonably divided.
[0041] And when the resource processing method of dividing by function is actually operated, the resource volume that can be split is very limited. Especially for large data volume application programs with complex and numerous functions, it is generally difficult to reach 50%. Because the functions are complex and numerous, and there are many intersections among the resources of multiple functions, it is very difficult to completely sort out all the resources involved in a function. Therefore, the resources split by this splitting method are all large and functionally independent resources, with poor practicality and an unreasonable division method.
[0042] In addition, when a blockage occurs, the application needs to know which other resources the resources to be loaded currently depend on. Only when all the compressed packages where these resources are located are downloaded completely can the blockage end. Generally, the dependencies of these resources are queried through a resource registry file, and at the same time, it is necessary to additionally record the compressed package where each resource is located. Whether it is the resource processing method divided by stages or the resource processing method divided by functions, for an application with a large amount of resources, its corresponding registry file will be very large and occupy a large amount of memory. And the process of dependency query needs to be recursive. For example, a depends on b and c, and b and c may respectively depend on d, e and f, g, and so on. At the same time, it is also necessary to remove duplicates from the results and handle circular dependencies. Therefore, the above two resource processing methods not only occupy a large amount of resources, but also take a relatively long time when querying dependency relationships, which will lead to a low overall efficiency of resource processing.
[0043] Based on the above situation, an embodiment of the present disclosure provides a resource processing solution, including:
[0044] First, during the execution of each test case of the target program, record at least one program running progress included in the test case and the resource file identifier of the resource file loaded during the local test corresponding to the program running progress, and generate a resource information file corresponding to the test case; based on each program running progress in each resource information file, package the resource files corresponding to the resource file identifiers corresponding to the same program running progress to generate multiple resource compressed packages corresponding to the target program. In this way, the resource files corresponding to the target program can be divided according to the program running progress corresponding to the test case. The entire division process does not require manual participation, which not only improves the resource division efficiency, but also makes the resource division method more reasonable, and at the same time reduces the probability of blockage occurrence.
[0045] Second, during the running of the target program, based on the current running progress of the target program, download the resource compression package corresponding to the current running progress as the current main resource; generate the current path hash value based on the resource path of the current main resource, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource on which the current main resource depends; wherein, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource; download the resource compression package as the current secondary resource based on the resource download information; load the current main resource and the current secondary resource to continue running the target program. In this way, the resource download information of the secondary resource can be determined according to the hash value of the resource path of the main resource to download the secondary resource. That is to say, when storing the resource path, instead of storing the resource path itself, the hash value of the resource path is stored, and the length of the hash value is much smaller than the resource path string. Therefore, the resource occupancy of the dependency relationship is greatly reduced, the query time is saved, and the resource processing efficiency is improved.
[0046] The resource processing method provided by the embodiments of the present disclosure is applicable to the scenarios of installing or updating application programs with a large amount of data. This method can be executed by a resource processing device, which can be implemented in a software and / or hardware manner, and the device can be integrated in a device with resource processing capabilities. Among them, the electronic device may include, but is not limited to, mobile terminals such as smart phones, laptop computers, tablet personal computers (Tablet PCs), etc., and fixed terminals such as digital TVs, desktop computers, etc.
[0047] Figure 1 shows a schematic flowchart of a resource processing method provided by an embodiment of the present disclosure. As Figure 1 shown, the resource processing method may include the following steps:
[0048] S110. During the running of the target program, based on the current running progress of the target program, download the resource compression package corresponding to the current running progress as the current main resource.
[0049] Among them, the target program is a program with large resources, such as large games, large data management systems, etc. The current running progress refers to the program running progress where the target program is currently located; each resource compression package is pre-generated based on the program running progress of the target program. The resource files can be divided into directly loaded main resources and secondary resources that are not directly loaded (resource files that are automatically loaded when the main resource is loaded, that is, dependent on the main resource) according to whether the resource files will be directly loaded. The current main resource refers to the directly loadable main resource corresponding to the current running progress.
[0050] Specifically, as the user opens and uses the target program, the resource compression package corresponding to the current running progress is used as the current main resource, and the resource compression packages are downloaded in the order of the program running progress. At the same time, each resource compression package without resource dependency relationships will directly trigger a loading task. If, when submitting the loading task corresponding to a resource compression package, the resource compression package of the next loading task has not been downloaded yet, a block will be triggered until the corresponding resource compression package is downloaded and the loading task can continue.
[0051] S120. Generate a current path hash value based on the resource path of the current main resource, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource on which the current main resource depends.
[0052] Among them, the resource dependency relationship records the dependency relationships between various resource files based on the resource path hash value of the main resource. Specifically, the recording methods of the resource dependency relationship can include the direct hashing method and the compressed hashing method. The direct hashing method means directly calculating the hash value of the resource path of each resource file, and then recording the resource path hash values of each resource file according to the dependency relationships between the resource files. For example, the original dependency relationship is: the resource path of resource file a -> the resource path of resource file b -> the resource path of resource file c -> the resource path of resource file d -> the resource path of resource file e. After being recorded as the resource dependency relationship of the direct hashing method, it becomes: the hash value of the resource path of resource file a -> the hash value of the resource path of resource file b -> the hash value of the resource path of resource file c -> the hash value of the resource path of resource file d -> the hash value of the resource path of resource file e. Among them, "the resource path of resource file a -> the resource path of resource file b" means that resource file a depends on resource file b. The compressed hashing method means changing the recording method of the dependency relationship from resource file to resource file to from resource file to resource compression package. For example, when resource file a belongs to resource compression package 1, resource file b belongs to resource compression package 2, resource file c belongs to resource compression package 2, resource file d belongs to resource compression package 3, resource file e belongs to resource compression package 3, and the original dependency relationship is: the resource path of resource file a -> the resource path of resource file b -> the resource path of resource file c -> the resource path of resource file d -> the resource path of resource file e, it is determined that resource file a requires resource compression packages 1, 2, and 3. After being recorded as the resource dependency relationship, it becomes: the hash value of the resource path of resource file a -> {the number of resource compression package 1, the number of resource compression package 2, the number of resource compression package 3}. Among them, the number of the resource compression package is pre-configured and can uniquely represent the resource compression package.
[0053] Specifically, since the resource path of the primary resource is hashed when recording the dependency relationship, when downloading the primary resource with resource dependencies, it is necessary to generate the current path hash value based on the resource path of the current primary resource, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource depended on by the current primary resource.
[0054] In this way, when the recording method of the resource dependency relationship is the direct hashing method, and the resource download information of the current secondary resource depended on by the current primary resource is determined by querying the resource dependency relationship based on the current path hash value, it is necessary to perform an inverse hashing calculation on the hash value corresponding to the resource path of the current secondary resource queried according to the current path hash value to obtain the resource path of the current secondary resource, and determine the resource path of the current secondary resource as the resource download information of the current secondary resource.
[0055] When the recording method of the resource dependency relationship is the compressed hashing method, that is, the resource dependency relationship records the resource path hash value of the primary resource and the compression package identifier of the resource compression package where the secondary resource dependent on the primary resource is located. At this time, the method of querying the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource depended on by the current primary resource can be to query the resource dependency relationship based on the current path hash value to determine the current compression package identifier corresponding to the current secondary resource as the resource download information, that is, directly obtain the corresponding resource compression package number (i.e., the compression package identifier) in the resource dependency relationship according to the current path hash value, and determine the resource compression package number as the resource download information, and determine the resource compression package corresponding to the resource compression package number as the current secondary resource.
[0056] In some embodiments, when using the direct hashing method or the compressed hashing method to record the resource dependency relationship, it is also necessary to check whether there are hash collisions in each hash value. If so, it is necessary to modify the name of the resource file where the collision occurs and recalculate the hash value. This can also improve the efficiency of runtime dependency lookup, because whether using the efficient storage and lookup mechanism of strings or resource names to find dependencies, after calculating the hash value, there is still a string comparison, while storing the hash value does not require string comparison, saving computing resources.
[0057] In some embodiments, the resource dependencies include dependencies generated by the game engine and dependencies included in the code of the target program. Specifically, before recording the resource dependencies, the dependencies between each resource file are also scanned. When scanning for dependencies, in addition to the dependencies recorded by each engine, such as the game development engine, it is also necessary to additionally scan for potential dependencies in the project code. For example, one interface may use another sub-interface in the code, and such dependencies cannot be recorded by the game development engine. By customizing the rules for scanning dependencies for each module, we can discover these additional dependencies used in the code and configuration and add them to the registry file to obtain the initial resource dependencies.
[0058] S130. Download the resource compressed package based on the resource download information as the current secondary resource.
[0059] Specifically, download the corresponding resource compressed package based on the resource path in the resource download information or the resource compressed package number as the current secondary resource.
[0060] S140. Load the current primary resource and the current secondary resource to continue running the target program.
[0061] In the above solution, during the running of the target program, based on the current running progress of the target program, download the resource compressed package corresponding to the current running progress as the current primary resource; where each resource compressed package is pre-generated based on the program running progress of the target program; generate the current path hash value based on the resource path of the current primary resource, and query the resource dependencies based on the current path hash value to determine the resource download information of the current secondary resource on which the current primary resource depends; where the resource dependencies record the dependencies between each resource file based on the resource path hash value of the primary resource; download the resource compressed package based on the resource download information as the current secondary resource; load the current primary resource and the current secondary resource to continue running the target program. In this way, it is possible to determine the resource download information of the secondary resource based on the hash value of the resource path of the primary resource to download the secondary resource. That is to say, when storing the resource path, instead of storing the resource path itself, the hash value of the resource path is stored, and the length of the hash value is much smaller than the resource path string. Therefore, the resource occupancy of the dependencies is greatly reduced, the query time is saved, and the resource processing efficiency is improved.
[0062] Figure 2 shows a schematic flowchart of a resource processing method provided by an embodiment of the present disclosure. As Figure 2 shown, the resource processing method may include the following steps:
[0063] S250. During the execution of each test case of the target program, record at least one program running progress included in the test case and the resource file identifier of the resource file loaded during the partial test process corresponding to the program running progress, and generate a resource information file corresponding to the test case.
[0064] Among them, the test cases are configured during program development and are specific test scenarios used to verify whether the program meets the requirements. To ensure the program running effect, a program can correspond to a large number of test cases, that is, one test case corresponds to a part of the functions in the program. The resource file refers to various files that need to be loaded during the running of the test case, and the resource file identifier is an identifier that can uniquely identify the resource file. For example, the resource file identifier can be the resource path where the resource file is located. The program running progress refers to the progress (also called depth, represented by NodeId) where the user is during the program running. For example, when the program is a game program, the program running progress can be the user's character level, level of the level, etc. At this time, the resource files corresponding to the earlier program running progress are preferentially loaded. Among them, the smaller the character level corresponding to the earlier program running progress, or the smaller the level of the level corresponding to it. Exemplarily, according to whether the resource is a game engine resource, the resources can be divided into two types. One is the game development engine resource, with the extension uasset or umap, managed by Unreal; the other is the non-game development engine resource, such as mp4, txt, etc. In the extended Unreal File System (UnrealFileSystem), the interface corresponding to the file can be hooked to automatically run the game, mark information such as the main task where the resource is loaded, the player level, etc., and this file can be called a resource file (or a collection file). The automated test cases themselves are segmented. For example, levels 1 to 5 of the player are one test case, and levels 5 to 10 are one test case. Each test case generates an independent collection file. The advantage of splitting the collection file is that if a certain function is modified, only the test case where the function is located needs to be rerun separately.
[0065] It should be noted that a program can correspond to multiple test cases; one test case can correspond to multiple tasks, and one task corresponds to one program running progress and at least one resource file. Exemplarily, in Figure 3In the shown scenario, the test cases include 5 tasks from Task A to Task E. Among them, the program running progress of Task A is 1, and the corresponding resource files include Resource File a1, Resource File a2, …, Resource File an; the program running progress of both Task B and Task C is 2. The resource files corresponding to Task B include Resource File b1, Resource File b2, …, Resource File bm; the resource files corresponding to Task C include Resource File c1, Resource File c2, …, Resource File co; the program running progress of Task D is 3, and the corresponding resource files include Resource File d1, Resource File d2, …, Resource File dp; the program running progress of Task E is 4, and the corresponding resource files include Resource File e1, Resource File e2, …, Resource File eq.
[0066] Specifically, during the execution of each test case of the target program, record at least one program running progress included in the test case and the resource file identifiers of the resource files loaded during the partial test process corresponding to the program running progress, and generate a resource information file corresponding to the test case. Exemplarily, during the execution of the test case as shown in Figure 3 record the resource file identifiers of Resource Files a1 to an corresponding to the program running progress 1; the resource file identifiers of Resource Files b1 to bm and Resource Files c1 to co corresponding to the program running progress 2; the resource file identifiers of Resource Files d1 to dp corresponding to the program running progress 3; the resource file identifiers of Resource Files e1 to eq corresponding to the program running progress 4.
[0067] In some embodiments, the resource files can be divided into directly loaded primary resources and secondary resources that are not directly loaded (resource files automatically loaded when loading the primary resources, i.e., dependent on the primary resources) according to whether the resource files will be directly loaded. For resources with such a dependency relationship (e.g., game engine resources), since the secondary resources are dynamically added to the packaged file according to the dependency relationship during packaging, only the primary resources can be recorded. That is, if the resource files loaded corresponding to the program running progress include directly loaded primary resources and secondary resources that are dependently loaded depending on the primary resources, record the program running progress and the resource file identifiers of the primary resources, and generate a resource information file corresponding to the test case. In this way, in many cases, when the planner performs function iteration, the relevant functions do not need to be recorded again. For example, if the texture resource in the User Interface (UI) is changed from a to b, it will be automatically found during the next packaging that b needs to be packaged into a resource compression package with the UI, greatly reducing the resource usage and improving the resource processing efficiency.
[0068] S260. Based on each program running progress in each resource information file, package the resource files corresponding to the resource file identifiers corresponding to the same program running progress to generate multiple resource compression packages corresponding to the target program.
[0069] Specifically, to optimize the interface efficiency, generally, each resource file is not independently placed on the disk. Instead, some resource files with strong correlations (for example, in a game development engine, the same character materials, animations, skeletons, etc.) are placed in a resource compression package (in a game development engine, this compression package is called a pak). Therefore, all resource files corresponding to the target program are packaged according to the program running progress, and finally, a resource compression package corresponding to each program running progress is obtained, with one resource compression package corresponding to one program running progress. Exemplarily, when the resource files included in the target program are as shown in Figure 3 shown, the resource files a1 to an corresponding to the program running progress 1 are packaged into a resource compression package; the resource files b1 to bm and the resource files c1 to co corresponding to the program running progress 2 are packaged into a resource compression package; the resource files d1 to dp corresponding to the program running progress 3 are packaged into a resource compression package; the resource files e1 to eq corresponding to the program running progress 4 are packaged into a resource compression package, and a total of 4 resource compression packages are obtained.
[0070] In some embodiments, when the resource files are divided into main resources and secondary resources, based on each program running progress in each resource information file, the method of packaging the resource files corresponding to the resource file identifiers corresponding to the same program running progress to generate multiple resource compression packages corresponding to the target program can be, within one program running progress, according to the dependency relationship between the main resources and the secondary resources, packaging the main resources and the secondary resources with a dependency relationship into a resource compression package; or within one program running progress, according to the dependency relationship between the main resources and the secondary resources, packaging the main resources and the secondary resources into different resource compression packages respectively (for example, all main resources are packaged into a resource compression package, all secondary resources are packaged into a compression package, or the main resources and the secondary resources are respectively packaged according to a preset size), and then downloading and loading the corresponding resources according to the dependency relationship during runtime. In this way, when packaging the resource files, it is possible to package according to the dependency relationship of the resource files, as much as possible avoiding and reducing the resource occupation amount, saving the dependency relationship query time, and improving the resource processing efficiency.
[0071] S210. During the running of the target program, based on the current running progress of the target program, download the resource compression package corresponding to the current running progress as the current main resource.
[0072] Among them, each resource compression package is pre-generated based on the program running progress of the target program.
[0073] S220. Generate a current path hash value based on the resource path of the current main resource, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource depended on by the current main resource.
[0074] Among them, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource.
[0075] S230. Download the resource compression package based on the resource download information as the current secondary resource.
[0076] S240. Load the current main resource and the current secondary resource to continue running the target program.
[0077] In the above solution, during the execution of each test case of the target program, at least one program running progress included in the test case and the resource file identifier of the resource file loaded during the partial test process corresponding to the program running progress can be recorded, and a resource information file corresponding to the test case is generated; based on each program running progress in each resource information file, the resource files corresponding to the resource file identifiers corresponding to the same program running progress are packaged to generate multiple resource compression packages corresponding to the target program. In this way, on the one hand, during the process of testing the target program, according to the program running progress corresponding to each test case, the resource files loaded during the test process of the test case are packaged to generate multiple resource compression packages, that is, the same program running progress can be associated with multiple resource files, and the resource files corresponding to the target program can be automatically divided according to the program running progress corresponding to the test case, which not only does not require manual participation in the division process, but also can divide into a relatively fine granularity, improving the practicability and resource processing efficiency, and the division method is more reasonable. On the other hand, recording the resource files corresponding to the program running progress during the test process of the target program and packaging the resource files according to the program running progress does not require an additional program running process, improving the resource utilization rate.
[0078] Figure 4 It is a flowchart of another resource processing method provided by an embodiment of the present disclosure, which further optimizes S260. The explanations of the same or corresponding terms as those in the above embodiments are not repeated here. Refer to Figure 4 This resource processing method includes:
[0079] S350. During the execution of each test case of the target program, record at least one program running progress included in the test case and the resource file identifier of the resource file loaded during the partial test process corresponding to the program running progress, and generate a resource information file corresponding to the test case.
[0080] S361. Based on the program running progress and retaining the resource file identifiers corresponding to the first occurrence of the program running progress, perform deduplication and file merging processing on the resource file identifiers included in each resource information file to generate a target information file.
[0081] Specifically, when the resource file identifiers of a certain resource file correspond to multiple program running progress, only the resource file identifier corresponding to the first program running progress is retained. For example, when the program running progress 1 corresponds to the resource file identifiers of resource files a1, a2, and a3; the program running progress 2 corresponds to the resource file identifiers of resource files a1 and b1; the program running progress 3 corresponds to the resource file identifiers of resource files a2 and b1; the program running progress 4 corresponds to the resource file identifiers of resource files a3 and c1; retain the resource file identifiers of resource files a1, a2, and a3 corresponding to the program running progress 1, the resource file identifier of resource file b1 corresponding to the program running progress 2, and the resource file identifier of resource file c1 corresponding to the program running progress 4; delete the resource file identifier of resource file a1 corresponding to the program running progress 2, the resource file identifiers of resource files a2 and b1 corresponding to the program running progress 3, and the resource file identifier of resource file a3 corresponding to the program running progress 4.
[0082] S362. Based on each program running progress in the target information file, package the resource files corresponding to the resource file identifiers corresponding to the same program running progress to generate multiple resource compression packages corresponding to the target program.
[0083] Specifically, the method of packaging the resource files corresponding to the resource file identifiers corresponding to the same program running progress based on each program running progress in the target information file to generate multiple resource compression packages corresponding to the target program is the same as the method in S120 of packaging the resource files corresponding to the resource file identifiers corresponding to the same program running progress based on each program running progress in each resource information file to generate multiple resource compression packages corresponding to the target program, which will not be elaborated here.
[0084] S310. During the running process of the target program, based on the current running progress of the target program, download the resource compression package corresponding to the current running progress as the current main resource.
[0085] Among them, each resource compression package is pre-generated based on the program running progress of the target program.
[0086] S320. Generate the current path hash value based on the resource path of the current main resource, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource depended on by the current main resource.
[0087] Among them, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource.
[0088] S330. Download the resource compression package based on the resource download information as the current secondary resource.
[0089] S340. Load the current main resource and the current secondary resource to continue running the target program.
[0090] In the above solution, before packaging, the resource file identifiers are de-duplicated and merged, and the resource file identifier corresponding to the first occurrence of the program running progress is retained, which can ensure that the packaged resource files are not repeated and are downloaded at the earliest progress, reducing the probability of the user being blocked in the initial stage; at the same time, without affecting the resource processing result, the number of resource processing is greatly reduced, improving the resource processing efficiency.
[0091] Figure 5 It is a flowchart of another resource processing method provided by an embodiment of the present disclosure, which further optimizes S260. The explanations of the same or corresponding terms in the above embodiments are not repeated here. Refer to Figure 5 , the resource processing method includes:
[0092] S450. During the execution of each test case of the target program, record at least one program running progress included in the test case and the resource file identifier of the resource file loaded during the local test corresponding to the program running progress, and generate a resource information file corresponding to the test case.
[0093] S463. For each program running progress in each resource information file, determine the resource file corresponding to each resource file identifier corresponding to the program running progress.
[0094] Specifically, the resource information file generated in S450 includes the program running progress and the resource file identifier corresponding to the program running progress, and the resource file can be determined from the resource file library according to the resource file identifier.
[0095] In some embodiments, for each program running progress in each resource information file, the method of determining the resource file corresponding to each resource file identifier corresponding to the program running progress may also be to first perform de-duplication and file merging processing on the resource file identifiers included in each resource information file based on the program running progress and retaining the resource file identifier corresponding to the first occurrence of the program running progress to generate a target information file; then, based on each program running progress in the target resource information file, determine the resource file corresponding to each resource file identifier corresponding to the program running progress.
[0096] S464. If the main resource is included in each resource file, determine the secondary resource that depends on the main resource based on the resource file identifier and resource dependency of the main resource.
[0097] Among them, the resource dependency relationship can be generated by calling a dependency generation function (including implicit dependency relationships between codes) during the development of the target program, and includes the correspondence relationship between the resource file identifier of the main resource with a dependency relationship and the resource file identifier of the secondary resource.
[0098] Specifically, it can be determined whether the resource file contains the main resource according to whether the resource file will be directly loaded. If the resource file is directly loaded, it is determined that the resource file contains the main resource. At this time, first, based on the resource file identifier of the main resource, the resource file identifier of the secondary resource dependent on the main resource is determined from the resource dependency relationship; then, according to the resource file identifier of the secondary resource, the secondary resource is determined from the resource file library.
[0099] S465. Package each resource file and the secondary resource to generate a resource compression package corresponding to the program running progress.
[0100] Specifically, when packaging the resource file, within a program running progress corresponding to the target program, all resource files including the main resource and the secondary resources corresponding to the main resource are packaged into a resource compression package corresponding to this program running progress. Exemplarily, within a program running progress A, there are 5 resource files, namely resource file a1, resource file a2, resource file a3, resource file a4, and resource file a5, and when resource file a1 is the main resource, based on the resource file identifier of resource file a1 and the resource dependency relationship, the secondary resources dependent on resource file a1 are determined. Assuming that the secondary resources determined for resource file a1 include secondary resource a11 and secondary resource a12, then resource file a1, resource file a2, resource file a3, resource file a4, resource file a5, secondary resource a11, and secondary resource a12 are packaged to generate a resource compression package corresponding to program running progress A in the target program.
[0101] S410. During the running of the target program, based on the current running progress of the target program, download the resource compression package corresponding to the current running progress as the current main resource.
[0102] Among them, each resource compression package is pre-generated based on the program running progress of the target program.
[0103] S420. Based on the resource path of the current main resource, generate a current path hash value, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource dependent on the current main resource.
[0104] Among them, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource.
[0105] S430. Download the resource compression package based on the resource download information as the current secondary resource.
[0106] S440. Load the current primary resource and the current secondary resource to continue running the target program.
[0107] In the above solution, when packaging resource files, the primary resource and the secondary resource with a resource dependency relationship can be packaged into a resource compression package, which can ensure the integrity of the resources in the resource compression package and avoid running problems caused by missing dependent resources or incorrect loading order. At the same time, it also reduces resource file fragmentation and improves the loading efficiency.
[0108] Figure 6 It is a flowchart of another resource processing method provided by an embodiment of the present disclosure, which further optimizes S362. The explanations of the same or corresponding terms in the above embodiments will not be repeated here. Refer to Figure 6 This resource processing method includes:
[0109] S550. During the execution of each test case of the target program, record at least one program running progress included in the test case and the resource file identifier of the resource file loaded during the local test corresponding to the program running progress, and generate a resource information file corresponding to the test case.
[0110] S561. Based on the program running progress and retaining the resource file identifier corresponding to the first occurrence of the program running progress, perform deduplication and file merging processing on the resource file identifiers included in each resource information file to generate a target information file.
[0111] S5621. Based on each program running progress in the target information file, package the resource files corresponding to the resource file identifiers corresponding to the same program running progress to generate an initial compression package corresponding to the program running progress.
[0112] Specifically, the method of packaging the resource files corresponding to the resource file identifiers corresponding to the same program running progress based on each program running progress in the target information file to generate an initial compression package corresponding to the program running progress is similar to the method in S120 of packaging the resource files corresponding to the resource file identifiers corresponding to the same program running progress based on each program running progress in each resource information file to generate multiple resource compression packages corresponding to the target program, and will not be repeated here.
[0113] S5622. Generate an installation package for the target program based on the initial compression packages corresponding to each first running progress.
[0114] Among them, the first running progress includes a preset running progress or a program running progress before the preset running progress.
[0115] Specifically, in order to prevent the user from immediately encountering a blocking phenomenon when entering the target program, the embodiments of the present disclosure place all the initial compressed packages before a certain program running progress (preset running progress) into the installation package of the target program. For example, if the preset running progress is 50, only the initial compressed packages corresponding to the program running progress after 50 will be downloaded while playing.
[0116] S5623. Constrained by the data volume threshold, based on the order of each program running progress, perform a merging process on the initial compressed packages corresponding to multiple second running progress to generate each resource compressed package corresponding to the target program.
[0117] Among them, the second running progress includes the program running progress other than the first running progress in each program running progress. The data volume threshold is a preset value. For example, it is the default value, or a value set by relevant personnel according to the actual situation. For another example, the data volume threshold is 50M.
[0118] Specifically, because most task processes do not use a lot of resources, in order to prevent the initial compressed packages from being too small and too many, the initial compressed packages of adjacent program running progress can be merged, and the merged resource compressed package is controlled to be less than or equal to the data volume threshold. Repeat the merging process until all the initial compressed packages are processed to obtain each resource compressed package corresponding to the target program.
[0119] In the above solution, on the one hand, it can place all the initial compressed packages before the preset running progress into the installation package of the target program, avoiding the problem that the user immediately encounters a blocking phenomenon when entering the target program and improving the user experience; on the other hand, it can also be constrained by the data volume threshold, based on the order of each program running progress, perform a merging process on the initial compressed packages corresponding to multiple second running progress to generate each resource compressed package corresponding to the target program, avoiding the problem of large maintenance volume caused by the initial compressed packages being too small and too many.
[0120] In some embodiments, for various function modules within the application, the blocking policy at the function module level can also be customized depending on the information in the registry file. For example, when opening the interface, the required resources will be queried from the registry file, and the interface cannot be opened before the download is completed. By customizing the blocking policy in each module and adding an additional scan for dependencies for each module when generating the registry, the situation of resource shortage can be avoided, providing a fallback protection for each function without modifying the existing complex function logic, and at the same time reducing the update frequency of automated collection. When the resource usage situation changes, it is not necessarily necessary to re-collect, thereby further improving the resource processing efficiency.
[0121] The following are embodiments of a resource processing apparatus provided by the embodiments of the present invention. This apparatus and the resource processing methods of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the resource processing apparatus, reference may be made to the embodiments of the above resource processing methods.
[0122] Figure 7 The following shows a schematic structural diagram of a resource processing apparatus provided by an embodiment of the present disclosure. As Figure 7 shown, the resource processing apparatus 600 may include:
[0123] A main resource download module 61, configured to download a resource compression package corresponding to the current running progress as the current main resource during the running of a target program, based on the current running progress of the target program; wherein, each of the resource compression packages is pre-generated based on the program running progress of the target program;
[0124] A resource download information determination module 62, configured to generate a current path hash value based on the resource path of the current main resource, and query a resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource on which the current main resource depends; wherein, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource;
[0125] A secondary resource download module 63, configured to download the resource compression package as the current secondary resource based on the resource download information;
[0126] A target program running module 64, configured to load the current main resource and the current secondary resource to continue running the target program.
[0127] In the above solution, during the running of the target program, based on the current running progress of the target program, a resource compression package corresponding to the current running progress is downloaded as the current main resource; wherein, each resource compression package is pre-generated based on the program running progress of the target program; based on the resource path of the current main resource, a current path hash value is generated, and based on the current path hash value, a resource dependency relationship is queried to determine the resource download information of the current secondary resource on which the current main resource depends; wherein, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource; based on the resource download information, a resource compression package is downloaded as the current secondary resource; the current main resource and the current secondary resource are loaded to continue running the target program. In this way, the resource download information of the secondary resource can be determined according to the hash value of the resource path of the main resource to download the secondary resource. That is to say, when storing the resource path, it is no longer the resource path itself that is stored, but the hash value of the resource path, and the length of the hash value is much smaller than the resource path string. Therefore, the resource occupancy of the dependency relationship is greatly reduced, the query time is saved, and the resource processing efficiency is improved.
[0128] In some embodiments, the resource dependency relationship records the resource path hash value of the main resource and the compression package identifier of the resource compression package where the secondary resource dependent on the main resource is located;
[0129] The resource download information determination module 62 is specifically configured to:
[0130] Query the resource dependency relationship based on the current path hash value to determine the current compression package identifier corresponding to the current secondary resource as the resource download information.
[0131] In some embodiments, the resource dependency relationship includes the dependency relationship generated by the game engine and the dependency relationship included in the code of the target program.
[0132] In some embodiments, the resource processing device 600 may further include:
[0133] The resource file information generation module is configured to record at least one program running progress included in the test case and the resource file identifier of the resource file loaded during the local test corresponding to the program running progress during the execution of each test case of the target program, and generate a resource information file corresponding to the test case;
[0134] The resource compression package generation module is configured to pack the resource files corresponding to the resource file identifiers corresponding to the same program running progress based on each program running progress in each resource information file to generate multiple resource compression packages corresponding to the target program.
[0135] In some embodiments, the resource compression package generation module is specifically configured to:
[0136] Based on the program running progress and retaining the resource file identifiers corresponding to the first-occurring program running progress, perform deduplication and file merging processing on the resource file identifiers included in each resource information file to generate a target information file;
[0137] Based on each program running progress in the target information file, package the resource files corresponding to the resource file identifiers corresponding to the same program running progress to generate multiple resource compression packages corresponding to the target program.
[0138] In some embodiments, the resource file information generation module is specifically configured to:
[0139] If the loaded resource files corresponding to the program running progress include directly loaded main resources and secondary resources that are dependently loaded depending on the main resources, record the program running progress and the resource file identifiers of the main resources to generate a resource information file corresponding to the test case.
[0140] In some embodiments, the resource compression package generation module is specifically configured to:
[0141] For each program running progress in each resource information file, determine the resource files corresponding to the resource file identifiers corresponding to the program running progress;
[0142] If the main resources are included in the resource files, based on the resource file identifiers and resource dependency relationships of the main resources, determine the secondary resources that depend on the main resources;
[0143] Package each resource file and the secondary resources to generate a resource compression package corresponding to the program running progress.
[0144] In some embodiments, the resource compression package generation module is specifically configured to:
[0145] Based on each program running progress in the target information file, package the resource files corresponding to the resource file identifiers corresponding to the same program running progress to generate an initial compression package corresponding to the program running progress;
[0146] Generate an installation package for the target program based on the initial compression packages corresponding to each first running progress; wherein, the first running progress includes a preset running progress or a program running progress before the preset running progress;
[0147] Constrained by the data volume threshold, based on the order of each program running progress, perform merging processing on the initial compression packages corresponding to multiple second running progress to generate each resource compression package corresponding to the target program; wherein, the second running progress includes the program running progress other than the first running progress in each program running progress.
[0148] The resource processing device provided by an embodiment of the present invention can execute the resource processing method provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution of the method.
[0149] It should be noted that in the above embodiments of the resource processing device, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present disclosure.
[0150] An embodiment of the present disclosure also provides an electronic device, which may include a processor and a memory, and the memory may be used to store executable instructions. Among them, the processor may be used to read the executable instructions from the memory and execute the executable instructions to implement the resource processing method in the above embodiments.
[0151] Figure 8 The structural schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown.
[0152] As Figure 8 shown, the electronic device 700 may include a processing device 701 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output interface (I / O interface) 705 is also connected to the bus 704.
[0153] Generally, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or wiredly to exchange data.
[0154] It should be noted that Figure 8 the shown electronic device 700 is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present disclosure. That is, although Figure 8An electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0155] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by a processing device 701, the above-mentioned functions defined in the resource processing method of any embodiment of the present disclosure are performed.
[0156] An embodiment of the present disclosure also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the processor is caused to implement the resource processing method in any embodiment of the present disclosure.
[0157] It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination of the above.
[0158] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as the Hypertext Transfer Protocol (HTTP), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0159] The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist separately without being assembled into the electronic device.
[0160] The above computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the resource processing method described in any embodiment of the present disclosure.
[0161] In embodiments of the present disclosure, computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone 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 may 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0162] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0163] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, the exemplary types of hardware logic components that can be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), and so on.
[0164] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features. At the same time, it should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0165] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0166] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A resource processing method, characterized in that Including: During the running of the target program, based on the current running progress of the target program, download the resource compression package corresponding to the current running progress as the current main resource; wherein, each of the resource compression packages is pre-generated based on the program running progress of the target program; Generate a current path hash value based on the resource path of the current main resource, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource on which the current main resource depends; wherein, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource; Download the resource compression package based on the resource download information as the current secondary resource; Load the current main resource and the current secondary resource to continue running the target program.
2. The method according to claim 1, wherein The resource dependency relationship records the resource path hash value of the main resource and the compression package identifier of the resource compression package where the secondary resource depending on the main resource is located; The querying the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource on which the current main resource depends includes: Query the resource dependency relationship based on the current path hash value to determine the current compression package identifier corresponding to the current secondary resource as the resource download information.
3. The method according to claim 1, wherein The resource dependency relationship includes the dependency relationship generated by the game engine and the dependency relationship included in the code of the target program.
4. The method according to claim 1, wherein The resource compression package is pre-generated in the following manner: During the execution of each test case of the target program, record at least one of the program running progress included in the test case and the resource file identifier of the resource file loaded during the local test corresponding to the program running progress, and generate a resource information file corresponding to the test case; Based on each program running progress in each of the resource information files, package the resource files corresponding to each resource file identifier corresponding to the same program running progress to generate multiple resource compression packages corresponding to the target program.
5. The method according to claim 4, wherein The packaging the resource files corresponding to each resource file identifier corresponding to the same program running progress based on each program running progress in each of the resource information files to generate multiple resource compression packages corresponding to the target program includes: Based on the program running progress and retaining the resource file identifier corresponding to the first occurrence of the program running progress, perform deduplication and file merging processing on each resource file identifier included in each of the resource information files to generate a target information file; Based on each program running progress in the target information file, package the resource files corresponding to each resource file identifier corresponding to the same program running progress to generate multiple resource compression packages corresponding to the target program.
6. The method according to claim 4 or 5, characterized in that The recording at least one of the program running progress included in the test case and the resource file identifier of the resource file loaded during the local test corresponding to the program running progress to generate a resource information file corresponding to the test case includes: If the loaded resource file corresponding to the program running progress includes a directly loaded main resource and a secondary resource that is dependently loaded depending on the main resource, record the program running progress and the resource file identifier of the main resource, and generate a resource information file corresponding to the test case.
7. The method according to claim 6, characterized in that Packaging the resource files corresponding to the resource file identifiers corresponding to the same program running progress based on each program running progress in each resource information file to generate multiple resource compression packages corresponding to the target program, includes: For each program running progress in each resource information file, determine the resource files corresponding to the resource file identifiers corresponding to the program running progress; If the main resource is included in each resource file, based on the resource file identifier and resource dependency relationship of the main resource, determine the secondary resources that depend on the main resource; Package each resource file and the secondary resources to generate a resource compression package corresponding to the program running progress.
8. The method according to claim 5, wherein Packaging the resource files corresponding to the resource file identifiers corresponding to the same program running progress based on each program running progress in the target information file to generate multiple resource compression packages corresponding to the target program, includes: Based on each program running progress in the target information file, package the resource files corresponding to the resource file identifiers corresponding to the same program running progress to generate an initial compression package corresponding to the program running progress; Generate an installation package of the target program based on the initial compression packages corresponding to each first running progress; wherein, the first running progress includes a preset running progress or a program running progress before the preset running progress; Constrained by a data volume threshold, based on the order of each program running progress, perform a merging process on the initial compression packages corresponding to multiple second running progress to generate each resource compression package corresponding to the target program; wherein, the second running progress includes each program running progress except the first running progress.
9. A resource processing device, characterized in that, Includes: A main resource download module, configured to, during the running of the target program, based on the current running progress of the target program, download the resource compression package corresponding to the current running progress as the current main resource; wherein, each resource compression package is pre-generated based on the program running progress of the target program; A resource download information determination module, configured to generate a current path hash value based on the resource path of the current main resource, and query the resource dependency relationship based on the current path hash value to determine the resource download information of the current secondary resource that the current main resource depends on; wherein, the resource dependency relationship records the dependency relationship between each resource file based on the resource path hash value of the main resource; A secondary resource download module, configured to download the resource compression package based on the resource download information as the current secondary resource; A target program running module, configured to load the current main resource and the current secondary resource to continue running the target program.
10. An electronic device, characterized in that, Includes: Processor; Memory for storing executable instructions; Wherein, the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the resource processing method according to any one of claims 1-8 above.
11. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, causes the processor to implement the resource processing method according to any one of claims 1-8 above.
12. A computer program product, characterized in that, The computer program product is used to implement the resource processing method according to any one of claims 1-8 above.
Citation Information
Cited By
Resource management method and system for animation items
CN121120871A