Resource processing method and related equipment

By storing resource attribute information and change information in the database, the problem of inefficient update of resource reference relationships in super-large-scale engineering projects is solved, and the rapid maintenance of resource dependencies and efficient loading of engineering projects is achieved.

CN120030023APending Publication Date: 2025-05-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311568059.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In hyper-large-scale engineering projects, the update of resource reference relationships is not efficient enough, resulting in insufficient maintenance capabilities.

Method used

By storing resource attribute information and change information in the database, quickly update resource reference relationships. The specific steps include determining the target resources in the project, updating their resource attribute information, and updating the resource reference relationship based on these updated information.

Benefits of technology

It improves the efficiency of updating resource reference relationships, ensures the correct maintenance of resource dependencies, and reduces the loading time and editing time of engineering projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030023A_ABST
    Figure CN120030023A_ABST
Patent Text Reader

Abstract

The invention discloses a resource processing method and related equipment, and the method comprises the steps: determining an engineering project in a resource management engine, and enabling a plurality of resources in the engineering project to have a resource reference relationship; the resource management engine corresponds to a database, and the database comprises a first storage area and a second storage area; in response to an update request for the engineering project, reading resource change information of the engineering project from the first storage area, and determining a changed target resource in the engineering project according to the read resource change information; updating the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area; and furthermore, the resource reference relationship among the plurality of resources can be updated based on the updated resource attribute information. According to the method and the device, the resource attribute information can be quickly updated by means of the database, so that the resource reference relationship is efficiently updated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] During the development of an application, the non-code resources required by the application can be created and managed with the help of a resource management engine. These resources can usually be organized in a project related to the application, and the resources in the project can be managed (including but not limited to: adding, modifying, deleting, etc.). For example, for a game application, a resource management engine (such as the Unity engine, a 3D real-time interactive graphics creation platform commonly used to make games) can be used to create and manage various non-code resources required to run the game application in the game project, such as: textures, materials, models, and scenes.

[0003] In order to better organize resources, two resources in a project may have a resource reference relationship (i.e., a relationship in which a resource is referenced by another resource, also known as a reverse dependency relationship), and in actual applications, resource reference relationships are frequently searched and used. However, based on the resource management engine's own mechanism, the resource management engine currently lacks the ability to maintain resource reference relationships. In ultra-large-scale projects, the update of resource reference relationships is not efficient enough, so a mechanism needs to be designed to quickly update resource reference relationships. Summary of the invention

[0004] The embodiment of the present application provides a resource processing method and related equipment, which can quickly update resource attribute information with the help of a database, thereby efficiently updating resource reference relationships.

[0005] On the one hand, an embodiment of the present application provides a resource processing method, the method comprising:

[0006] Determine a project in a resource management engine, wherein the project includes multiple resources, and the multiple resources have a resource reference relationship; the resource management engine corresponds to a database, and the database includes a first storage area and a second storage area; the first storage area is used to store resource change information generated each time a resource change is made in the project, and the second storage area is used to store resource attribute information of each resource in the project;

[0007] In response to an update request for a project, resource change information of the project is read from the first storage area, and a target resource that has been changed in the project is determined according to the read resource change information;

[0008] Updating the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area;

[0009] The updated resource attribute information is read from the second storage area, and based on the updated resource attribute information, the resource reference relationship between the multiple resources is updated.

[0010] On the one hand, an embodiment of the present application provides a resource processing device, the device comprising:

[0011] A determination unit is used to determine a project in a resource management engine, wherein the project includes multiple resources, and the multiple resources have a resource reference relationship; the resource management engine corresponds to a database, and the database includes a first storage area and a second storage area; the first storage area is used to store resource change information generated each time a resource change is made in the project, and the second storage area is used to store resource attribute information of each resource in the project;

[0012] A processing unit, configured to read resource change information of the project from the first storage area in response to an update request for the project, and determine a target resource that has been changed in the project according to the read resource change information;

[0013] The processing unit is further used to update the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area;

[0014] The processing unit is further used to read the updated resource attribute information from the second storage area, and based on the updated resource attribute information, update the resource reference relationship between the multiple resources.

[0015] In one aspect, an embodiment of the present application provides a computer device, the computer device comprising:

[0016] a processor suitable for executing a computer program;

[0017] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the resource processing method described above is implemented.

[0018] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded by a processor and executes the resource processing method as described above.

[0019] Accordingly, an embodiment of the present application provides a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions implement the above-mentioned resource processing method when executed by a processor.

[0020] In an embodiment of the present application, a project in a resource management engine can be determined, the project includes multiple resources, and there is a resource reference relationship between the multiple resources; the resource management engine corresponds to a database, the database includes a first storage area and a second storage area, the first storage area is used to store the resource change information generated by the project each time the resource is changed; the second storage area is used to store the resource attribute information of each resource in the project; after that, in response to an update request for the project, the resource change information of the project can be read from the first storage area, and according to the read resource change information, the target resource that has been changed in the project is determined, and then the resource attribute information of the target resource is updated in the second storage area to update the resource attribute information stored in the second storage area. In this process, relying on the efficient read and write performance of the database, the resource change information for updating can be quickly obtained from the first storage area of ​​the database, and then the resource attribute information in the second storage area can be updated at a high speed, so that the resource attribute information stored in the second storage area is consistent with the resource attribute information of each resource after the project changes the resource. Furthermore, if the project has undergone multiple resource changes, the accumulated resource change information is stored in the first storage area, and the resource attribute information in the second storage area can be updated in place at one time through the current update request, and the time cost and calculation cost are relatively low. Afterwards, the updated resource attribute information can be read from the second storage area, and based on the updated resource attribute information, the resource reference relationship between multiple resources can be updated. On the one hand, based on the resource attribute information that is consistent with the project, the resource reference relationship can be correctly updated so that the correct resource reference information can be found based on the resource reference relationship; on the other hand, since the resource attribute information (including resource dependencies) stored in the database may be accessed multiple times and frequently, compared to obtaining the relevant resource attribute information through the engine interface, obtaining the resource attribute information from the database has a faster speed, so that the resource reference relationship can be quickly updated. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0022] Figure 1a is a schematic diagram of resource dependency provided by an exemplary embodiment of the present application;

[0023] Figure 1bIt is a schematic diagram of a resource reference provided by an exemplary embodiment of the present application;

[0024] Figure 1c is an architecture diagram of a resource processing system provided by an exemplary embodiment of the present application;

[0025] Figure 2 It is a flowchart of a resource processing method provided by an exemplary embodiment of the present application;

[0026] Figure 3 is a schematic diagram of resource change information stored in a database provided by an exemplary embodiment of the present application;

[0027] Figure 4 is a flowchart of another resource processing method provided by an exemplary embodiment of the present application;

[0028] Figure 5a It is a progress diagram of a full resource scan provided by an exemplary embodiment of the present application;

[0029] Figure 5b It is a content schematic diagram of storing resource attribute information and establishing resource reference relationship provided by an exemplary embodiment of the present application;

[0030] Figure 5c It is a flowchart of updating a reference relationship management container provided by an exemplary embodiment of the present application;

[0031] Figure 5d It is a schematic diagram of another process of updating a reference relationship management container provided by an exemplary embodiment of the present application;

[0032] Figure 5e is a schematic diagram of another updating reference relationship management container provided by an exemplary embodiment of the present application;

[0033] Figure 6 is a flowchart of another resource processing method provided by an exemplary embodiment of the present application;

[0034] Figure 7a It is a schematic diagram of a format of a packaged log provided by an exemplary embodiment of the present application;

[0035] Figure 7b It is a schematic diagram of specifying to load a certain resource in a code or configuration file provided by an exemplary embodiment of the present application;

[0036] Figure 7c It is a flowchart of useless resource identification provided by an exemplary embodiment of the present application;

[0037] Figure 7dIt is a conditional schematic diagram of a useless resource provided by an exemplary embodiment of the present application;

[0038] Figure 8 is a structural schematic diagram of a resource processing device provided by an exemplary embodiment of the present application;

[0039] Fig. 9 It is a structural diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] The present application proposes a resource processing method, which is based on an update request for an engineering project in a resource management engine, and can quickly update the resource reference relationship of multiple resources in the engineering project in the resource management engine with the help of data stored in the database corresponding to the resource management engine. Specifically, the resource change information of the engineering project can be read from the first storage area included in the database, and the target resource that has been changed can be determined based on the resource change information, so that the resource attribute information of the target resource can be updated in the second storage area. In this process, the resource attribute information stored in the second storage area can be updated based on the resource change information, so that the resource attribute information stored in the second storage area is consistent with the resource attribute information of the engineering project after the resource change. In addition, it is not necessary to scan all resources for the engineering project in full, but to scan the target resources that have been changed and then quickly update the relevant resource attribute information in the second storage area, thereby improving the update efficiency of the resource attribute information; further, the updated resource attribute information can be read from the second storage of the database, and the resource reference relationship can be updated based on the updated resource attribute information. It can be seen that by storing resource attribute information in a high-performance database, there is no need to obtain resource attribute information through the interface provided by the resource management engine (referred to as the engine interface). Instead, resource attribute information consistent with the project can be quickly obtained directly from the database, thereby correctly and quickly updating the resource reference relationship and realizing the maintenance of the resource reference relationship.

[0042] The resource processing solution provided by this application is a mechanism that can quickly update resource reference relationships, which can more efficiently update resource reference relationships and resource dependencies for ultra-large-scale engineering projects. Based on the correct and efficient maintenance of resource reference relationships, it is convenient for developers and artists to quickly grasp the correct resource reference situation, so that based on the resource reference relationship, resources in large-scale engineering projects can be optimized, the resource scale of engineering projects can be controlled, and the volume of engineering projects can be effectively reduced, so that the optimized engineering projects can be loaded into the resource management engine more quickly, speeding up the opening and editing time of engineering projects.

[0043] The resource management engine mentioned in this application is an engine for managing various resources of a certain engineering project. For example, the resource management engine is the Unity engine, which is a 3D real-time interactive graphics creation platform that can be used to make games. In the Unity engine, an object can carry / mount multiple components or functions, including executing logic, physical calculations, model rendering, network processing, etc. In this application, objects specifically refer to all types of assets or resources in Unity. Therefore, the "objects" and "resources" mentioned in this application can also be regarded as another way of expressing objects.

[0044] A project is a project used to create and develop applications, and may also be referred to as a project or project in this application. The project can be understood as a folder containing all resources, code, and settings, and the contents of the folder are used to create and develop applications. The project can be loaded into a resource management engine, and the project can be edited in the resource management engine, including but not limited to: adding resources, deleting resources, and modifying resources. A project may include multiple resources, which specifically refer to non-code resources. For example, the project of a game application includes various resources such as scenes, materials, textures, models, audio, and animation. These resources can exist in the form of an asset bundle (Asset Bundle, or asset bundle), which can be understood as an archive file that can contain platform-specific non-code resources (such as models, textures, prefabs, audio clips, and even entire scenes) loaded by a resource management engine (such as the Unity engine) at runtime. Resource bundles can express dependencies between each other; for example, a material in one resource bundle can reference a texture in another resource bundle. In order to deliver efficiently over the network, a built-in algorithm can be used to select compressed resource bundles. Code and configuration files can also be included in the project, and some non-code resources can also be referenced in the code or configuration files. It can be seen that through engineering projects, developers can manage and organize all resources, and develop, test and deploy in the editor provided by the resource management engine. It should be noted that the term "multiple" in this application means two or more; for example: the above-mentioned multiple resources refer to two or more resources.

[0045] In this application, the multiple resources included in the project have a resource reference relationship. The resource reference relationship refers to the relationship between a resource being referenced by other resources, which can also be called a reverse dependency relationship. A resource can be referenced by one or more resources. For example, Figure 1a The texture resource gamesuggest.png shown is referenced by five resources (including three scene resources.unity and two prefab resources.prefab). Texture resources are image resources, and prefab resources refer to all components used to create and store a game object. Simply put, it means assembling and splicing some modules into objects that you need and can be reused. Therefore, there is a resource reference relationship between the texture resource gamesuggest.png and these five resources. Based on the resource reference relationship, if the texture resource gamesuggest.png is deleted, these scenes and prefabs will report an error, indicating that the required texture is missing.

[0046] Correspondingly, two resources with a resource reference relationship also have a resource dependency relationship. A resource dependency relationship refers to a relationship in which a resource depends on other resources; for example: Figure 1aThe texture resource gamesuggest.png in is referenced by the scene resource game_entry.unity, so it can be known that the resources that the scene resource game_entry.unity depends on at least include the texture resource gamesuggest.png, that is, there is a resource dependency relationship between the scene resource game_entry.unity and the texture resource gamesuggest.png. Other resources that a resource depends on refer to the related resources that the resource needs to call when it is used; a resource can depend on one or more resources. For example: Figure 1b As shown in the resource dependency relationship, a certain resource card_num_font.mat depends on two resources to work properly. These two resources are the resource UI-Default.shader and the resource card_numfont.png. If one or both of these two resources are lost, the resource card_num_font.mat will have problems.

[0047] Therefore, resource dependency and resource reference relationships exist between two resources at the same time, such as the above Figure 1b In the example, the resource card_num_font.mat depends on the resource UI-Default.shader. From the perspective of the resource UI-Default.shader, the resource UI-Default.shader is referenced by the resource card_num_font.mat. That is, there is a resource dependency relationship and a resource reference relationship between the resource card_num_font.mat and the resource UI-Default.shader. For a resource, a resource may be referenced by other resources but not dependent on other resources; or a resource may depend on other resources but not referenced by other resources. For example: the scene resource game_entry.unity depends on the map resource gamesuggest.png, but the scene resource game_entry.unity is not referenced by other resources. In one implementation, in a resource management engine (such as the Unity engine), resource dependencies can be managed and packaged through asset bundles (AssetBundle). Through reasonable resource attribute settings and resource dependency management, the performance and loading speed of applications (such as game applications) can be improved.

[0048] In this application, the resource management engine can update the resource dependency between multiple resources in the project in real time. In one implementation, the resource dependency can be updated in real time as the project is re-imported into the resource management engine. This is because the resource management engine can maintain the resource dependency, and can obtain the latest resource dependency of a resource at any time through the interface provided by the resource engine, and obtain the latest resource dependency, thereby updating the historical resource dependency. However, for large-scale engineering projects, the number of resources included is large and the scale is large. If it is still obtained from the engine interface, the performance is not high enough. Therefore, this application stores the resource dependency as part of the resource attribute information in the database, so that the resource dependency can be frequently and efficiently read and written based on the database support, and the dependent resources in the engineering project can be quickly screened based on the read resource dependency. However, for resource reference relationships, the resource management engine cannot be updated in real time as the resources are re-imported. Instead, the resource reference relationship can be obtained by obtaining the resource dependency from the engine interface and then analyzing it based on the resource dependency. This has poor performance in the scanning scenario of large-scale engineering projects. Therefore, the resource reference relationship of the present application can be obtained with the help of resource attribute information read from the database, and can be updated based on the update requirements after the resource attribute information is updated. Compared with updating by obtaining resource attribute information through the interface provided by the resource management engine, the database has more efficient read and write performance, so that resource attribute information can be obtained more quickly to update resource reference relationships.

[0049] The database mentioned in this application is a database for storing resource attribute information and resource change information, such as: SQLite database, which is a lightweight database that supports various operating systems and has a faster processing speed. It can also be other databases, such as: MySQL database (a relational database), Oracle database (can be used to process large amounts of data and ensure high availability and security of data), PostgreSQL database (based on SQL standardized query language to manage and store data), etc. The database includes a first storage area and a second storage area. In one implementation, the first storage area and the second storage area can be two independent storage spaces in the same database, such as different data tables in the same SQLite database; in another implementation, the first storage area and the second storage area can also be different sub-databases, such as the first storage area is a SQLite database, and the first storage area is a MySQL database. For ease of understanding, this application takes the first storage area and the second storage area as two independent storage spaces in the same database (such as SQLite) as an example for exemplary explanation, so the subsequent reading of relevant data, writing of relevant data, etc. are performed for the corresponding storage areas in the same database. It should be noted that the terms "first", "second", etc. in the present application are used to distinguish identical items or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on the quantity and execution order.

