Resource processing method and system

By obtaining resource usage information of the game engine and automatically subcontracting according to resource types, the loading time and memory waste caused by inconsistent resource subcontracting in the game engine are solved, and more efficient and stable resource management is achieved.

CN113961344BActive Publication Date: 2025-05-23SHANGHAI HODE INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111234794.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2025-05-23
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

When developing games using game engines, inconsistent resource subcontracting strategies lead to extended resource loading time, wasted memory, and may even cause game running lag or crashes.

Method used

By obtaining resource usage information of the game engine, determine the resource types of each used resource and divide the resource into multiple resource packages according to these types.

Benefits of technology

Automatic resource subcontracting is realized, which avoids faults and rational differences caused by manual subcontracting, reduces the use of equipment performance, and improves the loading efficiency and stability of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961344B_ABST
    Figure CN113961344B_ABST
Patent Text Reader

Abstract

The present application discloses a resource processing method, the method comprising: obtaining resource usage information of a game engine, the resource usage information being associated with a plurality of used resources; determining the resource type of each used resource according to the resource usage information; and dividing the plurality of used resources into a plurality of resource packages according to the resource type of each used resource. The present application also discloses a resource processing system, a computer device, and a computer-readable storage medium. The technical solution provided by the present application includes the following advantages: automatic subpackaging based on resource types can avoid maintenance difficulties caused by manual subpackaging and reduce equipment performance loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a resource processing method, system, computer device, and computer-readable storage medium. Background Art

[0002] With the development of computer technology, game engines are becoming more and more popular among game developers. Game engines are the core components of some pre-written editable computer game systems or some interactive real-time applications. Most game engines integrate functions such as graphics, sound, physics and artificial intelligence. These functions are open to developers, allowing them to develop games based on them and reduce development complexity. For example, Unity is a cross-platform 2D / 3D game engine developed by Unity Technologies. It can be used to develop stand-alone games for Windows, MacOS and Linux platforms, video games for game console platforms such as PlayStation, Xbox, Nintendo and Switch, and games for mobile devices such as iOS and Android.

[0003] In games developed using game engines, there is the issue of resource subpackaging. The inventors have learned that resources used for games are generally subpacked manually or based on folders, which has the following problems:

[0004] (1) If the project is redeveloped or the game program and engine are maintained by different people, adding new resources is prone to failure and trouble.

[0005] (2) Different people may use different subpackaging strategies, so there may be differences in rationality. An unreasonable subpackaging strategy will cause electronic devices to load a lot of unnecessary resources when using resources, resulting in prolonged loading time and memory waste. It may even cause the game to freeze or crash when there is insufficient memory. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a resource processing method, system, computer device and computer-readable storage medium to solve the above-mentioned problems.

[0007] One aspect of an embodiment of the present application provides a resource processing method, the method comprising:

[0008] Obtaining resource usage information of a game engine, wherein the resource usage information is associated with a plurality of used resources;

[0009] Determining the resource type of each used resource according to the resource usage information; and

[0010] The multiple used resources are divided into multiple resource packages according to resource types of the respective used resources.

[0011] Optionally, the resource usage information includes multiple states;

[0012] The multiple states are distributed in a tree structure, each state is a string of characters, and each string of characters maps used resources associated with a frame when it is rendered.

[0013] Optionally, determining the resource type of each used resource according to the resource usage information includes:

[0014] Analyze the used resources of multiple child state mappings under the same parent state;

[0015] Determine the used resources to which all child states under the same parent state are mapped as static resources;

[0016] Other used resources of the multiple state mappings under the same parent state are determined as dynamic resources, and the other used resources are resources other than the static resources among the used resources of the multiple child state mappings.

[0017] Optionally, the multiple used resources include multiple static resources and / or multiple dynamic resources;

[0018] The dividing the plurality of used resources into a plurality of resource packages according to the resource type of each of the used resources comprises:

[0019] Sub-packaging the multiple static resources to obtain multiple static resource packages in the multiple resource packages; and / or

[0020] The multiple dynamic resources are packaged to obtain multiple dynamic resource packages in the multiple resource packages.

[0021] Optionally, also include:

[0022] According to the first naming rule, each static resource package is named separately; and / or

[0023] According to the second naming rule, name each dynamic resource package separately;

[0024] The first naming rule and the second naming rule are different.

[0025] Optionally, the step of performing sub-packaging processing on the multiple static resources to obtain multiple static resource packages in the multiple resource packages includes:

[0026] Acquire multiple static resource combinations according to the multiple static resources;

[0027] Determining a target static resource combination from the plurality of static resource combinations according to the performance consumption values ​​of the various static resource combinations; and

[0028] The multiple static resources are divided into the multiple static resource packages according to the target static resource combination.

[0029] Optionally, also include:

[0030] Calculate the first performance consumption value of each static resource used individually;

[0031] Calculate a second performance consumption value of each static resource used individually during game execution;

[0032] Calculate a third performance consumption value used by each static resource in a corresponding resource package;

[0033] Calculating a fourth performance consumption value of each static resource when the static resource is loaded but not used;

[0034] The performance consumption values ​​of the various static resource combinations are calculated according to the first performance consumption value, the second performance consumption value, the third performance consumption value and the fourth performance consumption value of each static resource.

[0035] Optionally, the step of performing sub-packaging processing on the multiple static resources to obtain multiple static resource packages in the multiple resource packages includes:

[0036] According to the order of the states, the static resources mapped by the states are divided in sequence, and the resource combination obtained after each division is obtained according to the static resources of the current state and the resource combinations after the adjacent previous divisions;

[0037] Determine the resource combination obtained after the last division as the target static resource combination; and

[0038] The multiple static resources are divided into the multiple static resource packages according to the target static resource combination.

[0039] Optionally, the step of performing subpackaging processing on the multiple dynamic resources to obtain multiple dynamic resource packages in the multiple resource packages includes:

[0040] Divide all dynamic resources of multiple child states under the same parent state into one or more dynamic resource bundles.

[0041] Optionally, also include:

[0042] Calculate the performance consumption value required to update each static resource package according to the size and resource quantity of each static resource package;

[0043] According to the performance consumption value required for updating each static resource package, judging whether each static resource package meets the re-packaging standard;

[0044] Selecting a plurality of target resource packages that meet the re-packaging standard from the plurality of static resource packages; and

[0045] The multiple target resource packages are sub-packaged again.

[0046] Optionally, the re-packaging the multiple target resource packages includes:

[0047] sorting the multiple target resources in the multiple target resource packages;

[0048] Adding an empty package, and dividing each target resource into the empty package according to the order of the multiple target resources, until the empty package is full;

[0049] Add the next empty package, and divide the remaining target resources in the previous division into the next sub-package according to the order of the multiple target resources in the previous division, until the empty package is full; repeat this operation until the target resource packages do not meet the re-sub-package standard.

[0050] Optionally, also include:

[0051] Subpackaging a plurality of unused resources, wherein the plurality of unused resources include a plurality of first-category unused resources that comply with a preset naming rule and a plurality of second-category unused resources that do not comply with the preset naming rule;

