Batch processing method and device for multi-channel function plug-ins

By obtaining and processing the packaging files of the function plug-in and using channel name and dimension information for automated processing, the problem of low processing efficiency of multi-channel function plug-ins in the existing technology is solved, and simplifying operations and improving efficiency is achieved.

CN119292648APending Publication Date: 2025-01-10GUANGZHOU YINGFENG NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411102262.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, the multi-channel function plug-in processing has problems such as cumbersome operation steps and low processing efficiency, which require manual operation and cannot be processed in batches.

Method used

By obtaining the packaged file of the function plug-in, rename and copying it to the initial path folder according to the channel name and dimension information, using the preset plug-in processing tool for processing, the final function plug-in file is generated and copied to the final path folder.

Benefits of technology

Automatic batch processing of multi-channel function plug-in packaging files is realized, simplifying operation steps and improving processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292648A_ABST
    Figure CN119292648A_ABST
Patent Text Reader

Abstract

The invention discloses a batch processing method and device for a multi-channel function plug-in, and the method comprises the steps: obtaining at least two first packaging files of the function plug-in, and renaming the at least two first packaging files according to the channel name and dimension information of the function plug-in to obtain at least two second packaging files; copying the second packaged file into the initial path folder based on the channel name and the dimension information, reading the packaged file in the initial path folder, and processing the packaged file based on a preset plug-in processing tool to obtain a plug-in file of the functional plug-in; and copying the plug-in file into the final path folder so as to be loaded and used by a host. Through the technical scheme, the purpose of automatically processing the multi-channel function plug-in packaging files in batches can be achieved, the processing operation steps of the multi-channel function plug-in are simplified, and the processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a batch processing method and device for multi-channel functional plug-ins. Background Art

[0002] Plugin processing is a software development technology that breaks down a large application into multiple smaller and independent functional plug-in modules. These functional plug-in modules can be dynamically loaded into the host module at runtime, and finally packaged with the host to generate different program files, thereby achieving flexible expansion and update of application functions. Functional plug-in modules will use multi-channel packaging technology to adapt to different application markets. With the continuous comprehensiveness of application functions and the continuous expansion of the application market, the processing of multi-channel functional plug-ins has gradually become a hot topic.

[0003] In the prior art, for function plug-ins using multi-channel packaging technology, software developers usually manually package the function plug-ins into package files corresponding to each channel, and then copy the package files to another Java project respectively, and process the package files in sequence through the program in the Java project to generate the final function plug-in package files, and finally copy the processed function plug-in package files in sequence to the designated directory for use by the host. Since the operations in the prior art need to be manually completed by the software developer, and the function plug-in files cannot be processed in batches, there are problems such as cumbersome operation steps and low processing efficiency when using the prior art to process multi-channel function plug-ins. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method and device for batch processing of multi-channel functional plug-ins, which solves the problems of complicated operating steps and low processing efficiency when using the existing technology to process multi-channel functional plug-ins. By obtaining at least two packaged files of the functional plug-in, copying the packaged files to the initial path folder according to the channel name and dimension information of the functional plug-in, and processing the packaged files in the initial path folder based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in, the purpose of automatically batch processing the packaged files of multi-channel functional plug-ins can be achieved, the operating steps for processing multi-channel functional plug-ins are simplified, and the processing efficiency is improved.

[0005] In a first aspect, an embodiment of the present application provides a method for batch processing of multi-channel function plug-ins, the method comprising:

[0006] Acquire at least two first package files of the function plug-in, and rename the at least two first package files according to the channel name and dimension information of the first package files to obtain at least two second package files, wherein the at least two first package files are package files of the function plug-in under different channels;

[0007] Based on the channel name and dimension information, copy the second package file to the initial path folder, read the package file in the initial path folder, and process the package file based on a preset plug-in processing tool to obtain a plug-in file of the functional plug-in;

[0008] Copy the plug-in file to the final path folder for the host to load and use.

[0009] Furthermore, before obtaining at least two first packaged files of the function plug-in, the method further includes:

[0010] Generate at least two channel modules of the functional plug-in based on at least two pre-stored channel names and dimension information corresponding to each channel name;

[0011] The main module of the functional plug-in is combined with the at least two channel modules to obtain at least two channels of functional plug-ins to be packaged, and the functional plug-ins to be packaged of the at least two channels are packaged to obtain at least two first packaged files.

[0012] Further, the step of copying the second package file to an initial path folder based on the channel name and dimension information includes:

[0013] Reading the channel name in the second package file, and identifying whether there is an initial path folder currently based on the channel name;

[0014] If an initial path folder currently exists, copying the second package file to the initial path folder based on the channel name;

[0015] If the initial path folder does not currently exist, an initial path folder is generated based on the channel name and the preset module path, and the second package file is copied to the initial path folder based on the channel name.

[0016] Furthermore, before the packaged file is processed based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in, the method further includes:

[0017] Identify whether a temporary path folder currently exists based on a preset temporary path folder identifier;

[0018] If a temporary path folder does not currently exist, a temporary path folder is generated based on a preset temporary path folder identifier, the channel name, a preset file separator and a preset module path. The temporary path folder is used to store process files generated during the processing of the packaged file.

