Resource processing method and device, electronic equipment and computer readable storage medium

By replacing the target resource index with a non-duplicate one during compilation, the problem of duplicate resource indexes in the dynamic feature module mechanism is solved, the complexity of resource index management is simplified, and the uniqueness and management efficiency of resource indexes are ensured.

CN120723451APending Publication Date: 2025-09-30SHENZHEN FALCON NETWORK MEDIA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510831958.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

The existing dynamic feature module mechanism is prone to duplicate resource indexes in complex cross-team and cross-project scenarios, resulting in the inability to match expected resources and increasing the complexity of resource index management.

Method used

By directly replacing the target resource index with a non-duplicate one during compilation, the problem of duplicate resource indexes between dynamic feature modules is solved, simplifying the complexity of resource index management.

Benefits of technology

By directly replacing the target resource index with a non-duplicate one during compilation, the complexity of resource index management is simplified, and resource conflicts and loading failures are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723451A_ABST
    Figure CN120723451A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a resource processing method and device, electronic equipment and a computer readable storage medium, and the method comprises the steps: responding to compilation for a target dynamic characteristic function module in a current project, and determining a target resource index of the target dynamic characteristic function module, the target resource index is obtained by distributing each dynamic characteristic function module in the current project in advance, and the resource indexes distributed by each dynamic characteristic function module are not repeated; replacing a native resource index of the target dynamic characteristic function module with the target resource index; and compiling according to the target resource index to obtain a target file of the target dynamic characteristic function module. According to the embodiment of the invention, the problem of resource index repetition between the dynamic characteristic function modules is solved through a mode of directly replacing with the non-repeated target resource index during compiling, and compared with a mode of creating redundant empty dynamic characteristic function modules to carry out resource index occupation in a traditional scheme, the resource index management complexity is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of software development technology, and specifically to a resource processing method, device, electronic device, and computer-readable storage medium. Background Art

[0002] In software development, Dynamic Feature Module (DFM) is a modular development mechanism provided by Android that allows developers to split the functionality of an application into independent modules (i.e., dynamic feature function modules developed based on dynamic feature modules). These modules can be dynamically loaded at runtime, thereby reducing the size of the initial installation package of the application.

[0003] However, the existing dynamic feature module mechanism has problems with resource index management, especially for complex scenarios across teams and projects, which easily leads to duplication of resource indexes, resulting in failure to match expected resources.

[0004] The existing mechanism is to create many redundant empty dynamic feature function modules to occupy resource indexes in order to solve the problem of resource index conflicts. However, such a mechanism increases the complexity of resource index management. Summary of the Invention

[0005] The embodiments of the present application provide a resource processing method, device, electronic device, and computer-readable storage medium, which can solve the problem of resource index duplication and simplify the complexity of resource index management.

[0006] In a first aspect, an embodiment of the present application provides a resource processing method, the method comprising:

[0007] In response to compiling a target dynamic feature function module in a current project, determining a target resource index of the target dynamic feature function module, wherein the target resource index is pre-allocated to each dynamic feature function module in the current project, and resource indexes allocated to each dynamic feature function module are non-repeated;

[0008] Replace the native resource index of the target dynamic feature function module with the target resource index;

[0009] The target file of the target dynamic feature function module is obtained by compiling according to the target resource index.

[0010] In a second aspect, an embodiment of the present application further provides a resource processing device, the device comprising:

[0011] a determination module configured to determine, in response to compiling a target dynamic feature function module in a current project, a target resource index of the target dynamic feature function module, wherein the target resource index is pre-allocated to each dynamic feature function module in the current project, and resource indexes allocated to each dynamic feature function module are non-repeated;

[0012] A replacement module, configured to replace the native resource index of the target dynamic feature function module with the target resource index;

[0013] A compiling module is used to compile the target file of the target dynamic feature function module according to the target resource index.

[0014] Optionally, in some embodiments of the present application, before determining the target resource index of the dynamic feature function module in response to compiling the dynamic feature function module in the current project, the method further includes:

[0015] Determine each dynamic characteristic function module in the current project;

[0016] The dynamic characteristic function modules are allocated to obtain target resource indexes corresponding to the dynamic characteristic function modules, wherein the target resource indexes in the current project are not repeated.

[0017] Optionally, in some embodiments of the present application, allocating the native resource indexes to obtain target resource indexes corresponding to the dynamic feature function modules includes:

[0018] Determine the starting resource index;

[0019] The target resource index corresponding to each of the dynamic characteristic function modules is configured in sequence based on the starting resource index and in a preset order.

[0020] Optionally, in some embodiments of the present application, before determining the target resource index of the target dynamic feature function module in response to compiling the target dynamic feature function module in the current project, the method further includes:

[0021] For each of the dynamic feature function modules, storing the target resource index of the dynamic feature function module in the target directory file of the dynamic feature function module;

[0022] The step of determining a target resource index of a target dynamic feature function module in response to compiling the target dynamic feature function module in the current project includes:

[0023] In response to compiling the target dynamic feature function module in the current project, the target resource index is obtained from a target directory file of the target dynamic feature function module.

[0024] Optionally, in some embodiments of the present application, allocating the native resource indexes to obtain target resource indexes corresponding to the dynamic feature function modules includes:

[0025] Receive the target resource index of each dynamic characteristic function module sent by the opposite device, where the target resource index is obtained through the configuration of the opposite device.

[0026] Optionally, in some embodiments of the present application, replacing the native resource index of the target dynamic feature function module with the target resource index includes:

[0027] Determining a target tool version, where the target tool version is a version of a target tool for building the target dynamic feature function module;

[0028] Determine the index offset to be modified in the target resource link file according to the target tool version;

[0029] The native resource index corresponding to the to-be-modified index offset is replaced with the target resource index through reflection processing.

[0030] Optionally, in some embodiments of the present application, in response to compiling a target dynamic feature function module in a current project, determining a target resource index of the target dynamic feature function module includes:

[0031] In response to compiling a target dynamic feature function module in a current project, starting a resource linking task;

[0032] The target resource index of the target dynamic characteristic function module is determined at the start execution phase of the resource linking task.

[0033] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps in the above-mentioned resource processing method are implemented.

[0034] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned resource processing method are implemented.

[0035] In a fifth aspect, embodiments of the present application further provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described in the embodiments of the present application.

[0036] An embodiment of the present application determines a target resource index of the target dynamic feature function module in response to compilation of a target dynamic feature function module in the current project. The target resource index is obtained by pre-allocating each dynamic feature function module in the current project. The resource indexes allocated to each dynamic feature function module are not repeated. The native resource index of the target dynamic feature function module is replaced by the target resource index, and the target file of the target dynamic feature function module is compiled according to the target resource index.

[0037] Among them, the problem of resource index duplication between dynamic feature function modules is solved by directly replacing them with non-duplicate target resource indexes during compilation. Compared with the traditional solution of creating redundant empty dynamic feature function modules to occupy resource indexes, the embodiment of the present application simplifies the complexity of resource index management. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in this application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 This is a schematic diagram of a scenario in which a terminal device according to an embodiment of the present application executes the resource processing method;

[0040] Figure 2 This is a flow chart of a resource processing method provided in an embodiment of the present application;

[0041] Figure 3 is a structural diagram of a resource processing device provided in an embodiment of the present application;

[0042] Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.

[0044] The embodiments of the present application provide a resource processing method, device, electronic device and computer-readable storage medium. Specifically, the embodiments of the present application provide a resource processing device suitable for electronic devices, which is used to solve the problem of resource index duplication and simplify the complexity of resource index management. Specifically, the electronic device includes a terminal device or a server, and the terminal device includes but is not limited to mobile phones, tablet computers and other devices. 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 cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The server can be directly or indirectly connected via wired or wireless communication.