[0050] Based on the above definition, the principle of the resource processing method proposed in the embodiment of the present application is explained below. Specifically, the general principle of the method is as follows: first determine the engineering project in the resource management engine, the engineering project includes multiple resources, and there is a resource reference relationship between the multiple resources; the resource management engine corresponds to a database, the database includes a first storage area and a second storage area, the first storage area is used to store the resource change information generated by the engineering project each time the resource is changed; the second storage area is used to store the resource attribute information of each resource in the engineering project; based on this, in response to an update request for the engineering project, the resource change information of the engineering project can be read from the first storage area, and according to the read resource change information, the target resource that has been changed in the engineering project is determined, and then the resource attribute information of the target resource is updated in the second storage area. Thus, the resource attribute information stored in the second storage area can be updated to be consistent with the resource attribute information of each resource after the resource change of the engineering project, and the resource attribute information in the second storage area can be updated at a high speed by relying on the resource change information obtained from the first storage area of ​​the database for updating. Afterwards, the updated resource attribute information can be read from the second storage area, and based on the updated resource attribute information, the resource reference relationship between multiple resources can be updated. On the one hand, based on the resource attribute information that is consistent with the project, the resource reference relationship can be correctly updated. On the other hand, since the resource attribute information (including resource dependencies) stored in the database may be accessed multiple times and frequently, compared to obtaining relevant resource attribute information through the engine interface, obtaining it from the database is faster, so that the resource reference relationship can be updated quickly.

[0051] In a specific implementation, the above-mentioned method can be executed by a computer device, which can be a terminal or a server. For example, the server can determine the engineering project in the resource management engine, and after receiving an update request for the engineering project, it can read the resource change information from the first storage area, and based on the resource change information, update the resource attribute information of the target resource involved in the resource change in the second storage area, thereby updating the resource attribute information stored in the second storage area. Furthermore, the resource reference relationship between resources can be updated based on the updated resource attribute information in the second storage area. The above-mentioned method can be jointly executed by multiple computer devices, and the multiple computer devices include terminals and servers; for example, Figure 1cIn the schematic diagram of the architecture of the resource processing system shown in the figure, the resource management engine can be run in the terminal, and a certain project can be loaded into the resource management engine through the terminal, so that the loaded project can be determined as the project in the resource management engine. When the user has an update demand for the resource reference relationship, the terminal can generate an update request for the project, and then the terminal can send the update request to the server, and the server can respond to the update request, read the resource change information of the project from the first storage area included in the database, and then update the resource attribute information of the target resource stored in the second storage area included in the database, so as to update the resource attribute information stored in the second storage area, and update the resource reference relationship based on the updated resource attribute information. It can be seen that the resource change information stored in the first storage area is used to update the resource attribute information, and the resource attribute information in the second storage area is used to update the resource reference relationship. Further, based on the updated resource reference relationship, the resources in the project can also be optimized. For example: based on the updated resource reference relationship, useless resources in the project can be determined and deleted, so that when the project is opened next time, since there is no need to load useless resources, the speed of starting the project can be accelerated to quickly enter the editing stage of the project.

[0052] The terminals mentioned above include but are not limited to: smart phones, tablet computers, smart wearable devices, smart voice interaction devices, smart home appliances, personal computers, vehicle-mounted terminals, smart cameras, virtual reality devices, etc., and this application does not impose any restrictions on this. This application does not limit the number of terminals. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but is not limited to this. This application does not limit the number of servers.

[0053] Based on the above description, see Figure 2 , is a flowchart of a resource processing method provided by an exemplary embodiment of the present application. The resource processing method can be executed by the computer device (terminal or server) mentioned above, or can be executed by the terminal and the server together; for the convenience of explanation, the following description will be given by taking the computer device executing the resource processing method as an example. The resource processing method may include the following steps S201-S204.

[0054] S201, determine the engineering project in the resource management engine, the engineering project includes multiple resources, and there is a resource reference relationship between the multiple resources; the resource management engine corresponds to a database, and the database includes a first storage area and a second storage area; the first storage area is used to store resource change information generated by the engineering project each time a resource change is made, and the second storage area is used to store resource attribute information of each resource in the engineering project.

[0055] In a specific implementation, after a project is loaded into a resource management engine, the computer device may determine that the project is a project in the resource management engine. As can be seen from the foregoing, the resource management engine is, for example, the Unity engine, and the project is, for example, a project of a game application. The multiple resources included in the project may be non-code resources, for example: various types of resources such as textures, materials, and models. The multiple resources may include at least one type of resource, and each type of resource may include one or more. For example, a texture resource may include one or more, and a material resource may also include one or more.

[0056] For any two resources among the multiple resources, there may be a resource reference relationship between the two, or there may not be a resource reference relationship, which can be specifically determined based on whether one resource is referenced by another resource. Exemplarily, the multiple resources include at least: two texture resources (gamesuggest.png and icon.png), three scene resources (game_entry.unity, game_launcher.unity, and in-game configuration.unity), and two prefab resources (checkasset_panell.prefab and ApplicationObject.prefab), and the texture resource gamesuggest.png is referenced by the three scene resources and the two prefab resources, thus, there is a resource reference relationship between the texture resource and the three scene resources, and there is a resource reference relationship between the texture resource and the two prefab resources. However, the texture resource icon.png is not referenced by any resource, thus, there is no resource reference relationship between the texture resource icon.png and other resources. For a certain resource, the corresponding resource reference relationship can be determined based on the situation in which it is referenced, but the resource management engine cannot obtain the situation in which a certain resource is referenced. Therefore, the resource management engine cannot update the resource reference relationship involving the resource in the engineering project. The present application can be implemented by storing the resource attribute information of each resource in the second storage area in the database.

[0057] Each resource has one or more resource attributes, which can constitute the resource attribute information of a resource, that is, the resource attribute information can refer to the collection of resource attributes of a resource. For example, the resource attribute information of resource A includes but is not limited to: resource name, resource type, resource size, resource storage path, resource dependency, resource identifier, etc. Among them, the resource name is, for example, gamesuggest.png; the resource type is, for example, a texture resource, a scene resource, and a prefab resource; the resource size can be determined based on the storage space occupied by the resource, for example, 2KB (KB is a storage unit in a computer system, 1KB = 1024 bytes); the resource storage path can be used to indicate the location of the resource in the project, which can also be called a resource directory (path), for example, the resource storage path of a scene resource is: Assets / resource / scenes / game_launcher.unity. Based on the resource storage path, the resource directory can be determined to be Assets / resource / scenes, and the resource name is game_launcher.unity. The resource storage paths of different resources can indicate different locations. Exemplarily, the storage path of a certain resource is: Assets / resource / scenes / game_launcher.unity. game_launcher.unity is the name of the resource file that encapsulates the scene resource. The storage path of another resource is Assets / resource / scenes / game_entry.unity, and game_entry.unity is the file name of the resource file that encapsulates another scene resource. It can be seen that the locations of these two resources are different, but the resource directories have the same prefix. The resource dependency relationship can be determined by the resource dependency information, which is used to indicate at least one resource that is dependent. If a resource does not depend on any resource, then the resource attribute information of the resource may not include the resource dependency relationship. The resource identifier is a global identifier in the resource management engine. Each resource has a resource identifier, and the resource identifier of each resource is unique, so that different resources can be distinguished based on the resource identifier. In one implementation, no matter which resource, after being successfully added to the project, the resource management engine can assign a unique resource identifier to the resource to identify the resource.

[0058] In this application, the resource identifier is, for example, a GUID (Globally Unique Identifier), which can also be called a UUID (Universally Unique Identifier). GUID is a 128-bit digital identifier generated by an algorithm, which can ensure that the GUIDs generated in different computer systems and at different times are unique. Therefore, GUID can be widely used in distributed systems, such as databases, operating systems, network protocols, etc., to uniquely identify objects in computer systems (that is, to identify resources in engineering projects in this application). It is usually expressed in the form of a hexadecimal string. For example, the GUID of a resource is: {3F2504E0-4F89-11D3-9A0C-0305E82C3301}. The role of GUID is to uniquely identify objects in a distributed system to avoid duplicate identifiers. This is because in a computer system, many objects need to be uniquely identified, such as files, database records, network resources, etc. If a simple number or string is used as an identifier, duplication may occur, causing system errors; using a GUID as an identifier can ensure that each object in a distributed system has a unique identifier to avoid duplication. In this application, the use of a GUID can uniquely identify resources in a project, and the GUID can also be used as a resource index. References or dependencies between resources can be implemented based on the use of the GUID.

[0059] Since the resource dependency relationship and resource reference relationship between two resources exist at the same time, if there is no resource dependency relationship between the two resources, then there is no resource reference relationship. From a global perspective, the resource reference relationship between multiple resources can be changed based on the change of the resource dependency relationship between multiple resources. Exemplarily, the resource dependency relationship corresponding to resource A indicates that resource A depends on resource B and resource C, then there may be two resource reference relationships corresponding to the resources, one for indicating that resource B is referenced by resource A, and the other for indicating that resource C is referenced by resource A. When the resource dependency relationship corresponding to resource A is changed, it indicates that resource A depends on resource B and resource D, so it can be determined that resource C is no longer referenced by resource A, but resource D is referenced by resource A. Therefore, the resource reference relationship between resource A and resource C can be released, and there is a resource reference relationship between resource A and resource D.

[0060] The database corresponding to the resource management engine is, for example, a SQLite database. For ease of explanation, the present application takes the database as one database, and the first storage area and the second storage area as different storage areas in the same database for exemplary explanation. In one implementation, the resource management engine can monitor whether there are resource changes in the project. Once a resource change occurs in the project, the resource management engine can notify the resource processing tool to store the resource change information generated by the resource change in the first storage area of ​​the database. Among them, the resource processing tool is a tool used to implement the resource processing method provided by the present application and deployed in the resource management engine. In one implementation, if the project is opened for the first time, the project can be fully scanned, and the resource attribute information of each resource in the project can be obtained through the engine interface, and then the resource attribute information of each resource obtained can be stored in the second storage area of ​​the database.

[0061] Resource change information refers to information generated by resource changes to a project, where resource changes to a project include but are not limited to any one or more of the following combinations: adding new resources, deleting resources, modifying resources, and moving resources. Adding new resources means adding new resources to a project; deleting resources means deleting existing resources in a project; modifying resources means changing some resource attribute information (such as resource dependencies) of existing resources in a project; a resource can change some inherent resource attributes (such as changing resource names, resource sizes, etc.) but the corresponding resource dependencies ( / resource reference relationships) remain unchanged, and the resource dependencies ( / resource reference relationships) may also change due to changes in some resource attributes of the resource. For example, a resource R originally references resource A, resource B, resource C, and resource D. After the change, the resource R becomes a reference to resource B, resource C, resource E, and resource F, etc. Moving resources means moving existing resources in a project, specifically by changing the resource storage path to achieve movement, but other attributes of the resource remain unchanged, such as resource name, resource dependencies, etc.). The resource changes shown above may be a combination of two or more, for example, for a resource in a project, not only the dependent resources are changed, but also the location of the resource is moved (ie, the resource storage path is changed).

[0062] The resource change information of the project may include resource change sub-information of one or more resources, for example, Figure 3 The resource change information of the engineering project stored in the database shown includes: the added resource GUID, the deleted resource GUID, the moved resource GUID and the original storage path (or original directory path) of the moved resource. It can be seen that the resource change sub-information of each resource can be used to indicate the changed resource and the resource change type (i.e., added, deleted, moved or modified).

[0063] By storing resource change information in the first storage area in the database, when the user needs to filter dependent or referenced resources, the resource change information can be read from the first storage area to update the resource attribute information in the second storage area, and then update the resource dependency in the resource attribute information. This is because if the scale of the project is relatively large, the amount of resources included in the project will be particularly large, so the amount of resource attribute information of each resource stored in the second storage area is also very large, and in large-scale projects, resource changes are also a very frequent demand. If the resource attribute information of the corresponding resources in the second storage area is updated every time a resource change occurs in the project, the engine interface will be frequently called to obtain the resource attribute information of the target resources involved in the resource change. Although the time may be relatively short once or twice, the accumulated time is relatively long, which will bring a higher time cost. Therefore, the present application stores the resource change information in the first storage area of ​​the database, and only calls the engine interface to obtain the resource attribute information of the target resource when the resource attribute information stored in the second storage area needs to be updated to be consistent with the engineering project. This avoids frequent calls to the engine interface, and instead obtains the resource change information from the database, and calls the engine interface once based on the resource change information, thereby updating the resource attribute information of the target resources involved in the resource changes to the engineering project in the second storage area at one time, thereby avoiding updating every time a resource change occurs, optimizing the update process, and being able to spend less time on updates, thereby improving update efficiency.

[0064] S202, in response to an update request for a project, reading resource change information of the project from a first storage area, and determining a target resource in the project that has been changed according to the read resource change information.

[0065] In a specific implementation, the resource management engine may provide a resource management interface, which is a UI (User Interface) interface that can receive user input and display execution results. Specifically, the resource management interface may be used to provide resource management services, which include but are not limited to: making resource changes to engineering projects, incremental updates to engineering projects (or incremental scanning), etc. Among them, incremental update refers to updating the resource attribute information in the second storage area by scanning one or more resources involved in making resource changes to the engineering project, and updating the resource reference relationship. This is to avoid scanning the engineering project in full each time, reduce the amount of resource scanning, and improve scanning efficiency. Specifically, when a resource change occurs in the engineering project and the corresponding resource change information is stored in the first storage area of ​​the database, an update control may be displayed in the resource management interface. When a user triggers the update control (e.g., clicks on the update control), an update request for the engineering project may be generated. It is understandable that if the engineering project has never undergone a resource change, the update control may be hidden in the resource management interface.

[0066] The reason for setting the update control in the resource management interface is that the engine interface is called relatively frequently to update the engineering project and notify the resource management engine of resource changes. Based on the update control, the user can independently decide when to update the resource attribute information of each resource in the engineering project in the second storage area, instead of updating the resource attribute information of each resource in the engineering project in the second storage area every time a resource change occurs. Thus, based on the update request, the resource change information accumulated by one or more resource changes to the engineering project can be read from the first storage area, so that the corresponding resource attribute information in the second storage area can be updated at one time based on the resource change information. For example, after the engineering project has been changed twice, an update request is received, then all the resource change information generated by the two resource changes can be read from the first storage area, and these resource change information are used to determine all the resources involved in the previous two resource changes, and the resource attribute information of these resources is updated in the second storage area.

[0067] In one implementation, the resource change information includes one or more resource identifiers, and the computer device can determine the resource identified by the one or more resource identifiers in the resource change information as the target resource that has changed in the project. In other words, the target resource refers to: one or more resources that have changed in the project. For ease of understanding, this application takes the target resource as an example of a resource. If the target resource includes multiple resources, then the solution logic provided in this application can be followed for each resource. The target resource can also be understood as the resource involved in the resource change of the project, which can also be called the changed resource. Based on the different resource change types, the target resource may be a resource that the project already has before the resource change, or it may be a resource that the project has added after the resource change. For example, if the resource change type is a resource addition type, then the target resource can be a resource that has been added to the project, and if the resource change type is a resource movement type, then the target resource can be an existing resource that has been moved in the project.

[0068] S203: Update the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area.

[0069] In a specific implementation, after the target resource is determined, the resource attribute information of the target resource can be updated in the second storage area, thereby updating the resource attribute information stored in the second storage area. Specifically, based on the resource change type involved in the target resource, the above-mentioned update can be to add the resource attribute information of the target resource in the second storage area, then the updated resource attribute information includes the resource attribute information of the target resource; or to update the resource attribute information of the existing target resource in the second storage area, then the updated resource attribute information includes the latest resource attribute information of the target resource; or to delete the resource attribute information of the target resource in the second storage area, then the updated resource attribute information does not include the resource attribute information of the target resource. In general, the updated resource attribute information obtained by the update can include at least one of the following: resource attribute information of some resources previously stored in the second storage area, and modified resource attribute information of a certain resource.

[0070] For example, when making resource changes to an engineering project, the resource storage path of resource A in the engineering project is changed from path1 to path2, then the resource storage path path1 of resource A stored in the second storage area is also changed to path2 after update, so that the updated resource attribute information includes the latest resource storage path path2 of resource A in the engineering project.

[0071] By updating the resource attribute information of the target resource in the second storage area, the updated resource attribute information in the second storage area can be matched with the engineering project after the resource change. Therefore, based on the latest resource attribute information in the second storage area, the resource reference relationship can be updated to obtain the correct resource reference relationship, so as to return the correct result when subsequently searching and maintaining the resource reference relationship.

