Module migration analysis processing method and device, storage medium and electronic equipment
By using preset migration analysis and processing tools, analyzing and replacing native modules of customized modules in Android systems, the migration problem when modules are migrated to supplier partitions is solved, and efficient and reliable module migration evaluation is achieved.
Patent Information
- Application Number
- CN202510035195.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-08
AI Technical Summary
In Android systems, when custom modules are migrated to vendor partitions, the native modules are unavailable, resulting in poor migration and lack of effective migration evaluation solutions.
Through the preset migration analysis processing tool, the native module of the module to be migrated is determined, and the alternative analysis is performed, the replacement module is obtained, and the partition migration analysis report is output to achieve efficient and reliable migration evaluation of candidate modules.
It realizes efficient and reliable migration evaluation of candidate modules that need to be migrated to the supplier partition, ensuring the stability and success rate of the module migration process.
Smart Images

Figure CN119988180A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of operating system technology, and in particular to a module migration analysis and processing method, device, storage medium and electronic device. Background Art
[0002] There are many customized modules in the Android system. These modules are usually integrated in the system partition. In the early writing process, these customized modules may use native modules, such as hidden APIs and private modules. These native modules are usually only provided for internal use of the system and are not open to external applications.
[0003] When these customized modules are migrated to the vendor partition, these native modules will be unavailable, resulting in poor portability of these customized modules. Currently, there is usually no effective solution to perform portability assessment when these customized modules need to be migrated. Summary of the invention
[0004] The embodiment of the present application provides a solution that can implement efficient and reliable migration assessment of candidate modules that need to be migrated to the vendor partition.
[0005] The embodiments of the present application provide the following technical solutions:
[0006] According to one embodiment of the present application, a module migration analysis and processing method includes: determining a candidate module to be migrated from a system partition to a vendor partition; using a preset migration analysis and processing tool to perform module analysis on the candidate module to obtain a native module used by the candidate module; and, performing replacement analysis on the native module to obtain a replacement module for the native module; and, outputting a partition migration analysis report of the candidate module, wherein the partition migration analysis report includes at least module information of the candidate module, the native module and the replacement module.
[0007] In some embodiments of the present application, after outputting the partition migration analysis report of the candidate module, the method further includes: using the preset migration analysis and processing tool to determine the partition migration adaptation parameters corresponding to the module integration file; using the partition migration adaptation parameters to modify the original system partition parameters in the module integration file to obtain a modified module integration file.
[0008] In some embodiments of the present application, the module analysis processing performed on the candidate module to obtain the native module used by the candidate module includes: determining the dependent library that the candidate module directly and indirectly depends on; judging whether there is a dependent library classified as a private module among the dependent libraries that the candidate module depends on; if so, determining the dependent library classified as a private module as the native module used by the candidate module.
[0009] In some embodiments of the present application, after determining whether the dependent library that the candidate module depends on is a dependent library classified as a private module, the method further includes: if not, scanning the import package classes of the candidate module; determining whether there are import package classes in the import package classes of the candidate module that are not located in the preset public class package; if so, determining the import package class that is not located in the preset public class package as a hidden interface, and determining the hidden interface as the native module used by the candidate module.
[0010] In some embodiments of the present application, the performing replacement analysis processing on the native module to obtain a replacement module for the native module includes: determining a native development library that matches the vendor partition; performing similar module matching processing on the native module in the native development library that matches the vendor partition to obtain a module that matches the native module; and determining the module that matches the native module as a replacement module for the native module.
[0011] In some embodiments of the present application, after determining whether there is a package import class in the candidate module that is not located in the preset public class package, the method further includes: generating a stub class with the same name as the package import class that is not located in the preset public class package, the stub class being used to be inserted into the source code of the candidate module; and including the stub class with the same name as the package import class that is not located in the preset public class package in the partition migration analysis report.
[0012] In some embodiments of the present application, determining the dependent libraries that the candidate module directly and indirectly depends on includes: scanning a module integration file to obtain the candidate module defined therein and a first dependent library set of the candidate module; scanning and searching the dependent libraries that the first dependent library set depends on in the operating system source code to obtain a second dependent library set; and determining the dependent libraries in the first dependent library set and the second dependent library set as the dependent libraries that the candidate module directly and indirectly depends on.
[0013] According to one embodiment of the present application, a module migration analysis and processing device includes: a determination unit, used to: determine a candidate module to be migrated from a system partition to a vendor partition; an analysis unit, used to: use a preset migration analysis and processing tool to perform module analysis and processing on the candidate module to obtain a native module used by the candidate module; and, perform replacement analysis and processing on the native module to obtain a replacement module for the native module; and, output a partition migration analysis report of the candidate module, wherein the partition migration analysis report at least includes module information of the candidate module, the native module and the replacement module.
[0014] In some embodiments of the present application, after outputting the partition migration analysis report of the candidate module, the analysis unit is further used to: use the preset migration analysis and processing tool to determine the partition migration adaptation parameters corresponding to the module integration file; use the partition migration adaptation parameters to modify the original system partition parameters in the module integration file to obtain the modified module integration file.
[0015] In some embodiments of the present application, the analysis unit is used to: determine the dependent libraries that the candidate module directly and indirectly depends on; determine whether there is a dependent library classified as a private module among the dependent libraries that the candidate module depends on; if so, determine the dependent library classified as a private module as the native module used by the candidate module.
[0016] In some embodiments of the present application, after determining whether the dependent library that the candidate module depends on is a dependent library classified as a private module, the analysis unit is used to: if not, scan the import package classes of the candidate module; determine whether there are import package classes in the import package classes of the candidate module that are not located in the preset public class package; if so, determine the import package class that is not located in the preset public class package as a hidden interface, and determine the hidden interface as the native module used by the candidate module.
[0017] In some embodiments of the present application, the analysis unit is used to: determine a native development library that matches the vendor partition; perform similar module matching processing on the native module in the native development library that matches the vendor partition to obtain a module that matches the native module; and determine the module that matches the native module as a replacement module for the native module.
[0018] In some embodiments of the present application, after determining whether there is a package import class in the candidate module that is not located in the preset public class package, the analysis unit is used to: generate a stub class with the same name as the package import class that is not located in the preset public class package, and the stub class is used to insert into the source code of the candidate module; and include the stub class with the same name as the package import class that is not located in the preset public class package in the partition migration analysis report.
[0019] In some embodiments of the present application, the analysis unit is used to: scan the module integration file to obtain the candidate module defined therein and the first dependency library set of the candidate module; scan and search the operating system source code for the dependency library on which the first dependency library set depends to obtain the second dependency library set; and determine the dependency libraries in the first dependency library set and the second dependency library set as the dependency libraries on which the candidate module directly and indirectly depends.
[0020] According to another embodiment of the present application, a storage medium stores a computer program thereon, and when the computer program is executed by a processor of a device, the device executes the method described in the embodiment of the present application.
[0021] According to another embodiment of the present application, an electronic device may include: a memory storing a computer program; and a processor reading the computer program stored in the memory to execute the method described in the embodiment of the present application.
[0022] According to another embodiment of the present application, a computer program product or a computer program includes a computer instruction stored in a computer-readable storage medium. A processor of a device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the device executes the method provided in various optional implementations described in the embodiments of the present application.
[0023] In an embodiment of the present application, a candidate module to be migrated from a system partition to a vendor partition is determined; a preset migration analysis and processing tool is used to perform module analysis on the candidate module to obtain a native module used by the candidate module; and, an alternative analysis is performed on the native module to obtain an alternative module for the native module; and, a partition migration analysis report of the candidate module is output, wherein the partition migration analysis report includes at least module information of the candidate module, the native module and the alternative module.
[0024] In the manner of an embodiment of the present application, for candidate modules that need to be migrated from the system partition to the vendor partition, a preset migration analysis and processing tool is used to not only analyze the native modules used by them, but also analyze the alternative modules matching these native modules, and output a partition migration analysis report to present the module's mobility-related information, thereby achieving efficient and reliable portability evaluation of the candidate modules that need to be migrated to the vendor partition. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A flowchart of a module migration analysis and processing method according to an embodiment of the present application is shown.
[0027] Figure 2 A native module analysis flow chart according to an embodiment of the present application is shown.
[0028] Figure 3 A native module analysis flow chart according to another embodiment of the present application is shown.
[0029] Figure 4 A block diagram of a module migration analysis and processing device according to an embodiment of the present application is shown.
[0030] Figure 5 A block diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0031] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are only used to explain the present disclosure and are not intended to limit the present disclosure. In addition, the embodiments provided below are partial embodiments for implementing the present disclosure, rather than providing all embodiments for implementing the present disclosure. In the absence of conflict, the technical solutions recorded in the embodiments of the present disclosure can be implemented in any combination.
[0032] It should be noted that, in the embodiments of the present disclosure, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method or apparatus including a series of elements includes not only the elements explicitly recorded, but also includes other elements not explicitly listed, or also includes elements inherent to the implementation of the method or apparatus. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other related elements in the method or apparatus including the element (such as a step in the method or a unit in the apparatus, for example, a unit may be a part of a circuit, a part of a processor, a part of a program or software, etc.).
[0033] For example, the module migration analysis and processing method provided in the embodiment of the present disclosure includes a series of steps, but the module migration analysis and processing method provided in the embodiment of the present disclosure is not limited to the recorded steps. Similarly, the module migration analysis and processing device provided in the embodiment of the present disclosure includes a series of units, but the device provided in the embodiment of the present disclosure is not limited to including the units explicitly recorded, and may also include units required to obtain relevant information or perform processing based on information.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure.
[0035] It is understandable that in the specific implementation of this application, relevant data is involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0036] Figure 1 The flowchart of the module migration analysis and processing method according to an embodiment of the present application is schematically shown. The execution subject of the module migration analysis and processing method can be any device with processing capabilities, such as a computer, a mobile phone, a smart watch, a television, and other home appliances.
[0037] like Figure 1 As shown, the module migration analysis and processing method may include steps S110 to S140.
[0038] Step S110, determining candidate modules to be migrated from the system partition to the supplier partition;
[0039] Step S120, using a preset migration analysis and processing tool to perform module analysis and processing on the candidate module to obtain a native module used by the candidate module; and
[0040] Step S130, performing a replacement analysis process on the native module to obtain a replacement module for the native module; and
[0041] Step S140: outputting a partition migration analysis report of the candidate module, wherein the partition migration analysis report at least includes module information of the candidate module, the native module and the replacement module.
[0042] There are many customized modules in the Android system, which are usually integrated in the system partition. The customized modules in the system partition can be determined as candidate modules to be migrated from the system partition to the vendor partition. Specifically, the module integration file in the Android system can be parsed to obtain the modules defined therein as candidate modules, wherein the module integration file can specifically refer to a BP file (Blueprint file) and / or an MK file: (Makefile file).
[0043] For these candidate modules, a preset migration analysis and processing tool can be used to perform module analysis on the candidate modules to obtain the native modules used by these candidate modules; and alternative analysis can be performed on the native modules to obtain alternative modules for these native modules. Among them, native modules include hidden APIs and private modules, which are usually only provided for internal use of the system and are not open to external applications.
[0044] Furthermore, the preset migration analysis processing tool can output a partition migration analysis report of the candidate module, and the partition migration analysis report at least includes module information of the candidate module, the native module used by the candidate module, and the replacement module of the native module.
[0045] In this way, for candidate modules that need to be migrated from the system partition to the vendor partition, the preset migration analysis and processing tool can be used to not only analyze the native modules used by them, but also analyze the alternative modules matching these native modules, and output a partition migration analysis report to present the module's mobility-related information, thereby achieving efficient and reliable portability evaluation of candidate modules that need to be migrated to the vendor partition.
[0046] Described below Figure 1 When performing module migration analysis and processing under the embodiment, further optional specific embodiments are provided under each step performed.
[0047] In one embodiment, see Figure 2 , the module analysis processing of the candidate module to obtain the native module used by the candidate module may include: step S210, determining the dependency library that the candidate module directly and indirectly depends on; step S220, judging whether the dependency library that the candidate module depends on has a dependency library classified as a private module; step S230, if so, determining the dependency library classified as a private module as the native module used by the candidate module.
[0048] After determining the dependent libraries that the candidate module directly and indirectly depends on, if the candidate module is a "shared library module (SO module, usually in the form of a .so file)", it can be determined whether there is a dependent library classified as a private module in the dependent library that the candidate module depends on. If there is a dependent library classified as a private module, it can be accurately determined that the dependent library classified as a private module is the native module used by the candidate module (shared library module).
[0049] Among them, the dependency library of the private module category is only provided to the Android system (system) and not to the vendor partition (vendor). For example, if the dependency library is the vendor native development tool library (VNDK: Vendor Native DevelopmentKit) but the private attribute (private: true) is set, then the dependency library is a private module.
[0050] In one embodiment, determining the dependent libraries that the candidate module directly and indirectly depends on may include: scanning a module integration file to obtain the candidate module defined therein and a first dependent library set of the candidate module; scanning and searching the operating system source code for the dependent libraries that the first dependent library set depends on to obtain a second dependent library set; and determining the dependent libraries in the first dependent library set and the second dependent library set as the dependent libraries that the candidate module directly and indirectly depends on.
[0051] Scanning module integration files (BP files and / or MK files) can obtain the modules defined therein and the dependent libraries on which the modules depend. The modules defined therein can be used as candidate modules, and the set of dependent libraries on which the modules defined therein depend is the first dependent library set.
[0052] Then, the operating system source code can be further scanned to find the dependent libraries that the dependent libraries in the first dependent library set further depend on, and the set of dependent libraries that are further dependent is the second dependent library set. Finally, the dependent libraries in the first dependent library set and the second dependent library set are the dependent libraries that the complete candidate module directly and indirectly depends on.
[0053] Further, in one embodiment, see Figure 2 After determining whether the dependent library that the candidate module depends on has a dependent library classified as a private module, the method may further include: step S310, if not, scanning the import package class of the candidate module; step S320, determining whether there is an import package class that is not located in the preset public class package in the import package class of the candidate module; step S330, if yes, determining the import package class that is not located in the preset public class package as a hidden interface, and determining the hidden interface as the native module used by the candidate module.
[0054] If the candidate module is a "JAR module (Java archive file, used to package multiple Java class files)", the import package classes of the candidate module can be scanned to determine whether there are import package classes in the candidate module that are not located in the preset public class package; if there are import package classes that are not located in the preset public class package, the import package classes that are not located in the preset public class package are hidden interfaces, and the hidden interface is accurately determined to be the native module used by the candidate module (JAR module).
[0055] In one embodiment, after determining whether there is a package import class in the candidate module that is not located in the preset public class package, the method may further include: generating a stub class with the same name as the package import class that is not located in the preset public class package, the stub class being used to be inserted into the source code of the candidate module; and including the stub class with the same name as the package import class that is not located in the preset public class package in the partition migration analysis report.
[0056] If the candidate module is a "JAR module (Java archive file, used to package multiple Java class files)", by generating a stub class with the same name as the import class that is not located in the preset public class package, this stub class can be inserted into the source code of the candidate module to further ensure that the candidate module can be compiled after being migrated to the vendor partition, thereby further improving the reliability of the module portability assessment.
[0057] In one embodiment, the performing of replacement analysis processing on the native module to obtain a replacement module for the native module includes: determining a native development library that matches the vendor partition; performing similar module matching processing on the native module in the native development library that matches the vendor partition to obtain a module that matches the native module; and determining the module that matches the native module as a replacement module for the native module.
[0058] After determining the native development library that matches the vendor partition, perform similar module matching on the native module from the native development library that matches the vendor partition, and obtain the module that matches the native module in the native development library as the replacement module of the native module, which can effectively replace the native module so that the candidate module can be migrated to the vendor partition. The native development library that matches the vendor partition includes, for example, the Vendor Native Development Kit (VNDK), the Low Level NDK (LLNDK), etc.
[0059] Furthermore, in one embodiment, after outputting the partition migration analysis report of the candidate module, the method may also include: using the preset migration analysis and processing tool to determine the partition migration adaptation parameters corresponding to the module integration file; using the partition migration adaptation parameters to modify the original system partition parameters in the module integration file to obtain the modified module integration file.
[0060] When migrating a candidate module to a vendor partition, the module integration file needs to be migrated at the same time. The partition migration adaptation parameters corresponding to the module integration file can be determined through the preset migration analysis and processing tool, and the original system partition parameters in the module integration file are modified using the partition migration adaptation parameters to obtain the modified module integration file. The modified module integration file can be effectively used for the partition migration of the candidate module, further improving the reliability of the module portability assessment. For example, if a partition migration adaptation parameter is the vendor: true attribute, the system_ext_specific: true attribute in the module integration file can be modified to the vendor: true attribute.
[0061] In order to facilitate better implementation of the module migration analysis and processing method provided in the embodiment of the present application, the embodiment of the present application also provides a module migration analysis and processing device based on the above module migration analysis and processing method. The meanings of the terms are the same as those in the above module migration analysis and processing method, and the specific implementation details can refer to the description in the method embodiment. Figure 4 A block diagram of a module migration analysis and processing device according to an embodiment of the present application is shown.
[0062] like Figure 4 As shown, the module migration analysis and processing device 400 may include: a determination unit 410 may be used to: determine a candidate module to be migrated from a system partition to a vendor partition; an analysis unit 420 may be used to: use a preset migration analysis and processing tool to perform module analysis on the candidate module to obtain a native module used by the candidate module; and, perform alternative analysis on the native module to obtain an alternative module for the native module; and, output a partition migration analysis report of the candidate module, wherein the partition migration analysis report at least includes module information of the candidate module, the native module and the alternative module.
[0063] In some embodiments of the present application, after outputting the partition migration analysis report of the candidate module, the analysis unit is further used to: use the preset migration analysis and processing tool to determine the partition migration adaptation parameters corresponding to the module integration file; use the partition migration adaptation parameters to modify the original system partition parameters in the module integration file to obtain the modified module integration file.
[0064] In some embodiments of the present application, the analysis unit is used to: determine the dependent libraries that the candidate module directly and indirectly depends on; determine whether there is a dependent library classified as a private module among the dependent libraries that the candidate module depends on; if so, determine the dependent library classified as a private module as the native module used by the candidate module.
[0065] In some embodiments of the present application, after determining whether the dependent library that the candidate module depends on is a dependent library classified as a private module, the analysis unit is used to: if not, scan the import package classes of the candidate module; determine whether there are import package classes in the import package classes of the candidate module that are not located in the preset public class package; if so, determine the import package class that is not located in the preset public class package as a hidden interface, and determine the hidden interface as the native module used by the candidate module.
[0066] In some embodiments of the present application, the analysis unit is used to: determine a native development library that matches the vendor partition; perform similar module matching processing on the native module in the native development library that matches the vendor partition to obtain a module that matches the native module; and determine the module that matches the native module as a replacement module for the native module.
[0067] In some embodiments of the present application, after determining whether there is a package import class in the candidate module that is not located in the preset public class package, the analysis unit is used to: generate a stub class with the same name as the package import class that is not located in the preset public class package, and the stub class is used to insert into the source code of the candidate module; and include the stub class with the same name as the package import class that is not located in the preset public class package in the partition migration analysis report.
[0068] In some embodiments of the present application, the analysis unit is used to: scan the module integration file to obtain the candidate module defined therein and the first dependency library set of the candidate module; scan and search the operating system source code for the dependency library on which the first dependency library set depends to obtain the second dependency library set; and determine the dependency libraries in the first dependency library set and the second dependency library set as the dependency libraries on which the candidate module directly and indirectly depends.
[0069] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0070] In addition, the present application also provides an electronic device, such as Figure 5As shown, Figure 5 A block diagram of an electronic device according to an embodiment of the present application is shown, specifically:
[0071] The electronic device may include components such as a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a power supply 503, and an input unit 504. Those skilled in the art will appreciate that Figure 5 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0072] in:
[0073] The processor 501 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 502 and calling data stored in the memory 502, it executes various functions of the computer device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user pages and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501.
[0074] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 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 computer device, etc. In addition, the memory 502 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 devices. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
[0075] The electronic device also includes a power supply 503 for supplying power to each component. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 503 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0076] The electronic device may further include an input unit 504, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0077] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 501 in the electronic device will load the executable files corresponding to the processes of one or more computer programs into the memory 502 according to the following instructions, and the processor 501 will run the computer program stored in the memory 502, thereby realizing various functions in the aforementioned embodiments of the present application, such as the processor 501 may perform the following steps:
[0078] Determine candidate modules to be migrated from the system partition to the vendor partition; use a preset migration analysis and processing tool to perform module analysis on the candidate modules to obtain native modules used by the candidate modules; and, perform replacement analysis on the native modules to obtain replacement modules for the native modules; and, output a partition migration analysis report for the candidate modules, wherein the partition migration analysis report includes at least module information of the candidate modules, the native modules and the replacement modules.
[0079] In some embodiments of the present application, after outputting the partition migration analysis report of the candidate module, the method further includes: using the preset migration analysis and processing tool to determine the partition migration adaptation parameters corresponding to the module integration file; using the partition migration adaptation parameters to modify the original system partition parameters in the module integration file to obtain a modified module integration file.
[0080] In some embodiments of the present application, the module analysis processing performed on the candidate module to obtain the native module used by the candidate module includes: determining the dependent library that the candidate module directly and indirectly depends on; judging whether there is a dependent library classified as a private module among the dependent libraries that the candidate module depends on; if so, determining the dependent library classified as a private module as the native module used by the candidate module.
[0081] In some embodiments of the present application, after determining whether the dependent library that the candidate module depends on is a dependent library classified as a private module, the method further includes: if not, scanning the import package classes of the candidate module; determining whether there are import package classes in the import package classes of the candidate module that are not located in the preset public class package; if so, determining the import package class that is not located in the preset public class package as a hidden interface, and determining the hidden interface as the native module used by the candidate module.
[0082] In some embodiments of the present application, the performing replacement analysis processing on the native module to obtain a replacement module for the native module includes: determining a native development library that matches the vendor partition; performing similar module matching processing on the native module in the native development library that matches the vendor partition to obtain a module that matches the native module; and determining the module that matches the native module as a replacement module for the native module.
[0083] In some embodiments of the present application, after determining whether there is a package import class in the candidate module that is not located in the preset public class package, the method further includes: generating a stub class with the same name as the package import class that is not located in the preset public class package, the stub class being used to be inserted into the source code of the candidate module; and including the stub class with the same name as the package import class that is not located in the preset public class package in the partition migration analysis report.
[0084] In some embodiments of the present application, determining the dependent libraries that the candidate module directly and indirectly depends on includes: scanning a module integration file to obtain the candidate module defined therein and a first dependent library set of the candidate module; scanning and searching the dependent libraries that the first dependent library set depends on in the operating system source code to obtain a second dependent library set; and determining the dependent libraries in the first dependent library set and the second dependent library set as the dependent libraries that the candidate module directly and indirectly depends on.
[0085] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0086] To this end, an embodiment of the present application further provides a storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any method provided in the embodiment of the present application.
[0087] The storage medium may be a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0088] Since the computer program stored in the storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by the method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0089] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0090] It should be understood that the present application is not limited to the embodiments that have been described above and shown in the accompanying drawings, but various modifications and changes may be made without departing from the scope thereof.
Claims
1. A module migration analysis and processing method, characterized in that: include: Determine candidate modules to be migrated from the system partition to the vendor partition; Using a preset migration analysis and processing tool, performing module analysis and processing on the candidate module to obtain a native module used by the candidate module; as well as, Performing a replacement analysis process on the native module to obtain a replacement module for the native module; as well as, A partition migration analysis report of the candidate module is output, wherein the partition migration analysis report at least includes module information of the candidate module, the native module, and the replacement module.
2. The method according to claim 1, characterized in that After outputting the partition migration analysis report of the candidate module, the method further includes: Using the preset migration analysis and processing tool, determine the partition migration adaptation parameters corresponding to the module integration file; The partition migration adaptation parameters are used to modify the original system partition parameters in the module integration file to obtain a modified module integration file.
3. The method according to claim 1, characterized in that The performing module analysis on the candidate module to obtain a native module used by the candidate module includes: Determine the dependent libraries that the candidate module directly and indirectly depends on; Determine whether the dependency library on which the candidate module depends has a dependency library of the private module category; If so, the dependent library classified as a private module is determined as a native module used by the candidate module.
4. The method according to claim 3, characterized in that After determining whether the dependent library on which the candidate module depends has a dependent library of a private module category, the method further includes: If not, scan the import package class of the candidate module; Determine whether there is a package import class in the package import class of the candidate module that is not located in the preset public class package; If so, the imported package class that is not in the preset public class package is determined as a hidden interface, and the hidden interface is determined as a native module used by the candidate module.
5. The method according to claim 1, characterized in that: The performing replacement analysis on the native module to obtain a replacement module for the native module includes: Determining native development libraries matching the vendor partition; Performing similar module matching processing on the native module in the native development library matched by the vendor partition to obtain a module matched by the native module; A module matching the native module is determined as a replacement module for the native module.
6. The method according to claim 4, characterized in that After determining whether there is a package import class that is not located in a preset public class package in the package import class of the candidate module, the method further includes: Generate a stub class with the same name as the package import class that is not located in the preset public class package, and the stub class is used to be inserted into the source code of the candidate module; The partition migration analysis report includes stub classes with the same name as the import package classes that are not located in the preset public class package.
7. The method according to claim 1, characterized in that The step of determining the dependency libraries that the candidate module directly and indirectly depends on includes: Scan the module integration file to obtain the candidate module defined therein and the first dependent library set of the candidate module; Scanning and searching the operating system source code for the dependent libraries on which the first dependent library set depends, to obtain a second dependent library set; Determine the dependent libraries in the first dependent library set and the second dependent library set as the dependent libraries that the candidate module directly and indirectly depends on.
8. A module migration analysis and processing device, characterized in that: include: A determination unit, configured to: determine a candidate module to be migrated from the system partition to the supplier partition; The analysis unit is used to: use a preset migration analysis and processing tool to perform module analysis on the candidate module to obtain a native module used by the candidate module; and perform replacement analysis on the native module to obtain a replacement module for the native module; And, outputting a partition migration analysis report of the candidate module, wherein the partition migration analysis report at least includes module information of the candidate module, the native module and the replacement module.
9. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: a memory storing a computer program; A processor reads a computer program stored in a memory to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Number writing method and device based on Android platform and computer readable medium
CN111651177A
Migration adaptation method and device based on domestic information creation software and hardware platform, and equipment
CN112463417A
Method for migrating Android project to similar Android system, electronic equipment and storage medium
CN115543440A
Method for transplanting NFC function based on operating system
CN117785281A