[0045] See also Figure 1 , Figure 1 : is a schematic diagram of a scenario in which a terminal device according to an embodiment of the present application executes the resource processing method. The specific execution process of the terminal device executing the resource processing method is as follows:

[0046] The terminal device 10 determines the target resource index of the target dynamic feature function module in response to the compilation of the target dynamic feature function module in the current project. The target resource index is obtained by pre-allocating each dynamic feature function module in the current project. The resource indexes allocated to each dynamic feature function module are not repeated. The terminal device 10 replaces the native resource index of the target dynamic feature function module with the target resource index, and compiles the target file of the target dynamic feature function module according to the target resource index.

[0047] For example, non-overlapping allocated resource indexes are obtained in advance based on the allocation of each dynamic feature function module in the current project. Then, when compiling a target dynamic feature function module, the target resource index corresponding to the target dynamic feature function module is determined from the allocated resource indexes.

[0048] In summary, the embodiment of the present application solves the problem of duplicate resource indexes between dynamic feature function modules by directly replacing them with non-duplicate target resource indexes during compilation. Compared with the traditional solution of creating redundant empty dynamic feature function modules to occupy resource indexes, the embodiment of the present application simplifies the complexity of resource index management.

[0049] The following are detailed descriptions. It should be noted that the order of description of the following embodiments does not limit the priority order of the embodiments. Figure 2 , Figure 2 This is a flowchart of a resource processing method provided in an embodiment of the present application. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the flowchart. Specifically, the process of the resource processing method specifically includes:

[0050] 101. In response to compiling a target dynamic feature function module in a current project, determine a target resource index of the target dynamic feature function module, wherein the target resource index is pre-allocated to each dynamic feature function module in the current project, and resource indexes allocated to each dynamic feature function module are not repeated.

[0051] It should be noted that the dynamic feature function module is a function module developed based on the dynamic feature module (DFM) mechanism. This function module is generally a partial module in an application or project. Based on the characteristics of the dynamic feature module mechanism, this function module can be loaded or unloaded independently. For example, you can first download and install the main module of the application, and then download and install the function module separately based on the actual needs of the user.

[0052] It is understood that the target dynamic feature function module is the dynamic feature function module targeted by the embodiments of this application, and the purpose is to illustrate the resource index processing problem for the function module developed based on the dynamic feature module. The target resource index is the index corresponding to the resources required by the target dynamic feature function module.

[0053] Among them, by allocating the resource indexes of the dynamic characteristic modules in the current project, it is helpful to obtain resource indexes that are not repeated.

[0054] 102. Replace the native resource index of the target dynamic feature function module with the target resource index.

[0055] Among them, the native resource index is a resource index generated under the native mechanism. Since the native mechanism has problems with resource index management, that is, the resource index generated based on the native mechanism is prone to duplication, such as the native mechanism of Android. Therefore, in an embodiment of the present application, by allocating the resource index of each dynamic feature module in the current project and replacing the native resource index based on the allocated target resource index, the resource indexes between the dynamic feature function modules are not repeated, avoiding the problem of resource conflicts. For example, it avoids different resources using the same resource index, resulting in the dynamic feature function module being unable to use accurate and effective resources, resulting in the failure of the dynamic feature function module to load.

[0056] 103. Obtain a target file of the target dynamic feature function module according to the target resource index compilation.

[0057] Among them, the target file is the product after compiling the target dynamic feature function module, usually an apk file. The embodiment of the present application modifies the native resource index to the target resource index during compilation, so that the resources used by the target file are directly the resources corresponding to the target resource index, without the need to modify the resource index when obtaining the compiled product, thereby simplifying the complexity of resource index management.

[0058] In summary, the embodiment of the present application solves the problem of duplicate resource indexes between dynamic feature function modules by directly replacing them with non-duplicate resource indexes during compilation. Compared with the traditional solution of creating redundant empty dynamic feature function modules to occupy resource indexes, the embodiment of the present application simplifies the complexity of resource index management.