[0072] S204, reading updated resource attribute information from the second storage area, and updating resource reference relationships between multiple resources based on the updated resource attribute information.

[0073] In a specific implementation, the updated resource attribute information read by the computer device from the second storage area does not include the resource attribute information of the target resource when the target resource is a resource deleted in the engineering project, and includes the resource attribute information of the target resource when the target resource is a newly added resource in the engineering project. In any case, after the resource reference relationship between multiple resources is updated based on the updated resource attribute information, the referenced situation of the corresponding resources may change. Exemplarily, resource A is referenced by resource X and resource Y. If after the update, resource A is referenced by resource X, resource Y and resource Z. Thus, a resource reference relationship between resource A and resource Y is added. If after the update, resource A is only referenced by resource X, thus, the resource reference relationship between resource A and resource C is released. Therefore, the updated resource reference relationship may include a newly added resource reference relationship, or a previously released resource reference relationship.

[0074] In a specific implementation, the resource reference relationship between multiple resources exists in the form of at least one resource reference list, each resource reference list corresponds to a resource, and a resource reference list is used to record the resource identifiers of each resource that references the same resource, so that when the resource reference relationship between multiple resources is updated based on the updated resource attribute information, the resource reference relationship can be updated by updating these resource reference lists. Optionally, the resource processing solution provided by the present application can be executed by a resource processing tool in a computer device, and the resource processing tool can be deployed in a resource management engine, so that the computer device can quickly update the resource reference relationship through the resource processing tool.

[0075] The resource processing method provided in the present application can update the resource attribute information stored in the second storage area based on the resource change information, so that the resource attribute information stored in the second storage area is consistent with the resource attribute information of the project after the resource change. In addition, it is not necessary to scan all resources of the project in full, but to scan the target resources that have been changed to quickly update the relevant resource attribute information in the second storage area, thereby improving the updating efficiency of the resource attribute information; in addition, by storing the resource attribute information in a high-performance database, it is not necessary to obtain the resource attribute information through the interface provided by the resource management engine (referred to as the engine interface), but it is possible to quickly obtain the resource attribute information consistent with the project directly from the database, thereby correctly and quickly updating the resource reference relationship and realizing the maintenance of the resource reference relationship.

[0076] See also Figure 4 , is a flowchart of a resource processing method provided by an exemplary embodiment of the present application; in the embodiment of the present application, the resource processing method is mainly described by taking a computer device executing the resource processing method as an example; in Figure 4 In the illustrated embodiment, the storage of resource attributes of each resource in the engineering project and the establishment of resource reference relationships between multiple resources are mainly described.

[0077] S401, determining a project in a resource management engine.

[0078] The following is a detailed description of the process of how the resource attribute information of each resource in the project is stored in the database. In one embodiment, before updating the project, the project can be fully scanned, and the resource attribute information of all resources in the project can be obtained through the full scan, and the resource attribute information of each resource can be stored in the database, so that the resource attribute information of all resources consistent with the project can be directly obtained from the database to build or update the resource reference relationship, without the need to scan all resources through the interface of the resource management engine, thereby improving the update efficiency and processing performance of the resource reference relationship.

[0079] In an achievable manner, the computer device can detect whether the resource attribute information of each resource of the project is stored in the second storage area included in the database. If the resource attribute information of each resource of the project is not stored in the second storage area, it can be determined that the project has not been scanned, so that the project can be fully scanned for the first time. On the contrary, if the resource attribute information of at least one resource of the project is stored in the second storage area, it is determined that the project has been scanned before, but a large number of resources may be added to the project due to resource changes, resulting in a large difference between the resource attribute information stored in the database and the resource attribute information of the resources currently included in the project. Therefore, a preset threshold can be set to determine whether to perform a full scan on the project again. Among them, the preset threshold can be determined based on the resource quantity of the resources currently included in the project. For example, if the resource quantity of the resources currently included in the project is 120, the preset threshold can directly take the resource quantity 120, or take a value according to a certain proportion, such as 2 / 3 of the resource quantity, that is, 80. This is because, if the difference between the number of resources currently included in the project and the number of resources corresponding to the resource attribute information in the second storage area is greater than a preset threshold, it means that a lot of new resources have been added to the project, and when the difference in the amount of resources before and after the resource change is close to the amount of resources before the project change, the time cost spent on incremental scanning and full scanning is relatively close, then you can also choose to perform a full scan of the project, and then update the resource attribute information of each resource of the project stored in the second storage area. Conversely, if the difference is less than the preset threshold, you can choose to perform an incremental scan of the project, that is, when the number of new resources added to the project is small, you can choose to perform an incremental scan based on the above Figure 2 The update logic shown performs incremental scanning. Of course, as a better choice, after a full scan of the project, no matter what resource changes occur in the project, incremental scanning can be selected to minimize the scanning time, so that the resource reference relationship is maintained in time to match the project.

[0080] A full resource scan for an engineering project may include the following steps (1)-(2).

[0081] (1) Scan each resource in the project to obtain resource attribute information of each resource.

[0082] In one specific implementation, each resource has a resource identifier, and the computer device can scan each resource in the project based on the resource identifier (such as GUID). During the scanning process, the interface of the resource management engine can be called to obtain resource attribute information of each resource from the project based on the resource identifier, including but not limited to: resource name, resource type, resource size, resource storage path, resource dependency, resource file hash, etc. In another specific implementation, the resource is encapsulated in a file, and each resource in the project can be scanned based on the file hash to find the resource attribute information of the resource.

[0083] Among them, the resource file hash is a hash value calculated by a hash function, which can be a string and is unique. The resource identifier (such as GUID) can be regarded as a resource index. The full scan of the project is a scanning method based on the resource index. Through scanning, the information based on the resource identifier can be found, thereby obtaining the resource dependency relationship. Exemplarily, when scanning each resource, if a file describing the resource dependency relationship of a certain resource is scanned, then the file can be parsed to obtain the resource identifiers of each resource that a certain resource depends on, and these resource identifiers are added to the resource attribute information as resource dependency information.

[0084] (2) The resource attribute information of each resource is stored in the second storage area.

[0085] In a specific implementation, for each resource attribute information of a resource, the computer device may store the resource attribute information of the resource in the second storage area in a classified manner according to the corresponding attribute category. For example, the resource GUID and the resource path may be associated and stored in the second storage area, the resource identifier of at least one resource that a certain resource depends on may be classified into a list and stored in the second storage area, and the resource identifier of at least one resource that references a certain resource may be classified into another list and stored in the second storage area.

[0086] In one embodiment, the resource attribute information of each resource includes at least: a resource identifier of each resource and a resource storage path of each resource. Each resource has a resource identifier and a resource storage path, and the resource storage path can be used to indicate the location of the resource, for example, in which file the resource is specifically encapsulated. The specific implementation of the computer device storing the resource attribute information of each resource in the second storage area may include the following ①-③: ① Mapping the resource identifier of each resource and the resource storage path of the corresponding resource to obtain the path dependency of the corresponding resource; ② Determining a first container, the first container is used to store the path dependency of resources; ③ Storing the path dependency of each resource in the first container, and storing the first container in the second storage area.

[0087] One resource corresponds to one resource storage path. The computer device can map the resource identifier of a resource and the resource storage path of the resource to obtain the path mapping relationship of the resource. The path mapping relationship can be used to indicate the mapping of the resource storage path to the resource identifier. For example, the resource identifier GUID of resource A is {3F2504E0-4F89-11D3-9A0C-0305E82C3301}, and the resource storage path of resource A is Assets / resource / scenes / game_launcher.unity, so the GUID and the resource storage path can be mapped, and the resource storage path and GUID are associated as a set of data and stored together to represent the path mapping relationship. For each resource in the scanned engineering project, the corresponding path dependency relationship can be obtained in this way. For example, if the engineering project includes 100 resources, 100 path dependencies can be obtained, and each path dependency relationship corresponds to one resource.

[0088] The container mentioned in this application is a lightweight and relatively easy to transplant data management tool. Different containers can be used to isolate data and realize secure storage of data. In one implementation, the resource management engine can correspond to multiple containers, each of which is used to store a type of data. The computer device can determine a first container from multiple containers according to the type of data stored, and the first container is used to store the path dependency of resources. The path dependency of each resource of the engineering project scanned in full can be stored in the first container, so that the first container can include the resource identification and resource storage path of each resource in the engineering project. Further, the first container can be stored in the second storage area of ​​the database, so that when the resource attribute information of each resource in the engineering project is needed, the first container can be run to obtain the resource attribute information of each resource of the engineering project stored in the first container. Specifically, the first container can be exported from the database, and the first container is stored in the database and the memory at the same time.

[0089] In another embodiment, the resource attribute information of each resource includes at least: resource dependency information of at least one resource, and the resource dependency information of any resource includes the resource identifier of one or more resources that the corresponding resource depends on. The number of resources of resources that different resources depend on may be different, for example, resource A depends on 2 resources, and resource B depends on 3 resources. The number of resources of resources that different resources depend on is the same, but the specific resources they depend on may be different, for example, resource A depends on resource B and resource C, and resource B depends on resource F and resource H. Based on the content included in the above resource attribute information, the computer device can execute the following content: ① Obtain the resource identifier of one or more resources that the corresponding resource depends on from the resource dependency information of each resource, and establish a resource dependency list of the corresponding resource according to the resource identifier of one or more resources that each resource depends on; ② Determine a second container; the second container is used to store the resource dependency list of at least one resource; ③ Store the resource dependency list of each resource in the second container, and store the second container in the second storage area.

[0090] Taking a resource (such as resource Ri) as an example, the resource identifiers of one or more resources that the resource Ri depends on can be obtained from the resource dependency information of the resource Ri, and then the resource dependency list of the resource Ri can be established according to the resource identifier of at least one resource that the resource Ri depends on, and the resource dependency list of the resource Ri includes the resource identifiers of one or more resources that the resource Ri depends on. In this regard, the computer device can determine a second container from multiple containers, and can store the resource dependency list of the resource Ri in the second container. It can be understood that for each resource, a resource dependency list corresponding to the resource can be established in the above manner, so that the resource dependency list can be stored in the second container. After the resource dependency lists of each resource are stored in the second container, the second container can be stored in the second storage area of ​​the database.

[0091] The above method is for resources scanned for the first time. If a resource in the project is not scanned for the first time, the second container can store the resource dependency list of the resource. Then, the resource dependency list of the resource in the second container can be updated according to the resource identifiers of the acquired one or more resources. The updated resource dependency list includes the resource identifiers of the one or more resources it depends on. The update of the resource dependency list can involve one or both of the following: adding new resource identifiers and deleting existing resource identifiers.

[0092] In another embodiment, the resource attribute information of each resource includes at least: the resource name of each resource and the hash value of each resource. If the full scan is not the first time, then when the resource is modified, the resource attribute information also includes the resource modification time. Based on this, when the computer device stores the resource attribute information of each resource in the second storage area, for a certain resource, the resource name of the resource, the hash value of the resource and the resource modification time of the resource can be determined as resource information stored in the third container, and then after the resource information of each resource is stored in the third container, the third container can be stored in the second storage area.

[0093] In the process shown in (1)-(2) above, by scanning the resources in the project, the resource attribute information of the resources can be obtained, and then the resource attribute information is organized and stored in the second storage area of ​​the database in a corresponding form. This method optimizes the storage structure of the resource attribute information, and by distributing and storing the resource attribute information in multiple containers and then storing the containers in the database, the resource attribute information of different information types can be isolated, so that it is easy to manage the resource attribute information and convenient to read and write.

[0094] In one embodiment, the dependency search tool provided by the resource management engine (such as the Reference Finder provided by the Unity engine) can be used to perform a full scan of the project to find out whether a resource is referenced by other resources, or to find out what resources a resource references (that is, what resources it depends on), and obtain the resource reference relationship. However, if the project is a very large-scale project, and each time the dependency search tool is used to obtain the full amount of resource attribute information from the engine through the interface provided by the resource management engine, then searching for the dependencies or references of all resources from the resource management engine is a very cumbersome task and will incur a high time cost. For example, if Figure 5a The progress diagram of the full resource scan is shown in the figure. The total resource volume is as follows: Figure 5a As shown in the figure, the number of files with extensions other than .meta in the Assets directory is counted. These files will be regarded as resources for import by Unity. The number of resources scanned so far has reached 300,000.

[0095] Therefore, the present application uses the relevant data of the engineering project stored in the database to quickly build a resource reference relationship. Further, the resource reference relationship can be recorded in a reference relationship management container, which exists in the memory, and then in accordance with the following Figure 2When the process shown updates the resource reference relationship, the resource reference relationship in the reference relationship management container can be updated based on the updated resource attribute information read from the second storage area. The updated resource attribute information is the resource attribute information of the full amount of resources corresponding to the project after the resource change. In this way, there is no need to obtain the resource attribute information of the full amount of resources in the updated project by calling the engine interface, but with the help of the high-speed reading performance of the database, the data is read from the second storage area to realize the rapid update of the resource reference relationship.

[0096] In another embodiment, the resource attribute information of each resource stored in the second storage area can be used to obtain the resource reference relationship between multiple resources. Based on the resource attribute information of each resource being distributed and stored in multiple containers, the following can be provided: Figure 5b The schematic diagram of storing resource attribute information and establishing resource reference relationships is shown in FIG. Figure 5b As shown, the resource attribute information (or composition) of resource A includes resource identification, resource path, resource name and resource reference / dependency relationship, and the resource identification and resource path can be mapped and stored in the first container (i.e., container C1), and in the resource reference / dependency relationship, the resource list that resource A depends on (or can be called a resource dependency list, recording each resource that resource A depends on (including resource X, resource Y, resource Z)) can be stored in the second container (i.e., container C2), and the file unique hash, file name and modification time of resource A can be stored in the third container (i.e., container C3), and the first container, the second container and the third container can all be stored in the database. Then, based on the data stored in the first container, the second container and the third container in the database, a reference relationship management container (i.e., container C4) can be reconstructed, specifically, a resource reference relationship is established. It includes a reverse dependent resource list (or can be called a resource reference list), which records each resource that references resource A (including resource X, resource Y, resource Z).

[0097] The resource attribute information of each resource in the engineering project stored in the second storage area at least includes: at least one resource dependency list and the resource identifier of each resource. In the engineering project, each resource is assigned a resource identifier to uniquely distinguish the resource. One resource dependency list corresponds to one resource, and different resource dependency lists correspond to different resources. The resources corresponding to at least one resource dependency list may include all resources or part of the resources in the engineering project. Exemplarily, the engineering project includes 100 resources, and only 80 resource dependency lists are stored in the second storage area, that is, only 80 resources correspond to resource dependencies, and the remaining 20 resources do not depend on other resources, but these resources may be referenced by other resources. The resource dependency list of any resource is used to record the resource identifier of one or more resources that the corresponding resource depends on. If a resource depends on at least one resource, the resource identifier of the resource it depends on can be recorded in the resource dependency list. Exemplarily, resource A depends on resource B, resource C and resource D, then the resource dependency list may include the GUID of resource B, the GUID of resource C and the GUID of resource D. If a resource does not currently depend on any resource, then after detecting that the resource depends on other resources, a resource dependency list can be established and the resource identifiers of the dependent resources can be added to the resource dependency list. The resource reference relationship between multiple resources can be established based on the above resource dependency list and the resource identifiers of the resources, and the specific establishment method is shown in S402-S404 below.

[0098] S402: Obtain a resource identifier of each resource from the second storage area, and obtain at least one resource dependency list recording the resource identifier from the second storage area.

[0099] Specifically, the resource identifiers of each resource obtained here are the resource identifiers of all resources of the engineering project stored in the second storage area. At least one resource dependency list obtained corresponds to part or all of the resources, and each resource dependency list records the resource identifiers of one or more resources that the corresponding resource depends on. If different resources depend on the same resource, the resource identifiers recorded in the resource dependency lists of different resources may include the same resource identifier. For example: resource A and resource S both depend on resource B, then the GUID of resource B is recorded in the resource dependency list list-a of resource A and the resource dependency list list-s of resource S; if the resources that different resources depend on are different, the resource identifiers recorded in different resource dependency lists are also different. For example: resource A depends on resource B, resource C and resource D, and resource B depends on resource W, resource Y and resource Z. Then the resource dependency list list-a of resource A records the GUIDs of resource B, resource C and resource D, and the resource dependency list list-s of resource B records the GUIDs of resource W, resource Y and resource Z.