[0019] Further, the reading of the packaged file in the initial path folder and processing the packaged file based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in includes:

[0020] Read the file name of the packaged file stored in the initial path folder, and determine the channel name of the packaged file according to the file name;

[0021] Perform resource ID rewriting processing on the packaged file based on a preset plug-in processing tool, and store the process file generated in the resource ID rewriting process in the temporary path folder based on the channel name, wherein the resource ID rewriting process includes packaged file decompilation, resource ID editing, back compilation and re-signing;

[0022] The processing result of the resource ID rewriting process is used as a plug-in file of the function plug-in.

[0023] Furthermore, the resource ID rewriting process of the packaged file based on the preset plug-in processing tool includes:

[0024] Decompiling the packaged file based on a preset plug-in processing tool to obtain a resource ID parsing result of the packaged file;

[0025] Performing ID editing on the resource ID parsing result based on a preset plug-in processing tool and preset variables to obtain a resource ID rewriting result;

[0026] The resource ID rewriting result is back compiled and re-signed.

[0027] Furthermore, copying the plug-in file to the final path folder includes:

[0028] Identify whether a final path folder currently exists based on a preset final path folder identifier;

[0029] If a final path folder currently exists, the plug-in file is copied to the final path folder, and the temporary path folder and the initial path folder are deleted;

[0030] If the final path folder does not currently exist, a final path folder is generated based on the preset final path folder identifier, the preset file separator and the preset module path, the plug-in file is copied to the final path folder, and the temporary path folder and the initial path folder are deleted.

[0031] In a second aspect, an embodiment of the present application provides a batch processing device for multi-channel function plug-ins, the device comprising:

[0032] A file renaming module, used to obtain at least two first packaged files of the function plug-in, and rename the at least two first packaged files according to the channel name and dimension information of the function plug-in to obtain at least two second packaged files, wherein the at least two first packaged files are packaged files of the function plug-in under different channels;

[0033] a function plug-in processing module, used to copy the second package file to the initial path folder based on the channel name and dimension information, read the package file in the initial path folder, and process the package file based on a preset plug-in processing tool to obtain a plug-in file of the function plug-in;

[0034] The functional plug-in copy module is used to copy the plug-in file to the final path folder for the host to load and use.

[0035] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0036] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0037] In the fifth aspect, an embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium, and at least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device performs the method described in the first aspect.

[0038] In an embodiment of the present application, at least two first package files of a functional plug-in are obtained, and at least two second package files are respectively renamed according to the channel name and dimension information of the first package file to obtain at least two second package files, and the at least two first package files are package files of the functional plug-in under different channels; based on the channel name and dimension information, the second package file is copied to the initial path folder, the package file in the initial path folder is read, and the package file is processed based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in; the plug-in file is copied to the final path folder for loading and use by the host. The above-mentioned batch processing method of multi-channel functional plug-ins solves the problem of cumbersome operation steps and low processing efficiency when using the prior art to process multi-channel functional plug-ins. By obtaining at least two package files of a functional plug-in, copying the package file to the initial path folder according to the channel name and dimension information of the functional plug-in, and processing the package file in the initial path folder based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in, the purpose of automatically batch processing multi-channel functional plug-in package files can be achieved, simplifying the operation steps of multi-channel functional plug-in processing, and improving processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of a batch processing method of a multi-channel function plug-in provided in an embodiment of the present application;

[0040] Figure 2 This is a schematic diagram of the opening interface of the initial path folder provided by this application;

[0041] Figure 3 This is a flowchart of copying the initial path folder of the packaged file provided by the embodiment of the present application;

[0042] Figure 4 It is a flow chart of a batch processing method of a multi-channel function plug-in provided in an embodiment of the present application;

[0043] Figure 5 It is a structural block diagram of a batch processing device of a multi-channel function plug-in provided in an embodiment of the present application;

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

[0045] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0046] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0047] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0048] First of all, the usage scenario of this solution can be a scenario of plug-in processing for plug-ins used to extend application functions, especially a scenario of batch processing of multi-channel functional plug-ins. By obtaining at least two packaged files of the functional plug-in, copying the packaged files to the initial path folder according to the channel name and dimension information of the functional plug-in, and processing the packaged files in the initial path folder based on the preset plug-in processing tool to obtain the plug-in file of the functional plug-in, the purpose of automatic batch processing of multi-channel functional plug-in packaged files can be achieved, which simplifies the operation steps for multi-channel functional plug-in processing and improves processing efficiency. Based on the above usage scenarios, it can be understood that the executor of this solution can be an electronic device, such as smart terminals such as mobile phones and computers.

[0049] In conjunction with the accompanying drawings, a batch processing method and device for a multi-channel function plug-in provided in an embodiment of the present application are described in detail through specific embodiments and application scenarios.

[0050] Figure 1 1 is a flow chart of a batch processing method of a multi-channel function plug-in provided in an embodiment of the present application. Figure 1 As shown, the specific steps include:

[0051] S101, obtaining at least two first packaged files of a function plug-in, and renaming the at least two first packaged files according to channel names and dimension information of the first packaged files to obtain at least two second packaged files.