[0059] In the embodiments of the present application, the resource index of each dynamic feature function module may be pre-allocated, and compilation is performed based on the allocated resource index. That is, optionally, in some embodiments of the present application, before the step of “determining the target resource index of the dynamic feature function module in response to compilation of the dynamic feature function module in the current project”, the method further includes:

[0060] Determine each dynamic characteristic function module in the current project;

[0061] The dynamic characteristic function modules are allocated to obtain target resource indexes corresponding to the dynamic characteristic function modules, wherein the target resource indexes in the current project are not repeated.

[0062] Among them, by determining each dynamic characteristic function module in the current project, it is helpful to uniformly allocate resource indexes to each dynamic characteristic function module, and it is helpful to obtain target resource indexes that are not repeated.

[0063] For example, in an embodiment of the present application, a collection can be constructed to record the dynamic feature function modules in the current project, and then the target resource index of each dynamic feature function module can be obtained by assigning resource indexes to each dynamic feature function module. The assignment can include random assignment or based on the developer's custom configuration, and the resource indexes of each dynamic feature function module must be different.

[0064] Optionally, in some embodiments of the present application, in order to avoid duplication between allocated resource indexes, an initial resource index may be set, and the resource indexes of each dynamic feature function module may be allocated in ascending or descending order. That is, optionally, in some embodiments of the present application, the step of "allocating each of the native resource indexes to obtain the target resource index corresponding to each of the dynamic feature function modules" includes:

[0065] Determine the starting resource index;

[0066] The target resource index corresponding to each of the dynamic characteristic function modules is configured in sequence based on the starting resource index and in a preset order.

[0067] For example, taking the resource index in hexadecimal format as an example, if the initial resource index is 0x7d, the allocated resource indexes of subsequent dynamic characteristic function modules may be 0x7c, 0x7b, 0x7a, etc. in sequence.

[0068] Setting the target resource indexes in sequence helps ensure that there is no duplication between target resource indexes.

[0069] Optionally, in an embodiment of the present application, a target resource index for each dynamic feature function module may be configured in a target directory file of the dynamic feature function module, so that the target resource index can be obtained from the target directory file when the dynamic feature function module is compiled. That is, optionally, in some embodiments of the present application, before the step of “determining the target resource index of the target dynamic feature function module in response to compiling the target dynamic feature function module in the current project”, the method further includes:

[0070] For each of the dynamic feature function modules, storing the target resource index of the dynamic feature function module in the target directory file of the dynamic feature function module;

[0071] The step of determining a target resource index of a target dynamic feature function module in response to compiling the target dynamic feature function module in the current project includes:

[0072] In response to compiling the target dynamic feature function module in the current project, the target resource index is obtained from a target directory file of the target dynamic feature function module.

[0073] The target directory file is a specific file in the directory of the dynamic feature function module, such as a build.gradle file, in which the target resource index of the dynamic feature function module is configured. Subsequently, the target resource index can be read from the build.gradle file.

[0074] Optionally, in an embodiment of the present application, the resource index may be updated through the cloud or remote control to obtain the target resource index. That is, optionally, in some embodiments of the present application, the step of "assigning each of the native resource indexes to obtain the target resource index corresponding to each of the dynamic feature function modules" includes:

[0075] Receive the target resource index of each dynamic characteristic function module sent by the opposite device, where the target resource index is obtained through the configuration of the opposite device.

[0076] For example, developers obtain the target resource index through cloud configuration, and then store the target resource index in the local device by issuing the target resource index, thereby improving the flexibility of resource index configuration.

[0077] Among them, since different versions of development tools record different index offsets of resource indexes, that is, different versions of development tools use different index offset variables to record resource indexes (that is, resource index values), therefore, the embodiment of the present application determines the index offset to be modified based on different tool versions, and implements the modification of the index value corresponding to the index offset to be modified through the reflection mechanism, that is, the step of "replacing the native resource index of the target dynamic feature function module with the target resource index" includes:

[0078] Determining a target tool version, where the target tool version is a version of a target tool for building the target dynamic feature function module;

[0079] Determine the index offset to be modified in the target resource link file according to the target tool version;

[0080] The native resource index corresponding to the to-be-modified index offset is replaced with the target resource index through reflection processing.

[0081] For example, in AGP 3.6.3, the LinkApplicationAndroidResourcesTask class is loaded through reflection, its member variable resOffsetSupplier is obtained, and the original resource index generated by the native mechanism under the corresponding DFM is replaced with the target resource index. For example, in AGP 4.2.0 and above, the resOffset member variable of the LinkApplicationAndroidResourcesTask class is modified through reflection to control the index value of the generated resOffset (i.e., the target resource index). AGP, or Android Gradle Plugin, is a build tool for Android applications.

[0082] In the embodiments of the present application, in order to simplify the replacement logic of the resource index, the replacement of the native resource index is started at the initial stage of compiling the target dynamic feature function module. That is, optionally, in some embodiments of the present application, the step of "determining the target resource index of the target dynamic feature function module in response to the compilation of the target dynamic feature function module in the current project" includes:

[0083] In response to compiling a target dynamic feature function module in a current project, starting a resource linking task;

[0084] The target resource index of the target dynamic characteristic function module is determined at the start execution phase of the resource linking task.

[0085] Among them, the resource linking task, namely the LinkApplicationAndroidResourcesTask task, is a key task when compiling the target dynamic feature function module, which is responsible for linking and merging the resources of the application and the target dynamic feature function module. The execution phase begins, namely the doFirst phase. The doFirst phase is a lifecycle method of the Gradle task, which is used to execute some custom logic before the task is executed. By replacing the native resource index in this phase, the modification of the resource index can be completed with the least impact as possible, so that the index value of the target file finally generated is the target resource index. Compared with the subsequent resource index replacement in the doLast phase, the embodiment of the present application does not need to generate, verify and then modify it, which simplifies the replacement logic of the resource index and avoids stability problems caused by subsequent modifications.

[0086] In summary, the embodiment of the present application solves the problem of duplicate resource indexes between dynamic feature function modules by directly replacing them with non-duplicate target resource indexes during compilation. Compared with the traditional solution of creating redundant empty dynamic feature function modules to occupy resource indexes, the embodiment of the present application simplifies the complexity of resource index management.

[0087] Furthermore, setting the target resource index of each dynamic feature function module in sequence through the starting resource index helps to avoid duplicate target resource indexes.

[0088] Among them, by replacing the resource index at the beginning of the execution phase (doFirst phase), the replacement logic of the resource index is simplified, avoiding stability problems caused by the modification.

[0089] To facilitate better implementation of the resource processing method of this application, this application also provides a resource processing device based on the above resource processing method. The meanings of the terms are the same as those in the above resource processing method, and the specific implementation details can be referred to the description in the method embodiment.

[0090] See also Figure 3 , Figure 3 : is a schematic diagram of the structure of the resource processing device provided in an embodiment of the present application. The resource processing device may be specifically as follows:

[0091] Determining module 201, configured to determine a target resource index of a target dynamic feature function module in response to compiling the target dynamic feature function module in the current project, wherein the target resource index is pre-assigned to each dynamic feature function module in the current project, and resource indexes assigned to each dynamic feature function module are non-repeated;

[0092] A replacement module 202 is configured to replace the native resource index of the target dynamic feature function module with the target resource index;

[0093] The compiling module 203 is configured to compile the target file of the target dynamic feature function module according to the target resource index.

[0094] Optionally, in some embodiments of the present application, before determining the target resource index of the dynamic feature function module in response to compiling the dynamic feature function module in the current project, the method further includes:

[0095] Determine each dynamic characteristic function module in the current project;

[0096] The dynamic characteristic function modules are allocated to obtain target resource indexes corresponding to the dynamic characteristic function modules, wherein the target resource indexes in the current project are not repeated.