[0100] S403: extract reference relationships according to the acquired resource identifiers of each resource and the resource identifiers recorded in at least one resource dependency list to obtain one or more resource reference lists.

[0101] In a specific implementation, the resource corresponding to the resource dependency list can be called a reference resource, and the resource corresponding to the resource identifier recorded in the resource dependency list can be called a referenced resource. In the process of extracting the reference relationship, the computer device can traverse the corresponding resource dependency list based on the resource identifier of each resource, and then obtain the resource reference list of each referenced resource based on the resource identifier recorded in the resource dependency list, and then the resource identifier of the referenced resource can be recorded in the resource reference list. Exemplarily, the resource dependency list list-a of resource A records the GUIDs of resource B, resource C and resource D, then resource A is a reference resource, resource B, resource C and resource D are referenced resources, so that the resource reference lists of resource B, resource C and resource D can be counted, and each resource reference list includes the GUID of resource A, that is, resource B is referenced by resource A, resource C is referenced by resource A, and resource D is referenced by resource A. Optionally, if a resource is not referenced, a resource reference list can be established first, and after the resource is referenced later, the referenced resource can be directly added to the resource reference list. One resource reference list corresponds to one resource in the project; different resource reference lists can correspond to different resources in the project.

[0102] In one embodiment, the resource management engine also corresponds to a reference relationship management container, which can be used to store resource reference lists. After obtaining one or more resource reference lists, the one or more resource reference lists can be stored in the reference relationship management container. When the computer device executes the above step S403, it can specifically execute the following steps 1 to 4.

[0103] Step 1: traverse the resource identifiers of each resource obtained, and determine the traversed resource identifier as the resource identifier of the first resource.

[0104] In a specific implementation, the computer device can simultaneously or successively traverse the resource identifiers of the acquired resources, and determine the traversed resource identifier as the resource identifier of the first resource. The resource identified by the traversed resource identifier is the first resource. For ease of understanding, the logic of reference relationship extraction is explained by taking a traversed resource identifier as an example.

[0105] Step 2: If at least one resource dependency list includes the resource dependency list of the first resource, select the resource dependency list of the first resource from the at least one resource dependency list.

[0106] In a specific implementation, each resource dependency list can be associated with the resource identifier of the corresponding resource, for example, the name of the resource dependency list and the resource identifier of the corresponding resource can be mapped to each other to indicate that the resources identified by the resource identifier recorded in the resource dependency list are all resources that a certain resource depends on. If a first resource depends on a second resource (i.e., a related resource called when the first resource is used), then at least one resource dependency list includes the resource dependency list of the first resource, and the resource identifier of the second resource is recorded in the resource dependency list of the first resource, so that the resource dependency list of the first resource can be selected from at least one resource dependency list. If the first resource depends on any resource, then the resource dependency list of the first resource is not included in at least one resource dependency list. In this case, the acquired resource identifiers can be traversed continuously until the resource dependency list corresponding to the resource identified by the traversed resource identifier exists in at least one resource dependency list.

[0107] Step 3: Update the reference relationship management container according to the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource.

[0108] In a specific implementation, when a full scan is performed on a project for the first time, the resource reference list corresponding to the resources in the project is not recorded in the reference relationship management container. Therefore, when the reference relationship management container is updated, a new resource reference list can be established based on the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource, and the resource identifier of the first resource is added to the resource reference list. It is understandable that when a full scan is not performed on a project for the first time, a resource in the project may have been scanned before, and its resource reference list has been stored in the reference relationship container. Then, when other resources depend on the resource, the resource identifier of the other resource can be added to the resource reference list of the resource, indicating that the resource is referenced by other resources.

[0109] In a feasible implementation, the second storage area of ​​the database may include a first container and a second container, the resource identifier of each resource in the project may be stored in the first container, and at least one resource dependency list may be stored in the second container; based on this, the first container and the second container may be specifically derived from the database, and then the resource identifier (such as GUID) of each resource may be derived from the first container, and at least one resource dependency list may be derived from the second container. A resource dependency list records the resource identifiers (such as GUID) of one or more resources that are dependent on the same resource, and then the resource identifiers in the resource dependency list are combined with the resource identifiers of the resources read from the first container to obtain a resource reference list, which is stored in the reference relationship management container. For the above process, please refer to Figure 5cThe content shown can quickly establish a resource reference relationship in the reference relationship management container based on the data recorded in the first container (container C1) and the second container (container C2). If the resource attribute information in the second storage area is updated, the resource reference relationship can also be updated based on the first container and the second container based on a similar principle.

[0110] In a feasible implementation, when the computer device updates the reference relationship management container according to the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource, it can be specifically implemented according to the following steps 3.1 to 3.3.

[0111] Step 3.1 traverses the resource identifiers recorded in the resource dependency list of the first resource, and determines the traversed resource identifier as the current resource identifier, which is used to identify the current resource.

[0112] The resource identifiers in the resource dependency list of the first resource can be sorted according to the time point of establishing the resource dependency relationship, and the computer device can traverse the resource identifiers recorded in the resource dependency list of the first resource in order. Alternatively, the computer device can also traverse the resource identifiers recorded in the resource dependency list of the first resource in parallel. For ease of understanding, taking the current traversal to a resource identifier as an example, the current traversal to a resource identifier can be determined as the current resource identifier, and the resource identified by it is used as the current resource.

[0113] A resource reference list corresponds to a resource. Similarly, the resource reference list and the resource identifier of the corresponding resource can also be associated, so that the computer device can search for the resource reference list of the current resource in the reference relationship management container according to the current resource identifier. If the current resource is scanned for the first time, the resource reference list of the current resource is not included in the reference relationship management container, and the resource reference list of the current resource cannot be found in the reference relationship management container; if the current resource is not scanned for the first time, the resource reference list of the current resource has been established in the reference relationship management container during the previous first scan, and the resource reference list of the current resource can be found in the reference relationship management container. Based on whether the resource reference list of the current resource is found, the following steps 3.2 or 3.3 can be executed.

[0114] Step 3.2: If the reference relationship management container includes a resource reference list of the current resource, the resource reference list of the current resource is updated according to the resource identifier of the first resource.

[0115] Specifically, if the reference relationship management container includes the resource reference list of the current resource, it means that the current resource is not scanned for the first time, and the current resource may also be referenced by other resources and a resource reference list is established in the reference relationship container, which can then be updated to the resource reference list of the current resource according to the resource identifier of the first resource. In the specific update process, the above update refers to adding a resource identifier of the first resource to the resource reference list of the current resource to indicate that the current resource is referenced by the first resource.

[0116] Step 3.3: If the reference relationship management container does not include the resource reference list of the current resource, a resource reference list of the current resource is established in the reference relationship management container, and the resource identifier of the first resource is added to the established resource reference list of the current resource.

[0117] If the reference relationship management container does not include the resource reference list of the current resource, it means that the current resource is scanned for the first time, and a new resource reference list of the current resource can be created in the reference relationship management container, and then the resource identifier of the first resource is added to the resource reference list of the current resource to indicate that the current resource is referenced by the first resource. In this way, a resource reference list including the current resource is newly added to the reference relationship management container, and the resource reference list of the current resource includes the resource identifier of the first resource.

[0118] When the resource dependency list of the first resource has not been traversed completely, the traversal can continue, and the traversed resource identifier is determined as the current resource identifier, and the above steps 3.2-3.3 are repeated. In this way, after traversing the resource identifiers recorded in the resource dependency list of the first resource, the reference relationship management container includes at least one resource reference list, and each resource reference list corresponds to the resource identified by the corresponding resource identifier in the resource dependency list of the first resource. In other words, for each resource identified by the resource identifier recorded in the first resource dependency list, a corresponding resource reference list can be obtained. The at least one resource reference list may include a newly added resource reference list, and may also include an existing resource reference list with a new resource identifier added. In one implementation, based on whether the resource dependency list is stored in the first storage area after the first full scan of the engineering project, it can be decided whether to add the resource identifier of the first resource to the above resource reference list. Exemplarily, in the resource dependency list obtained by the first full scan, the resource dependency list of the first resource A includes resource B, resource C and resource D. Then based on the first resource dependency list, a resource reference list b-list of resource B, a resource reference list c-list of resource C and a resource reference list d-list of resource D can be obtained, and the GUID of the first resource A is recorded in the above three resource reference lists.

[0119] Based on the above process of updating the reference relationship management container, the following can be provided: Figure 5d As shown, exemplarily, each resource identifier in the resource dependency list of a resource (such as resource A) can be traversed. If for a resource identified by a resource identifier in the resource dependency list (such as resource B), a resource reference list (which can be understood as an entry reference list) corresponding to the resource already exists in the reference relationship management container, then the resource identifier of resource A can be added to the resource reference list, and then updated to the reference relationship management container; if the resource reference list corresponding to the resource identifier does not exist in the reference relationship management container, a new resource reference list can be created, and the resource identifier of resource A can be added to the resource reference list, thereby realizing the filling of new data in the reference relationship management container.

[0120] Step 4: After at least one resource dependency list has been selected and the reference relationship management container has been updated, one or more resource reference lists are obtained.

[0121] In a specific implementation, when the resource identifiers of each resource obtained have not been traversed completely, the traversal can continue, and the traversed resource identifier is determined as the resource identifier of the first resource, and then the above steps 2 to 3 are repeated. Then, after the resource identifiers of each resource of the project are traversed, each resource dependency list in at least one resource dependency list will be selected and used to update the reference relationship management container.

[0122] For each resource dependency list in at least one resource dependency list, the existing resource reference list in the reference relationship management container can be updated based on the traversal of the resource identifiers recorded in the resource dependency list, or a new resource reference list can be added to the reference relationship management container. When the resource identifiers in all resource dependency lists have been traversed, it can be determined that the update of the reference relationship management container has been completed. By updating the reference relationship management container in the above manner, one or more resource reference lists can be finally obtained, and the number of the resource reference lists can be a target number, which refers to the total number of non-repetitive resource identifiers calculated based on the number of resource identifiers recorded in at least one resource dependency list. That is, each dependent resource in the engineering project corresponds to a resource reference list, and one or more resource reference lists exist in the reference relationship management container.

[0123] To facilitate understanding of the specific process of updating the reference relationship management container shown in steps 1 to 4 above, the following is provided: Figure 5eThe example diagram shown is further explained. The first resource (such as resource A) can be traversed from the first container (container C1), and then the resource dependency list List-A of the first resource can be selected from the second container. The resource dependency list records the resource identifiers of each resource that resource A depends on. The reference relationship management container (i.e., container C4) does not include the resource reference list of resources B, C, and D, so as to establish a resource reference list B-list of resource B, a resource reference list C-list of resource C, and a resource reference list D-list of resource D, and add the resource identifier of resource A to each resource reference list to respectively indicate that resource B is referenced by resource A, resource C is referenced by resource A, and resource D is referenced by resource A.

[0124] S404: Determine one or more resource reference lists as resource reference relationships between multiple resources.

[0125] The computer device may determine one or more resource reference lists extracted based on the reference relationship as resource reference relationships between multiple resources, and each resource reference list may be used to indicate resource reference relationships between a certain resource and one or more other resources. When the resource reference relationship is subsequently updated, the corresponding resource reference relationship is updated by updating the resource reference list.

[0126] It should be noted that the first container, the second container, and the third container mentioned in the embodiment of the present application can exist in both the memory and the database at runtime, but the reference relationship management container exists in the memory. The resource reference relationship managed in the reference relationship management container can be updated in a timely manner based on the update of the relevant data stored in the first container, the second container, and the third container. Therefore, in the actual application process, the resource reference relationship can be quickly found.

[0127] S405 , in response to an update request for the project, read resource change information of the project from the first storage area, and determine a target resource in the project that has been changed according to the read resource change information.

[0128] S406: Update the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area.

[0129] S407, reading updated resource attribute information from the second storage area, and updating resource reference relationships between multiple resources based on the updated resource attribute information.

[0130] It is understandable that for the specific implementation of updating the resource reference relationship according to the updated resource attribute information, the resource reference relationship can be updated by updating the resource dependency list or adding a new resource dependency list, referring to the similar logic introduced in the above steps S402-S404.

[0131] The resource processing method provided in the embodiment of the present application can establish a resource reference relationship based on the resource attribute information stored in the second storage area when the second storage area included in the database corresponding to the resource management engine includes resource attribute information of all resources of the project. Specifically, a resource reference list can be established through the resource identifiers recorded in the resource dependency list and the resource identifiers of the resources belonging to the resource dependency list, and then the resource reference relationship can be represented by the resource reference list. With the help of the efficient access performance of the database, the speed of obtaining or updating the resource reference list can be improved, and the resource reference relationship can be quickly established.

[0132] Based on the above embodiments, an exemplary embodiment of the present application further proposes a more specific resource processing method. In the embodiment of the present application, the resource processing method is mainly described by taking a computer device executing the resource processing method as an example; see Figure 6 , the resource processing method may include the following steps S601-S605.

[0133] S601, determine the engineering project in the resource management engine, the engineering project includes multiple resources, and there is a resource reference relationship between the multiple resources; the resource management engine corresponds to a database, the database includes a first storage area and a second storage area, the first storage area is used to store resource change information generated each time the engineering project changes resources; the second storage area is used to store resource attribute information of each resource in the engineering project.

[0134] In one embodiment, the storage process of resource change information can be specifically referred to the following implementation:

[0135] (1) If a resource change notification for a project is received, resource change information for the project is generated based on the resource change notification for the project; wherein the resource change notification is sent by the resource management engine after it detects a resource change for the project and updates the changed resources to the project, calling a target method; the target method is a method registered for notifying resource changes.

[0136] In a specific implementation, the resource management engine has the function of detecting and notifying resource changes. Every time a resource change occurs in a project, the resource management engine can detect it and notify a certain method (i.e., the target method), informing the method which resources have changed (i.e., added, deleted, modified, or moved). The resource management engine runs in a computer device, and a resource processing tool is deployed in the resource management engine. The resource processing tool can be used as a module in the resource management engine to support interaction with the database and other modules of the resource management engine to implement the solution provided in this application. The resource processing tool can register the target method. Each time the resource management engine detects a resource change in the project and imports the changed resources, the resource management engine can call the target method to send a resource change notification to the resource processing tool, so that the resource processing tool can receive the resource change notification and generate resource change information for the project based on the resource change notification of the project.

[0137] In a specific implementation, the resource change notification includes: a resource identifier of at least one changed resource and a resource change type of the corresponding changed resource; when generating resource change information for the project according to the resource change notification of the project, specifically: the resource identifier of each changed resource and the resource change type of the corresponding changed resource are combined to obtain resource change sub-information of each changed resource, so that the resource change sub-information of each changed resource can be determined as the resource change information of the project. Thus, the resource change information of the project includes the resource change sub-information of at least one changed resource.

[0138] The resource change notification can provide one or more of the following information: added resources (GUID), deleted resources (GUID), moved resources (GUID), and the original resource storage path (path, or original directory) where the moved resource is located. The original directory refers to the directory where the resource was located before it was moved. The directory where the resource is located after it is moved can be obtained based on the resource identifier (such as GUID) of the resource through the interface provided by the resource engine. Based on the different resource change types, the content included in the resource change information is different. Specifically, it includes the following ①-②: ① If the resource change type of the corresponding changed resource is a resource move type, the resource change sub-information of the corresponding resource includes: the resource identifier of the changed resource, the resource change type, and the original resource storage path of the changed resource. That is, the changed resource is a moved resource, and the resource identifier, resource change type, and original storage path (i.e., the resource storage path before the resource is moved) of the resource can be added to the resource change sub-information of the resource. ② If the resource change type of the corresponding changed resource is the target type, the resource change sub-information of the corresponding resource includes: the resource identifier and resource change type of the changed resource, wherein the target type is any one of the following: resource addition type, resource deletion type, and resource modification type. That is, whether the changed resource is a newly added resource, a deleted resource in the project, or a modified resource in the project, the corresponding resource change information includes the resource identifier, so that the complete resource attribute information of the resource can be obtained through the engine interface based on the resource identifier to update the resource attribute information stored in the second storage area, or the existing resource attribute information in the second storage area can be directly deleted based on the resource identifier.