[0052] Among them, the function plug-in can be a program written in accordance with a certain specification of the application program interface for adding or enhancing software functions. The function plug-in has the characteristics of being pluggable and can be added or removed at any time according to the needs, thereby realizing the flexibility and scalability of the software. The first packaged file can be a file obtained by packaging the function plug-in. In this scheme, at least two first packaged files of the function plug-in are packaged files of the function plug-in under different channels. Different channels can be different application markets. Since the channel names and channel dimensions of different channels are different, in order to enable the same function plug-in to run in different channels, the function plug-in needs to be packaged according to different channels. The channel name can be a name used to represent the application market. For example: Xiaomi Market, 360 Market, App Treasure Market, etc. The dimension information can be the identification information of the channel. The dimension information is used to distinguish the channels corresponding to different channel names. For example: skin identification or style identification of different channels. A channel can define multiple dimension information according to user needs. The second packaged file can be a file after the channel information and dimension information corresponding to the first packaged file are added to the file name.

[0053] In one embodiment, at least two first package files of the pre-packaged functional plug-in can be obtained according to the function or plug-in identifier of the functional plug-in. The channel names and dimension information of the at least two first package files are respectively written into the file names of the respective first package files, so as to rename the first package files to obtain at least two second package files.

[0054] In one embodiment, the following code may be used to rename the first package file:

[0055] outputFileName="plugin_${buildType.name}_${variant.flavorName}.apk";

[0056] Here, flavorName may be the channel name of the first packaged file.

[0057] In one embodiment, optionally, before obtaining at least two first package files of the function plug-in, the method further includes:

[0058] Generate at least two channel modules of the functional plug-in based on at least two pre-stored channel names and dimension information corresponding to each channel name;

[0059] The main module of the function plug-in is combined with at least two channel modules to obtain at least two channels of function plug-ins to be packaged, and the function plug-ins to be packaged of at least two channels are packaged to obtain at least two first packaged files.

[0060] Among them, the channel module of the functional plug-in can be a module for configuring the channels of the functional plug-in and the dimension information of each channel. One channel module of the functional plug-in can correspond to one channel. The main module of the functional plug-in can be a plug-in program module of the functional plug-in. The main module of the functional plug-in is used to run and manage the plug-in functions. The main module of the functional plug-in includes the plug-in enhancement logic and operation principles declared by the plug-in developer. The functional plug-in to be packaged can be a program to be packaged obtained by combining the main module of the functional plug-in with a channel module.

[0061] In one embodiment, at least two pre-stored channel names and the dimension information corresponding to each channel name may be combined to generate at least two channel modules of functional plug-ins corresponding to each channel name. The at least two channel names may be pre-uploaded by the user based on the applicable scope of the application. The dimension information corresponding to each channel name may be pre-defined and uploaded by the user based on channel differentiation requirements or channel design requirements.

[0062] In one embodiment, the channel name and dimension information of the function plug-in can be defined by the following code:

[0063]

[0064] }

[0065] }

[0066] In one embodiment, the main module of the function plug-in can be combined with each channel module to obtain a function plug-in for each channel, that is, a function plug-in to be packaged. The function plug-ins to be packaged of each channel are packaged to obtain at least two first package files.

[0067] In one embodiment, the packaging of the functional plug-in can be implemented by the following code:

[0068] *Configure plugin packaging tasks

[0069] * /