[0097] Optionally, in some embodiments of the present application, allocating the native resource indexes to obtain target resource indexes corresponding to the dynamic feature function modules includes:

[0098] Determine the starting resource index;

[0099] The target resource index corresponding to each of the dynamic characteristic function modules is configured in sequence based on the starting resource index and in a preset order.

[0100] Optionally, in some embodiments of the present application, before determining the target resource index of the target dynamic feature function module in response to compiling the target dynamic feature function module in the current project, the method further includes:

[0101] For each of the dynamic feature function modules, storing the target resource index of the dynamic feature function module in the target directory file of the dynamic feature function module;

[0102] The step of determining a target resource index of a target dynamic feature function module in response to compiling the target dynamic feature function module in the current project includes:

[0103] In response to compiling the target dynamic feature function module in the current project, the target resource index is obtained from a target directory file of the target dynamic feature function module.

[0104] Optionally, in some embodiments of the present application, allocating the native resource indexes to obtain target resource indexes corresponding to the dynamic feature function modules includes:

[0105] Receive the target resource index of each dynamic characteristic function module sent by the opposite device, where the target resource index is obtained through the configuration of the opposite device.

[0106] Optionally, in some embodiments of the present application, replacing the native resource index of the target dynamic feature function module with the target resource index includes:

[0107] Determining a target tool version, where the target tool version is a version of a target tool for building the target dynamic feature function module;

[0108] Determine the index offset to be modified in the target resource link file according to the target tool version;

[0109] The native resource index corresponding to the to-be-modified index offset is replaced with the target resource index through reflection processing.

[0110] Optionally, in some embodiments of the present application, in response to compiling a target dynamic feature function module in a current project, determining a target resource index of the target dynamic feature function module includes:

[0111] In response to compiling a target dynamic feature function module in a current project, starting a resource linking task;

[0112] The target resource index of the target dynamic characteristic function module is determined at the start execution phase of the resource linking task.

[0113] In the embodiment of the present application, the determination module 201 determines the target resource index of the target dynamic feature function module in response to the compilation of the target dynamic feature function module in the current project. The target resource index is obtained by pre-allocating each dynamic feature function module in the current project, and the resource indexes allocated to each dynamic feature function module are not repeated. The replacement module 202 replaces the native resource index of the target dynamic feature function module with the target resource index, and the compilation module 203 compiles the target file of the target dynamic feature function module according to the target resource index.

[0114] Among them, the embodiment of the present application solves the problem of repeated resource indexes between dynamic feature function modules by directly replacing them with non-duplicate target resource indexes during compilation. Compared with the traditional solution of creating redundant empty dynamic feature function modules to occupy resource indexes, the embodiment of the present application simplifies the complexity of resource index management.

[0115] In addition, the present application also provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:

[0116] The electronic device may include one or more processing core processors 301, one or more computer-readable storage media memories 302, a power supply 303, an input unit 304 and other components. Those skilled in the art will understand that Figure 4 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.

[0117] The processor 301 is the control center of the electronic device. It connects all parts of the electronic device using various interfaces and lines. By running or executing software programs and / or modules stored in the memory 302 and accessing data stored in the memory 302, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into the processor 301.

[0118] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.

[0119] The electronic device also includes a power supply 303 for supplying power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 303 can also include one or more DC or AC power supplies, a recharging system, a power supply device debugging circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0120] The electronic device may further include an input unit 304, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0121] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 301 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 302 according to the following instructions, and the processor 301 will run the application programs stored in the memory 302, thereby implementing the steps of any resource processing method provided in the embodiments of the present application.

[0122] An embodiment of the present application determines a target resource index of the target dynamic feature function module in response to compilation of a target dynamic feature function module in the current project. The target resource index is obtained by pre-allocating each dynamic feature function module in the current project. The resource indexes allocated to each dynamic feature function module are not repeated. The native resource index of the target dynamic feature function module is replaced by the target resource index, and the target file of the target dynamic feature function module is compiled according to the target resource index.