[0139] (2) Storing resource change information for the project in the first storage area; wherein, after the resource change information stored in the first storage area is read, the resource change information is cleared to store the resource change information generated when the project makes a resource change next time.

[0140] Specifically, the resource change information of the project includes at least one resource change sub-information of the changed resource. When the stored area is equal to the first storage area, the first storage area includes at least one resource change sub-information of the changed resource. The resource change information of the project is cached in the first storage area. Based on the cache function, after the resource change information is read from the first storage area in response to the update request of the project, the read resource change information can be deleted from the first storage area. Alternatively, in order to prevent the update from being stopped due to a device failure during the update of the resource attribute information, the read resource change information can be deleted from the first storage area after the resource attribute information is updated. By periodically clearing the resource change information, the amount of information of the cached resource change information in the first storage area can be controlled, and the correct update of the resource attribute information can be ensured. Sufficient space can also be reserved to facilitate the storage of new resource change information generated when the resource is changed after the project, so as to update the resource attribute information stored in the second storage area again.

[0141] The storage of the resource change information shown in (1)-(2) above can be based on the notification mechanism of the resource management engine itself, and resource change notifications can be sent in a timely manner each time a resource change occurs in a project, so that the resource change information can be cached in the database. When the resource attribute information stored in the database needs to be updated to match the project, the resource attribute information can be incrementally updated based on the correct resource change information, without the need to perform a full resource scan of the project to obtain the full amount of resource attribute information, so that resource dependencies and resource reference relationships can be quickly updated.

[0142] S602 , in response to an update request for a project item, read resource change information of the project item from a first storage area, and determine a target resource in the project item that has been changed according to the read resource change information.

[0143] In one embodiment, the resource attribute information of each resource can be distributed and stored in multiple containers in the second storage area, and each container is used to store different resource attribute information, so as to isolate and manage resource attributes of different information categories. Based on this, when the resource attribute information of the target resource is updated in the second storage area, the resource attributes stored in the corresponding container are updated based on the resource change type involved in the target resource.

[0144] S603: Determine a target container to be updated from a plurality of containers included in the second storage area according to the resource change type involved in the target resource.

[0145] In one embodiment, the multiple containers include a first container and a second container, the first container is used to store the path dependency relationship of the resource; the second container is used to store the resource dependency list of the resource. When the computer device executes the above S603, it may specifically include the following ①-③.

[0146] ① If the resource change type involved in the target resource includes a resource movement type, then the first container is determined from the multiple containers included in the second storage area, and the first container is determined as the target container to be updated. Specifically, if the resource change type involved in the target resource includes a resource movement type, it means that the target resource is a moved resource. Since only the resource path is changed when the resource is moved, other resource attributes of the resource, such as the resource name, resource reference status, etc., are not changed, and the first container is used to store the path dependency of the resource, which includes the resource identifier and the resource storage path. Therefore, the first container among the multiple containers can be determined as the target container to be updated, so as to update the path dependency of the target resource stored in the first container. The updated path dependency of the target resource includes the resource identifier and the latest resource storage path.

[0147] ② If the resource change type involved in the target resource includes a resource increase type or a resource deletion type, each container in the second storage area is determined as a target container to be updated. If the resource change type involved in the target resource includes a resource increase type, it means that the target resource is an increased resource. In the case of resource increase, the resource attribute information of the resource will also increase. Similarly, if the resource change type involved in the target resource includes a resource deletion type, it means that the target resource is a resource deleted in the project. In the case of resource deletion, the resource attribute information of the resource will also be deleted. The resource attribute information of the resource is distributed and stored in multiple containers. Therefore, whether deleting resources or adding resources, the first container and the second container can be used as target containers to be updated. If the multiple containers also include a third container for storing resource information (including file hash, file name, resource change time, etc.), then the third container can also be determined as a target container to be updated.

[0148] ③ If the resource change type involved in the target resource includes a resource modification type, a second container is determined from the multiple containers included in the second storage area, and the second container is determined as the target container to be updated. If the resource change type involved in the target resource includes a resource modification type, it means that some inherent attributes of the target resource (such as the resource name) may change or the resource dependency may change. In order to avoid missing changes in resource dependency information and causing inaccurate updates to the resource reference list, the second container used to record the resource dependency list can be determined as the target container to be updated, and then the resource dependency list of the target resource recorded in the second container can be updated, thereby updating the resource dependency relationship.

[0149] S604: Use the resource attribute information of the target resource to update the resource attribute information stored in the target container.

[0150] In one embodiment, based on different resource types involved in the target resource, updating the resource attribute information stored in the target container specifically includes the following (i) to (iv):

[0151] (i) The resource change type involved in the target resource includes the resource movement type. Then the target container is the first container, and the path dependency of the target resource is stored in the first container, and the path dependency includes the resource identifier of the target resource and the resource storage path of the target resource before being moved (referred to as the original resource storage path). The update of the target container specifically includes the following steps 1-1 to 1-3.

[0152] Step 1-1: Call the interface provided by the resource management engine to obtain the resource storage path of the target resource according to the resource identifier of the target resource.

[0153] Step 1-2: Map the resource storage path of the target resource and the resource identifier of the target resource to obtain the target path dependency relationship.

[0154] Step 1-3: Use the target path dependency to replace the path dependency of the target resource included in the first container.

[0155] Specifically, the target resources in the engineering project can be scanned according to the resource identifier of the target resource through the interface provided by the resource management engine, so as to obtain the resource storage path of the target resource. After that, a mapping from the obtained resource storage path to the resource identifier can be established to obtain a new path dependency (i.e., a target path dependency), and then the path dependency of the target resource recorded in the first container is replaced with the target path dependency, so as to replace the original resource path. The target path dependency of the target resource included in the first container refers to the mapping relationship from the latest resource storage path of the target resource to the resource identifier of the target resource.

[0156] (ii) The resource change type involved in the target resource includes a resource addition type. Then the target resource is a newly added resource, and the target container includes a first container and a second container. The update of the target container specifically includes the following steps 2-1 to 2-3.

[0157] Step 2-1: Call the interface provided by the resource management engine to obtain the resource storage path of the target resource and the resource identifier of at least one resource that the target resource depends on according to the resource identifier of the target resource.

[0158] Step 2-2: Map the resource storage path of the target resource and the resource identifier of the target resource to obtain the path dependency of the target resource, and add the path dependency of the target resource to the first container.

[0159] Step 2-3: Create a resource dependency list of the target resource according to the resource identifier of at least one resource that the target resource depends on, and add the resource dependency list of the target resource to the second container.

[0160] Specifically, the computer device can call the interface provided by the resource management engine, and based on the resource identifier of the target resource, scan the target resources included in the engineering project in the resource management engine, so as to obtain the resource storage path and resource dependency information of the target resource, and the resource dependency information includes: the resource identifier of at least one resource that the target resource depends on. Since the target resource is a newly added resource, the resource attribute information of the target resource has not been stored in the second storage area, so it is necessary to establish a mapping from the resource storage path of the target resource to the resource identifier, and obtain the path dependency relationship of the target resource, so as to store the path dependency relationship of the target resource in the first container, so that the path dependency relationship of the target resource is added to the first container, thereby updating the path dependency relationship of each resource already in the first container. In addition, according to the resource identifier of at least one resource that the target resource depends on, a new resource dependency list of the target resource can be created, and the resource dependency list of the target resource includes the resource identifier of at least one resource that the target resource depends on; thereafter, the resource dependency list can be stored in the second container, so that the second container includes the resource dependency list of the target resource, thereby increasing the number of resource dependency lists already in the first container.

[0161] It is understandable that if the target container includes a third container, then in this case, the resource information of the resource, including the file hash, file name, and resource creation time (which can be used as the resource modification time), etc., can also be obtained through the engine interface, so that the resource information can be added to the third container, so that the resource information is newly added to the third container.

[0162] In the case where existing resources in the above-mentioned project are moved or new resources are added to the project, the corresponding resource attributes of the target resource can be obtained in real time based on the resource identifier of the target resource included in the resource change information by calling the engine interface, and then the obtained resource attributes can be stored in the corresponding container of the second storage area in a corresponding form. In the case of new resources added to the project, the target container can be updated based on the resource attribute information so that each container in the second storage area includes the corresponding resource attributes of the target resource. In the case where existing resources in the project are moved, updating through the first container can update the resource storage path of the target resource stored in the first container to the latest path.

[0163] (III) The resource change type involved in the target resource includes the resource deletion type. Then the target resource is a resource that has been deleted in the project, and the target container includes a first container and a second container. The update of the target container specifically includes the following steps 3-1 to 3-2.

[0164] Step 3-1: According to the resource identifier of the target resource, search for the path dependency of the target resource in the first container, and delete the searched path dependency of the target resource.

[0165] Step 3-2: According to the resource identifier of the target resource, search for the resource dependency list of the target resource in the second container, and delete the searched resource dependency list of the target resource.

[0166] Specifically, after the existing resources in the project are deleted and before the second storage area is updated, the resource attribute information of the target resource still exists in the second storage area. In order to make the resource attribute information stored in the second storage area match the resource attribute information of the resources in the project, the computer device can search for the path dependency of the target resource in the first container based on the resource identifier of the target resource, and search for the resource dependency list of the target resource in the second container based on the resource identifier of the target resource, and then directly delete the path dependency of the target resource in the first container, and delete the resource dependency list of the target resource in the second container. It is understandable that if the target container also includes a third container, then the resource information of the target resource in the third container can also be deleted, so that the resource information of the target resource is not included in the third container.

[0167] (IV) The resource change type involved in the target resource includes the resource modification type. Then the target resource is the existing resource to be modified in the engineering project, and the target container includes at least the second container. The update of the target container specifically includes the following steps 4-1 to 4-3.

[0168] Step 4-1: Call the interface provided by the resource management engine to obtain the resource identifier of at least one reference resource that the target resource depends on from the engineering project according to the resource identifier of the target resource.

[0169] Step 4-2: Compare the acquired resource identifier of at least one reference resource with the resource identifier in the resource dependency list of the target resource stored in the second container.

[0170] Step 4-3: If there is a difference between the resource identifier of at least one reference resource and the resource identifier in the resource dependency list of the target resource stored in the second container, the dependent resource list of the target resource stored in the second container is updated based on the resource identifier of at least one reference resource, so that the resource dependency list of the target resource stored in the second container includes the resource identifier of at least one reference resource.

[0171] Specifically, the computer device can call the engine interface to scan the target resource, thereby enumerating the resource identifiers of all reference resources that the target source depends on, wherein the reference resource is the resource called when the target resource is used. The resource identifier recorded in the resource dependency list of the target resource included in the second container can be the resource identifier of the resource that the target resource depends on before the engineering project makes a resource change, or it can be the resource dependency list used for the last update of the resource reference relationship. Therefore, the computer device can compare all the resource identifiers in the resource dependency list of the target resource in the second container, as well as the resource identifier of at least one reference resource obtained, to determine whether there is a difference between the relevant resource identifier recorded in the second container and the obtained resource identifier, and then determine whether to update the relevant resource identifier recorded in the second container.

[0172] If there is a difference, it means that after the resource change, the resource dependency of the target resource (including the dependent resources) has changed; for example: compared with the resource identifier recorded in the resource dependency list of the target resource in the second container, after the target resource is modified, a new resource is added to the resource dependency of the target resource, or a resource is reduced by the target resource. In order to synchronize the latest resource dependency of the engineering project after the resource change to the second storage area, the resource identifier recorded in the resource dependency list of the target resource stored in the second container is updated based on the resource identifier of at least one reference resource obtained from the current engineering project, thereby updating the resource dependency relationship managed by the second resource. Based on the difference between the dependent resources of the target resource before and after the resource change, the update here may include one or both of the following: deleting the existing resource identifier in the resource dependency list and adding a new resource identifier to the resource dependency list. Specifically: ① If the resource identifier of a reference resource is the same as a resource identifier in the resource dependency list of the target resource, then the resource identifier can be retained in the resource dependency list of the target resource; ② If the resource identifier of a reference resource does not exist in the resource dependency list of the target resource, then the resource identifier of the reference resource can be added to the resource dependency list of the target resource; ③ If a resource identifier in the resource dependency list of the target resource does not exist in the resource identifier of at least one reference resource, it means that the resource corresponding to the resource identifier has been released from the resource dependency relationship with the target resource, then the resource identifier can be deleted from the resource dependency list of the target resource. After the above processing, the resource dependency list of the target resource stored in the second container includes the resource identifier of at least one reference resource, and at least one reference resource that the target resource depends on can be determined based on the resource dependency list.

[0173] On the contrary, if there is no difference between the resource identifier of at least one reference resource and the resource identifier in the resource dependency list of the target resource stored in the second container, it means that the resource dependency of the target resource has not changed, and the resource dependency list of the target resource can be kept unchanged. Furthermore, if the resource information of the target resource, such as the file name, file hash or resource change time, changes, for example: after the same resource in the engineering project is moved, the resource information is modified. In the engineering project, the corresponding resource change time can be recorded after the resource is changed, for example, the resource change time of resource A is 2023 / 10 / 1 17:00. The computer device can call the interface provided by the resource management engine, scan the target resource based on the resource identifier of the target resource, obtain the resource information of the target resource, including the resource change time, and update the resource information in the third container, so that the resource information of the target resource recorded in the third container matches the resource information of the target resource in the engineering project.

[0174] It should be noted that the serial numbers of the steps in this application do not necessarily limit the execution order of the corresponding contents; for example, the above-mentioned step 3-1 and step 3-2 can be executed simultaneously or successively.

[0175] In one embodiment, the multiple containers further include a third container, and the third container is used to store the resource change time of the changed resource; the resource change time refers to the time point when a certain resource is changed. For example, if a resource is added to a project, the time point when the resource is introduced into the project can be used as the resource change time. For another example, if a resource is moved to another location, the time point when the resource is successfully moved to the other location can be used as the resource change time point. The resource change time can include the year, month, day and a specific time point in a day. It should be noted that the changed resources stored here include moved resources, modified resources and newly added resources. If a resource has been deleted in the project, the resource attribute information of the resource in the second storage area will also be cleared, so that the third container does not include the resource change time of the deleted resource. Based on the record of the resource change time, it is relatively convenient to verify and trace when the resource was modified. In one embodiment, the target resource includes multiple resources. The computer device can filter out the recently modified resources by the resource change time of each resource, so that the resources are highlighted in a corresponding manner when viewing the resource reference relationship. Specifically, it may include the following contents (1)-(2).

[0176] (1) According to the resource change time of each resource recorded in the third container, at least one resource whose resource change time point is within a preset time period is selected from the target resources.

[0177] Specifically, the preset time period can be a time interval, and the units of the time interval include but are not limited to: weeks, days, hours, minutes and seconds. Exemplarily, the preset time period can be the most recent week. Based on the resource change time of each resource recorded in the third container and the preset time period, at least one resource can be filtered out from multiple resources, and the resource change time of the filtered resources is within the preset time period. For example, using the above-mentioned example of the preset time period, the time when the computer device executes this solution is October 7, 2023, then the preset time period is from October 1, 2023 to October 7, 2023. All resources that have been changed within this time period can be filtered out. For example, if the resource change time of a resource is October 1, then the resource can be filtered out for subsequent highlighting.

[0178] (2) In the process of viewing the updated resource reference relationship, at least one of the filtered resources is highlighted in a preset display mode; wherein the preset display mode includes any one or more of the following: highlight display, bold display, and flashing display.

[0179] In a specific implementation, a user can use a resource processing tool to view the updated resource reference relationship. During the viewing process, the computer device can display a reference search interface, and display the resource and the relevant resource attributes of at least one resource that references the resource in the reference search interface, specifically displaying: resource name, resource storage path, and the number of times each resource has been cited. When displaying these contents, the information of the resources that have been changed recently can be highlighted to highlight the resource. The highlighting method includes but is not limited to: highlighting text content, or bolding the resource name of the resource, or flashing display, etc., one or more combinations thereof.

[0180] S605: Read updated resource attribute information from the second storage area, and update resource reference relationships between multiple resources based on the updated resource attribute information.

[0181] Specifically, the computer device can export the first container and the second container from the second storage area, and then read the resource identifiers of all resources from the first container and read all resource dependency lists from the second container. These resource information is the updated resource attribute information read.