[0052] The plurality of first-category unused resources and the plurality of second-category unused resources are respectively subpackaged.

[0053] Optionally, also include:

[0054] If there are new resources, perform the following operations:

[0055] Acquire multiple candidate resource packages associated with the newly added resource;

[0056] Obtaining the number of associations between the newly added resource and each candidate resource package, and generating a sorting table, wherein the order of each candidate resource package in the sorting table corresponds to the number of associations between each candidate resource package and the newly added resource;

[0057] According to the order of the resource packages to be selected, the resource packages to be selected are traversed until a resource package to be selected suitable for adding the newly added resource is found or it is determined that the resource packages to be selected are not suitable for adding the newly added resource;

[0058] If a candidate resource package suitable for adding the newly added resource is found, the operation of adding the newly added resource is performed;

[0059] If it is determined that none of the candidate resource packages are suitable for adding the newly added resource, the newly added resource is marked as an independent resource, and the newly added resource marked as an independent resource is subpackaged in the subpackage manner of unused resources.

[0060] Optionally, also include:

[0061] Generate a resource lookup table, the resource lookup table is used to query the package name of the resource package corresponding to each resource; and / or

[0062] Generate a resource record table, where the resource record table is used to record metadata information of the resource package generated last time.

[0063] Optionally, also include:

[0064] Check whether there are several resources with the same MD5 in the resource library; and

[0065] If there are several resources with the same MD5 in the resource library, a redundant resource warning is generated.

[0066] Optionally, also include:

[0067] Determine whether the MD5 corresponding to each resource in the resource library can be found in the resource usage information table; and

[0068] If the MD5 of at least some resources cannot be found in the resource usage information table, a useless resource warning is generated.

[0069] One aspect of an embodiment of the present application further provides a resource processing system, the system comprising:

[0070] An acquisition module, used to acquire resource usage information of a game engine, wherein the resource usage information is associated with a plurality of used resources;

[0071] A determination module, used to determine the resource type of each used resource according to the resource usage information;

[0072] The packaging module is used to divide the multiple used resources into multiple resource packages according to the resource type of each used resource.

[0073] One aspect of an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is used to implement the steps of the resource processing method described above when executing the computer program.

[0074] One aspect of an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program can be executed by at least one processor to enable the at least one processor to perform the steps of the resource processing method as described above.

[0075] The resource processing method, system, device, and computer-readable storage medium provided by the embodiments of the present application have the following advantages:

[0076] (1) Automatic subcontracting based on resource type can avoid the following problems caused by manual subcontracting: If the project is redeveloped or the game program and engine are maintained by different people, the addition of new resources is prone to failure and trouble.

[0077] (2) Automatic subpackaging based on resource type can reduce device performance loss and avoid the following problems caused by manual subpackaging: different people have different subpackaging strategies, so there may be differences in rationality. Unreasonable subpackaging strategies will cause electronic devices to load many unnecessary resources when using resources, resulting in prolonged loading time and memory waste. It may even cause the game to freeze or crash when there is insufficient memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 A diagram schematically shows an application environment of a resource processing method according to an embodiment of the present application;

[0079] Figure 2 The flowchart of the resource processing method according to the first embodiment of the present application is schematically shown;

[0080] Figure 3 for Figure 2 Flow chart of sub-steps of step S202;

[0081] Figure 4 for Figure 2 Flow chart of sub-steps of step S204;

[0082] Figure 5 The following schematically shows a flowchart of newly added steps of the resource processing method according to the first embodiment of the present application;

[0083] Figure 6 for Figure 4 Flow chart of sub-steps of step S400;

[0084] Figure 7 for Figure 4 Flow chart of newly added sub-steps of step S400;

[0085] Figure 8 for Figure 4 Another sub-step flow chart of step S400;

[0086] Fig. 9 for Figure 4 Flow chart of sub-steps of step S402;

[0087] Fig.10 The following schematically shows a flowchart of newly added steps of the resource processing method according to the first embodiment of the present application;

[0088] Fig.11 for Fig.10 Flow chart of sub-steps of step S1006;

[0089] Fig.12 The following schematically shows a flowchart of newly added steps of the resource processing method according to the first embodiment of the present application;

[0090] Fig.13 for Fig.12 Flow chart of sub-steps of step S1202;

[0091] Fig.14 for Fig.12 Another sub-step flow chart of step S1202;

[0092] Fig.15 The following schematically shows a flowchart of newly added steps of the resource processing method according to the first embodiment of the present application;

[0093] Fig.16 for Fig.15 Flow chart of sub-steps of step S1504;

[0094] Fig.17 The following schematically shows a flowchart of newly added steps of the resource processing method according to the first embodiment of the present application;

[0095] Fig.18 The following schematically shows a flowchart of newly added steps of the resource processing method according to the first embodiment of the present application;

[0096] Fig.19 The following schematically shows a flowchart of newly added steps of the resource processing method according to the first embodiment of the present application;

[0097] Fig. 20 The resource processing interface is schematically shown;

[0098] Fig.21 The display interface of the redundant resource detection result is schematically shown;

[0099] Fig. 22 The display interface of the detection result of useless resources is schematically shown;

[0100] Fig.23 A block diagram of a resource processing system according to Embodiment 2 of the present application is schematically shown;

[0101] Fig.24 The schematic diagram shows a hardware architecture of a computer device suitable for implementing the resource processing method according to the third embodiment of the present application. DETAILED DESCRIPTION

[0102] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0103] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0104] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.

[0105] According to the inventor's analysis, in games developed using game engines, there is generally a problem of hot resource updates. For example, in games developed using the Unity game engine, it is basically impossible to avoid using AssetBundle to package game resources for hot resource updates. However, the AssetBundle package generation strategies that the inventor knows are basically through folder sub-packaging, or through function sub-packaging. A more reasonable way is to increase the package size limit while sub-packaging according to functions or folders. However, the following problems still exist:

[0106] First, manual sub-packaging is required, such as which resources should be packaged into the same AssetBundle package, the naming rules of the AssetBundle package, etc., and if the project is redeveloped or the client is maintained by a different person, adding new resources will be very troublesome.

[0107] Second, different people have different strategies for dividing AssetBundle packages, so there may be differences in rationality. An unreasonable sub-packaging strategy will cause the client to load a lot of unnecessary resources when using resources, resulting in prolonged loading time and memory waste (for example, in the case of tight memory, it may even cause the game to run stuck or crash).

[0108] Third, when using a certain resource, you need to pre-specify the AssetBundle package containing the resource, and then load the AssetBundle package and the remaining AssetBundle packages associated with the AssetBundle package. When no longer in use, you need to manually uninstall the package and the remaining AssetBundle packages associated with the package.

[0109] Fourth, client game development is basically collaborative development, with multiple people managing client resources together. If there is resource redundancy, it will also cause the resource package to increase and waste memory. And if duplicate resources need to be modified, there is also the risk of missing the modification.

[0110] In response to the above-mentioned problems, this application aims to monitor resource usage information through the game engine and perform the following operations:

[0111] First, analyze resource usage information, determine the resources contained in the optimal AssetBundle package and the relationship between multiple AssetBundle packages through relevant algorithms, and then generate a specific AssetBundle package.

[0112] Second, analyze resource usage information, determine a more reasonable subpackaging strategy, and reduce the loading of useless resources in various states of game operation.

[0113] Third, detect whether there are redundant resources and useless resources on the client, and issue system warnings for the redundant resources and useless resources.

[0114] Fourth, provide resource loading and unloading interfaces to ensure that the game runs without difference in editor and release modes.

[0115] Fifth, decouple client program development and resource management. Therefore, developers can focus only on the functional implementation of client development programs, without spending too much time considering how to store resources and other things that are not related to logic.

[0116] The following is an explanation of the terms used in this application:

[0117] Game engine: refers to the core components of some pre-written editable computer game systems or interactive real-time graphics applications. These systems provide game designers with various tools needed to write games, with the aim of allowing game designers to easily and quickly create game programs without starting from scratch. Most of them support multiple operating platforms, such as Linux, Mac OS X, and Microsoft Windows. Game engines include the following systems: rendering engine (also known as "renderer", including 2D graphics engine and 3D graphics engine), physics engine, collision detection system, sound effects, script engine, computer animation, artificial intelligence, network engine, and scene management.

[0118] AssetBundle: A file storage format supported by Unity. It is also the officially recommended resource storage and update method by Unity. It can compress, group, dynamically load, and hot update resources (Assets). However, AssetBundle cannot hot update Unity scripts because they need to be compiled during packaging.

[0119] MD5 (Message-Digest Algorithm) is a cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure the integrity and consistency of information transmission.

[0120] Resources can include pictures, shaders (shading codes), materials, models, animations, etc.

[0121] State: the resource information used in each frame is digitally encoded into a unique state. For example, rendering a frame A uses "resource 1", "resource 2" and "resource 3" in sequence. A unique string of characters (such as an MD code) can be generated based on the names or other identifiers of "resource 1", "resource 2" and "resource 3". When the device reads this string of characters, it can be parsed to obtain that frame A uses "resource 1", "resource 2" and "resource 3". The current state refers to the digital encoding of multiple resources used to render the current frame. In this application, the digital encoding can be an MD5 encoding or an encoding of other algorithms.

[0122] Figure 1 The following schematically shows an environment architecture diagram of a resource processing method according to an embodiment of the present application. Figure 1 As shown, the computer device 2 can be connected to multiple electronic devices 6 via a network 4 .

[0123] Computer device 2 may provide resource management services via one or more networks 4 .

[0124] The computer device 2 may be composed of a single or multiple computing devices, such as a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. The one or more computer devices may include a virtualized computing instance. The computer device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., an operating system, a dedicated application, a server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on the one or more computer devices.

[0125] The network 4 may include various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 4 may include physical links, such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and / or the like. The network 4 may include wireless links, such as cellular links, satellite links, Wi-Fi links, and / or the like.

[0126] The electronic device 6 may be configured to access the computer device 2. The electronic device 6 may include any type of computer device that can be used with a game engine, such as: a smart phone, a tablet device, a laptop computer, a smart device (e.g., a smart watch, smart glasses), virtual reality, a gaming device, a set-top box, a digital streaming device, a vehicle-mounted terminal, a smart TV, a TV box, an MP4 (Moving Picture Experts Group Audio Layer IV) player, etc.

[0127] Electronic device 6, can run Windows system, Android TM ) system or iOS system and other operating systems. In addition, users can also install various applications, program components (such as game engines) as needed. Based on the above programs or program components, various functions can be implemented, such as game functions, or resource monitoring functions. The game engine is a core component for running game applications, which is used to provide various tools required for various operations, such as some pre-written editable computer game systems or some interactive real-time image application programs. The core components. In this application, the game engine can be responsible for providing resource usage information used by the game in different states when the game is running, such as what resources are loaded in the current state, what resources are released, etc.

[0128] Hereinafter, the present application will provide a resource processing method, system, computer device and computer-readable storage medium.

[0129] Embodiment 1

[0130] Figure 2The flowchart of the resource processing method according to the first embodiment of the present application is schematically shown. The method can be executed in the computer device 2. Figure 2 As shown, the resource processing method may include steps S200 to S204, wherein:

[0131] Step S200, obtaining resource usage information of the game engine, wherein the resource usage information is associated with a plurality of used resources.

[0132] Step S202: determining the resource type of each used resource according to the resource usage information.

[0133] Step S204: Divide the multiple used resources into multiple resource packages according to the resource type of each used resource.

[0134] In actual applications, when developing games using a game engine (such as Unity), a monitoring program can be injected into the game engine of each electronic device 6 to obtain resource usage information (the actual rendering status of the resources).

[0135] Take one of the electronic devices 6 as an example: during the entire game running process, the electronic device 6 will monitor the resource usage information of each used resource used by the game engine through the monitoring program, and the information is as follows:

[0136] Name: the resource name of the used resource;

[0137] Type: the type of the used resource;

[0138] Path: the path of the used resource;

[0139] MD5: MD5 corresponding to the used resource;

[0140] Mem: the memory size occupied by the used resource;

[0141] LoadTime: The time it takes to load the resource individually (Mem*X), where X is the default value.

[0142] UnloadTime: The time (Mem*Y) of unloading the used resource, where Y is the preset value.

[0143] Associated: The resource usage information of other used resources rendered by the game engine at the same time in a frame being rendered for this used resource (this field is a list, and the content includes the MD5 code of each other used resource);

[0144] State: The sum of information about all used resources (including stable resources, i.e., resources that exist and remain unchanged during rendering) used by the game engine to render a frame represents a state, which is generated by the Associated field through an algorithm;

[0145] ReferenceState: Renders all states of the used resource (this field is a list).

[0146] After the game is running, the electronic device 6 automatically generates a temporary database to store data (resource usage information). The temporary database is designed as follows:

[0147] (1) State information table: The primary key is the state identifier, column 1 is the MD5 code of all used resources corresponding to the state, column 2 is the previous state of the state, and column 3 is the next state of the state. The same state is deduplicated;

[0148] (2) File information table: can store resource usage information of each used resource.

[0149] After exiting the game, the electronic device 6 will send the data stored in the temporary database to the computer device 2.

[0150] The above provides an example of an electronic device 6 collecting resource usage information. It should be noted that the computer device 2 will integrate the data reported by all electronic devices and form a resource usage information table (including deduplication and new additions).

[0151] Next, the computer device 2 determines the resource type of each used resource associated with the resource usage information according to the resource usage information (i.e., all resource usage information obtained from each electronic device 6). The resource type can be divided based on preset rules, such as static resources and dynamic resources.

[0152] Next, the computer device 2 divides the multiple used resources into multiple resource packages according to the resource types of the various used resources. Compared with the manual packaging or packaging based on folders in the prior art, in this embodiment, packaging is performed according to the resource types of the various used resources, which includes the following advantages:

[0153] (1) Automatic subcontracting based on resource type can avoid the following problems caused by manual subcontracting: If the project is redeveloped or the game program and engine are maintained by different people, the addition of new resources is prone to failure and trouble.

[0154] (2) Automatic subpackaging based on resource type can reduce device performance loss and avoid the following problems caused by manual subpackaging: different people have different subpackaging strategies, so there may be differences in rationality. Unreasonable subpackaging strategies will cause electronic devices to load many unnecessary resources when using resources, resulting in prolonged loading time and memory waste. It may even cause the game to freeze or crash when there is insufficient memory.

[0155] After analysis, it is found that there are some relatively fixed frames in the game process, such as the game lobby page. There are multiple activity pages under the game lobby, and the game lobby page and the multiple activity pages under it are parent-child relationships. A state corresponds to the used resources used to render a frame, so there is a corresponding relationship between the state and the frame.

[0156] As an optional embodiment, in order to improve management efficiency, the resource usage information includes multiple states; the multiple states are distributed in a tree structure, each state is a string of characters, and each string of characters maps the used resources associated with a frame when it is rendered.

[0157] As an optional embodiment, Figure 3 As shown, step S202 may include the following steps: step S300, analyzing the used resources mapped by multiple sub-states under the same parent state; step S302, determining the used resources mapped to each sub-state under the same parent state as static resources; step S304, determining other used resources mapped by the multiple states under the same parent state as dynamic resources, and the other used resources are the resources other than the static resources in the used resources mapped by the multiple sub-states. For example: the login interface, the login interface for each user to enter the game is the same. Enter the game hall through the login interface, and the avatars of each person in the game hall are different, so the game hall will correspond to multiple different states. Compare the used resources mapped by the states corresponding to each game hall, and obtain the resources that each user has in their respective game halls and the resources that may not be available: such as the hall background, avatar frame, avatar, etc. The used resources that all states corresponding to the game halls have are static resources, such as the hall background and avatar frame. The used resources that each user may not have in their respective game halls are dynamic resources (variable resources), for example, avatars. In this embodiment, the resource type of each used resource can be effectively identified.

[0158] As an optional embodiment, the plurality of used resources include a plurality of static resources and / or a plurality of dynamic resources. Figure 4As shown, step S204 may include the following steps: step S400, sub-packaging the multiple static resources to obtain multiple static resource packages in the multiple resource packages; and / or step S402, sub-packaging the multiple dynamic resources to obtain multiple dynamic resource packages in the multiple resource packages. The reuse rate of static resources is higher than that of dynamic resources. Based on the sub-packaging strategy of static resource packages and dynamic resource packages, the loading of useless resources in various states of game operation can be reasonably reduced.

[0159] As an optional embodiment, Figure 5 As shown, the method also includes: step S500, naming each static resource package according to a first naming rule; and / or step S502, naming each dynamic resource package according to a second naming rule; wherein the first naming rule and the second naming rule are different.

[0160] For example:

[0161] The first naming rule may be as follows:

[0162] Package name = static_+number (0…N), for example: static_0.unity3d, static_1.unity3d,…

[0163] The second naming rule may be as follows:

[0164] Package name = dynamic_+number (0…N), for example: dynamic_0.unity3d, dynamic_1.unity3d,…

[0165] In the above embodiment, different naming rules are used for static resource packages and dynamic resources, which is beneficial to the management of resource packages and can also be used to quickly select static resource packages in subsequent secondary subpackaging, resource addition, etc. It should be noted that the package name count of the static resource package and the package name count of the dynamic resource package are managed by a counter.

[0166] As an optional embodiment, Figure 6As shown, step S400 may include the following steps: step S600, obtaining a plurality of static resource combinations according to the plurality of static resources; step S602, determining a target static resource combination from the plurality of static resource combinations according to the performance consumption values ​​of the various static resource combinations; and step S604, dividing the plurality of static resources into the plurality of static resource packages according to the target static resource combination. In this embodiment, by analyzing the specific usage details of each used resource, a plurality of optimized static resource packages are obtained. That is, based on the performance consumption value of each used resource, the utilization rate of each static resource and static resource package is increased, and the time that each static resource is used as a useless resource during the game operation is shortened, thereby further reducing the loading of useless resources in various states of the game operation.

[0167] The performance consumption value, which can also be called "cost", refers to the cost that the electronic device 6 needs to pay for running the game.

[0168] The above embodiment arranges the possible static resource combinations of all static resources through horizontal analysis, calculates the final cost of each static resource combination, sorts the final costs, obtains the optimal subpackaging strategy based on the static resource combination with the minimum cost (i.e., the target static resource combination), and subpacks the multiple static resources based on the optimal subpackaging strategy to obtain the multiple static resource packages.

[0169] As an optional embodiment, in order to calculate more effective performance consumption values ​​of various static resource combinations, such as Figure 7 As shown, the steps for calculating the performance consumption values ​​of various static resource combinations may be as follows: Step S700, calculating the first performance consumption value of each static resource used alone; Step S702, calculating the second performance consumption value of each static resource used alone during game operation; Step S704, calculating the third performance consumption value of each static resource used in the corresponding resource package; Step S706, calculating the fourth performance consumption value of each static resource when loaded but not used; Step S708, calculating the performance consumption values ​​of the various static resource combinations based on the first performance consumption value, the second performance consumption value, the third performance consumption value and the fourth performance consumption value of each static resource.

[0170] 1) The first performance consumption value PRICE1 of each static resource used alone (i.e., the cost of each static resource used alone) can be calculated as follows:

[0171] PRICE1 = loading time * X + unloading time * Y + @;

[0172] 2) The second performance consumption value PRICE2 of each static resource used independently during the game running (that is, the code used independently during the entire running period of each static resource) can be calculated by the following formula:

[0173] PRICE2 = PRICE1 * the number of times the game is used during the entire game run;

[0174] 3) The third performance consumption value PRICE3 used by each static resource in the corresponding resource package (ie, the cost of each static resource used in the corresponding static resource package) may be calculated by the following formula:

[0175] PRICE3 = static resource package loading time * X + static resource package unloading time * Y + @;

[0176] 4) The fourth performance consumption value PRICE4 (resource retention cost, i.e., the cost of a static resource being loaded but not used) of each static resource when it is loaded but not used can be calculated by the following formula:

[0177] PRICE4 = Mem*W*N;

[0178] Variable explanation:

[0179] @: indicates the IO (input / output) performance loss when loading static resources, which can be set based on experience;

[0180] X: The cost ratio corresponding to the loading time;

[0181] Y: The cost ratio corresponding to the uninstallation time;

[0182] W: The cost ratio corresponding to memory usage;

[0183] N: Indicates the number of states in which a static resource is loaded into memory but not used.

[0184] As an optional embodiment, Figure 8As shown, step S400 may also include the following steps: step S800, according to the order of the states, the static resources mapped to the states are divided in sequence, and the resource combination obtained after each division is obtained according to the static resources of the current state and the resource combination after the adjacent previous divisions (each division is iterated on the basis of the results of the previous divisions); S802, the resource combination obtained after the last division is determined as the target static resource combination; and S804, according to the target static resource combination, the multiple static resources are divided into the multiple static resource packages. In this embodiment, through vertical analysis, all states are traversed to find the target static resource combination that is suitable for all states and is optimal overall, and multiple static resource packages are divided based on the optimal target static resource combination.