[0123] Among them, the problem of resource index duplication between dynamic feature function modules is solved by directly replacing them with non-duplicate target resource indexes during compilation. Compared with the traditional solution of creating redundant empty dynamic feature function modules to occupy resource indexes, the embodiment of the present application simplifies the complexity of resource index management.

[0124] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

[0125] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0126] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any resource processing method provided in the present application.

[0127] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.

[0128] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0129] Since the instructions stored in the computer-readable storage medium can execute the steps in any resource processing method provided in this application, the beneficial effects that can be achieved by any resource processing method provided in this application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0130] The above is a detailed introduction to a resource processing method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A resource processing method, characterized in that: The method comprises: In response to compiling a target dynamic feature function module in a current project, determining a target resource index of the target dynamic feature function module, wherein the target resource index is pre-allocated to each dynamic feature function module in the current project, and resource indexes allocated to each dynamic feature function module are non-repeated; Replace the native resource index of the target dynamic feature function module with the target resource index; The target file of the target dynamic feature function module is obtained by compiling according to the target resource index.

2. The resource processing method according to claim 1, characterized in that: Before determining the target resource index of the dynamic feature function module in response to compiling the dynamic feature function module in the current project, the method further includes: Determine each dynamic characteristic function module in the current project; The dynamic characteristic function modules are allocated to obtain target resource indexes corresponding to the dynamic characteristic function modules, wherein the target resource indexes in the current project are not repeated.

3. The resource processing method according to claim 2, characterized in that: The allocating the native resource indexes to obtain target resource indexes corresponding to the dynamic feature function modules includes: Determine the starting resource index; The target resource index corresponding to each of the dynamic characteristic function modules is configured in sequence based on the starting resource index and in a preset order.

4. The resource processing method according to claim 1, characterized in that: Before determining the target resource index of the target dynamic feature function module in response to compiling the target dynamic feature function module in the current project, the method further includes: For each of the dynamic feature function modules, storing the target resource index of the dynamic feature function module in the target directory file of the dynamic feature function module; The step of determining a target resource index of a target dynamic feature function module in response to compiling the target dynamic feature function module in the current project includes: In response to compiling the target dynamic feature function module in the current project, the target resource index is obtained from a target directory file of the target dynamic feature function module.

5. The resource processing method according to claim 2, characterized in that: The allocating the native resource indexes to obtain target resource indexes corresponding to the dynamic feature function modules includes: Receive the target resource index of each dynamic characteristic function module sent by the opposite device, where the target resource index is obtained through the configuration of the opposite device.

6. The resource processing method according to claim 1, characterized in that: The replacing the native resource index of the target dynamic feature function module with the target resource index includes: Determining a target tool version, where the target tool version is a version of a target tool for building the target dynamic feature function module; Determine the index offset to be modified in the target resource link file according to the target tool version; The native resource index corresponding to the to-be-modified index offset is replaced with the target resource index through reflection processing.

7. The resource processing method according to claim 1, characterized in that: The step of determining a target resource index of a target dynamic feature function module in response to compiling the target dynamic feature function module in the current project includes: In response to compiling a target dynamic feature function module in a current project, starting a resource linking task; The target resource index of the target dynamic characteristic function module is determined at the start execution phase of the resource linking task.

8. A resource processing device, characterized in that: The device comprises: a determination module configured to determine, in response to compiling a target dynamic feature function module in a current project, a target resource index of the target dynamic feature function module, wherein the target resource index is pre-allocated to each dynamic feature function module in the current project, and resource indexes allocated to each dynamic feature function module are non-repeated; A replacement module, configured to replace the native resource index of the target dynamic feature function module with the target resource index; A compiling module is used to compile the target file of the target dynamic feature function module according to the target resource index.

9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the resource processing method according to any one of claims 1 to 7 when executing the computer program.

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