[0182] In one embodiment, the resource reference relationship between multiple resources is stored in the reference relationship management container in the form of at least one resource reference list. When the computer device updates the resource reference relationship based on the updated resource attribute information, the resource reference list stored in the reference relationship management container can be updated based on the updated resource attribute information including at least one resource dependency list and resource identifiers of multiple resources. Figure 4The content about establishing resource reference relationship introduced in the illustrated embodiment is similar to the update logic of resource reference relationship here, and the updated resource attribute information can be used as the resource attribute information of each resource stored in the second storage area, and the updated resource attribute information includes a resource dependency list and a resource identifier. Specifically, the following logic can be included: the computer device can traverse each resource identifier, and use the traversed resource identifier as the resource identifier of the first resource, and then search the resource dependency list of the first resource from each resource dependency list, and then traverse the resource identifier recorded in the resource dependency list of the first resource, and use the traversed resource identifier as the resource identifier of the current resource. In the case where the resource reference list of the current resource is included in the reference relationship management container, if the resource identifier of the first resource does not exist in the resource reference list of the current resource, the resource identifier of the first resource can be added to the resource reference list; in the case where the resource reference list of the current resource is not included in the reference relationship management container, a new resource reference list of the current resource can be created in the reference relationship management container, and the resource identifier of the target resource can be added to the resource reference list of the current resource. Therefore, after traversing the resource identifiers of each resource and the resource identifiers in each resource dependency list, the resource reference relationship container can be updated.

[0183] The resource processing method provided in the embodiment of the present application is based on the resource attribute information being distributed and stored in various containers in the second storage area. Based on the resource change type involved in the target resource, the resource attributes stored in the corresponding container in the database can be correctly updated, and in the update process, only the relevant resource attributes of the target resource involved in the resource change can be obtained based on the resource change information for update, without obtaining the resource attribute information of the entire resource, which can improve the update efficiency; in addition, since there is no need to obtain the resource change information generated when the resource is changed from the resource engine interface, but directly read from the database, the speed of container update can also be improved. Furthermore, based on the rapid update of resource attribute information in the container, when the resource reference relationship needs to be updated, the update time can be reduced.

[0184] Furthermore, the updated resource reference relationship is used to optimize the resources of the project. This is because the project can be opened and edited by loading it into the resource management engine. In actual applications, due to the increase in the scale of the project and the multiple iterations of the project, there may be some useless resources in a project, or some resources are not managed in a reasonable way, which affects the loading speed of the project in the resource management engine, thereby affecting the opening and editing of the project. Therefore, it is necessary to optimize the resources in the project.

[0185] In one embodiment, after the resource reference relationship is updated, the project can be optimized for resources according to the updated resource reference relationship. The resource optimization may include one or more of the following: eliminating useless resources in the project, optimizing the resource management method in the project. Among them, the optimized resource management method is, for example, to package various resources that depend on the same resource into the same resource package, so that when loading, a resource package can be parsed to obtain various resources that reference the same resource, thereby improving the resource loading speed and the loading performance of the application.

[0186] In a specific implementation, based on the update logic introduced above. The updated resource reference relationship includes: a resource reference list of the target resource. The resource reference list of the target resource is used to record the resource identifier of at least one resource that references the target resource. For example, the target resource is resource A, and the resource reference list of resource A records the GUIDs of resource X, resource Y, and resource Z, then it can be determined that resource X, resource Y, and resource Z are resources that reference resource A, that is, resource A is dependent on these resources. If the target resource is a newly added resource and the newly added resource is referenced by other resources, then the resource reference list of the target resource can be a newly added resource reference list, and the resource reference list records the resource identifier of at least one resource that references the target resource; if the target resource is an original resource that has been modified in the engineering project and the resource that references the original resource has changed, then the resource list of the target resource can be an existing resource reference list that has been updated.

[0187] Based on this, the implementation of resource optimization of the engineering project by the computer device according to the updated resource reference relationship may include the following steps s11 and s12.

[0188] Step s11: Determine the number of resource identifiers recorded in the resource reference list of the target resource as the number of times the target resource has been referenced.

[0189] In a specific implementation, if the target resource is not referenced by any other resource, then no resource identifier is recorded in the resource reference list of the target resource, then it can be determined that the number of resource identifiers recorded in the resource reference list of the target resource is 0, and thus the number of times the target resource is referenced is 0; this also indicates that the target resource is not referenced at the resource management level of the resource management engine. If the target resource is referenced by at least one resource, then at least one resource identifier is recorded in the resource reference list of the target resource, and each resource identifier is used to identify a resource that references the target resource, so that it can be determined that the number of times the target resource is referenced is equal to the number of resources that reference the target resource. For example, the target resource is resource A, and three GUIDs are recorded in the resource reference list of resource A, which are used to identify resource X, resource Y, and resource Z, respectively, so that the number of times the target resource is referenced is 3.

[0190] Step s12: Optimize the target resources in the engineering project according to the number of times the target resources are cited.

[0191] In one implementation, if the number of times the target resource is referenced is zero, indicating that the target resource is not referenced by other resources, the target resource can be determined to be a useless resource and removed from the project. In this way, useless resources at the resource management level of the resource management engine in the project can be quickly screened and deleted.

[0192] In another implementation, the above-mentioned determination of the number of times the target resource is referenced based on the resource reference list is determined based on the resource identifier, which is relatively accurate for some target resources that have been referenced by other resources. However, if the number of times the target resource is referenced is 0, it can only prove that the target resource has not been referenced at the resource management level, and cannot prove that the target resource is referenced through other reference methods. This is because the reference of resources can be referenced by file name, resource package, etc. in addition to the resource identifier-based method, that is, the target resource may be referenced at the resource package, code, etc. level, so it is also necessary to determine whether the target resource is referenced at other levels. Specifically, the engineering project also includes: packaging logs and code resources, and the packaging log is used to record one or more resources packaged into the resource package. In the engineering project, the resources included in it need to be packaged into the installation package for use. When packaging, one or more resources that have a resource reference relationship with the same resource need to be packaged into the resource package. When running the application based on the installation package, the resource package can be loaded and decompressed to use the resource. The packaging log is generated every time resources are packaged into the installation package. The packaging log can reflect the list of all resources packaged into the resource package in the project, and the format of the packaging log is as follows: Figure 7a As shown. Figure 7a The target resource referenced by other resources in the packaging log is marked with 701. The resource is referenced in the form of resource name. The resources in the project exist in the form of files, and are referenced in the code resources by file identifiers. Code resources include code and configuration files. You can specify to load a certain resource in the code or configuration file, such as Figure 7b (1) in the code specifies to load a resource marked with 7021, such as Figure 7bAs shown in (2), a resource marked with 7022 is specified to be loaded in the configuration, and the specification is made through a file name, and then the resource reference can be determined by scanning the resource indicated by the file name. The file identifier refers to the identifier of the resource file, which can be the name of the resource file (or can be called the resource name). For example, write the following content in a code: set mat.texture = "aaa.png", or configure the following content in the configuration file: cfg.MainTexture = aaa.png. In this way, in the code file or configuration file, an image resource with a resource name of aaa.png is referenced. Based on this, the specific steps of optimizing the engineering project according to the number of times the target resource is referenced include the following steps s21-step s22.

[0193] Step s21: If the number of times the target resource is referenced is zero, the packaging log in the project is scanned to obtain the log scanning result; and the code resources in the project are scanned to obtain the file scanning result.

[0194] Specifically, if the number of references based on the target resource is zero, the computer device can further scan the packaging log, and the obtained log scanning result includes: the file identifier of one or more resources packaged into the resource package in the engineering project. The computer device can also scan the code resources in the engineering project, specifically scan the code and configuration files, and the obtained file scanning results may include the file identifier of the resource referenced in the code or the file identifier of the resource referenced in the configuration file. Since the resource is referenced in the packaging log or code resource based on the file identifier (such as the file name of the resource file) instead of the resource identifier (such as GUID), the reference in the packaging log or code resource cannot be found through the resource dependency provided by the resource management engine. For this purpose, a scanning tool (such as ripgrep tool) can be introduced, which can quickly search one or more files for a keyword through regular expressions, wildcards, etc., and its search efficiency is extremely high. Assuming that the code and configuration files of the entire engineering project are all extracted and searched, it will take about one second. Based on this, when the computer device executes the above step 2.1, it can specifically call the scanning tool to implement it. The scanning tool can scan code resources and packaging logs, such as searching for file names of resource files in code resources and packaging logs.

[0195] Step s22: When the log scanning result indicates that the target resource is not packaged into the resource package, and the file scanning result indicates that the target resource is not included in the code resource, the target resource is determined as a useless resource and is removed from the engineering project.

[0196] Specifically, if the file identifier of the target resource (such as the file name of the resource file) is not included in the log scanning result, it can be determined that the target resource is not packaged into any resource package; if the file scanning result does not include the file identifier of the target resource, it can be determined that the target resource is not explicitly referenced in the code resource, and based on the resource identifier, it can also be determined that the target resource is not referenced by any resource. In summary, it can be determined that the target resource is not referenced in any reference manner, so that the target resource can be determined to be a useless resource and eliminated.

[0197] It is worth noting that the scanning and execution order of the package log and code resources in the present application can be executed concurrently, simultaneously, or in a sequential order. In one implementation method, it is possible to determine whether the target resource is referenced by other resources based on the number of times the target resource is referenced. If the target resource is not referenced by other resources, that is, the number of references is 0, then the package log can be scanned. If it is determined that the target log is not packaged, the code and configuration files are scanned. If they are still not referenced, the target resource can be deleted; conversely, if the target resource is referenced by other resources, or is packaged into a resource package, or is referenced in plain text (that is, a string, such as the file name of a resource file) in the code or configuration, then the target resource can be retained. For the above process, please refer to Figure 7c The flowchart of useless resource identification is shown, in which the resource to be deleted is the target resource mentioned above, and the dependency search tool can obtain the resource reference relationship from the reference relationship management container to determine whether the target resource is referenced. In another implementation, if the target resource is not referenced by other resources, the code and configuration file can be scanned first, and then the packaging log can be scanned. In one implementation, the references in these three aspects can be detected in parallel, that is, determining the resource reference relationship of the target resource, scanning the packaging log, and scanning the code and configuration file can be performed concurrently.

[0198] It can be seen that whether the target resource is a useless resource requires the following three conditions to be met: ① Determine through the resource reference relationship that the target resource is not referenced by any resource; ② Determine through the package log scan that the target resource is not packaged into any resource package (such as AssetBundle); ③ Scan the code to determine that the resource is not referenced in plain text (in the form of a string) by the code and configuration file. The target resource can be regarded as a useless resource only when all the above conditions are met. This is what the invalid file screening function needs to do, and the filtered useless resources can be removed from the project, such as Figure 7dAs shown. It can be understood that if any of the above conditions is not met, the target resource can be retained. For example: when the log scanning result indicates that the target resource is packaged into the resource package, or the file scanning result indicates that the target resource is not included in the code resource, or the number of references of the target resource is non-zero, it can be determined that the target resource is a useful resource, and thus the target resource can be retained.

[0199] The resource optimization introduced in the above method can avoid the necessity of scanning the entire project, whether it is configuration, prefabricated or various resources, by introducing resource reference relationships (stored in reference relationship management containers). Instead, some unreferenced resources are directly screened out based on the resource reference list stored in the reference relationship management container, so that only a few configurations and code files need to be scanned to screen out useless resources; specifically, the resource reference list can be used to check whether the target resource is referenced by other resources, without directly scanning the references of the target resource in the entire project. The search for references to each resource can save more time, thereby greatly reducing the optimization time. Experiments have shown that the above process can save about one minute, and the screening of each resource can be reduced from minutes to less than 1 second. Secondly, whether it is a reference based on resource identification, a reference packaged into a resource package, or a plain text reference in the code or configuration, these three reference methods exist independently. Determining whether the target resource is referenced by these aspects can avoid the problem of accidental deletion and improve the accuracy of determining useless resources. On the other hand, if a project has resources that have not been cleaned up for a long time, the above method can also conduct a relatively comprehensive screening and cleaning of the project, thereby optimizing the resources of the project more safely and accurately and reducing the size of the project.

[0200] See also Figure 8 , Figure 8 : is a schematic diagram of a resource processing device provided by an exemplary embodiment of the present application. The resource processing device may be a computer program (including program code) running in a computer device, for example, the resource processing device is an application software; the resource processing device may be used to execute the corresponding steps of the method provided by the embodiment of the present application. Figure 8 As shown, the resource processing device may include: a determining unit 801 , a processing unit 802 , an acquiring unit 803 and an output unit 804 .

[0201] The determining unit 801 is used to determine a project in a resource management engine, wherein the project includes multiple resources, and the multiple resources have a resource reference relationship; the resource management engine corresponds to a database, and the database includes a first storage area and a second storage area; the first storage area is used to store resource change information generated when the project changes resources each time, and the second storage area is used to store resource attribute information of each resource in the project;

[0202] The processing unit 802 is used to read the resource change information of the project from the first storage area in response to the update request for the project, and determine the target resource that has been changed in the project according to the read resource change information;

[0203] The processing unit 802 is further configured to update the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area;

[0204] The processing unit 802 is further configured to read updated resource attribute information from the second storage area, and update resource reference relationships between multiple resources based on the updated resource attribute information.

[0205] In one embodiment, the resource attribute information of each resource in the engineering project includes at least: at least one resource dependency list and resource identifiers of each resource; one resource dependency list corresponds to one resource, and the resource dependency list of any resource is used to record the resource identifiers of one or more resources that the corresponding resource depends on;

[0206] The acquisition unit 803 is used to acquire the resource identifier of each resource from the second storage area, and acquire at least one resource dependency list from the second storage area;

[0207] The processing unit 802 is used to extract reference relationships according to the resource identifiers of each resource obtained and the resource identifiers recorded in at least one resource dependency list to obtain one or more resource reference lists; one resource reference list corresponds to one resource in the engineering project;

[0208] The processing unit 802 is configured to determine one or more resource reference lists as resource reference relationships between multiple resources.

[0209] In one embodiment, the resource management engine further corresponds to a reference relationship management container, which is used to store a resource reference list; the resource reference list of any resource is used to record the resource identifier of at least one resource that references the corresponding resource;

[0210] The processing unit 802, when extracting reference relationships according to the acquired resource identifiers of each resource and the resource identifiers recorded in at least one resource dependency list to obtain one or more resource reference lists, is specifically configured to:

[0211] Traversing the resource identifiers of each resource obtained, and determining the traversed resource identifier as the resource identifier of the first resource;

[0212] If the at least one resource dependency list includes the resource dependency list of the first resource, selecting the resource dependency list of the first resource from the at least one resource dependency list;

[0213] Updating the reference relationship management container according to the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource;

[0214] When at least one resource dependency list has been selected and the reference relationship management container has been updated, one or more resource reference lists are obtained.

[0215] In one embodiment, the processing unit 802, when updating the reference relationship management container according to the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource, is specifically configured to:

[0216] Traversing the resource identifiers recorded in the resource dependency list of the first resource, and determining the traversed resource identifier as the current resource identifier, where the current resource identifier is used to identify the current resource;

[0217] If the reference relationship management container includes a resource reference list of the current resource, then updating the resource reference list of the current resource according to the resource identifier of the first resource;

[0218] If the reference relationship management container does not include the resource reference list of the current resource, then a resource reference list of the current resource is established in the reference relationship management container, and the resource identifier of the first resource is added to the established resource reference list of the current resource;

[0219] After traversing the resource identifiers recorded in the resource dependency list of the first resource, the reference relationship management container includes at least one resource dependency list, and each resource reference list corresponds to the resource identified by the corresponding resource identifier in the first resource dependency list.

[0220] In one embodiment, the processing unit 802 is further configured to:

[0221] Scan each resource in the project to obtain resource attribute information of each resource;

[0222] The resource attribute information of each resource is stored in the second storage area.

[0223] In one embodiment, the resource attribute information of each resource includes at least: a resource identifier of each resource and a resource storage path of each resource; when the processing unit 802 stores the resource attribute information of each resource in the second storage area, it is specifically used to:

[0224] Mapping the resource identifier of each resource and the resource storage path of the corresponding resource to obtain the path dependency relationship of the corresponding resource;

[0225] Determine a first container, where the first container is used to store path dependencies of resources;