[0070] android.applicationVariants.all{variant->

[0071] variant.outputs.all{output->

[0072] / **

[0073] This solution generates at least two channel modules of the functional plug-in based on at least two pre-stored channel names and dimensional information corresponding to each channel name, combines the main module of the functional plug-in with the at least two channel modules to obtain functional plug-ins to be packaged for at least two channels, and packages the functional plug-ins to be packaged for at least two channels to obtain at least two first package files, thereby achieving the purpose of multi-channel packaging of the functional plug-ins and improving the accuracy of multi-channel packaging.

[0074] S102, based on the channel name and dimension information, copy the second package file to the initial path folder, read the package file in the initial path folder, and process the package file based on a preset plug-in processing tool to obtain a plug-in file of the functional plug-in.

[0075] Among them, the initial path folder can be a folder for storing and managing unprocessed second packaged files. The initial path folder includes initial path information, initial storage location, and file name of each file. The packaged file can be all second packaged files stored in the initial path folder. The preset plug-in processing tool can be a tool for automatically processing packaged files by a pre-set application. Automatic processing includes rewriting the ID of the packaged file, etc. Different plug-in processing tools can have different processing functions. The plug-in file of the functional plug-in can be a packaged file obtained by processing the second packaged file of the functional plug-in.

[0076] Figure 2 This is a schematic diagram of the opening interface of the initial path folder provided by this application. Figure 2 As shown, the initial path folder opening interface includes the storage locations of each packaged file, such as "storage location A", "storage location B", "storage location C" and "storage location D". Click storage location D to read the file name of the packaged file stored at the storage location, and click the file name to obtain the storage path of each file stored at the location. That is, the initial path folder includes the initial path information, initial storage location and file name of each file, and the storage location and storage path of each packaged file can be represented by a directory or index.

[0077] In one embodiment, since the initial folder may include path information, storage location and file name of each file, the second packaged file may be copied to the corresponding position of the initial path folder based on the channel name and dimension information. All packaged files in the initial path folder are read according to the storage list or directory structure in the initial folder, and the packaged files are processed accordingly using a preset plug-in processing tool to obtain the plug-in file of the functional plug-in.

[0078] In one embodiment, the second packaged file can be copied to the initial path folder by the following code:

[0079]

[0080] Among them, original can be the initial path folder.

[0081] S103, copy the plug-in file to the final path folder for loading and use by the host.

[0082] The final path folder may be a folder for storing and managing the processed second packaged file. The final path folder includes the final path information, final storage location, and file name of each file. The host may be a software application. The host provides a basic operating environment and functional framework, and the host application is responsible for managing and controlling the plug-in to ensure that the plug-in can be correctly integrated into the host environment and can work in conjunction with other parts of the host.

[0083] In one embodiment, the plug-in file can be copied to a location corresponding to the file name in the final path folder according to the file name of the plug-in file, so as to be loaded and used by the host. The host can read the function plug-in required by the current application from the final path folder based on the current channel information and the received user instruction.

[0084] The technical solution provided by the embodiment of the present application is to obtain at least two first package files of the function plug-in, rename the at least two first package files according to the channel name and dimension information of the first package file to obtain at least two second package files, and the at least two first package files are package files of the function plug-in under different channels; copy the second package file to the initial path folder based on the channel name and dimension information, read the package file in the initial path folder, and process the package file based on the preset plug-in processing tool to obtain the plug-in file of the function plug-in; copy the plug-in file to the final path folder for the host to load and use. Through the above-mentioned batch processing method of multi-channel function plug-ins, the problems of cumbersome operation steps and low processing efficiency when using the existing technology to process multi-channel function plug-ins are solved. By obtaining at least two package files of the function plug-in, copying the package file to the initial path folder according to the channel name and dimension information of the function plug-in, and processing the package file in the initial path folder based on the preset plug-in processing tool to obtain the plug-in file of the function plug-in, the purpose of automatically batch processing the package files of multi-channel function plug-ins can be achieved, simplifying the operation steps of multi-channel function plug-in processing and improving the processing efficiency.

[0085] Figure 3 This is a flowchart of the initial path folder for the packaged file copying provided by the embodiment of the present application. Figure 3 As shown, the specific steps include:

[0086] S301, reading the channel name in the second package file, and identifying whether an initial path folder currently exists based on the channel name.

[0087] In one embodiment, the name at the channel name position in the file name of the second packaged file can be read based on the structure of the file name to identify whether there is currently a folder with the same name as the one at the channel name position. If so, it is determined that an initial path folder currently exists; if not, it is determined that an initial path folder currently does not exist.

[0088] S302: If an initial path folder currently exists, copy the second package file to the initial path folder based on the channel name.

[0089] In one embodiment, if an initial path folder currently exists, the second packaged file can be copied to the corresponding channel name in the initial path folder according to the channel name.

[0090] S303: If the initial path folder does not currently exist, generate the initial path folder based on the channel name and the preset module path, and copy the second package file to the initial path folder based on the channel name.

[0091] The preset module path may be a module dependency management path of a module that processes a functional plug-in. For example, if this solution is written in a Java project, the preset module path may be a dependency management path of a Java module. The preset module path may support more fine-grained dependency management, and modules may be loaded on demand. Each module may have its own namespace, making the dependency relationship between modules clearer and more controllable.

[0092] In one embodiment, if the initial path folder does not exist currently, the initial path folder can be generated according to the preset module path and channel name of the module currently processing the functional plug-in. The second package file is copied to the corresponding channel name in the initial path folder according to the channel name.

[0093] The technical solution provided in the embodiment of the present application identifies whether an initial path folder currently exists by reading the channel name in the second package file. If not, an initial path folder is generated based on the channel name and the preset module path, and the second package file is copied to the initial path folder based on the channel name. This can achieve the purpose of storing the second package file in the initial path folder, which is beneficial to the subsequent batch processing of functional plug-ins.

[0094] Figure 4 1 is a flow chart of a batch processing method of a multi-channel function plug-in provided in an embodiment of the present application. Figure 4 As shown, the specific steps include:

[0095] S401, obtaining at least two first packaged files of the function plug-in, and renaming the at least two first packaged files according to the channel names and dimension information of the first packaged files to obtain at least two second packaged files.

[0096] S402, copying the second packaged file to the initial path folder based on the channel name and dimension information, and reading the packaged file in the initial path folder.

[0097] S403: Identify whether a temporary path folder currently exists based on a preset temporary path folder identifier.

[0098] The temporary path folder may be a folder for storing and managing temporary files or process files generated in the process of processing the function plug-in. The temporary file or process file may be a file generated in the process of processing the packaged file. The temporary path folder includes temporary path information, temporary storage location, and file name of each temporary file. The preset temporary path folder identifier may be a pre-set feature or symbol for distinguishing the temporary path folder from other folders.

[0099] In one embodiment, it is possible to identify whether there is currently a folder identical to the preset temporary path folder identifier based on the preset temporary path folder identifier. If so, it means that there is currently a temporary path folder; if not, it means that there is currently no temporary path folder.

[0100] S404, when a temporary path folder does not currently exist, a temporary path folder is generated based on a preset temporary path folder identifier, a channel name, a preset file separator and a preset module path. The temporary path folder is used to store process files generated during the packaging file processing.

[0101] The preset file separator may be a preset file directory separator. The preset file separator may correctly represent the path of the file, thereby ensuring that the file path can be correctly parsed when the code is running on different operating systems.

[0102] In one embodiment, if there is no temporary path folder currently, a temporary path folder can be generated according to a preset temporary path folder identifier, a channel name, a preset file separator, and a preset module path. The temporary path folder is used to store process files generated during the processing of the packaged file. For example, according to the channel name of the packaged file, the process files generated during the processing of the packaged file can be stored in a location corresponding to the channel name in the temporary path folder.

[0103] In one embodiment, the following code may be used to represent a temporary path folder:

[0104] String tempPath=modulePath+DIRECTORY_WORKSPACE+File.separator+flavorName;

[0105] Among them, modulePath can be a preset module path; DIRECTORY_WORKSPACE can be a temporary path file directory, and the preset temporary path folder identifier can be set in the temporary path file directory; File.separator can be a preset file separator; flavorName can be a channel name.

[0106] S405: Process the packaged file based on a preset plug-in processing tool to obtain a plug-in file of the functional plug-in.

[0107] In one embodiment, optionally, the packaged file in the initial path folder is read, and the packaged file is processed based on a preset plug-in processing tool to obtain a plug-in file of the functional plug-in, including:

[0108] Read the file name of the packaged file stored in the initial path folder, and determine the channel name of the packaged file according to the file name;

[0109] Based on the preset plug-in processing tool, the resource ID of the packaged file is rewritten, and the process files generated during the resource ID rewriting process are stored in a temporary path folder based on the channel name. The resource ID rewriting process includes packaged file decompilation, resource ID editing, back compilation and re-signing;

[0110] The processing result of the resource ID rewriting process is used as a plug-in file of the function plug-in.

[0111] Among them, the file name of the packaged file may be the file name of the second packaged file. The file name of the second packaged file includes the channel name and dimension information of the packaged file. The resource ID may be a unique identifier assigned to the resource of the application. For example: a string or an integer value, etc. The resource ID enables the functional plug-in to reference the resource inside the application. The resource ID rewrite process may be a process of rewriting the resource ID in the packaged file of the functional plug-in to be different from the resource ID of the host. The resource ID rewrite process includes packaged file decompilation, resource ID editing, back compilation and re-signing. Decompilation may be a process of restoring a software program that has been compiled into machine code (assembly language) into a high-level programming language. Back compilation may be a process of compiling the restored source code into machine code again on the basis of decompilation. Resource ID editing may be a process of rewriting the unique number of the resource according to the resource ID naming rule of the plug-in. Re-signing may be a security measure to ensure that the software is not tampered with or replaced during installation and use, thereby ensuring the security and integrity of the software. The processing result of the resource ID rewrite process may be a file after the resource ID rewrite process is performed on the packaged file.

[0112] In one embodiment, since the host program and the function plug-in program are packaged separately, if the resource ID is not controlled, the resource ID in the function plug-in will conflict with the resource ID of the host, and then the system will not be able to accurately distinguish different resource requests. Therefore, in order to ensure the host's use of the function plug-in, the resource ID of the function plug-in needs to be processed. The file name of the packaged file stored in the initial path folder can be read according to the directory of the initial path folder. Since the file name contains the channel name, the channel name corresponding to each packaged file can be read according to the file name. Based on the preset plug-in processing tool, the packaged file is decompiled, the resource ID is edited, back compiled and re-signed, and the process file generated during the resource ID rewriting process is stored in the temporary path folder according to the channel name of each packaged file. The processing result of the resource ID rewriting process is used as the plug-in file of the function plug-in.

[0113] This solution can achieve the purpose of batch processing of packaged files of functional plug-ins by rewriting the resource ID of the packaged files stored in the initial path folder based on a preset plug-in processing tool, thereby improving the processing efficiency of functional plug-ins. At the same time, the process files generated in the resource ID rewriting process are stored in a temporary path folder based on the channel name, which can avoid the interference of the process files generated in the packaged file processing process with the file processing process and processing results, thereby improving the accuracy of batch processing of functional plug-ins.

[0114] In one embodiment, optionally, rewriting the resource ID of the packaged file based on a preset plug-in processing tool includes:

[0115] Decompile the packaged file based on the preset plug-in processing tool to obtain the resource ID parsing result of the packaged file;

[0116] Based on the preset plug-in processing tool and preset variables, the resource ID parsing result is ID edited to obtain the resource ID rewriting result;

[0117] Recompile and re-sign the resource ID rewrite result.

[0118] The resource ID parsing result of the packaged file may be an ID code after the resource ID is parsed from the machine language into the source code. ID editing may be an operation of rewriting the resource ID. ID editing only requires rewriting the resource ID of the functional plug-in to an ID different from the resource ID of the host. For example, the same variable may be added or subtracted from the resource ID of the functional plug-in at the same time. The preset variable may be a variable that is pre-set to distinguish the resource ID parsing result of the functional plug-in from the resource ID of the host.

[0119] In one embodiment, the preset plug-in processing tool can automatically complete the processing process of the resource ID of the functional plug-in. The preset plug-in processing tool can be used to decompile the packaged file to obtain the resource ID parsing result of the packaged file, and the resource ID parsing result can be ID edited based on the preset plug-in processing tool and preset variables to obtain the resource ID rewriting result, and the resource ID rewriting result can be back compiled and re-signed based on the preset plug-in processing tool.

[0120] This solution obtains the resource ID resolution result of the packaged file by decompiling the packaged file based on the preset plug-in processing tool, obtains the resource ID rewriting result by ID editing the resource ID resolution result based on the preset plug-in processing tool and preset variables, and back compiles and re-signs the resource ID rewriting result, thereby achieving the purpose of automatically processing the packaged file using the preset tool and improving the efficiency of resource ID rewriting.

[0121] S406, copy the plug-in file to the final path folder for loading and use by the host.

[0122] In one embodiment, optionally, the plug-in file is copied to the final path folder, including:

[0123] Identify whether a final path folder currently exists based on a preset final path folder identifier;

[0124] If the final path folder currently exists, copy the plug-in file to the final path folder, and delete the temporary path folder and the initial path folder;

[0125] If the final path folder does not currently exist, a final path folder is generated based on the preset final path folder identifier, the preset file separator, and the preset module path, the plug-in file is copied to the final path folder, and the temporary path folder and the initial path folder are deleted.

[0126] The final path folder may be a folder for storing and managing plug-in files after the packaged files are processed. The preset final path folder identifier may be a sign or symbol for distinguishing the final path folder from other folders.

[0127] In one embodiment, it can be determined whether there is a final path folder currently by searching whether there is a folder mark identical with the preset final path folder mark in the current system. If there is a final path folder currently, then the plug-in files can be all copied into the final path folder, and the temporary path folder and the initial path folder are deleted. If there is no final path folder currently, then the final path folder is generated according to the preset final path folder mark, the preset file separator and the preset module path, the plug-in files are all copied into the final path folder, and the temporary path folder and the initial path folder are deleted.

[0128] This solution, by identifying whether there is a final path folder currently, copies the plug-in file to the final path folder if it exists, deletes the temporary path folder and the initial path folder, and generates a final path folder based on the preset final path folder identifier, preset file separator and preset module path if it does not exist, which is beneficial to the subsequent host's use of the functional plug-in.

[0129] In one embodiment, taking the batch packaging process of Android plug-ins based on Java projects as an example, the batch processing process of multi-channel function plug-ins can be implemented by the following code:

[0130] Configure plugin packaging tasks

[0131] * /

[0132] android.applicationVariants.all{variant->

[0133]

[0134] Configure and execute the pack_assistant module: After the plug-in module completes the channel packaging tasks (i.e., generates the plug-in .apk file and copies it to the initial path folder of the pack_assistant module), execute the runPackAssistant task of the pack_assistant module to decompile, process resource IDs, back compile, re-sign, and other operations on each channel package.

[0135] * /

[0136] gradle.projectsEvaluated{

[0137] tasks.all{task->

[0138] / / After the assembleXXXDebug / assembleXXXRelease tasks are completed, execute the runPackAssistant task of the pack_assistant module. rootProject.currentBuildModule is a variable defined in the build.gradle file in the root directory of the project. Before you install the debug or release package of the plugin, you need to set it to 'debug' or 'release'.

[0139]

[0140] Configuring Java Modules

[0141] 1) Configure execution entry

[0142] Manifest-Version:1.0

[0143] Main-Class:com.plugin.pack.PackAssistant

[0144] Among them, Main-Class is used to configure the full class name of the main class, which is configured as the PackAssistant class here, which contains the main() method as the execution entry of the Java module. The PackAssistant class mainly implements functions such as decompiling plug-in .apk files, processing .apk file contents (such as resource IDs, etc.), back compiling .apk files, and re-signing.

[0145] 2) Configure build.gradle

[0146] Add the following configuration to build.gradle, call the main() method of the PackAssistant class in the runPackAssistant task, process the plugin .apk file, copy the final .apk file to the final path folder, and finally delete all intermediate files. The main code is as follows:

[0147] / **

[0148] *Configure the current module as a Java class library

[0149] ** /

[0150] plugins{

[0151] id 'java-library'

[0152] }

[0153] / **

[0154] *Delete all intermediate files, including: original initial path folder and workspace temporary path folder

[0155] ** /

[0156] task cleanAllTempFiles(type:Delete){

[0157] delete '. / original'

[0158] delete '. / workspace'

[0159] }

[0160] / **

[0161] * Run the main() method of PackAssistant

[0162] ** /

[0163]

[0164]

[0165]

[0166]

[0167] }

[0168] After receiving the assemble command for the main module of the plug-in, the batch packaging and processing of all channels of the functional plug-in can be automatically completed by executing the above code, and the final .apk files of all channels, i.e., packaged files, are automatically saved in the final path folder of the Java module. In the subsequent use process, the host selects and loads the .apk file of the corresponding channel from the destination folder, i.e., the final path folder, so that the current application can have the functions of the corresponding functional plug-in.

[0169] The technical solution provided in the embodiment of the present application identifies whether a temporary path folder currently exists. When the temporary path folder does not exist, a temporary path folder is generated based on a preset temporary path folder identifier, a channel name, a preset file separator, and a preset module path to store process files generated during the packaged file processing. This can avoid interference of process files generated during the functional plug-in processing with the processing process, thereby ensuring the accuracy of multi-channel functional plug-in processing.

[0170] Figure 5 1 is a structural block diagram of a batch processing device for a multi-channel function plug-in provided in an embodiment of the present application. Figure 5 As shown, specifically including the following:

[0171] The file renaming module 501 is used to obtain at least two first package files of the function plug-in, and rename the at least two first package files according to the channel name and dimension information of the function plug-in to obtain at least two second package files, where the at least two first package files are package files of the function plug-in under different channels;

[0172] The function plug-in processing module 502 is used to copy the second package file to the initial path folder based on the channel name and dimension information, read the package file in the initial path folder, and process the package file based on a preset plug-in processing tool to obtain a plug-in file of the function plug-in;

[0173] The function plug-in copy module 503 is used to copy the plug-in file to the final path folder for loading and use by the host.

[0174] Furthermore, the device also includes:

[0175] A channel module generation module, used to generate at least two channel modules of the functional plug-in based on at least two pre-stored channel names and dimension information corresponding to each channel name;

[0176] The plug-in packaging module is used to combine the main module of the functional plug-in with at least two channel modules to obtain at least two channels of functional plug-ins to be packaged, and to package the at least two channels of functional plug-ins to be packaged to obtain at least two first packaged files.

[0177] Furthermore, the functional plug-in processing module 502 is specifically used to:

[0178] Read the channel name in the second package file, and identify whether there is an initial path folder based on the channel name;

[0179] If the initial path folder currently exists, copy the second package file to the initial path folder based on the channel name;

[0180] If the initial path folder does not currently exist, the initial path folder is generated based on the channel name and the preset module path, and the second package file is copied to the initial path folder based on the channel name.

[0181] Furthermore, the functional plug-in processing module 502 is specifically used to:

[0182] Identify whether a temporary path folder currently exists based on a preset temporary path folder identifier;

[0183] If a temporary path folder does not currently exist, a temporary path folder is generated based on the preset temporary path folder identifier, channel name, preset file separator and preset module path. The temporary path folder is used to store process files generated during the packaging file processing.

[0184] Furthermore, the functional plug-in processing module 502 is specifically used to:

[0185] Read the file name of the packaged file stored in the initial path folder, and determine the channel name of the packaged file according to the file name;

[0186] Based on the preset plug-in processing tool, the resource ID of the packaged file is rewritten, and the process files generated during the resource ID rewriting process are stored in a temporary path folder based on the channel name. The resource ID rewriting process includes packaged file decompilation, resource ID editing, back compilation and re-signing;

[0187] The processing result of the resource ID rewriting process is used as a plug-in file of the function plug-in.

[0188] Furthermore, the functional plug-in processing module 502 is specifically used to:

[0189] Decompile the packaged file based on the preset plug-in processing tool to obtain the resource ID parsing result of the packaged file;

[0190] Based on the preset plug-in processing tool and preset variables, the resource ID parsing result is ID edited to obtain the resource ID rewriting result;

[0191] Recompile and re-sign the resource ID rewrite result.

[0192] Furthermore, the functional plug-in duplication module 503 is specifically used for:

[0193] Identify whether a final path folder currently exists based on a preset final path folder identifier;

[0194] If the final path folder currently exists, copy the plug-in file to the final path folder, and delete the temporary path folder and the initial path folder;

[0195] If the final path folder does not currently exist, a final path folder is generated based on the preset final path folder identifier, the preset file separator, and the preset module path, the plug-in file is copied to the final path folder, and the temporary path folder and the initial path folder are deleted.

[0196] The technical solution provided by the embodiment of the present application is a file renaming module, which is used to obtain at least two first packaged files of a functional plug-in, and rename the at least two first packaged files according to the channel name and dimension information of the functional plug-in to obtain at least two second packaged files; a functional plug-in processing module, which is used to copy the second packaged file to the initial path folder based on the channel name and dimension information, read the packaged file in the initial path folder, and process the packaged file based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in; a functional plug-in copying module, which is used to copy the plug-in file to the final path folder for the host to load and use. Through the above-mentioned multi-channel functional plug-in batch processing device, the problem of cumbersome operation steps and low processing efficiency when using the prior art to process multi-channel functional plug-ins is solved. By obtaining at least two packaged files of the functional plug-in, copying the packaged files to the initial path folder according to the channel name and dimension information of the functional plug-in, and processing the packaged files in the initial path folder based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in, the purpose of automatically batch processing the packaged files of multi-channel functional plug-ins can be achieved, the operation steps for processing multi-channel functional plug-ins are simplified, and the processing efficiency is improved.

[0197] A batch processing device of a multi-channel function plug-in in an embodiment of the present application can be configured in a device, or can be configured in a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0198] In the embodiment of the present application, a batch processing device of a multi-channel function plug-in may be an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0199] A batch processing device for a multi-channel function plug-in provided in an embodiment of the present application can implement each process implemented in the above-mentioned method embodiments, and will not be described again here to avoid repetition.

