Naming conflict identification method, device and equipment and readable storage medium
By scanning the jar package of the application software, analyzing the programming entity with the same signature, and identifying naming conflicts through operation instructions comparison, the operation failure problem caused by different functions of the same name algorithm in the application software is solved, and the stability and reliability of the software are improved.
Patent Information
- Application Number
- CN202411741706.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-29
AI Technical Summary
During the development of application software, algorithms with the same name may have different functions, which causes the class loader to mistakenly load incorrect classes, which in turn leads to the algorithm running failure or failure. Naming conflicts need to be resolved to improve the stability and reliability of the software.
By scanning all jar packages to be identified, we analyze whether there are programming entities with the same signature in different jar packages. If so, extract the operation instructions of the programming entity with the same signature, and compare whether these instructions are the same. If not, it is determined that there is a naming conflict.
This method can accurately identify whether the programming entity with the same signature in different jar packages has the same functions, improve the recognition efficiency through instruction comparison, and ensure software stability and reliability.
Smart Images

Figure CN119557226A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and more specifically, to a naming conflict identification method, device, equipment and readable storage medium. Background Art
[0002] As the complexity of application software continues to increase, software development projects are usually divided into multiple module development tasks. These module development tasks may be developed by different developers or organizations, each following different naming conventions and design concepts, which may easily lead to the same algorithm with different functions. Since the names are the same but the functions are different, during the operation of the application software, it is easy for the class loader to mistakenly load the class that is not expected, resulting in algorithm failure or algorithm operation failure.
[0003] Based on this, in the process of application software development, it is necessary to solve the naming conflict problem in time to improve the stability and reliability of the application software. However, the premise of solving the naming conflict problem is to be able to discover the naming conflict problem in time. Therefore, how to identify naming conflicts has become the focus of attention of people in this field. Summary of the invention
[0004] In view of this, the present application provides a naming conflict identification method, apparatus, device and readable storage medium for performing naming conflict identification.
[0005] In order to achieve the above objectives, the proposed solution is as follows:
[0006] A naming conflict identification method, comprising:
[0007] Scan all jar packages of the application to be identified and analyze whether there are programming entities with the same signature in different jar packages;
[0008] If not, determining that there is no naming conflict in the application to be identified;
[0009] If so, extract the operation instructions of each programming entity corresponding to the same signature, and identify whether the operation instructions of each programming entity corresponding to the same signature are the same;
[0010] If they are not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature;
[0011] If they are the same, the step of determining whether there is no naming conflict in the application to be identified is executed.
[0012] Optionally, scanning all jar packages in the application to be identified and analyzing whether there are programming entities with the same signature in different jar packages includes:
[0013] Extract all bytecode files of each jar package;
[0014] Parse the bytecode files of different jar packages and analyze whether there are programming entities with the same signature in different jar packages.
[0015] Optionally, parsing the bytecode files of different jar packages to analyze whether there are programming entities with the same signature in different jar packages includes:
[0016] Compare the bytecode files of different jar packages to determine whether there are bytecode files with the same structure in different jar packages;
[0017] If so, it is determined whether there are programming entities with the same signature in the bytecode files of the same composition.
[0018] Optionally, comparing the bytecode files of different jar packages to determine whether there are bytecode files with the same structure in different jar packages includes:
[0019] Determine the definition type and modifiers of programming entities in each bytecode file;
[0020] Determine whether there are bytecode files with the same definition type and modifiers of programming entities in different jar packages.
[0021] Optionally, extracting all bytecode files of each jar package includes:
[0022] Use command line tools to extract class files from each jar package.
[0023] Optionally, extracting the operation instructions of each programming entity corresponding to the same signature, and identifying whether the operation instructions of each programming entity corresponding to the same signature are the same, includes:
[0024] The operation instruction sets of each method corresponding to the same signature are extracted, and it is identified whether the operation instruction sets of each method corresponding to the same signature are the same.
[0025] Optionally, before scanning all jar packages in the application to be identified and analyzing whether there are programming entities with the same signature in different jar packages, the method further includes:
[0026] Log in to the server remotely via SSH protocol and download all jar packages of the application to be identified.
[0027] A naming conflict identification device, comprising:
[0028] The scanning module is used to scan all jar packages of the application to be identified and analyze whether there are programming entities with the same signature in different jar packages; if not, the determination module is called; if so, the extraction module is called;
[0029] A determination module, used to determine whether there is no naming conflict in the application to be identified;
[0030] The extraction module is used to extract the operation instructions of each programming entity corresponding to the same signature, and identify whether the operation instructions of each programming entity corresponding to the same signature are the same; if they are not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature; if they are the same, the determination module is called.
[0031] A naming conflict identification device includes a memory and a processor;
[0032] The memory is used to store programs;
[0033] The processor is used to execute the program to implement each step of the above-mentioned naming conflict identification method.
[0034] A readable storage medium stores a computer program thereon, characterized in that when the computer program is executed by a processor, each step of the above-mentioned naming conflict identification method is implemented.
[0035] It can be seen from the above technical scheme that the naming conflict identification method provided by the present application, considering that the functions of the programming entities with the same signature in the same jar package are the same, there will be no naming conflict. Therefore, the method can first scan all the jar packages of the application to be identified, and analyze whether there are programming entities with the same signature in different jar packages; if not, it is determined that there is no naming conflict in the application to be identified; based on this, the signature comparison process of the same jar package is removed to improve the recognition efficiency; and after determining that there are programming entities with the same signature in different jar packages, the operation instructions corresponding to each programming entity with the same signature can be extracted, and the operation instructions corresponding to each programming entity with the same signature can be identified. Whether the same; if not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature; if the same, enter the step of executing to determine that there is no naming conflict in the application to be identified. Based on this, the present application can determine whether the programming entities with the same signature in different jar packages have the same function by identifying the instructions in the programming entity, and convert the function identification process into an instruction extraction process and an instruction comparison process. The instruction is the specific execution step of the algorithm, and the algorithm function under the same execution step is the same. Through instruction comparison, the matching of the algorithm function can be accurately judged. At the same time, instruction extraction is relatively simple, so converting the function identification process into an instruction comparison process can simplify the identification difficulty as much as possible and improve the identification efficiency while ensuring the identification accuracy. It can be seen that the present application can determine whether there is a naming conflict in the application to be identified while ensuring the identification efficiency, thereby accelerating the naming conflict resolution process and improving the stability and reliability of the application software. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0037] Figure 1 A flowchart of a naming conflict identification method disclosed in an embodiment of the present application;
[0038] Figure 2 A flowchart of identifying programming entities with the same signature disclosed in an embodiment of the present application;
[0039] Figure 3 A structural block diagram of a naming conflict identification device disclosed in an embodiment of the present application;
[0040] Figure 4 This is a hardware structure block diagram of a naming conflict identification device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0042] The embodiment of the present application provides a naming conflict identification method, which can be applied to various test platforms or various algorithm detection systems, and can also be applied to various computer terminals or smart terminals. The execution subject can be a processor or server of the computer terminal or smart terminal. The method flow chart of the naming conflict identification method is as follows Figure 1 As shown, specifically including:
[0043] Step S1, scan all jar packages of the application to be identified, and analyze whether there are programming entities with the same signature in different jar packages; if not, execute step S4; if yes, execute step S2.
[0044] Specifically, all jar packages of the application to be identified may be obtained, and each jar package may be scanned to identify whether there are programming entities with the same signature in different jar packages.
[0045] If there are no programming entities with the same signature in different jar packages, step S4 can be executed.
[0046] If there are programming entities with the same signature in different jar packages, step S2 can be executed.
[0047] Each programming entity can be any of the following: a method in a jar package, a class in a jar package.
[0048] Step S2, extract the operation instructions of each programming entity corresponding to the same signature, and identify whether the operation instructions of each programming entity corresponding to the same signature are the same; if not, execute step S3; if yes, execute step S4.
[0049] Specifically, when there are programming entities with the same signature in different jar packages, it is necessary to identify whether the functions of the programming entities with the same signature in different jar packages are the same;
[0050] If the functions of programming entities with the same signature in different jar packages are different, it means that the programming entities with the same signature conflict with each other, which may easily lead to the operation failure of the application to be identified;
[0051] If the functions of programming entities with the same signature in different jar packages are the same, then the programming entities with the same signature can be considered to be unified programming entities without any conflict.
[0052] Among them, by comparing the operation instructions between various programming entities with the same signature, it can be determined whether the functions of different jar package programming entities corresponding to the same signature are the same.
[0053] If the operation instructions of different jar package programming entities corresponding to the same signature are the same, step S4 can be executed.
[0054] If there are differences in the operation instructions of different jar package programming entities corresponding to the same signature, step S3 can be executed.
[0055] Step S3: Determine whether conflicts exist between programming entities corresponding to the same signature.
[0056] Specifically, when there are differences in the operation instructions of different jar package programming entities corresponding to the same signature, it indicates that there are programming entities with naming conflicts between different jar packages. At this time, the jar package identifier and signature corresponding to the target programming entity with naming conflicts can be determined;
[0057] Generates a jar package containing the target programming entity's identifier and signature reminder information.
[0058] You can also build emails or reminder pop-ups based on reminder information;
[0059] Determine a technician terminal corresponding to the application to be identified;
[0060] Send an email or reminder pop-up window to the technician terminal.
[0061] Step S4: Determine whether there is no naming conflict in the application to be identified.
[0062] Specifically, when there are no programming entities with the same signature in different jar packages, it can be considered that there is no naming conflict problem in the application to be identified, and thus a detection result for indicating that there is no naming conflict in the application to be identified can be generated.
[0063] When there is no difference in the operation instructions of different jar package programming entities corresponding to the same signature, it indicates that there is no programming entity with naming conflict between different jar packages. At this time, it can be determined that there is no conflict between the programming entities corresponding to the same signature;
[0064] Feedback information indicating that there is no naming conflict for the application to be identified may be generated.
[0065] It can be seen from the above technical scheme that the naming conflict identification method provided by the present application, considering that the functions of the programming entities with the same signature in the same jar package are the same, there will be no naming conflict. Therefore, the method can first scan all the jar packages of the application to be identified, and analyze whether there are programming entities with the same signature in different jar packages; if not, it is determined that there is no naming conflict in the application to be identified; based on this, the signature comparison process of the same jar package is removed to improve the recognition efficiency; and after determining that there are programming entities with the same signature in different jar packages, the operation instructions corresponding to each programming entity with the same signature can be extracted, and the operation instructions corresponding to each programming entity with the same signature can be identified. Whether the same; if not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature; if the same, enter the step of executing to determine that there is no naming conflict in the application to be identified. Based on this, the present application can determine whether the programming entities with the same signature in different jar packages have the same function by identifying the instructions in the programming entity, and convert the function identification process into an instruction extraction process and an instruction comparison process. The instruction is the specific execution step of the algorithm, and the algorithm function under the same execution step is the same. Through instruction comparison, the matching of the algorithm function can be accurately judged. At the same time, instruction extraction is relatively simple, so converting the function identification process into an instruction comparison process can simplify the identification difficulty as much as possible and improve the identification efficiency while ensuring the identification accuracy. It can be seen that the present application can determine whether there is a naming conflict in the application to be identified while ensuring the identification efficiency, thereby accelerating the naming conflict resolution process and improving the stability and reliability of the application software.
[0066] In some embodiments of the present application, it is considered that the naming conflict may be caused by the deployment of multiple versions of the application to be identified on the server, and any one or more programming entities of the latest version have been modified, resulting in naming conflicts between programming entities with the same signature in different versions. Therefore, before scanning all jar packages of the application to be identified in step S1 and analyzing whether there are programming entities with the same signature in different jar packages, a process of obtaining all jar packages of the application to be identified on the server can be added to identify naming conflicts for the application to be identified deployed on the server. Next, the added process of obtaining all jar packages of the application to be identified on the server will be described in detail, and the steps are as follows:
[0067] Log in to the server remotely via SSH protocol and download all jar packages of the application to be identified.
[0068] Specifically, after monitoring the information sent by vpaas that the application to be identified is successfully deployed on the server, you can remotely log in to the server through the SSH protocol;
[0069] Download scripts and algorithm packages from the server.
[0070] It can be seen from the above technical solution that compared with the previous embodiment, this embodiment adds an optional method of obtaining all jar packages of the application to be identified from the server. Through the above method, naming conflicts of the application to be identified from the server can be identified, and the deployment of the application to be identified can be better completed.
[0071] In some embodiments of the present application, the process of scanning all jar packages of the application to be identified and analyzing whether there are programming entities with the same signature in different jar packages is described in detail, and the steps are as follows:
[0072] S10. Extract all bytecode files of each jar package.
[0073] Specifically, the bytecode file can be extracted from each jar package in a variety of ways.
[0074] For example, you can use a decompilation tool to extract all bytecode files from each jar package; you can also use a command line tool to extract all bytecode files from each jar package.
[0075] The decompilation tool may be JD-GUI or FernFlower.
[0076] S11. Parse the bytecode files of different jar packages to analyze whether there are programming entities with the same signature in different jar packages.
[0077] Specifically, the signature of each programming entity in each bytecode file may be obtained; for example, the signature of each programming entity may be searched through a command; or a bytecode operation library may be used to parse each bytecode file to determine the signature of each programming entity.
[0078] After determining the signature of each programming entity in all bytecode files, the signatures of each programming entity in similar bytecode files in different jar packages can be compared to determine whether there are programming entities with the same signature in different jar packages.
[0079] It can be seen from the above technical solution that this embodiment provides an optional method of scanning all jar packages of the application to be identified and analyzing whether there are programming entities with the same signature in different jar packages. Through the above method, each jar package can be disassembled into multiple bytecode files, and by comparing the programming entity signatures of each bytecode file in different jar packages, it can be determined whether there are programming entities with the same signature in different jar packages. The signatures can be better compared step by step to avoid comparison errors caused by excessive complexity of data.
[0080] In some embodiments of the present application, the process of extracting all bytecode files of each jar package in step S10 is described in detail, and the steps are as follows:
[0081] S100. Use command line tools to extract class files from each jar package.
[0082] Specifically, you can use the javap command to extract class files from each jar package.
[0083] It can be seen from the above technical solution that this embodiment provides an optional method for extracting all bytecode files of each jar package. The class file can be extracted by the above method to subsequently extract the signature of the programming entity.
[0084] In some embodiments of the present application, Figure 2 The process of parsing the bytecode files of different jar packages and analyzing whether there are programming entities with the same signature in different jar packages is described in detail in step S11. The steps are as follows:
[0085] Step S110, compare the bytecode files of different jar packages to determine whether there are bytecode files with the same structure in different jar packages; if so, execute step S111; if not, it can be determined that there is no naming conflict in the application to be identified.
[0086] Specifically, the content of each bytecode file can be compared with the content of each bytecode file of other jar packages in turn to determine whether there are bytecode files with the same structure in different jar packages.
[0087] If so, there may be a naming conflict between the bytecode files with the same structure and corresponding to different jar packages, then step S111 can be executed.
[0088] If not, the possibility that the bytecodes in different jar packages have the same signature programming entity is low, so it can be determined that there is no naming conflict in the application to be identified.
[0089] Step S111, determine whether there is a programming entity with the same signature in the bytecode file of the same structure.
[0090] Specifically, the signatures of the various programming entities of the bytecode files of the same composition may be compared to evaluate whether there are programming entities with the same signature in the bytecode files of the same composition.
[0091] It can be seen from the above technical solution that this embodiment provides an optional method for parsing bytecode files of different jar packages and analyzing whether there are programming entities with the same signature in different jar packages. Through the above method, it is possible to find bytecode files of the same structure in different jar packages, and then identify whether there are programming entities with the same signature in the bytecode files of the same structure, thereby reducing the amount of comparison data of the programming entity signature and the probability of error in the comparison result, thereby improving the comparison reliability of the present application and improving the accuracy of naming conflict identification of the present application.
[0092] In some embodiments of the present application, step S110, comparing the bytecode files of different jar packages to determine whether there are bytecode files with the same structure in different jar packages, is described in detail, and the steps are as follows:
[0093] S1100, determine the definition type and modifier of the programming entity in each bytecode file.
[0094] Specifically, the definition type and modifier of each programming entity can be extracted from each bytecode file.
[0095] For example, you can use javap to obtain detailed information about each class in each class file, which may include the programming entity definition type and modifiers.
[0096] S1101. Determine whether there are bytecode files with the same definition type and modifier of the programming entity in different jar packages.
[0097] Specifically, the programming entity definition type and modifier of each bytecode file in different jar packages can be compared, and bytecode files with the same programming entity definition type and modifier and belonging to different jar packages are regarded as bytecode files with the same structure.
[0098] It can be seen from the above technical solution that this embodiment provides an optional way to compare the bytecode files of different jar packages and determine whether there are bytecode files with the same structure in different jar packages. Through the above method, this application can convert the structure comparison between bytecode files into programming entity definition type and modifier comparison. Once the definition type and modifier of the programming entity are all the same, the structure of the bytecode files is the same. Based on this, bytecode files with the same structure and belonging to different jar packages can be better determined.
[0099] In some embodiments of the present application, the process of extracting the operation instructions of each programming entity corresponding to the same signature and identifying whether the operation instructions of each programming entity corresponding to the same signature are the same is described in detail, and the steps are as follows:
[0100] S20, extracting the operation instruction sets of each method corresponding to the same signature, and identifying whether the operation instruction sets of each method corresponding to the same signature are the same.
[0101] Specifically, considering that in general, naming conflicts lead to runtime errors because the class loader loads an unexpected method, it is more important to identify whether there are naming conflicts among methods in different jar packages during the naming conflict identification process. Therefore, you can try to identify whether the methods in different jar packages have the same signature but different functions.
[0102] On this basis, all operation instructions of each method with the same signature and belonging to different jar packages can be extracted, and all operation instructions of the same method can be written into the same operation instruction set;
[0103] Multiple operation instruction sets with the same corresponding method signature but different corresponding jar packages can be compared to determine whether the operation instruction sets with the same corresponding method signature but different corresponding jar packages are exactly the same;
[0104] If they are exactly the same, it can be determined that there is a conflict between the programming entities corresponding to the same signature;
[0105] If they are not exactly the same, it can be determined that there is no conflict between the programming entities corresponding to the same signature.
[0106] It can be seen from the above technical solution that this embodiment provides an optional method for extracting operation instructions of each programming entity corresponding to the same signature, and identifying whether the operation instructions of each programming entity corresponding to the same signature are the same. Through the above method, it is possible to identify operation failures caused by methods with the same signature but different functions, and timely identify method naming conflicts.
[0107] Next, we will combine Figure 3 The naming conflict identification device provided in the present application is introduced in detail. The naming conflict identification device provided below can be compared with the naming conflict identification method provided above.
[0108] See also Figure 3 It can be found that the naming conflict identification device may include:
[0109] The scanning module 10 is used to scan all jar packages of the application to be identified and analyze whether there are programming entities with the same signature in different jar packages; if not, the determination module is called; if so, the extraction module is called;
[0110] A determination module 20, configured to determine whether there is no naming conflict in the application to be identified;
[0111] The extraction module 30 is used to extract the operation instructions of each programming entity corresponding to the same signature, and identify whether the operation instructions of each programming entity corresponding to the same signature are the same; if they are not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature; if they are the same, the determination module is called.
[0112] Furthermore, the naming conflict identification device may further include:
[0113] The jar package downloading module is used to remotely log in to the server through the SSH protocol and download all jar packages of the application to be identified.
[0114] Furthermore, the scanning module may include:
[0115] Bytecode file extraction unit, used to extract all bytecode files of each jar package;
[0116] The bytecode file parsing unit is used to parse the bytecode files of different jar packages and analyze whether there are programming entities with the same signature in different jar packages.
[0117] Further, the bytecode file extraction unit may include:
[0118] The class file extraction unit is used to extract class files from each jar package using command line tools.
[0119] Further, the bytecode file parsing unit may include:
[0120] The bytecode file comparison component is used to compare the bytecode files of different jar packages to determine whether there are bytecode files with the same structure in different jar packages; if so, the signature comparison component is called;
[0121] The signature comparison component is used to determine whether there are programming entities with the same signature in the bytecode files of the same structure.
[0122] Furthermore, the bytecode file comparison component may include:
[0123] A modifier determination subcomponent is used to determine the definition type and modifier of the programming entity in each bytecode file;
[0124] The consistency judgment subcomponent is used to determine whether there are bytecode files with the same definition type and modifiers of programming entities in different jar packages.
[0125] Furthermore, the extraction module may include:
[0126] The operation instruction set comparison unit is used to extract the operation instruction sets of each method corresponding to the same signature, and identify whether the operation instruction sets of each method corresponding to the same signature are the same.
[0127] The naming conflict identification device provided in the embodiment of the present application can be applied to naming conflict identification devices, such as PC terminals, cloud platforms, servers and server clusters. Figure 4 The hardware structure diagram of the naming conflict recognition device is shown in FIG. Figure 4 ,The hardware structure of the naming conflict identification device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0128] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0129] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0130] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;
[0131] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0132] Scan all jar packages of the application to be identified and analyze whether there are programming entities with the same signature in different jar packages;
[0133] If not, determining that there is no naming conflict in the application to be identified;
[0134] If so, extract the operation instructions of each programming entity corresponding to the same signature, and identify whether the operation instructions of each programming entity corresponding to the same signature are the same;
[0135] If they are not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature;
[0136] If they are the same, the step of determining whether there is no naming conflict in the application to be identified is executed.
[0137] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0138] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0139] Scan all jar packages of the application to be identified and analyze whether there are programming entities with the same signature in different jar packages;
[0140] If not, determining that there is no naming conflict in the application to be identified;
[0141] If so, extract the operation instructions of each programming entity corresponding to the same signature, and identify whether the operation instructions of each programming entity corresponding to the same signature are the same;
[0142] If they are not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature;
[0143] If they are the same, the step of determining whether there is no naming conflict in the application to be identified is executed.
[0144] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0145] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also 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 a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0146] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0147] The above description of the disclosed embodiments enables professionals and technicians in the field to implement or use the present application. Various modifications to these embodiments will be apparent to professionals and technicians in the field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. The various embodiments of the present application can be combined with each other. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A naming conflict identification method, characterized in that: include: Scan all jar packages of the application to be identified and analyze whether there are programming entities with the same signature in different jar packages; If not, determining that there is no naming conflict in the application to be identified; If so, extract the operation instructions of each programming entity corresponding to the same signature, and identify whether the operation instructions of each programming entity corresponding to the same signature are the same; If they are not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature; If they are the same, the step of determining whether there is no naming conflict in the application to be identified is executed.
2. The naming conflict identification method according to claim 1, characterized in that: Scanning all jar packages of the application to be identified and analyzing whether there are programming entities with the same signature in different jar packages includes: Extract all bytecode files of each jar package; Parse the bytecode files of different jar packages and analyze whether there are programming entities with the same signature in different jar packages.
3. The naming conflict identification method according to claim 2, characterized in that: The bytecode files of different jar packages are parsed to analyze whether there are programming entities with the same signature in different jar packages, including: Compare the bytecode files of different jar packages to determine whether there are bytecode files with the same structure in different jar packages; If so, it is determined whether there are programming entities with the same signature in the bytecode files of the same composition.
4. The naming conflict identification method according to claim 3, characterized in that: The bytecode files of different jar packages are compared to determine whether there are bytecode files with the same structure in different jar packages, including: Determine the definition type and modifiers of programming entities in each bytecode file; Determine whether there are bytecode files with the same definition type and modifiers of programming entities in different jar packages.
5. The naming conflict identification method according to claim 2, characterized in that: The extraction of all bytecode files of each jar package includes: Use command line tools to extract class files from each jar package.
6. The naming conflict identification method according to claim 1, characterized in that: The extracting operation instructions of each programming entity corresponding to the same signature and identifying whether the operation instructions of each programming entity corresponding to the same signature are the same includes: The operation instruction sets of each method corresponding to the same signature are extracted, and it is identified whether the operation instruction sets of each method corresponding to the same signature are the same.
7. The naming conflict identification method according to claim 1, characterized in that: Before scanning all jar packages of the application to be identified and analyzing whether there are programming entities with the same signature in different jar packages, the method further includes: Log in to the server remotely via SSH protocol and download all jar packages of the application to be identified.
8. A naming conflict identification device, characterized in that: include: The scanning module is used to scan all jar packages of the application to be identified and analyze whether there are programming entities with the same signature in different jar packages; If it does not exist, call the determination module; If it exists, the extraction module is called; A determination module, used to determine whether there is no naming conflict in the application to be identified; The extraction module is used to extract the operation instructions of each programming entity corresponding to the same signature, and identify whether the operation instructions of each programming entity corresponding to the same signature are the same; if they are not the same, it is determined that there is a conflict between the programming entities corresponding to the same signature; if they are the same, the determination module is called.
9. A naming conflict identification device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the naming conflict identification method as described in any one of claims 1 to 7.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the naming conflict identification method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for detecting JAR packet collision
CN105630463A
Bytecode file processing method and device, equipment and storage medium
CN111078279A
Method and device for determining modification function point based on byte code, equipment and medium
CN114281401A
Jar packet conflict detection method and device, storage medium and computer equipment
CN115563010A
Bytecode instruction sequence analysis method and device, electronic equipment and storage medium
CN117492831A