[0226] The path dependency relationship of each resource is stored in the first container, and the first container is stored in the second storage area.

[0227] In one embodiment, the resource attribute information of each resource includes at least: resource dependency information of at least one resource, and the resource dependency information of any resource includes resource identifiers of one or more resources that the corresponding resource depends on; when the processing unit 802 stores the resource attribute information of each resource in the second storage area, it is specifically used to:

[0228] Obtain resource identifiers of one or more resources that the corresponding resource depends on from the resource dependency information of each resource, and establish a resource dependency list of the corresponding resource according to the resource identifiers of the one or more resources that each resource depends on;

[0229] Determine a second container; the second container is used to store a resource dependency list of at least one resource;

[0230] The resource dependency list of each resource is stored in the second container, and the second container is stored in the second storage area.

[0231] In one embodiment, the processing unit 802 is further configured to:

[0232] If a resource change notification for a project is received, resource change information for the project is generated according to the resource change notification for the project; wherein the resource change notification is sent by calling a target method after the resource management engine detects a resource change for the project and updates the changed resources to the project; the target method is a method registered for notifying resource changes;

[0233] The resource change information for the engineering project is stored in the first storage area; wherein, after the resource change information stored in the first storage area is read, the resource change information is cleared to store the resource change information generated when the engineering project makes a resource change next time.

[0234] In one embodiment, the resource change notification includes: a resource identifier of at least one changed resource and a resource change type of the corresponding changed resource; the resource change information of the engineering project includes resource change sub-information of at least one changed resource;

[0235] If the resource change type of the corresponding changed resource is a resource movement type, the resource change sub-information of the corresponding resource includes: a resource identifier of the changed resource, a resource change type, and an original resource storage path of the changed resource;

[0236] If the resource change type of the corresponding changed resource is a target type, the resource change sub-information of the corresponding resource includes: the resource identifier and resource change type of the changed resource, wherein the target type is any one of the following: resource addition type, resource deletion type and resource modification type.

[0237] In one embodiment, resource attribute information of each resource in the second storage area is distributed and stored in multiple containers; when the resource attribute information of the target resource is updated in the second storage area, the processing unit 802 is specifically used to:

[0238] According to the resource change type involved in the target resource, determining a target container to be updated from a plurality of containers included in the second storage area;

[0239] The resource attribute information stored in the target container is updated using the resource attribute information of the target resource.

[0240] In one embodiment, the multiple containers include a first container and a second container, the first container is used to store the path dependency relationship of the resource; the second container is used to store the resource dependency list of the resource; when the processing unit 802 determines the target container to be updated from the multiple containers included in the second storage area according to the resource change type involved in the target resource, it is specifically used for at least one of the following:

[0241] If the resource change type involved in the target resource includes a resource movement type, a first container is determined from a plurality of containers included in the second storage area, and the first container is determined as a target container to be updated; or,

[0242] If the resource change type involved in the target resource includes a resource addition type or a resource deletion type, each container in the second storage area is determined as a target container to be updated; or,

[0243] If the resource change type involved in the target resource includes a resource modification type, a second container is determined from a plurality of containers included in the second storage area, and the second container is determined as a target container to be updated.

[0244] In one embodiment, the resource change type involved in the target resource includes a resource movement type, and the path dependency relationship of any resource includes a resource identifier of the corresponding resource and a resource storage path of the corresponding resource; when the processing unit 802 uses the resource attribute information of the target resource to update the resource attribute information stored in the target container, it is specifically used to:

[0245] Call the interface provided by the resource management engine to obtain the resource storage path of the target resource according to the resource identifier of the target resource;

[0246] Mapping the resource storage path of the target resource and the resource identifier of the target resource to obtain the target path dependency;

[0247] The target path dependency is used to replace the path dependency of the target resource included in the first container.

[0248] In one embodiment, the resource change type involved in the target resource includes a resource addition type. When the processing unit 802 uses the resource attribute information of the target resource to update the resource attribute information stored in the target container, it is specifically used to:

[0249] Calling an interface provided by the resource management engine to obtain the resource storage path of the target resource and the resource identifier of at least one resource that the target resource depends on according to the resource identifier of the target resource;

[0250] Mapping the resource storage path of the target resource and the resource identifier of the target resource to obtain the path dependency relationship of the target resource, and adding the path dependency relationship of the target resource to the first container;

[0251] A resource dependency list of the target resource is established according to a resource identifier of at least one resource on which the target resource depends, and the resource dependency list of the target resource is added to the second container.

[0252] In one embodiment, the resource change type involved in the target resource includes a resource deletion type; when the processing unit 802 uses the resource attribute information of the target resource to update the resource attribute information stored in the target container, it is specifically used to:

[0253] According to the resource identifier of the target resource, searching for the path dependency of the target resource in the first container, and deleting the found path dependency of the target resource; and,

[0254] According to the resource identifier of the target resource, a resource dependency list of the target resource is determined in the second container, and the found resource dependency list of the target resource is deleted.

[0255] In one embodiment, the resource change type involved in the target resource includes a resource modification type; when the processing unit 802 uses the resource attribute information of the target resource to update the resource attribute information stored in the target container, it is specifically used to:

[0256] Calling an interface provided by the resource management engine, and obtaining a resource identifier of at least one reference resource that the target resource depends on from the engineering project according to the resource identifier of the target resource;

[0257] Compare the acquired resource identifier of the at least one reference resource with the resource identifier in the resource dependency list of the target resource stored in the second container;

[0258] If there is a difference between the resource identifier of at least one reference resource and the resource identifier in the resource dependency list of the target resource stored in the second container, the resource identifier of the at least one reference resource is used as a reference to update the dependent resource list of the target resource stored in the second container so that the resource dependency list of the target resource stored in the second container includes the resource identifier of the at least one reference resource.

[0259] In one embodiment, the plurality of containers further include a third container, the third container being used to store the resource change time of the changed resource; the target resource includes a plurality of resources;

[0260] The processing unit 802 is further configured to filter out at least one resource whose resource change time is within a preset time period from the target resources according to the resource change time of each resource recorded in the third container;

[0261] The output unit 804 is used to display at least one filtered resource in a preset display mode during viewing of the updated resource reference relationship; wherein the preset display mode includes any one or more of the following: highlight display, bold display, and flashing display.

[0262] In one embodiment, the updated resource reference relationship is used to optimize resources for the engineering project; the updated resource reference relationship includes: a resource reference list of the target resource, and the resource reference list of the target resource is used to record the resource identifier of at least one resource that references the target resource; the processing unit 802 is used to optimize resources for the engineering project according to the updated resource reference relationship, specifically for:

[0263] The number of resource identifiers recorded in the resource reference list of the target resource is determined as the number of times the target resource is referenced;

[0264] Optimize target resources in engineering projects based on the number of times they are cited.

[0265] In one embodiment, the engineering project further includes: a packaging log and code resources, the packaging log is used to record one or more resources packaged into the resource package, the resources exist in the form of files, and the resources are referenced by file identifiers in the code resources; when the processing unit 802 optimizes the target resources in the engineering project according to the number of times the target resources are referenced, it is specifically used to:

[0266] If the number of times the target resource is referenced is zero, the packaging log in the project is scanned to obtain the log scanning result; and the code resources in the project are scanned to obtain the file scanning result;

[0267] When the log scanning result indicates that the target resource is not packaged into the resource package, and the file scanning result indicates that the target resource is not included in the code resource, the target resource is determined as a useless resource and is removed from the engineering project.

[0268] The embodiment of the present application can update the resource attribute information stored in the second storage area based on the resource change information, so that the resource attribute information stored in the second storage area is consistent with the resource attribute information of the project after the resource change. In addition, it is not necessary to scan all resources for the project, but to scan the target resources that have been changed to quickly update the relevant resource attribute information in the second storage area, thereby improving the updating efficiency of the resource attribute information; in addition, by storing the resource attribute information in a high-performance database, it is not necessary to obtain the resource attribute information through the interface provided by the resource management engine, but it is possible to quickly obtain the resource attribute information consistent with the project directly from the database, thereby correctly and quickly updating the resource reference relationship and realizing the maintenance of the resource reference relationship.

[0269] It should be noted that in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0270] Next, the computer device provided in the embodiment of the present application is described.

[0271] See also Fig. 9 , Fig. 9It is a schematic diagram of the structure of a computer device (i.e., the first consensus node mentioned above) provided in an exemplary embodiment of the present application. The computer device may include an independent device (e.g., one or more of a server, a node, a terminal, etc.), or may include components inside an independent device (e.g., a chip, a software module, or a hardware module, etc.). The computer device may include at least one processor 901 and a communication interface 902. Further, optionally, the computer device may also include at least one memory 903 and a bus 904. Among them, the processor 901, the communication interface 902, and the memory 903 are connected via a bus 904.

[0272] Among them, the processor 901 is a module that performs arithmetic operations and / or logical operations, and can specifically be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a complex programmable logic device (CPLD), a coprocessor (assisting the central processing unit to complete corresponding processing and applications), a microcontroller unit (MCU) and other processing modules, or a combination of multiple of them.

[0273] The communication interface 902 may be used to provide information input or output for at least one processor. And / or, the communication interface 902 may be used to receive data sent externally and / or send data externally, and may be a wired link interface including an Ethernet cable, etc., or a wireless link (Wi-Fi, Bluetooth, general wireless transmission, vehicle-mounted short-range communication technology, and other short-range wireless communication technologies, etc.) interface. The communication interface 902 may be used as a network interface.

[0274] The memory 903 is used to provide a storage space, and the storage space can store data such as an operating system and a computer program. The memory 903 can be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read only memory (EPROM), or a portable read only memory (CD-ROM) or a combination of multiple thereof.

[0275] In a possible implementation manner, the processor 901 in the computer device is used to call a computer program stored in at least one memory 903 to perform the following operations:

[0276] Determine a project in a resource management engine, wherein the project includes multiple resources, and the multiple resources have a resource reference relationship; the resource management engine corresponds to a database, and the database includes a first storage area and a second storage area; the first storage area is used to store resource change information generated each time a resource change is made in the project, and the second storage area is used to store resource attribute information of each resource in the project;

[0277] In response to an update request for a project, resource change information of the project is read from the first storage area, and a target resource that has been changed in the project is determined according to the read resource change information;

[0278] Updating the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area;

[0279] The updated resource attribute information is read from the second storage area, and based on the updated resource attribute information, the resource reference relationship between the multiple resources is updated.

[0280] In one embodiment, the resource attribute information of each resource in the engineering project includes at least: at least one resource dependency list and a resource identifier of each resource; one resource dependency list corresponds to one resource, and the resource dependency list of any resource is used to record the resource identifiers of one or more resources that the corresponding resource depends on; the processor 901 is used to:

[0281] Acquire a resource identifier of each resource from the second storage area, and acquire at least one resource dependency list from the second storage area;

[0282] Extract reference relationships based on the resource identifiers of each resource obtained and the resource identifiers recorded in at least one resource dependency list to obtain one or more resource reference lists; one resource reference list corresponds to one resource in the project;

[0283] One or more resource reference lists are determined as resource reference relationships between multiple resources.

[0284] In one embodiment, the resource management engine further corresponds to a reference relationship management container, which is used to store a resource reference list; the resource reference list of any resource is used to record the resource identifier of at least one resource that references the corresponding resource;

[0285] Processor 901, when extracting reference relationships according to the acquired resource identifiers of each resource and the resource identifiers recorded in at least one resource dependency list to obtain one or more resource reference lists, is specifically configured to:

[0286] Traversing the resource identifiers of each resource obtained, and determining the traversed resource identifier as the resource identifier of the first resource;

[0287] If the at least one resource dependency list includes the resource dependency list of the first resource, selecting the resource dependency list of the first resource from the at least one resource dependency list;

[0288] Updating the reference relationship management container according to the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource;

[0289] When at least one resource dependency list has been selected and the reference relationship management container has been updated, one or more resource reference lists are obtained.

[0290] In one embodiment, the processor 901, when updating the reference relationship management container according to the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource, is specifically configured to:

[0291] Traversing the resource identifiers recorded in the resource dependency list of the first resource, and determining the traversed resource identifier as the current resource identifier, where the current resource identifier is used to identify the current resource;

[0292] If the reference relationship management container includes a resource reference list of the current resource, then updating the resource reference list of the current resource according to the resource identifier of the first resource;

[0293] If the reference relationship management container does not include the resource reference list of the current resource, then a resource reference list of the current resource is established in the reference relationship management container, and the resource identifier of the first resource is added to the established resource reference list of the current resource;

[0294] After traversing the resource identifiers recorded in the resource dependency list of the first resource, the reference relationship management container includes at least one resource dependency list, and each resource reference list corresponds to the resource identified by the corresponding resource identifier in the first resource dependency list.

[0295] In one embodiment, the processor 901 is further configured to:

[0296] Scan each resource in the project to obtain resource attribute information of each resource;

[0297] The resource attribute information of each resource is stored in the second storage area.

[0298] In one embodiment, the resource attribute information of each resource includes at least: a resource identifier of each resource and a resource storage path of each resource; when the processor 901 stores the resource attribute information of each resource in the second storage area, it is specifically used to:

[0299] Mapping the resource identifier of each resource and the resource storage path of the corresponding resource to obtain the path dependency relationship of the corresponding resource;

[0300] Determine a first container, where the first container is used to store path dependencies of resources;

[0301] The path dependency relationship of each resource is stored in the first container, and the first container is stored in the second storage area.

[0302] In one embodiment, the resource attribute information of each resource includes at least: resource dependency information of at least one resource, and the resource dependency information of any resource includes resource identifiers of one or more resources on which the corresponding resource depends; when the processor 901 stores the resource attribute information of each resource in the second storage area, it is specifically used to:

[0303] Obtain resource identifiers of one or more resources that the corresponding resource depends on from the resource dependency information of each resource, and establish a resource dependency list of the corresponding resource according to the resource identifiers of the one or more resources that each resource depends on;

[0304] Determine a second container; the second container is used to store a resource dependency list of at least one resource;

[0305] The resource dependency list of each resource is stored in the second container, and the second container is stored in the second storage area.

[0306] In one embodiment, the processor 901 is further configured to:

[0307] If a resource change notification for a project is received, resource change information for the project is generated according to the resource change notification for the project; wherein the resource change notification is sent by calling a target method after the resource management engine detects a resource change for the project and updates the changed resources to the project; the target method is a method registered for notifying resource changes;

[0308] The resource change information for the engineering project is stored in the first storage area; wherein, after the resource change information stored in the first storage area is read, the resource change information is cleared to store the resource change information generated when the engineering project makes a resource change next time.

[0309] In one embodiment, the resource change notification includes: a resource identifier of at least one changed resource and a resource change type of the corresponding changed resource; the resource change information of the engineering project includes resource change sub-information of at least one changed resource;

[0310] If the resource change type of the corresponding changed resource is a resource movement type, the resource change sub-information of the corresponding resource includes: a resource identifier of the changed resource, a resource change type, and an original resource storage path of the changed resource;

[0311] If the resource change type of the corresponding changed resource is a target type, the resource change sub-information of the corresponding resource includes: the resource identifier and resource change type of the changed resource, wherein the target type is any one of the following: resource addition type, resource deletion type and resource modification type.

[0312] In one embodiment, resource attribute information of each resource in the second storage area is distributed and stored in multiple containers; when the resource attribute information of the target resource is updated in the second storage area, the processor 901 is specifically used to:

[0313] According to the resource change type involved in the target resource, determining a target container to be updated from a plurality of containers included in the second storage area;

[0314] The resource attribute information stored in the target container is updated using the resource attribute information of the target resource.

[0315] In one embodiment, the multiple containers include a first container and a second container, the first container is used to store the path dependency relationship of the resource; the second container is used to store the resource dependency list of the resource; when the processor 901 determines the target container to be updated from the multiple containers included in the second storage area according to the resource change type involved in the target resource, it is specifically used for at least one of the following:

[0316] If the resource change type involved in the target resource includes a resource movement type, a first container is determined from a plurality of containers included in the second storage area, and the first container is determined as a target container to be updated; or,

[0317] If the resource change type involved in the target resource includes a resource addition type or a resource deletion type, each container in the second storage area is determined as a target container to be updated; or,

[0318] If the resource change type involved in the target resource includes a resource modification type, a second container is determined from a plurality of containers included in the second storage area, and the second container is determined as a target container to be updated.