[0185] Compared with horizontal analysis, the vertical analysis takes into account the order of state flow, and continuously iterates the static resource combination through the flow order of each state, and takes the last iterated static resource combination as the target static resource combination. Since adjacent states usually have more common static resources, the vertical analysis can find the overall optimal target static resource combination, and based on this, multiple static resources can be subcontracted.

[0186] As an optional embodiment, Fig. 9 As shown, step S402 may include the following steps: step S900, dividing all dynamic resources of multiple sub-states under the same parent state into one or more dynamic resource packages. For example: all dynamic resources of multiple sub-states under the same parent state constitute a dynamic resource set. Dynamic resources in the same dynamic resource set are randomly packaged. For example, if there are 100 dynamic resources in a dynamic resource set, these 100 dynamic resources can be divided into multiple dynamic resource packages according to the preset maximum package limit. In this embodiment, the automatic and random package division of dynamic resources improves the package division efficiency.

[0187] After the first subpackaging of the plurality of static resources is completed, a plurality of static resource packages are obtained. The static resource packages generated by the first subpackaging may have a large package body or a large number of resources therein. When some static resources need to be updated, a relatively large update cost may be required. Therefore, the following embodiments are provided.

[0188] As an optional embodiment, Fig.10As shown, the method further includes: step S1000, calculating the performance consumption value required for updating each static resource package according to the size and the number of resources of each static resource package; step S1002, judging whether each static resource package meets the re-subpackaging standard according to the performance consumption value required for updating each static resource package; step S1004, selecting multiple target resource packages that meet the re-subpackaging standard from the multiple static resource packages; and step S1006, re-subpackaging the multiple target resource packages. In this embodiment, based on the update cost (the performance consumption value required for the update), it is judged whether to allocate part of the resources in each static resource package to a new empty package to ensure that each static resource package can realize resource update at a lower cost, thereby reducing the performance consumption of updating the static resource package.

[0189] For example:

[0190] The performance consumption value PRICE5 (ie, update cost) required to update each static resource package may be calculated as follows:

[0191] PRICE5 = total size of resources in the package * R + number of resources in the package * O;

[0192] If PRICE5 is greater than P, it is determined that the static resource package needs to be sub-packaged again.

[0193] Variable explanation:

[0194] R: indicates the impact of the package size on the update cost when calculating the update cost (a preset value);

[0195] O: indicates the impact of the number of resources in the package on the update cost when calculating the update cost (a preset value);

[0196] P: indicates the maximum update cost that can be tolerated (a preset value).

[0197] As an optional embodiment, Fig.11 As shown, step S1006 may include the following steps S11-S13, wherein: S11: sorting the multiple target resources in the multiple target resource packages; S12: adding an empty package, and dividing each target resource into the empty package according to the sorting of the multiple target resources, until the empty package is full; S13: adding the next empty package, and according to the sorting of the multiple target resources remaining in the previous division, dividing each target resource remaining in the previous division into the next sub-package, until the empty package is full; repeating S13 until the multiple target resources are sub-packaged again.

[0198] For example, there are a total of Z target resources in the multiple target resource packages:

[0199] After each target resource is added to the newly added empty package, it will be marked as having been included in the new package;

[0200] A1: Add an empty packet (referred to as the i-th new packet). The initial value of i is 1, and i is a natural number.

[0201] A2: Add the target resource with the largest volume among all the remaining target resources (ie, unmarked target resources) in the i-th new package, and mark the target resource as being included in the i-th new package.

[0202] A3: Check whether PRICE5 of the i-th new packet is greater than P.

[0203] If PRICE5 of the i-th new packet is not greater than P, return to step A2.

[0204] If PRICE5 of the i-th new packet is greater than P, the i-th new packet is full and the division is completed, i is incremented by 1, and the process returns to step A1.

[0205] When the Z target resources are all divided into corresponding new packages, it means that the Z target resources have completed re-packaging.

[0206] In an optional embodiment, in step S11, the sorting may be performed from large to small, or from small to large.

[0207] As an optional embodiment, Fig.12 As shown, the method further includes: step S1200, sub-packaging a plurality of unused resources, wherein the plurality of unused resources include a plurality of first-class unused resources that conform to a preset naming rule and a plurality of second-class unused resources that do not conform to the preset naming rule; step S1202, sub-packaging the plurality of first-class unused resources and the plurality of second-class unused resources respectively. In this embodiment, the plurality of unused resources are automatically sub-packed in different ways to improve the efficiency and accuracy of sub-packaging, which is particularly suitable for adding resources in the case of secondary development of a project or replacement of maintenance personnel.

[0208] As an optional embodiment, Fig.13 As shown, the step S1202 includes: step S1300, based on the preset naming rule, the plurality of first-category unused resources are packaged. For example:

[0209] The preset naming rule may be: dynamic_auto_xxx_yyy.zzz;

[0210] dynamic_auto_: indicates that the first type of unused resources are manually subcontracted resources;

[0211] xxx_: indicates the package name of the resource package corresponding to the first type of unused resources, such as task_;

[0212] yyy.zzz: indicates the specific resource name and suffix of the first type of unused resources, such as temp1.png and temp2.png;

[0213] For example: dynamic_auto_task_temp1.png, dynamic_auto_task_temp2.png will generate a new package: dynamic_auto_task.unity3d.

[0214] As an optional embodiment, Fig.14 As shown, the step S1202 includes: S21: sorting each second-class unused resource; S22: adding an empty package, and dividing each second-class unused resource into the empty package according to the sorting of the multiple second-class unused resources, until the empty package is full; S23: adding the next empty package, and dividing each second-class unused resource remaining in the previous division into the next sub-package according to the sorting of each second-class unused resource remaining in the previous division of the multiple second-class unused resources, until the sub-package is full; repeating S23 until the multiple second-class unused resources are sub-packaged. The sub-packaging of the second-class unused resources can be specifically referred to the re-packaging above, which will not be repeated in this article. In this embodiment, a new package is generated for the second-class unused resources based on the update cost rule, which can ensure that after each second-class unused resource is divided into the corresponding resource package, the subsequent resource update can be achieved at a lower cost, thereby reducing the update performance consumption of the newly added resource package.

[0215] As an optional embodiment, Fig.15As shown, if there are new resources, the method also includes: step S1500, obtaining multiple candidate resource packages associated with the new resources; step S1502, obtaining the number of associations between the new resources and each candidate resource package, and generating a sorting table, the order of each candidate resource package in the sorting list corresponds to the number of associations between each candidate resource package and the new resources; step S1504, according to the order of each candidate resource package, traversing each candidate resource package until a candidate resource package suitable for adding to the new resources is found or it is determined that each candidate resource package is not suitable for adding to the new resources; step S1506, if a candidate resource package suitable for adding to the new resources is found, the operation of adding the new resources is executed; step S1508, if it is determined that each candidate resource package is not suitable for adding to the new resources, the new resources are marked as independent resources, and the new resources marked as independent resources are subpackaged in the subpackage manner of unused resources. In this embodiment, under the premise that multiple resource packages already exist, when new resources appear, the new resources can be added to the most appropriate resource package based on the number of associations, etc., thereby shortening the time that the new resources are useless resources during the game operation, thereby minimizing the loading of useless resources in various states of the game operation.