[0200] like Figure 6 As shown, an embodiment of the present application further provides an electronic device 600, including a processor 601, a memory 602, and a program or instruction stored in the memory 602 and executable on the processor 601. When the program or instruction is executed by the processor 601, each process of an embodiment of a batch processing method for a multi-channel functional plug-in described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0201] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0202] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the batch processing method embodiment of the above-mentioned multi-channel function plug-in is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0203] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0204] The present application embodiment further provides a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device can execute a batch processing method of a multi-channel function plug-in recorded in the embodiment of the present application. The program product can be implemented in any combination of one or more readable media.

[0205] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0206] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0207] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0208] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A batch processing method for multi-channel function plug-ins, characterized in that: The method comprises: Acquire at least two first package files of the function plug-in, and rename the at least two first package files according to the channel name and dimension information of the first package files to obtain at least two second package files, wherein the at least two first package files are package files of the function plug-in under different channels; Based on the channel name and dimension information, copy the second package file to the initial path folder, read the package file in the initial path folder, and process the package file based on a preset plug-in processing tool to obtain a plug-in file of the functional plug-in; Copy the plug-in file to the final path folder for the host to load and use.

2. The batch processing method of multi-channel function plug-ins according to claim 1, characterized in that: Before obtaining at least two first package files of the function plug-in, the method further includes: Generate at least two channel modules of the functional plug-in based on at least two pre-stored channel names and dimension information corresponding to each channel name; The main module of the functional plug-in is combined with the at least two channel modules to obtain at least two channels of functional plug-ins to be packaged, and the functional plug-ins to be packaged of the at least two channels are packaged to obtain at least two first packaged files.