[0319] In one embodiment, the resource change type involved in the target resource includes a resource movement type, and the path dependency relationship of any resource includes a resource identifier of the corresponding resource and a resource storage path of the corresponding resource; when the processor 901 uses the resource attribute information of the target resource to update the resource attribute information stored in the target container, it is specifically used to:

[0320] Call the interface provided by the resource management engine to obtain the resource storage path of the target resource according to the resource identifier of the target resource;

[0321] Mapping the resource storage path of the target resource and the resource identifier of the target resource to obtain the target path dependency;

[0322] The target path dependency is used to replace the path dependency of the target resource included in the first container.

[0323] In one embodiment, the resource change type involved in the target resource includes a resource addition type. When the processor 901 uses the resource attribute information of the target resource to update the resource attribute information stored in the target container, it is specifically configured to:

[0324] Calling an interface provided by the resource management engine to obtain the resource storage path of the target resource and the resource identifier of at least one resource that the target resource depends on according to the resource identifier of the target resource;

[0325] Mapping the resource storage path of the target resource and the resource identifier of the target resource to obtain the path dependency relationship of the target resource, and adding the path dependency relationship of the target resource to the first container;

[0326] A resource dependency list of the target resource is established according to a resource identifier of at least one resource on which the target resource depends, and the resource dependency list of the target resource is added to the second container.

[0327] In one embodiment, the resource change type involved in the target resource includes a resource deletion type; when the processor 901 uses the resource attribute information of the target resource to update the resource attribute information stored in the target container, it is specifically used to:

[0328] According to the resource identifier of the target resource, searching for the path dependency of the target resource in the first container, and deleting the found path dependency of the target resource; and,

[0329] According to the resource identifier of the target resource, a resource dependency list of the target resource is determined in the second container, and the found resource dependency list of the target resource is deleted.

[0330] In one embodiment, the resource change type involved in the target resource includes a resource modification type; when the processor 901 uses the resource attribute information of the target resource to update the resource attribute information stored in the target container, it is specifically used to:

[0331] Calling an interface provided by the resource management engine, and obtaining a resource identifier of at least one reference resource that the target resource depends on from the engineering project according to the resource identifier of the target resource;

[0332] Compare the acquired resource identifier of the at least one reference resource with the resource identifier in the resource dependency list of the target resource stored in the second container;

[0333] If there is a difference between the resource identifier of at least one reference resource and the resource identifier in the resource dependency list of the target resource stored in the second container, the resource identifier of the at least one reference resource is used as a reference to update the dependent resource list of the target resource stored in the second container so that the resource dependency list of the target resource stored in the second container includes the resource identifier of the at least one reference resource.

[0334] In one embodiment, the multiple containers also include a third container, and the third container is used to store the resource change time of the changed resource; the target resource includes multiple resources; the processor 901 is also used to filter out at least one resource whose resource change time is within a preset time period from the target resources according to the resource change time of each resource recorded in the third container; in the process of viewing the updated resource reference relationship, display the at least one filtered resource according to a preset display mode; wherein the preset display mode includes any one or more of the following: highlight display, bold display, and flashing display.

[0335] In one embodiment, the updated resource reference relationship is used to optimize resources for the engineering project; the updated resource reference relationship includes: a resource reference list of the target resource, and the resource reference list of the target resource is used to record the resource identifier of at least one resource that references the target resource; the processor 901 is used to optimize resources for the engineering project according to the updated resource reference relationship, specifically for:

[0336] The number of resource identifiers recorded in the resource reference list of the target resource is determined as the number of times the target resource is referenced;

[0337] Optimize target resources in engineering projects based on the number of times they are cited.

[0338] In one embodiment, the engineering project further includes: a packaging log and code resources, the packaging log is used to record one or more resources packaged into the resource package, the resources exist in the form of files, and the resources are referenced by file identifiers in the code resources; when the processor 901 optimizes the target resources in the engineering project according to the number of times the target resources are referenced, it is specifically used to:

[0339] If the number of times the target resource is referenced is zero, the packaging log in the project is scanned to obtain the log scanning result; and the code resources in the project are scanned to obtain the file scanning result;

[0340] When the log scanning result indicates that the target resource is not packaged into the resource package, and the file scanning result indicates that the target resource is not included in the code resource, the target resource is determined as a useless resource and is removed from the engineering project.

[0341] The embodiment of the present application can update the resource attribute information stored in the second storage area based on the resource change information, so that the resource attribute information stored in the second storage area is consistent with the resource attribute information of the project after the resource change. In addition, it is not necessary to scan all resources for the project, but to scan the target resources that have been changed to quickly update the relevant resource attribute information in the second storage area, thereby improving the updating efficiency of the resource attribute information; in addition, by storing the resource attribute information in a high-performance database, it is not necessary to obtain the resource attribute information through the interface provided by the resource management engine, but it is possible to quickly obtain the resource attribute information consistent with the project directly from the database, thereby correctly and quickly updating the resource reference relationship and realizing the maintenance of the resource reference relationship.

[0342] In addition, it should be noted that the embodiment of the present application also provides a computer-readable storage medium, in which a computer program of the aforementioned resource processing method is stored. When the computer program is executed by a processor, the description of the resource processing method in the embodiment of the present application is executed. That is, when one or more processors load and execute the computer program, the description of the resource processing method in the embodiment can be implemented, which will not be repeated here, and the description of the beneficial effects of adopting the same method will not be repeated here.

[0343] The computer-readable storage medium may be the resource processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0344] In one aspect of the present application, a computer program product or a computer program is provided, the computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the resource processing method provided in one aspect of the embodiments of the present application.

[0345] In one aspect of the present application, another computer program product or computer program is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps of the resource processing method provided in the embodiment of the present application are implemented.

[0346] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0347] The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0348] The above disclosure is only part of the embodiments of the present application, which cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made in the claims of the present application still fall within the scope covered by the present application.

Claims

1. A resource processing method, It is characterized in that The method comprises: Determine a project in a resource management engine, wherein the project includes a plurality of resources, and the plurality of resources have a resource reference relationship; the resource management engine corresponds to a database, and the database includes a first storage area and a second storage area; the first storage area is used to store resource change information generated each time a resource change is made to the project, and the second storage area is used to store resource attribute information of each resource in the project; In response to an update request for the project, read resource change information of the project from the first storage area, and determine a target resource that has been changed in the project according to the read resource change information; Updating the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area; The updated resource attribute information is read from the second storage area, and based on the updated resource attribute information, the resource reference relationship between the multiple resources is updated.

2. The method according to claim 1, It is characterized in that The resource attribute information of each resource in the engineering project at least includes: at least one resource dependency list and resource identifiers of each resource; one resource dependency list corresponds to one resource, and the resource dependency list of any resource is used to record the resource identifiers of one or more resources that the corresponding resource depends on; the method also includes: Acquire the resource identifier of each resource from the second storage area, and acquire the at least one resource dependency list from the second storage area; Extract reference relationships based on the resource identifiers of the resources obtained and the resource identifiers recorded in the at least one resource dependency list to obtain one or more resource reference lists; one resource reference list corresponds to one resource in the engineering project; The one or more resource reference lists are determined as resource reference relationships between the multiple resources.

3. The method according to claim 2, It is characterized in that The resource management engine also corresponds to a reference relationship management container, which is used to store a resource reference list; the resource reference list of any resource is used to record the resource identifier of at least one resource that references the corresponding resource; The extracting of reference relationships according to the acquired resource identifiers of the resources and the resource identifiers recorded in the at least one resource dependency list to obtain one or more resource reference lists includes: Traversing the acquired resource identifiers of the resources, and determining the traversed resource identifier as the resource identifier of the first resource; If the at least one resource dependency list includes the resource dependency list of the first resource, selecting the resource dependency list of the first resource from the at least one resource dependency list; updating the reference relationship management container according to the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource; After the at least one resource dependency list has been selected and the reference relationship management container has been updated, one or more resource reference lists are obtained.

4. The method according to claim 3, It is characterized in that The updating of the reference relationship management container according to the resource identifier recorded in the resource dependency list of the first resource and the resource identifier of the first resource includes: Traversing the resource identifiers recorded in the resource dependency list of the first resource, and determining the traversed resource identifier as the current resource identifier, wherein the current resource identifier is used to identify the current resource; If the reference relationship management container includes a resource reference list of the current resource, updating the resource reference list of the current resource according to the resource identifier of the first resource; If the reference relationship management container does not include the resource reference list of the current resource, then establishing the resource reference list of the current resource in the reference relationship management container, and adding the resource identifier of the first resource to the established resource reference list of the current resource; Among them, after traversing the resource identifiers recorded in the resource dependency list of the first resource, the reference relationship management container includes at least one resource dependency list, and each resource reference list corresponds to the resource identified by the corresponding resource identifier in the first resource dependency list.

5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Scanning each resource in the engineering project to obtain resource attribute information of each resource; The resource attribute information of each resource is stored in the second storage area.

6. The method according to claim 5, It is characterized in that The resource attribute information of each resource includes at least: a resource identifier of each resource and a resource storage path of each resource; and storing the resource attribute information of each resource in the second storage area includes: Mapping the resource identifier of each resource and the resource storage path of the corresponding resource to obtain the path dependency relationship of the corresponding resource; Determine a first container, where the first container is used to store path dependencies of resources; The path dependency relationship of each resource is stored in the first container, and the first container is stored in the second storage area.

7. The method according to claim 5, It is characterized in that The resource attribute information of each resource includes at least: resource dependency information of at least one resource, and the resource dependency information of any resource includes resource identifiers of one or more resources that the corresponding resource depends on; storing the resource attribute information of each resource in the second storage area includes: Obtain resource identifiers of one or more resources that the corresponding resource depends on from the resource dependency information of each resource, and establish a resource dependency list of the corresponding resource according to the resource identifiers of the one or more resources that each resource depends on; Determine a second container; the second container is used to store a resource dependency list of at least one resource; The resource dependency list of each resource is stored in the second container, and the second container is stored in the second storage area.

8. The method according to claim 1, It is characterized in that The method further comprises: If a resource change notification for the project is received, resource change information of the project is generated according to the resource change notification of the project; wherein the resource change notification is sent by the resource management engine after detecting a resource change to the project and updating the changed resources to the project, by calling a target method; the target method is a method registered for notifying a resource change; The resource change information for the engineering project is stored in the first storage area; wherein, after the resource change information stored in the first storage area is read, the resource change information is cleared to store the resource change information generated when the engineering project makes a resource change next time.

9. The method according to claim 1, It is characterized in that The resource attribute information of each resource in the second storage area is distributed and stored in a plurality of containers; and the updating of the resource attribute information of the target resource in the second storage area includes: According to the resource change type involved in the target resource, determining a target container to be updated from a plurality of containers included in the second storage area; The resource attribute information stored in the target container is updated using the resource attribute information of the target resource.

10. The method according to claim 9, It is characterized in that The multiple containers include a first container and a second container, the first container is used to store path dependencies of resources; the second container is used to store a resource dependency list of resources; the determining the target container to be updated from the multiple containers included in the second storage area according to the resource change type involved in the target resource includes at least one of the following: If the resource change type involved in the target resource includes a resource movement type, determining the first container from a plurality of containers included in the second storage area, and determining the first container as a target container to be updated; or, If the resource change type involved in the target resource includes a resource addition type or a resource deletion type, each container in the second storage area is determined as a target container to be updated; or, If the resource change type involved in the target resource includes a resource modification type, the second container is determined from a plurality of containers included in the second storage area, and the second container is determined as a target container to be updated.

11. The method according to claim 10, It is characterized in that The resource change type involved in the target resource includes a resource movement type, and the path dependency relationship of any resource includes a resource identifier of the corresponding resource and a resource storage path of the corresponding resource; The updating of the resource attribute information stored in the target container by using the resource attribute information of the target resource includes: Calling the interface provided by the resource management engine to obtain the resource storage path of the target resource according to the resource identifier of the target resource; Mapping the resource storage path of the target resource and the resource identifier of the target resource to obtain a target path dependency relationship; The target path dependency is used to replace the path dependency of the target resource included in the first container.

12. The method according to claim 10, It is characterized in that The resource change type involved in the target resource includes a resource addition type, and the updating of the resource attribute information stored in the target container using the resource attribute information of the target resource includes: Calling an interface provided by the resource management engine to obtain, according to the resource identifier of the target resource, a resource storage path of the target resource and a resource identifier of at least one resource on which the target resource depends; Mapping the resource storage path of the target resource and the resource identifier of the target resource to obtain the path dependency relationship of the target resource, and adding the path dependency relationship of the target resource to the first container; A resource dependency list of the target resource is established according to a resource identifier of at least one resource on which the target resource depends, and the resource dependency list of the target resource is added to the second container.

13. The method according to claim 10, It is characterized in that The resource change type involved in the target resource includes a resource modification type; and the updating of the resource attribute information stored in the target container using the resource attribute information of the target resource includes: Calling an interface provided by the resource management engine, and acquiring, from the engineering project, a resource identifier of at least one reference resource on which the target resource depends according to the resource identifier of the target resource; Comparing the obtained resource identifier of the at least one reference resource with the resource identifier in the resource dependency list of the target resource stored in the second container; If there is a difference between the resource identifier of the at least one reference resource and the resource identifier in the resource dependency list of the target resource stored in the second container, the dependent resource list of the target resource stored in the second container is updated based on the resource identifier of the at least one reference resource, so that the resource dependency list of the target resource stored in the second container includes the resource identifier of the at least one reference resource.

14. The method according to claim 9 or 10, It is characterized in that The multiple containers include a third container, and the third container is used to store the resource change time of the changed resource; The target resource includes a plurality of resources; the method further includes: According to the resource change time of each resource recorded in the third container, at least one resource whose resource change time is within a preset time period is selected from the target resources; In the process of viewing the updated resource reference relationship, at least one filtered resource is displayed according to a preset display mode; wherein the preset display mode includes any one or more of the following: highlight display, bold display and flashing display.

15. The method of claim 1, It is characterized in that The updated resource reference relationship is used to optimize resources for the engineering project; the updated resource reference relationship includes: a resource reference list of the target resource, and the resource reference list of the target resource is used to record the resource identifier of at least one resource that references the target resource; the updated resource reference relationship optimizes resources for the engineering project in a manner including: Determine the number of resource identifiers recorded in the resource reference list of the target resource as the number of times the target resource is referenced; The target resource in the engineering project is optimized according to the number of times the target resource is cited.

16. The method of claim 15, It is characterized in that The engineering project also includes: a packaging log and code resources, wherein the packaging log is used to record one or more resources packaged into a resource package, the resources exist in the form of files, and the resources are referenced by file identifiers in the code resources; the optimization of the target resources in the engineering project according to the number of times the target resources are referenced includes: If the number of times the target resource is referenced is zero, scanning the packaging log in the engineering project to obtain a log scanning result; and scanning the code resources in the engineering project to obtain a file scanning result; When the log scanning result indicates that the target resource is not packaged into the resource package, and the file scanning result indicates that the target resource is not included in the code resource, the target resource is determined as a useless resource and is removed from the engineering project.

17. A resource processing device, It is characterized in that The device comprises: A determination unit is used to determine a project in a resource management engine, wherein the project includes multiple resources, and the multiple resources have a resource reference relationship; the resource management engine corresponds to a database, and the database includes a first storage area and a second storage area; the first storage area is used to store resource change information generated by the project each time a resource change is made, and the second storage area is used to store resource attribute information of each resource in the project; a processing unit, configured to read resource change information of the project from the first storage area in response to an update request for the project, and determine a target resource that has been changed in the project according to the read resource change information; The processing unit is further used to update the resource attribute information of the target resource in the second storage area to update the resource attribute information stored in the second storage area; The processing unit is further configured to read updated resource attribute information from the second storage area, and update the resource reference relationship between the multiple resources based on the updated resource attribute information.

18. A computer device, It is characterized in that include: a processor suitable for executing a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the resource processing method according to any one of claims 1 to 18 is executed.

19. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the resource processing method according to any one of claims 1 to 16 is executed.

20. A computer program product, It is characterized in that The computer program product includes a computer program or a computer instruction, and the computer program or the computer instruction is executed by a processor to implement the resource processing method according to any one of claims 1 to 16.

Citation Information

Cited By

  • Resource management method and system for animation items

    CN121120871A