[0216] As an optional embodiment, Fig.16 As shown, the step S1504 includes: step S1600, comparing the performance consumption value required for the new resource to be added to a specific candidate resource package and the performance consumption value required when the new resource is used alone, and determining whether the specific candidate resource package is suitable for adding the new resource based on the comparison result; wherein the specific candidate resource package is any one of the multiple candidate resource packages.

[0217] For example:

[0218] In specific applications, the following operations can be used for: subpackaging when new resources are added to subsequent versions after a version has been released online.

[0219] 1) Subpackaging based on the premise that the newly added resource has been used in the electronic device 6:

[0220] a. Find all resource packages associated with the newly added resource and sort them by the total number of associations;

[0221] b. Select the resource package B1 with the highest number of associations from the sorted list, add the newly added resource to B1, and remove B1 from the list;

[0222] c. Calculate the total cost (performance consumption value) of using the newly added resource in B1 and the total cost (performance consumption value) of using the newly added resource alone. If it is less than, add the newly added resource to B1 and process the next newly added resource. If it is not less than, return to step b.

[0223] d. If no suitable resource package is found by repeating steps b and c, mark the newly added resource as an independent resource;

[0224] e. After all new resources are processed, the new resources marked as independent resources are subcontracted as "unused resources". It should be noted that the subcontracting based on "unused resources" is detailed in Figure 12-14 and related content.

[0225] As an optional embodiment, Fig.17 As shown, the method also includes: step S1700, generating a resource lookup table, the resource lookup table is used to query the package name of the resource package corresponding to each resource; and / or step S1702, generating a resource record table, the resource record table is used to record the metadata information of the resource package generated last time.

[0226] 1) The resource lookup table: When a specific resource is needed during the game, the package name of the resource package corresponding to the resource can be obtained by querying the resource lookup table, for example: {"temp.png":"static_0.unity3d"}. Therefore, there is no need to manually uninstall the resource package and other associated resource packages.

[0227] 2) Resource record table: used to record the resources contained in each resource package and the current size of the package when the resource package was generated last time, such as: {"static_0.unity3d":{"list":["temp.png"],"size":10M}}.

[0228] As an optional embodiment, Fig.18 As shown, the method also includes: step S1800, detecting whether there are several resources with the same MD5 in the resource library; and step S1802, if there are several resources with the same MD5 in the resource library, generating a redundant resource warning. Client game development is basically cooperative development, and resources are managed by multiple people. If there is redundant resources, it will cause the resource package to increase and memory to waste. And if it is assumed that duplicate resources need to be modified, there is also a risk of missing the modification. In this embodiment, MD5 is used to determine whether there are redundant resources, so as to promptly eliminate the problems of bloated resource packages and memory waste caused by redundant resources.

[0229] As an optional embodiment, Fig.19As shown, the method further includes: step S1900, determining whether the MD5 corresponding to each resource in the resource library can be found in the resource usage information table; and step S1902, if the MD5 of at least some resources cannot be found in the resource usage information table, generating a useless resource warning. In this embodiment, by timely eliminating useless resources, the bloated resource package can be reduced and memory waste can be reduced. The resource usage information table integrates the resource usage information of each resource used by all electronic devices 6.

[0230] Fig. 20 A resource processing interface is provided, which includes the following controls: Generate resource package (such as AssetBundle package), detect redundant resources, and detect useless resources. The above controls can be triggered by clicking. Fig.21 and Fig. 22 A detection result display interface for redundant resources and useless resources is provided for easy viewing.

[0231] It should be noted that:

[0232] (1) Each of the optional solutions provided above may be implemented individually or in combination.

[0233] (2) The game engine can be Unity, and the corresponding resource package is an AssetBundle package.

[0234] (3) Used resources, which may refer to the resources used by the electronic device for rendering the game engine during the game process;

[0235] Unused resources may refer to resources that currently exist but have not yet been used by various game engines;

[0236] New resources may refer to resources that did not exist before but are added with the release of a new version of the game.

[0237] (4) This application can also provide resource loading and unloading interfaces to enable the game to run without difference in editor mode and release mode.

[0238] (5) Based on the automatic subpackaging of this application, client program development and resource management are decoupled. Client program developers only need to focus on function implementation and do not need to spend too much time considering how to store resources and other things that are not related to logic.

[0239] Embodiment 2

[0240] Fig.23A block diagram of a resource processing system according to Embodiment 2 of the present application is schematically shown. The resource processing system can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can perform specific functions. The following description will specifically introduce the functions of each program module in this embodiment.

[0241] like Fig.23 As shown, the resource processing system 2300 may include an acquisition module 2310, a determination module 2320 and a subpackaging module 2330, wherein:

[0242] An acquisition module 2310 is used to acquire resource usage information of a game engine, wherein the resource usage information is associated with a plurality of used resources;

[0243] A determination module 2320, configured to determine a resource type of each used resource according to the resource usage information;

[0244] The packaging module 2330 is used to divide the multiple used resources into multiple resource packages according to the resource type of each of the used resources.

[0245] As an optional embodiment, the resource usage information includes multiple states;

[0246] The multiple states are distributed in a tree structure, each state is a string of characters, and each string of characters maps used resources associated with a frame when it is rendered.

[0247] As an optional embodiment, the determining module 2320 is further configured to:

[0248] Analyze the used resources of multiple child state mappings under the same parent state;

[0249] Determine the used resources to which all child states under the same parent state are mapped as static resources;

[0250] Other used resources of the multiple state mappings under the same parent state are determined as dynamic resources, and the other used resources are resources other than the static resources among the used resources of the multiple child state mappings.

[0251] As an optional embodiment, the plurality of used resources include a plurality of static resources and / or a plurality of dynamic resources;

[0252] The sub-packaging module 2330 is further used for:

[0253] Sub-packaging the multiple static resources to obtain multiple static resource packages in the multiple resource packages; and / or

[0254] The multiple dynamic resources are packaged to obtain multiple dynamic resource packages in the multiple resource packages.

[0255] As an optional embodiment, the system further includes a naming module (not identified) for:

[0256] According to the first naming rule, each static resource package is named separately; and / or

[0257] According to the second naming rule, name each dynamic resource package separately;

[0258] The first naming rule and the second naming rule are different.

[0259] As an optional embodiment, the subpackaging module 2330 is further used for:

[0260] Acquire multiple static resource combinations according to the multiple static resources;

[0261] Determining a target static resource combination from the plurality of static resource combinations according to the performance consumption values ​​of the various static resource combinations; and

[0262] The multiple static resources are divided into the multiple static resource packages according to the target static resource combination.

[0263] As an optional embodiment, the subpackaging module 2330 is further used for:

[0264] Calculate the first performance consumption value of each static resource used individually;

[0265] Calculate a second performance consumption value of each static resource used individually during game execution;

[0266] Calculate a third performance consumption value used by each static resource in a corresponding resource package;

[0267] Calculating a fourth performance consumption value of each static resource when the static resource is loaded but not used;

[0268] The performance consumption values ​​of the various static resource combinations are calculated according to the first performance consumption value, the second performance consumption value, the third performance consumption value and the fourth performance consumption value of each static resource.

[0269] As an optional embodiment, the subpackaging module 2330 is further used for:

[0270] According to the order of the states, the static resources mapped by the states are divided in sequence, and the resource combination obtained after each division is obtained according to the static resources of the current state and the resource combinations after the adjacent previous divisions;

[0271] Determine the resource combination obtained after the last division as the target static resource combination; and

[0272] The multiple static resources are divided into the multiple static resource packages according to the target static resource combination.

[0273] As an optional embodiment, the subpackaging module 2330 is further used for:

[0274] Divide all dynamic resources of multiple child states under the same parent state into one or more dynamic resource bundles.

[0275] As an optional embodiment, the system further includes a repackaging module (not marked) for:

[0276] Calculate the performance consumption value required to update each static resource package according to the size and resource quantity of each static resource package;

[0277] According to the performance consumption value required for updating each static resource package, judging whether each static resource package meets the re-packaging standard;

[0278] Selecting a plurality of target resource packages that meet the re-packaging standard from the plurality of static resource packages; and

[0279] The multiple target resource packages are sub-packaged again.

[0280] As an optional embodiment, the system further includes a re-packaging module, further used for:

[0281] sorting the multiple target resources in the multiple target resource packages;

[0282] Adding an empty package, and dividing each target resource into the empty package according to the order of the multiple target resources, until the empty package is full;

[0283] Add the next empty package, and divide the remaining target resources in the previous division into the next sub-package according to the order of the multiple target resources in the previous division, until the empty package is full; repeat this operation until the target resource packages do not meet the re-sub-package standard.

[0284] As an optional embodiment, the subpackaging module 2330 is further used for:

[0285] Subpackaging a plurality of unused resources, wherein the plurality of unused resources include a plurality of first-category unused resources that comply with a preset naming rule and a plurality of second-category unused resources that do not comply with the preset naming rule;

[0286] The plurality of first-category unused resources and the plurality of second-category unused resources are respectively subpackaged.

[0287] As an optional embodiment, the subpackaging module 2330 is further used for:

[0288] Based on the preset naming rule, the plurality of first-category unused resources are subpackaged.

[0289] As an optional embodiment, the subpackaging module 2330 is further used for:

[0290] S21: sorting the second category unused resources;

[0291] S22: adding an empty package, and dividing each second-category unused resource into the empty package according to the order of the plurality of second-category unused resources, until the empty package is full;

[0292] S23: Add the next empty package, and according to the order of the multiple second-category unused resources remaining in the previous division, divide the multiple second-category unused resources remaining in the previous division into the next sub-package until the sub-package is full; repeat S23 until the multiple second-category unused resources have completed sub-packaging.

[0293] As an optional embodiment, the subpackaging module 2330 is further used for:

[0294] If there are new resources, perform the following operations:

[0295] Acquire multiple candidate resource packages associated with the newly added resource;

[0296] Obtaining the number of associations between the newly added resource and each candidate resource package, and generating a sorting table, wherein the order of each candidate resource package in the sorting table corresponds to the number of associations between each candidate resource package and the newly added resource;

[0297] According to the order of the resource packages to be selected, the resource packages to be selected are traversed until a resource package to be selected suitable for adding the newly added resource is found or it is determined that the resource packages to be selected are not suitable for adding the newly added resource;

[0298] If a candidate resource package suitable for adding the newly added resource is found, the operation of adding the newly added resource is performed;

[0299] If it is determined that none of the candidate resource packages are suitable for adding the newly added resource, the newly added resource is marked as an independent resource, and the newly added resource marked as an independent resource is subpackaged in the subpackage manner of unused resources.

[0300] As an optional embodiment, the subpackaging module 2330 is further used for:

[0301] Compare the performance consumption value required for adding the newly added resources to the specific candidate resource package with the performance consumption value required when the newly added resources are used alone, and determine whether the specific candidate resource package is suitable for adding the newly added resources based on the comparison result; wherein the specific candidate resource package is any one of the multiple candidate resource packages.

[0302] As an optional embodiment, the system further includes a generating module (not identified) for:

[0303] Generate a resource lookup table, the resource lookup table is used to query the package name of the resource package corresponding to each resource; and / or

[0304] Generate a resource record table, where the resource record table is used to record metadata information of the resource package generated last time.

[0305] As an optional embodiment, the system further includes a redundant resource detection module (not identified), which is used to:

[0306] Check whether there are several resources with the same MD5 in the resource library; and

[0307] If there are several resources with the same MD5 in the resource library, a redundant resource warning is generated.

[0308] As an optional embodiment, the system further includes a useless resource detection module (not identified), which is used to:

[0309] Determine whether the MD5 corresponding to each resource in the resource library can be found in the resource usage information table; and

[0310] If the MD5 of at least some resources cannot be found in the resource usage information table, a useless resource warning is generated.

[0311] Embodiment 3

[0312] Fig.24 The schematic diagram of the hardware architecture of a computer device 2 suitable for implementing the resource processing method according to the third embodiment of the present application is shown. In this embodiment, the computer device 2 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. For example, it can be a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers). Fig.24 As shown, the computer device 2 at least includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them:

[0313] The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 10010 can be an internal storage module of the computer device 2, such as a hard disk or memory of the computer device 2. In other embodiments, the memory 10010 can also be an external storage device of the computer device 2, such as a plug-in hard disk equipped on the computer device 2, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card (FlashCard), etc. Of course, the memory 10010 can also include both the internal storage module of the computer device 2 and its external storage device. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed on the computer device 2, such as the program code of the resource processing method, etc. In addition, the memory 10010 can also be used to temporarily store various types of data that have been output or are to be output.

[0314] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 10020 is generally used to control the overall operation of the computer device 2, such as performing control and processing related to data interaction or communication with the computer device 2. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.

[0315] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 2 and other computer devices. For example, the network interface 10030 is used to connect the computer device 2 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 2 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0316] It should be pointed out that Fig.24 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may be implemented instead.

[0317] In this embodiment, the resource processing method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (processor 10020 in this embodiment) to complete the embodiment of the present application.

[0318] Embodiment 4

[0319] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the resource processing method in the embodiment are implemented.

[0320] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card, etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the resource processing method in the embodiment, etc. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.