3. The batch processing method of multi-channel function plug-ins according to claim 1, characterized in that: The step of copying the second package file to the initial path folder based on the channel name and dimension information includes: Reading the channel name in the second package file, and identifying whether there is an initial path folder currently based on the channel name; If an initial path folder currently exists, copying the second package file to the initial path folder based on the channel name; If the initial path folder does not currently exist, an initial path folder is generated based on the channel name and the preset module path, and the second package file is copied to the initial path folder based on the channel name.

4. The batch processing method of multi-channel function plug-ins according to claim 1, characterized in that: Before the packaged file is processed based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in, the method further includes: Identify whether a temporary path folder currently exists based on a preset temporary path folder identifier; If a temporary path folder does not currently exist, a temporary path folder is generated based on a preset temporary path folder identifier, the channel name, a preset file separator and a preset module path. The temporary path folder is used to store process files generated during the processing of the packaged file.

5. The batch processing method of multi-channel function plug-ins according to claim 4, characterized in that: The step of reading the packaged file in the initial path folder and processing the packaged file based on a preset plug-in processing tool to obtain the plug-in file of the functional plug-in includes: Read the file name of the packaged file stored in the initial path folder, and determine the channel name of the packaged file according to the file name; Perform resource ID rewriting processing on the packaged file based on a preset plug-in processing tool, and store the process file generated in the resource ID rewriting process in the temporary path folder based on the channel name, wherein the resource ID rewriting process includes packaged file decompilation, resource ID editing, back compilation and re-signing; The processing result of the resource ID rewriting process is used as a plug-in file of the function plug-in.

