Method for managing assestbundle resources based on table and related device
By using a table to manage AssestBundle resources, the system automatically updates resource names and monitors configuration information in real time, solving the problem of high resource management costs in Unity projects and improving development efficiency and classification accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEWBORN-TOWN NETWORK TECH (BEIJING) CO LTD
- Filing Date
- 2022-07-01
- Publication Date
- 2026-06-23
AI Technical Summary
In Unity project development, resource management costs are high, especially the tedious work of classifying, naming and maintaining AssetBundle resources, which leads to low development efficiency.
By managing AssestBundle resources based on tables, the system detects changes in configuration information and automatically updates resource names. It uses the C# class library FileSystemWatcher for real-time monitoring and combines different packaging methods and default/custom naming rules to reduce manual maintenance work.
It improves the efficiency of resource management, reduces the maintenance costs for R&D personnel, and enables flexible and accurate classification and efficient updating of AssetBundle resources.
Smart Images

Figure CN115357545B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resource management, and more particularly to a method for managing AssestBundle resources based on tables. Background Technology
[0002] AssetBundle is a compressed resource package that uses a compression format provided by Unity to store resources. It can store any resource that Unity can recognize, such as models, textures, audio, scenes, and other resources.
[0003] In Unity project development, resources typically need to be categorized and compressed according to AssetBundle format to ensure proper loading and operation on devices. Therefore, managing the categorization and naming of all project resources through AssetBundles is essential throughout the entire development process. The sheer volume and complexity of resources in daily projects necessitate maintaining AssetBundle categorization and naming for all newly added, modified, and structurally altered resources, resulting in significant costs for developers. Summary of the Invention
[0004] In view of this, the purpose of this application is to propose a method and related equipment for managing AssestBundle resources based on tables.
[0005] To achieve the above objectives, this application provides a method for managing AssestBundle resources based on tables, including:
[0006] In response to a detected change in the configuration information of the AssestBundle resource in the management table, the name of the AssestBundle resource is updated, wherein...
[0007] The configuration information for the AssestBundle resource is pre-entered into the management table.
[0008] Optionally, the configuration information includes: path, packaging method, and rename name.
[0009] Optionally, the packaging method includes:
[0010] The first type of packaging method: packaging the files or directories at the specified path;
[0011] The second type of packaging method: Package each first-level file in the directory of the specified path;
[0012] The third packaging method: Package each first-level folder under the directory of the specified path;
[0013] The fourth packaging method: Package each first-level file and folder in the directory of the specified path.
[0014] Optionally, updating the name of the AssestBundle resource includes:
[0015] In response to determining that the renamed name is the default name, the name of the AssestBundle resource is updated to the default name.
[0016] Optionally, the default name is set according to the path.
[0017] Optionally, the method for managing AssestBundle resources based on tables further includes:
[0018] In response to the packaging method being the first type of packaging method, the renamed name is set to the default name or a custom name;
[0019] In response to the packaging method being the second type of packaging method, the third type of packaging method, or the fourth type of packaging method, the renamed name is set to the default name.
[0020] Optionally, the method for managing AssestBundle resources based on tables further includes:
[0021] The configuration information of the AssestBundle resource in the management table is detected using the FileSystemWatcher class in the C# class library.
[0022] Based on the same inventive concept, this application also provides an apparatus for managing AssestBundle resources based on a table, comprising:
[0023] The update module is configured to update the name of the AssestBundle resource in response to detecting a change in the configuration information of the AssestBundle resource in the management table, wherein the configuration information of the AssestBundle resource is pre-entered into the management table.
[0024] Based on the same inventive concept, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described above when executing the computer program.
[0025] Based on the same inventive concept, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing a computer to perform the method described above.
[0026] As can be seen from the above, the method and related equipment for managing AssetBundle resources based on tables provided in this application can detect the configuration information of AssetBundle resources in the management table, and update the names of AssetBundle resources in a timely and accurate manner for the addition, deletion and modification of AssetBundle resources, thereby saving game developers unnecessary maintenance costs and improving development efficiency. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A flowchart illustrating a table-based method for managing AssestBundle resources according to an embodiment of this application;
[0029] Figure 2 This is a schematic diagram of the device structure for managing AssestBundle resources based on a table, according to an embodiment of this application.
[0030] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0032] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0033] The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0034] refer to Figure 1 This application provides a method for managing AssestBundle resources based on tables, including:
[0035] Step S101: In response to detecting a change in the configuration information of the AssestBundle resource in the management table, update the name of the AssestBundle resource, wherein the configuration information of the AssestBundle resource is pre-entered into the management table.
[0036] Specifically, during the development process, developers categorize and name the created AssestBundle resources and enter them into a management table. When an AssestBundle resource changes, this method can automatically update its name based on the configuration information recorded in the table. This eliminates the need for developers to spend a lot of time maintaining AssestBundle resources due to frequent modifications, greatly improving development efficiency.
[0037] Table 1 Management Form
[0038]
[0039] In some embodiments, referring to Table 1, the configuration information includes: path, packaging method, and rename name.
[0040] Specifically, the path is a string that provides the location of a file or directory. The path does not necessarily point to a location on disk; it may map to a location in memory or on the device. The exact format of the path is determined by the current platform. For example, in this embodiment, Path could be Android, or it could be Assets / Framework / ThirdLibs / Spine / icon-null.png.
[0041] Among them, the packaging method (PackageMeasureType) represents different ways to package and compress project resources into AssestBundle format. In this embodiment, the packaging methods mainly include four types, which are represented by Arabic numerals 0-3 in the management table.
[0042] The Rename option allows you to customize the name of the packaged AssestBundle.
[0043] In some embodiments, the packaging method includes:
[0044] The first type of packaging method: packaging the files or directories at the specified path;
[0045] The second type of packaging method: Package each first-level file in the directory of the specified path;
[0046] The third packaging method: Package each first-level folder under the directory of the specified path;
[0047] The fourth packaging method: Package each first-level file and folder in the directory of the specified path.
[0048] Specifically, the first type of packaging method (0) is to package the entire path file or directory into an AssestBundle package; the second type of packaging method (1) is to package each first-level file in the path directory into an AssestBundle package; the third type of packaging method (2) is to package each first-level folder in the path directory into an AssestBundle package; and the fourth type of packaging method (3) is to package each first-level file and folder in the path directory into an AssestBundle package.
[0049] By setting different packaging methods, different packaging methods can be selected according to development needs, which improves the convenience of development and management.
[0050] In some embodiments, referring to Table 1, updating the name of the AssestBundle resource includes:
[0051] In response to determining that the renamed name is the default name, the name of the AssestBundle resource is updated to the default name.
[0052] Specifically, when the renamed name is a blank cell in the management table, it means that the name of the AssestBundle resource is named using the default name.
[0053] In some embodiments, the default name is set based on the path.
[0054] Specifically, the default naming convention uses @ to distinguish the levels of the path directory and changes the directory identifier name to lowercase. For example, when the path where the AssetBundle resource is located is Assets / Game / Fonts, its default name is assets@game@fonts.
[0055] The directory hierarchy of the path serves a certain function of project classification. Therefore, setting the default name according to the path reduces the workload of developers and makes the name clearer and easier to read.
[0056] In some embodiments, the method includes: in response to the packaging method being the first type of packaging method, setting the rename name to the default name or a custom name;
[0057] In response to the packaging method being the second type of packaging method, the third type of packaging method, or the fourth type of packaging method, the renamed name is set to the default name.
[0058] Specifically, when the AssestBundle resource is packaged using the first type of packaging method, that is, when the path file or directory is packaged as a separate AssestBundle, the name of the AssestBundle resource can be customized and entered into the management table. When the AssestBundle resource changes subsequently, the name of the AssestBundle resource will not be updated. When the name is not customized, the Rename column in the management table will be blank and the default name will be used. When the AssestBundle resource changes, its name will be updated.
[0059] When the AssestBundle resource is packaged using the second, third, or fourth type of packaging method, custom names are not supported, and the default name will be used for renaming.
[0060] By using the above naming rules, the resources of the AssestBundle can be classified more flexibly and accurately when the entire path directory is packaged separately as an AssestBundle.
[0061] In some embodiments, the method includes: using the FileSystemWatcher class in the C# class library to perform the detection on the configuration information of the AssestBundle resource in the management table.
[0062] Specifically, C# provides a file monitoring class (FileSystemWatcher), which defines several file operation events. These events are triggered when a file operation is performed. By subscribing to these events and adding corresponding handlers, file monitoring can be achieved. These events can be Changed, Created, Deleted, etc., and the directory or file to be monitored can be set via Path.
[0063] The FileSystemWatcher class allows for real-time monitoring of AssetBundle resources, enabling timely updates to their names when changes occur.
[0064] In some embodiments, referring to Table 1, the management table further includes: resource group name (GroupName) and whether it is an incremental group (IsIncreaserGroup).
[0065] The resource group name is the name of the group in which the AssestBundle resource belongs. Resources with the same usage scenario are generally grouped under the same group name.
[0066] Whether it is an incremental group is a classification of the update method of the AssestBundle resource. It is used to determine whether the group to which the AssestBundle resource belongs belongs to the incremental update group. In the management table, false means not belonging and true means belonging.
[0067] When it does not belong to the incremental update group, the AssestBundle resource will be placed in the game package. After the user downloads the game package and installs it, the AssestBundle resource will be loaded.
[0068] When it belongs to the incremental update group, the AssestBundle resources will be downloaded incrementally from the server via the Content Delivery Network (CDN) through hot update, without having to download the game package again.
[0069] It should be noted that AssestBundle resources with the same resource group belong to the same incremental update group.
[0070] In some embodiments, the method includes updating the AssetBundle resource name by assigning a value to the assetBundleName field of the resource importer in Unity.
[0071] The resource importer is AssetImporter.
[0072] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0073] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0074] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides an apparatus for managing AssestBundle resources based on a table.
[0075] refer to Figure 2 The apparatus for managing AssestBundle resources based on tables includes:
[0076] The update module 201 is configured to update the name of the AssestBundle resource in response to detecting a change in the configuration information of the AssestBundle resource in the management table, wherein the configuration information of the AssestBundle resource is pre-entered into the management table.
[0077] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0078] The apparatus described above is used to implement the corresponding table-based method for managing AssestBundle resources in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0079] In some embodiments, the configuration information includes: path, packaging method, and rename name.
[0080] In some embodiments, the packaging method includes:
[0081] The first type of packaging method: packaging the files or directories at the specified path;
[0082] The second type of packaging method: Package each first-level file in the directory of the specified path;
[0083] The third packaging method: Package each first-level folder under the directory of the specified path;
[0084] The fourth packaging method: Package each first-level file and folder in the directory of the specified path.
[0085] In some embodiments, the update module 201 is further configured to:
[0086] In response to determining that the renamed name is the default name, the name of the AssestBundle resource is updated to the default name.
[0087] In some embodiments, the default name is set based on the path.
[0088] In some embodiments, it further includes:
[0089] In response to the packaging method being the first type of packaging method, the renamed name is set to the default name or a custom name;
[0090] In response to the packaging method being the second type of packaging method, the third type of packaging method, or the fourth type of packaging method, the renamed name is set to the default name.
[0091] In some embodiments, it also includes:
[0092] The configuration information of the AssestBundle resource in the management table is detected using the FileSystemWatcher class in the C# class library.
[0093] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the table-based AssestBundle resource management method described in any of the above embodiments.
[0094] Figure 3This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0095] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0096] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0097] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0098] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0099] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0100] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0101] The electronic devices described above are used to implement the corresponding table-based method for managing AssestBundle resources in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0102] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the table-based AssestBundle resource management method as described in any of the above embodiments.
[0103] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0104] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the table-based method for managing AssestBundle resources as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0105] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0106] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0107] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0108] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A method for managing AssestBundle resources based on tables, characterized in that, include: In response to a detected change in the configuration information of the AssestBundle resource in the management table, the name of the AssestBundle resource is updated, wherein... The configuration information of the AssestBundle resource is pre-entered into the management table; The configuration information of the AssestBundle resource in the management table is detected using the file monitoring class. The management table also includes the resource group name and whether it is an incremental group. If the AssestBundle resource does not belong to the incremental update group, the AssestBundle resource is placed in the game package. If the AssestBundle resource belongs to the incremental update group, the AssestBundle resource is incrementally downloaded from the server via the content delivery network through hot update.
2. The method according to claim 1, characterized in that, The configuration information includes: Path, packaging method, and rename.
3. The method according to claim 2, characterized in that, The packaging method includes: The first type of packaging method: packaging the files or directories at the specified path; The second type of packaging method: Package each first-level file in the directory of the specified path; The third packaging method: Package each first-level folder under the directory of the specified path; The fourth packaging method: Package each first-level file and folder in the directory of the specified path.
4. The method according to claim 3, characterized in that, The step of updating the name of the AssestBundle resource includes: In response to determining that the renamed name is the default name, the name of the AssestBundle resource is updated to the default name.
5. The method according to claim 4, characterized in that, The default name is set according to the path.
6. The method according to claim 4, characterized in that, Also includes: In response to the packaging method being the first type of packaging method, the renamed name is set to the default name or a custom name; In response to the packaging method being the second type of packaging method, the third type of packaging method, or the fourth type of packaging method, the renamed name is set to the default name.
7. The method according to claim 1, characterized in that, Also includes: The configuration information of the AssestBundle resource in the management table is detected using the FileSystemWatcher class in the C# class library.
8. A device for managing AssestBundle resources based on tables, characterized in that, include: The update module is configured to update the name of the AssestBundle resource in response to detecting a change in the configuration information of the AssestBundle resource in the management table, wherein the configuration information of the AssestBundle resource is pre-entered into the management table; The configuration information of the AssestBundle resource in the management table is detected using the file monitoring class. The management table also includes the resource group name and whether it is an incremental group. If the AssestBundle resource does not belong to the incremental update group, the AssestBundle resource is placed in the game package. If the AssestBundle resource belongs to the incremental update group, the AssestBundle resource is incrementally downloaded from the server via the content delivery network through hot update.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method described in any one of claims 1 to 7.