[0321] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0322] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A resource processing method, It is characterized in that The method comprises: Obtaining resource usage information of a game engine, wherein the resource usage information is associated with a plurality of used resources; Determining the resource type of each used resource according to the resource usage information; and Dividing the plurality of used resources into a plurality of resource packages according to resource types of the respective used resources; Wherein, the resource usage information includes multiple states; The multiple states are distributed in a tree structure, each state is a string of characters, and each string of characters maps the used resources associated with a frame when it is rendered; Wherein, determining the resource type of each used resource according to the resource usage information includes: Analyze the used resources of multiple child state mappings under the same parent state; Determine the used resources to which all child states under the same parent state are mapped as static resources; Other used resources of the multiple state mappings under the same parent state are determined as dynamic resources, and the other used resources are resources other than the static resources among the used resources of the multiple child state mappings.

2. The resource processing method according to claim 1, It is characterized in that The plurality of used resources include a plurality of static resources and / or a plurality of dynamic resources; The dividing the plurality of used resources into a plurality of resource packages according to the resource type of each of the used resources comprises: Sub-packaging the multiple static resources to obtain multiple static resource packages in the multiple resource packages; and / or The multiple dynamic resources are packaged to obtain multiple dynamic resource packages in the multiple resource packages.

3. The resource processing method according to claim 2, It is characterized in that Also includes: According to the first naming rule, name each static resource package separately; and / or According to the second naming rule, name each dynamic resource package separately; The first naming rule and the second naming rule are different.

4. The resource processing method according to claim 2, It is characterized in that The step of performing subpackaging processing on the multiple static resources to obtain multiple static resource packages in the multiple resource packages includes: Acquire multiple static resource combinations according to the multiple static resources; Determining a target static resource combination from the plurality of static resource combinations according to the performance consumption values ​​of the various static resource combinations; and The multiple static resources are divided into the multiple static resource packages according to the target static resource combination.

5. The resource processing method according to claim 4, It is characterized in that Also includes: Calculate the first performance consumption value of each static resource used individually; Calculate a second performance consumption value of each static resource used individually during game execution; Calculate a third performance consumption value used by each static resource in a corresponding resource package; Calculating a fourth performance consumption value of each static resource when the static resource is loaded but not used; The performance consumption values ​​of the various static resource combinations are calculated according to the first performance consumption value, the second performance consumption value, the third performance consumption value and the fourth performance consumption value of each static resource.

6. The resource processing method according to claim 3, It is characterized in that The step of performing subpackaging processing on the multiple static resources to obtain multiple static resource packages in the multiple resource packages includes: According to the order of the states, the static resources mapped by the states are divided in sequence, and the resource combination obtained after each division is obtained according to the static resources of the current state and the resource combinations after the adjacent previous divisions; Determine the resource combination obtained after the last division as the target static resource combination; and The multiple static resources are divided into the multiple static resource packages according to the target static resource combination.

7. The resource processing method according to claim 3, It is characterized in that The step of performing subpackaging processing on the multiple dynamic resources to obtain multiple dynamic resource packages in the multiple resource packages includes: Divide all dynamic resources of multiple child states under the same parent state into one or more dynamic resource bundles.

8. The resource processing method according to any one of claims 3 to 6, It is characterized in that Also includes: Calculate the performance consumption value required to update each static resource package according to the size and resource quantity of each static resource package; According to the performance consumption value required for updating each static resource package, judging whether each static resource package meets the re-packaging standard; Selecting a plurality of target resource packages that meet the re-packaging standard from the plurality of static resource packages; and The multiple target resource packages are sub-packaged again.

9. The resource processing method according to claim 8, It is characterized in that The repackaging of the multiple target resource packages comprises: sorting the multiple target resources in the multiple target resource packages; Adding an empty package, and dividing each target resource into the empty package according to the order of the multiple target resources, until the empty package is full; Add the next empty package, and divide the remaining target resources in the previous division into the next sub-package according to the order of the multiple target resources in the previous division, until the empty package is full; repeat this operation until the target resource packages do not meet the re-sub-package standard.

10. The resource processing method according to any one of claims 1 to 7, It is characterized in that Also includes: Subpackaging a plurality of unused resources, wherein the plurality of unused resources include a plurality of first-category unused resources that comply with a preset naming rule and a plurality of second-category unused resources that do not comply with the preset naming rule; The plurality of first-category unused resources and the plurality of second-category unused resources are respectively subpackaged.

11. The resource processing method according to any one of claims 1 to 7, It is characterized in that Also includes: If there are new resources, perform the following operations: Acquire multiple candidate resource packages associated with the newly added resource; Obtaining the number of associations between the newly added resource and each candidate resource package, and generating a sorting table, wherein the order of each candidate resource package in the sorting table corresponds to the number of associations between each candidate resource package and the newly added resource; According to the order of the resource packages to be selected, the resource packages to be selected are traversed until a resource package to be selected suitable for adding the newly added resource is found or it is determined that the resource packages to be selected are not suitable for adding the newly added resource; If a candidate resource package suitable for adding the newly added resource is found, the operation of adding the newly added resource is performed; If it is determined that none of the candidate resource packages are suitable for adding the newly added resource, the newly added resource is marked as an independent resource, and the newly added resource marked as an independent resource is subpackaged in the subpackage manner of unused resources.

12. The resource processing method according to any one of claims 1 to 7, It is characterized in that Also includes: Generate a resource lookup table, where the resource lookup table is used to query the package name of the resource package corresponding to each resource; and / or Generate a resource record table, where the resource record table is used to record metadata information of the resource package generated last time.

13. The resource processing method according to any one of claims 1 to 7, It is characterized in that Also includes: Check whether there are several resources with the same MD5 in the resource library; and If there are several resources with the same MD5 in the resource library, a redundant resource warning is generated.

14. The resource processing method according to any one of claims 1 to 7, It is characterized in that Also includes: Determine whether the MD5 corresponding to each resource in the resource library can be found in the resource usage information table; and If the MD5 of at least some resources cannot be found in the resource usage information table, a useless resource warning is generated.

15. A resource processing system, It is characterized in that The system comprises: An acquisition module, used to acquire resource usage information of a game engine, wherein the resource usage information is associated with a plurality of used resources; A determination module, used to determine the resource type of each used resource according to the resource usage information; A subpackaging module, configured to divide the plurality of used resources into a plurality of resource packages according to resource types of the respective used resources; Wherein, the resource usage information includes multiple states; The multiple states are distributed in a tree structure, each state is a string of characters, and each string of characters maps the used resources associated with a frame when it is rendered; Wherein, determining the resource type of each used resource according to the resource usage information includes: Analyze the used resources of multiple child state mappings under the same parent state; Determine the used resources to which all child states under the same parent state are mapped as static resources; Other used resources of the multiple state mappings under the same parent state are determined as dynamic resources, and the other used resources are resources other than the static resources among the used resources of the multiple child state mappings.

16. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, it is used to implement the steps of the resource processing method described in any one of claims 1 to 14.

17. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and the computer program can be executed by at least one processor so that the at least one processor executes the steps of the resource processing method described in any one of claims 1 to 14.

18. A computer program product comprising computer instructions, It is characterized in that When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 14 are implemented.

Citation Information

Patent Citations

  • Resource packaging method and device, server and storage medium

    CN110908697A

  • Resource packaging method and device, server and storage medium

    CN110908707A

  • Resource processing method and device

    CN113076185A