6. The batch processing method of multi-channel function plug-ins according to claim 5, characterized in that: The resource ID rewriting process of the packaged file based on the preset plug-in processing tool includes: Decompiling the packaged file based on a preset plug-in processing tool to obtain a resource ID parsing result of the packaged file; Performing ID editing on the resource ID parsing result based on a preset plug-in processing tool and preset variables to obtain a resource ID rewriting result; The resource ID rewriting result is back compiled and re-signed.

7. The batch processing method of multi-channel function plug-ins according to claim 5, characterized in that: The step of copying the plug-in file to the final path folder includes: Identify whether a final path folder currently exists based on a preset final path folder identifier; If a final path folder currently exists, the plug-in file is copied to the final path folder, and the temporary path folder and the initial path folder are deleted; If the final path folder does not currently exist, a final path folder is generated based on the preset final path folder identifier, the preset file separator and the preset module path, the plug-in file is copied to the final path folder, and the temporary path folder and the initial path folder are deleted.

8. A batch processing device for multi-channel functional plug-ins, characterized in that: The device comprises: A file renaming module, used to obtain at least two first packaged files of the function plug-in, and rename the at least two first packaged files according to the channel name and dimension information of the function plug-in to obtain at least two second packaged files, wherein the at least two first packaged files are packaged files of the function plug-in under different channels; a function plug-in processing module, used to copy the second package file to the initial path folder based on the channel name and dimension information, read the package file in the initial path folder, and process the package file based on a preset plug-in processing tool to obtain a plug-in file of the function plug-in; The functional plug-in copy module is used to copy the plug-in file to the final path folder for the host to load and use.

9. An electronic device, characterized in that: The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of a batch processing method of a multi-channel function plug-in as described in any one of claims 1 to 7 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of a batch processing method for a multi-channel function plug-in according to any one of claims 1 to 7 are implemented.