CN117667668A - Application analysis method, device, equipment and storage medium based on application upgrading - Google Patents

Application analysis method, device, equipment and storage medium based on application upgrading Download PDF

Info

Publication number
CN117667668A
CN117667668A CN202311427307.5A CN202311427307A CN117667668A CN 117667668 A CN117667668 A CN 117667668A CN 202311427307 A CN202311427307 A CN 202311427307A CN 117667668 A CN117667668 A CN 117667668A
Authority
CN
China
Prior art keywords
file
application
upgrading
original edition
upgrade
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311427307.5A
Other languages
Chinese (zh)
Inventor
肖巍智
刘辉军
蔡博文
廖慧
周伟萍
林兵
陆勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yuanguang Software Co Ltd
Original Assignee
Yuanguang Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yuanguang Software Co Ltd filed Critical Yuanguang Software Co Ltd
Priority to CN202311427307.5A priority Critical patent/CN117667668A/en
Publication of CN117667668A publication Critical patent/CN117667668A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The application belongs to the field of data analysis, and relates to an application analysis method based on application upgrading, which comprises the steps of respectively loading an upgrading application package and an original application package to obtain an upgrading application file and an original application file; judging whether the original edition application file corresponding to the upgrading application file belongs to the two-party dependent file or not; if the comparison analysis belongs to the upgrading application file and the corresponding original edition application file, carrying out file content comparison analysis on the upgrading application file and the corresponding original edition application file to obtain a comparison analysis result; if not, identifying the modified contents of the upgrading application file and the original edition application file; and after the content comparison analysis or the modification content identification is completed by all the upgrading application packages, combining the comparison analysis result and the modification content to obtain a target analysis result. The application analysis device, the computer equipment and the storage medium based on the application upgrading are also provided. The method and the device can improve the online effect of upgrading application.

Description

Application analysis method, device, equipment and storage medium based on application upgrading
Technical Field
The present disclosure relates to the field of data analysis, and in particular, to an application analysis method, apparatus, device, and storage medium based on application upgrade.
Background
With the wide application of micro-service technology, business applications are split into a plurality of micro-service applications, and the release of new versions of the micro-service applications involves the preparation before the release of a plurality of application packages and the construction of dependency packages, in which case the dependency analysis of the application packages is particularly important.
The application analysis is a process of analyzing and comparing the application version before and after upgrading of the micro-service application, and the traditional analysis method generally analyzes and checks the pure code of the micro-service application through a before and after-upgrading application version and a related tool of the before and after-upgrading application version so as to compare the application content of the micro-service application and determine the modification and the content after the application upgrading.
Before the application is upgraded, a great amount of functional tests, system integration tests and automatic tests are required to be carried out on the new version application in a test environment, and although the existing analysis method can pass the tests, untested application details still appear in the actual use process of the new version application after the new version application is uploaded, so that the online upgrading application effect is poor.
Disclosure of Invention
The invention provides an application analysis method, an application analysis device and a storage medium based on application upgrading, and aims to improve the online effect of upgrading application.
In order to solve the above technical problems, the embodiments of the present application provide an application analysis method based on application upgrade, which adopts the following technical scheme:
acquiring an upgrade application package to be analyzed and an original application package corresponding to the upgrade application package, and respectively loading the upgrade application package and the original application package to obtain an upgrade application file and an original application file;
judging whether the original edition application file corresponding to the upgrading application file belongs to a two-party dependent file or not;
if the upgrading application file and the corresponding original edition application file belong to the two-party dependent file, carrying out file content comparison analysis on the upgrading application file and the corresponding original edition application file to obtain a comparison analysis result;
if the upgrade application file and the original edition application file corresponding to the upgrade application file do not belong to the two-party dependent file, identifying modification contents of the upgrade application file and the original edition application file;
and after the content comparison analysis or the modification content identification is completed by all the upgrading application packages, combining the comparison analysis result with the modification content to obtain a target analysis result.
Further, the performing file content comparison analysis on the upgrade application file and the corresponding original edition application file to obtain a comparison analysis result includes:
performing class change comparison on the upgrading byte file in the upgrading application file and the original edition byte file in the original edition application file to obtain a first comparison result;
performing item content comparison on the upgrading item file in the upgrading application file and the original edition item file in the original edition application file to obtain a second comparison result;
performing attribute comparison on the upgrading configuration file in the upgrading application file and the original edition configuration file in the original edition application file to obtain a third comparison result;
performing resource comparison on the upgrading resource file in the upgrading application file and the original edition resource file in the original edition application file to obtain a fourth comparison result;
and integrating the first comparison result, the second comparison result, the third comparison result and the fourth comparison result to obtain the comparison analysis result.
Further, the performing class change comparison on the upgrade byte file in the upgrade application file and the original edition byte file in the original edition application file to obtain a first comparison result, where the comparing includes:
Acquiring an upgrading class annotation method and an upgrading class annotation attribute in the upgrading byte file, and an original edition class annotation method and an original edition class annotation attribute in the original edition byte file;
comparing and analyzing the method type of the upgrading annotation method with the method type of the original edition annotation method to obtain a first type comparison result;
comparing and analyzing the annotation type of the upgrading annotation attribute with the annotation type of the original edition annotation attribute to obtain a second type comparison result;
and combining the first type comparison result and the second type comparison result to obtain the first comparison result.
Further, the determining whether the upgrade application file and the original version application file corresponding to the upgrade application file belong to the two-party dependency file includes:
acquiring upgrading project coordinates of an upgrading project file in the upgrading application file and original edition project coordinates of original edition project files in the original edition application file;
reading upgrading service information of the upgrading project coordinates and original edition service information of the original edition project coordinates, and respectively judging whether the upgrading service information and the original edition service information are consistent with preset service information or not;
If the upgrade application file and the corresponding original edition application file belong to the two-party dependent file, performing file content comparison analysis on the upgrade application file and the corresponding original edition application file to obtain a comparison analysis result, wherein the specific steps of obtaining the comparison analysis result include:
if the upgrading service information and the original edition service information are consistent with preset service information, determining that the upgrading application file and the corresponding original edition application file belong to the two-party dependent file, and performing file content comparison analysis on the upgrading application file and the corresponding original edition application file to obtain a comparison analysis result;
if the upgrade application file and the original edition application file corresponding to the upgrade application file do not belong to the two-party dependent file, the specific step of identifying the modification content of the upgrade application file and the original edition application file includes:
and if the upgrading service information and the original edition service information are inconsistent with the preset service information, determining that the upgrading application file and the original edition application file corresponding to the upgrading application file are not the two-party dependent file, and identifying the modification content of the upgrading application file and the original edition application file.
Further, the identifying the modified content of the upgrade application file and the original application file includes:
Acquiring all upgrading file names in the upgrading application file and all original edition file names in the original edition application file;
searching whether the name of the upgrading file and the name of the original edition file corresponding to the name of the upgrading file are changed or not by using a preset searching component;
if the name of the upgrade file is changed with the corresponding original edition file name, the changed upgrade file is used as modified content;
and if the name of the upgrading file is unchanged from the corresponding original file name, determining that the modified content does not exist.
Further, the loading the upgrade application package and the original application package to obtain an upgrade application file and an original application file respectively includes:
acquiring an upgrade file package name and an upgrade loading path of the upgrade application file, and an original edition file package name and an original edition loading path of the original edition application file by using a preset class loader;
class resource loading is carried out on the upgrade application file according to the upgrade file package name and the upgrade loading path, so that the upgrade application file comprising an upgrade byte file, an upgrade project file, an upgrade configuration file and an upgrade dependent file is obtained;
And carrying out class resource loading on the original edition application file according to the original edition file package name and the original edition loading path to obtain the original edition application file containing an original edition byte file, an original edition project file, an original edition configuration file and an original edition dependent file.
In order to solve the above technical problems, the embodiments of the present application further provide an application analysis device based on application upgrade, which adopts the following technical scheme:
the loading module is used for acquiring an upgrade application package to be analyzed and an original application package corresponding to the upgrade application package, and respectively loading the upgrade application package and the original application package to obtain an upgrade application file and an original edition application file;
the judging module is used for judging whether the upgrading application file and the original edition application file corresponding to the upgrading application file belong to two-party dependent files or not;
the analysis module is used for carrying out file content comparison analysis on the upgrading application file and the corresponding original edition application file if the upgrading application file and the corresponding original edition application file belong to the two-party dependent file, so as to obtain a comparison analysis result; if the upgrade application file and the original edition application file corresponding to the upgrade application file do not belong to the two-party dependent file, identifying modification contents of the upgrade application file and the original edition application file; and
And the combination module is used for combining the comparison analysis result and the modified content after all the upgrading application packages complete the content comparison analysis or identify the modified content to obtain a target analysis result.
In order to solve the above technical problems, the embodiments of the present application further provide a computer device, which adopts the following technical schemes:
a memory storing at least one computer program; and
And a processor executing the computer program stored in the memory to realize the application analysis based on the application upgrading.
In order to solve the above technical problems, embodiments of the present application further provide a computer readable storage medium, which adopts the following technical solutions:
the computer readable storage medium has stored therein at least one computer program that is executed by a processor in an electronic device to implement the application upgrade based application analysis described above.
Compared with the prior art, the application has the following main beneficial effects:
in the embodiment of the application, after the upgrade application package to be analyzed and the corresponding original application package are obtained, all application package files and dependency package files of the application version before upgrade and the application version after upgrade can be obtained by loading the upgrade application package and the original application package respectively; secondly, by judging whether the upgrading application file and the original edition application file corresponding to the upgrading application file belong to the two-party dependent file, the application analysis of the internal application file and the external application file can be conveniently carried out on the application layer, and the accuracy rate of the subsequent application analysis can be conveniently improved; finally, if the application file belongs to the two-party dependency file, the file content comparison analysis is carried out on the upgrading application file and the original version application file corresponding to the upgrading application file, so that the analysis and comparison of the new version application file and the old version application file can be realized at the application level, the modified content of the new version of the internal application relative to the old version can be determined, and the accuracy of the application analysis can be improved; if the application file does not belong to the two-party dependent file, the modified contents of the upgrading application file and the original edition application file are identified to determine the modified contents of the new edition external application package, so that the content of application analysis is further perfected, and the online effect of upgrading application is improved. Therefore, the application analysis method, the device, the equipment and the storage medium based on the application upgrading can improve the online effect of the upgrading application.
Drawings
For a clearer description of the solution in the present application, a brief description will be given below of the drawings that are needed in the description of the embodiments of the present application, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of an application analysis method based on application upgrades according to the present application;
FIG. 3 is a block diagram of one embodiment of a fabric side in an application upgrade-based application analysis system according to the present application;
FIG. 4 is a schematic structural diagram of one embodiment of a computer device according to the present application.
Detailed Description
The method for determining a data format provided in the embodiments of the present invention is applied to a data processing system, and all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains unless defined otherwise; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description and claims of the present application and in the description of the figures above are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to better understand the technical solutions of the present application, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social networking platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the application analysis method based on application upgrade provided in the embodiments of the present application is generally executed by a server/terminal device, and accordingly, an application analysis system based on application upgrade is generally set in the server/terminal device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow chart of one embodiment of an application analysis method based on application upgrades as set forth in the present application is shown. The application analysis method based on application upgrading comprises the following steps:
S210, acquiring an upgrade application package to be analyzed and an original application package corresponding to the upgrade application package, and respectively loading the upgrade application package and the original application package to obtain an upgrade application file and an original edition application file.
In this embodiment of the present application, the upgrade application package refers to a micro-service application code package stored after the micro-service application version is upgraded; the original application package refers to a micro-service application code package stored in an original version of the micro-service application. The upgrade application file is a code file comprising an upgrade byte file, an upgrade project file, an upgrade configuration file and an upgrade dependent file; the master application file is a code file comprising a master byte file, a master project file, a master configuration file, and a master dependency file.
As an embodiment of the present application, the loading the upgrade application package and the original application package to obtain an upgrade application file and an original application file includes:
acquiring an upgrade file package name and an upgrade loading path of the upgrade application file, and an original edition file package name and an original edition loading path of the original edition application file by using a preset class loader;
Class resource loading is carried out on the upgrade application file according to the upgrade file package name and the upgrade loading path, so that the upgrade application file comprising an upgrade byte file, an upgrade project file, an upgrade configuration file and an upgrade dependent file is obtained;
and carrying out class resource loading on the original edition application file according to the original edition file package name and the original edition loading path to obtain the original edition application file containing an original edition byte file, an original edition project file, an original edition configuration file and an original edition dependent file.
The preset class loading is a custom SpringYgBootClassLoader loader, and is used for loading attribute data of an application program in an application package and operation data in the application program, namely, loading byte files, project files, configuration files and dependency files in the application package, and converting the loaded data into java class data which can be directly read later.
In an embodiment of the present application, the loading paths include a Boot class loading path, an extension class loading path, and an application program class loading path, where the Boot class loading path refers to a Boot-Inf/lib or web-Inf/lib directory; the extension class loading path refers to an application Boot-Inf/lib/ext or web-Inf/lib/ext directory; the application class loading path refers to a user path (ClassPath), i.e. loads the specified class library, including the application code and the jar package of the third party used.
In the embodiment of the present application, the naming of the package name may be customized based on the actual service requirement, for example, there is a package name consisting of item name+data type+version number +. Jar/. Class/. Pore.
In the embodiment of the application, the upgrade package name and the upgrade loading path of the upgrade application file, the original package name and the original loading path of the original application file are obtained by using the preset class loader, so that the whole application program is not required to be loaded, only the application files of the upgrade application file and the original application file are required to be loaded in batches, the loading efficiency is improved, and the online efficiency of the subsequent upgrade application is convenient to improve.
S220, judging whether the original edition application file corresponding to the upgrading application file belongs to the two-party dependent file or not.
In this embodiment of the present application, the two-party dependency file is a dependency jar package published by an internal platform of an enterprise.
As an embodiment of the present application, the determining whether the upgrade application file and the original version application file corresponding to the upgrade application file belong to a two-party dependency file includes:
acquiring upgrading project coordinates of an upgrading project file in the upgrading application file and original edition project coordinates of original edition project files in the original edition application file;
Reading upgrading service information of the upgrading project coordinates and original edition service information of the original edition project coordinates, and respectively judging whether the upgrading service information and the original edition service information are consistent with preset service information or not;
if the upgrade application file and the corresponding original edition application file belong to the two-party dependent file, performing file content comparison analysis on the upgrade application file and the corresponding original edition application file to obtain a comparison analysis result, wherein the specific steps of obtaining the comparison analysis result include:
if the upgrading service information and the original edition service information are consistent with preset service information, determining that the upgrading application file and the corresponding original edition application file belong to the two-party dependent file, and performing file content comparison analysis on the upgrading application file and the corresponding original edition application file to obtain a comparison analysis result;
if the upgrade application file and the original edition application file corresponding to the upgrade application file do not belong to the two-party dependent file, the specific step of identifying the modification content of the upgrade application file and the original edition application file includes:
and if the upgrading service information and the original edition service information are inconsistent with the preset service information, determining that the upgrading application file and the original edition application file corresponding to the upgrading application file are not the two-party dependent file, and identifying the modification content of the upgrading application file and the original edition application file.
Wherein, the project coordinates are composed of GroupId, artifactId and version number, which are used for guaranteeing the uniqueness of the project file, wherein, groupID is generally composed of business lines and enterprise names; artifactId consists of item names; the version number refers to the project file version.
In an embodiment of the present application, the upgrade service information refers to service line information stored in GroupId in the upgrade project coordinate; the original edition business information refers to business line information stored by GroupID in original edition project coordinates; the preset service information is service line information of a service internal platform.
In the embodiment of the application file comparison method, whether the upgrading application file and the original version application file corresponding to the upgrading application file belong to the two-party dependence package or the three-party dependence package can be determined by judging whether the upgrading service information and the original version service information are consistent with the preset service information or not respectively, the detailed file content comparison of the application file of the two-party dependence package can be conveniently carried out subsequently, the modification content of the three-party dependence package is combined, the complete application file comparison result is obtained, and the accuracy of the comparison of the subsequent application file is improved.
And S230, if the upgrading application file and the corresponding original edition application file belong to the two-party dependent file, carrying out file content comparison analysis on the upgrading application file and the corresponding original edition application file to obtain a comparison analysis result.
In this embodiment of the present application, the comparison analysis result includes a class change comparison result, a project content comparison result, an attribute comparison result, and a resource comparison result.
As an embodiment of the present application, the performing file content comparison analysis on the upgrade application file and the corresponding original application file to obtain a comparison analysis result includes:
performing class change comparison on the upgrading byte file in the upgrading application file and the original edition byte file in the original edition application file to obtain a first comparison result;
performing item content comparison on the upgrading item file in the upgrading application file and the original edition item file in the original edition application file to obtain a second comparison result;
performing attribute comparison on the upgrading configuration file in the upgrading application file and the original edition configuration file in the original edition application file to obtain a third comparison result;
performing resource comparison on the upgrading resource file in the upgrading application file and the original edition resource file in the original edition application file to obtain a fourth comparison result;
and integrating the first comparison result, the second comparison result, the third comparison result and the fourth comparison result to obtain the comparison analysis result.
The class change comparison is to compare the method annotation of the class with the attribute annotation of the class with different versions to determine whether the class structure and the attribute in the upgrade byte file are modified, whether the class operation is newly added, whether the class operation is deleted and other first analysis results relative to the original byte file.
In an embodiment of the present application, the item content comparison refers to analysis and comparison of the Pom file content of the upgrade item file and the original edition item file, where Pom is an xml file, and includes basic information of the item, an item construction process, and information for declaring item dependence. Furthermore, the upgrade project file and the original project file can be obtained through the poc xml analysis tool, and project contents of the two versions are compared to determine whether the dependent three-party component has variation, whether project basic information and project construction process are modified, whether operations are added newly, whether operations are deleted or not and other second analysis results.
Further, in the embodiment of the present application, attribute comparison refers to parameter comparison performed on configuration files such as application, properties, application, yml, bootstrapping, yml, etc., and the parameters in the configuration files may be mapped to a map set through a yml parsing component, and attribute comparison is performed on configuration parameters of the map set to obtain a third comparison result.
In this embodiment, unstructured data, including text, pictures, and Html data, is stored in a resource file, where resource comparison refers to comparing unstructured data stored in different versions, for example, two versions of resource files both store picture data, respectively obtain md5 values corresponding to two versions of pictures, and determine whether the pictures are modified by determining whether the md5 values are consistent.
In the embodiment of the application file upgrading method, the device and the system, class change comparison, project content comparison, attribute comparison and resource comparison are carried out on the upgrading application file and the corresponding original edition application file, so that detailed comparison can be carried out on class files, pom files, configuration file parameters and unstructured resource parameters in the application files of two versions one by one, and the accuracy of application analysis comparison is improved.
Further, in this embodiment of the present application, performing class change comparison between the upgrade byte file in the upgrade application file and the original byte file in the original application file to obtain a first comparison result, where the first comparison result includes:
acquiring an upgrading class annotation method and an upgrading class annotation attribute in the upgrading byte file, and an original edition class annotation method and an original edition class annotation attribute in the original edition byte file;
Comparing and analyzing the method type of the upgrading annotation method with the method type of the original edition annotation method to obtain a first type comparison result;
comparing and analyzing the annotation type of the upgrading annotation attribute with the annotation type of the original edition annotation attribute to obtain a second type comparison result;
and combining the first type comparison result and the second type comparison result to obtain the first comparison result.
The class annotation method refers to the method annotation of the class, which is carried out on the parameters in the byte file based on the actual service requirement, and whether the structure of the class is modified, added or deleted can be determined by comparing and analyzing the method type of the upgrading class annotation method and the method type of the original class annotation method.
In the embodiment of the application, the class annotation attribute refers to the attribute annotation of the class performed on the parameters in the byte file based on the actual service requirement, and the class annotation attribute may include the following annotation types: byte (byte type), short (short integer), int (integer), long (long integer), float (single precision floating point type), double (double precision floating point type), bootean (boolean type), char (character type).
In the embodiment of the application, by comparing and analyzing the annotation type of the upgrading class annotation attribute and the annotation type of the original edition class annotation attribute, whether the class attribute has modification, addition or deletion operation can be determined, so that specific modification content of the upgrading application file compared with the original edition application file is determined.
S240, if the upgrading application file and the corresponding original edition application file do not belong to the two-party dependent file, the upgrading application file and the modified content of the original edition application file are identified.
In this embodiment of the present application, if the upgrade application file and the corresponding original application file do not belong to the two-party dependent file, it indicates that the upgrade application file and the corresponding original application file belong to the three-party dependent file, and by identifying the modification contents of the upgrade application file and the original application file, the modification contents of the new external application package can be determined, so that the content of application analysis is further improved, and the online effect of the upgrade application is improved; the three-party dependent file is a dependent jar package issued by an external source of the enterprise.
As one embodiment of the present application, the identifying the modified content of the upgrade application file and the original application file includes:
acquiring all upgrading file names in the upgrading application file and all original edition file names in the original edition application file;
searching whether the name of the upgrading file and the name of the original edition file corresponding to the name of the upgrading file are changed or not by using a preset searching component;
If the name of the upgrade file is changed with the corresponding original edition file name, the changed upgrade file is used as modified content;
and if the name of the upgrading file is unchanged from the corresponding original file name, determining that the modified content does not exist.
The preset searching component can be a nonwjava.com/jar component, all files in the application file can be traversed through the nonwjava.com/jar component, all upgrading file names and original edition file names can be read out, and the upgrading file names refer to all three-party file package names in the upgrading application file; the original file name is all three-party package names in the original application file.
In an embodiment of the present application, whether the update file name and the original file name corresponding to the update file name change is found by comparing the update file name with the original file name, which does not include comparison of version number information.
For example, the file name includes an item name+a data type+a version number +. Jar/. Class/. Pore, and if the suffix of the data type or the item name or the byte, the dependent package, etc. changes, the suffix of the changed data type or the item name or the byte, the dependent package, etc. is used as the modification content.
S250, after all the upgrading application packages complete the content comparison analysis or identify the modified content, combining the comparison analysis result with the modified content to obtain a target analysis result.
In this embodiment of the present application, the target analysis result includes an application file comparison analysis result of the two-party dependency package and an application file modification content of the three-party dependency package.
In an optional embodiment of the present application, after obtaining a target analysis result, a final analysis report may be derived by counting the target analysis result, where the analysis report includes application packet statistics information and application packet specific change application information, where the application packet statistics information includes an application packet name, a new entry corresponding to each application packet name, a modified entry, and a deleted entry; the application package specific change application information comprises application package names, types corresponding to each application package name, specific method parameters or attribute parameters which change, and the like.
In the embodiment of the application, after the content comparison analysis or the modification content identification is completed by all the upgrade application packages, the target analysis result is obtained by combining the comparison analysis result and the modification content, so that all the modified specific content can be displayed to the user, the untested application details are avoided in the actual use process of the new version application, and the online effect of the upgrade application is improved.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
in the embodiment of the application, after the upgrade application package to be analyzed and the corresponding original application package are obtained, all application package files and dependency package files of the application version before upgrade and the application version after upgrade can be obtained by loading the upgrade application package and the original application package respectively; secondly, by judging whether the upgrading application file and the original edition application file corresponding to the upgrading application file belong to the two-party dependent file, the application analysis of the internal application file and the external application file can be conveniently carried out on the application layer, and the accuracy rate of the subsequent application analysis can be conveniently improved; finally, if the application file belongs to the two-party dependency file, the file content comparison analysis is carried out on the upgrading application file and the original version application file corresponding to the upgrading application file, so that the analysis and comparison of the new version application file and the old version application file can be realized at the application level, the modified content of the new version of the internal application relative to the old version can be determined, and the accuracy of the application analysis can be improved; if the application file does not belong to the two-party dependent file, the modified contents of the upgrading application file and the original edition application file are identified to determine the modified contents of the new edition external application package, so that the content of application analysis is further perfected, and the online effect of upgrading application is improved. Therefore, the application analysis method based on application upgrading provided by the embodiment of the invention can improve the online effect of upgrading the application.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored in a computer-readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the application provides an embodiment of an application analysis device 310 based on application upgrade, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be specifically applied in various electronic devices.
The embodiment of the invention provides an application analysis system based on application upgrading, which comprises the following components;
the loading module 311 is configured to obtain an upgrade application package to be analyzed and an original application package corresponding to the upgrade application package, and load the upgrade application package and the original application package respectively to obtain an upgrade application file and an original application file;
a judging module 312, configured to judge whether the upgrade application file and an original version application file corresponding to the upgrade application file belong to a two-way dependency file;
the analysis module 313 is configured to perform a file content comparison analysis on the upgrade application file and the corresponding original application file if the upgrade application file and the corresponding original application file belong to the two-party dependent file, so as to obtain a comparison analysis result; if the upgrade application file and the original edition application file corresponding to the upgrade application file do not belong to the two-party dependent file, identifying modification contents of the upgrade application file and the original edition application file; and
And a combining module 314, configured to combine the comparison analysis result with the modified content after all the upgrade application packages complete the content comparison analysis or identify the modified content, so as to obtain a target analysis result.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
in the embodiment of the application, after the upgrade application package to be analyzed and the corresponding original application package are obtained, all application package files and dependency package files of the application version before upgrade and the application version after upgrade can be obtained by loading the upgrade application package and the original application package respectively; secondly, by judging whether the upgrading application file and the original edition application file corresponding to the upgrading application file belong to the two-party dependent file, the application analysis of the internal application file and the external application file can be conveniently carried out on the application layer, and the accuracy rate of the subsequent application analysis can be conveniently improved; finally, if the application file belongs to the two-party dependency file, the file content comparison analysis is carried out on the upgrading application file and the original version application file corresponding to the upgrading application file, so that the analysis and comparison of the new version application file and the old version application file can be realized at the application level, the modified content of the new version of the internal application relative to the old version can be determined, and the accuracy of the application analysis can be improved; if the application file does not belong to the two-party dependent file, the modified contents of the upgrading application file and the original edition application file are identified to determine the modified contents of the new edition external application package, so that the content of application analysis is further perfected, and the online effect of upgrading application is improved. Therefore, the application analysis party device based on application upgrading provided by the embodiment of the invention can improve the online effect of upgrading the application.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It should be noted that only computer device 4 having components 41-43 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 4. Of course, the memory 41 may also comprise both an internal memory unit of the computer device 4 and an external memory device. In this embodiment, the memory 41 is typically used to store an operating system and various application software installed on the computer device 4, such as program codes of an application analysis method based on application upgrade. Further, the memory 41 may be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute the program code stored in the memory 41 or process data, for example, execute the program code of the application analysis method based on application upgrade.
The network interface 43 may comprise a wireless network interface or a wired network interface, which network interface 43 is typically used for establishing a communication connection between the computer device 4 and other electronic devices.
The present application also provides another embodiment, namely, provides a computer readable storage medium, where the computer readable storage medium stores the application analysis method program based on application upgrade, where the application analysis method program based on application upgrade can be executed by at least one processor, so that the at least one processor performs the steps of the application analysis method based on application upgrade as described above.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general purpose hardware online platform, and of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
The subject application is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It is apparent that the embodiments described above are only some embodiments of the present application, but not all embodiments, the preferred embodiments of the present application are given in the drawings, but not limiting the patent scope of the present application. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a more thorough understanding of the present disclosure. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing, or equivalents may be substituted for elements thereof. All equivalent structures made by the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the protection scope of the application.

Claims (10)

1. An application analysis method based on application upgrading is characterized by comprising the following steps:
acquiring an upgrade application package to be analyzed and an original application package corresponding to the upgrade application package, and respectively loading the upgrade application package and the original application package to obtain an upgrade application file and an original application file;
judging whether the original edition application file corresponding to the upgrading application file belongs to a two-party dependent file or not;
if the upgrading application file and the corresponding original edition application file belong to the two-party dependent file, carrying out file content comparison analysis on the upgrading application file and the corresponding original edition application file to obtain a comparison analysis result;
if the upgrade application file and the original edition application file corresponding to the upgrade application file do not belong to the two-party dependent file, identifying modification contents of the upgrade application file and the original edition application file;
and after the content comparison analysis or the modification content identification is completed by all the upgrading application packages, combining the comparison analysis result with the modification content to obtain a target analysis result.
2. The application analysis method based on application upgrading according to claim 1, wherein the performing file content comparison analysis on the upgrading application file and the corresponding original application file to obtain a comparison analysis result includes:
Performing class change comparison on the upgrading byte file in the upgrading application file and the original edition byte file in the original edition application file to obtain a first comparison result;
performing item content comparison on the upgrading item file in the upgrading application file and the original edition item file in the original edition application file to obtain a second comparison result;
performing attribute comparison on the upgrading configuration file in the upgrading application file and the original edition configuration file in the original edition application file to obtain a third comparison result;
performing resource comparison on the upgrading resource file in the upgrading application file and the original edition resource file in the original edition application file to obtain a fourth comparison result;
and integrating the first comparison result, the second comparison result, the third comparison result and the fourth comparison result to obtain the comparison analysis result.
3. The application analysis method based on application upgrading according to claim 2, wherein the comparing the upgrading byte file in the upgrading application file with the original byte file in the original application file to obtain a first comparison result includes:
acquiring an upgrading class annotation method and an upgrading class annotation attribute in the upgrading byte file, and an original edition class annotation method and an original edition class annotation attribute in the original edition byte file;
Comparing and analyzing the method type of the upgrading annotation method with the method type of the original edition annotation method to obtain a first type comparison result;
comparing and analyzing the annotation type of the upgrading annotation attribute with the annotation type of the original edition annotation attribute to obtain a second type comparison result;
and combining the first type comparison result and the second type comparison result to obtain the first comparison result.
4. The application analysis method based on application upgrading according to claim 1, wherein the determining whether the upgrading application file and the original application file corresponding to the upgrading application file belong to two-party dependent files includes:
acquiring upgrading project coordinates of an upgrading project file in the upgrading application file and original edition project coordinates of original edition project files in the original edition application file;
reading upgrading service information of the upgrading project coordinates and original edition service information of the original edition project coordinates, and respectively judging whether the upgrading service information and the original edition service information are consistent with preset service information or not;
if the upgrade application file and the corresponding original edition application file belong to the two-party dependent file, performing file content comparison analysis on the upgrade application file and the corresponding original edition application file to obtain a comparison analysis result, wherein the specific steps of obtaining the comparison analysis result include:
If the upgrading service information and the original edition service information are consistent with preset service information, determining that the upgrading application file and the corresponding original edition application file belong to the two-party dependent file, and performing file content comparison analysis on the upgrading application file and the corresponding original edition application file to obtain a comparison analysis result;
if the upgrade application file and the original edition application file corresponding to the upgrade application file do not belong to the two-party dependent file, the specific step of identifying the modification content of the upgrade application file and the original edition application file includes:
and if the upgrading service information and the original edition service information are inconsistent with the preset service information, determining that the upgrading application file and the original edition application file corresponding to the upgrading application file are not the two-party dependent file, and identifying the modification content of the upgrading application file and the original edition application file.
5. The application upgrade based application analysis method according to any one of claims 1-4, wherein said identifying modified content of said upgrade application file and said master application file comprises:
acquiring all upgrading file names in the upgrading application file and all original edition file names in the original edition application file;
Searching whether the name of the upgrading file and the name of the original edition file corresponding to the name of the upgrading file are changed or not by using a preset searching component;
if the name of the upgrade file is changed with the corresponding original edition file name, the changed upgrade file is used as modified content;
and if the name of the upgrading file is unchanged from the corresponding original file name, determining that the modified content does not exist.
6. The application analysis method according to any one of claims 1 to 4, wherein loading the upgrade application package and the original application package to obtain an upgrade application file and an original application file includes:
acquiring an upgrade file package name and an upgrade loading path of the upgrade application file, and an original edition file package name and an original edition loading path of the original edition application file by using a preset class loader;
class resource loading is carried out on the upgrade application file according to the upgrade file package name and the upgrade loading path, so that the upgrade application file comprising an upgrade byte file, an upgrade project file, an upgrade configuration file and an upgrade dependent file is obtained;
and carrying out class resource loading on the original edition application file according to the original edition file package name and the original edition loading path to obtain the original edition application file containing an original edition byte file, an original edition project file, an original edition configuration file and an original edition dependent file.
7. An application upgrade-based application analysis apparatus, comprising:
the loading module is used for acquiring an upgrade application package to be analyzed and an original application package corresponding to the upgrade application package, and respectively loading the upgrade application package and the original application package to obtain an upgrade application file and an original edition application file;
the judging module is used for judging whether the upgrading application file and the original edition application file corresponding to the upgrading application file belong to two-party dependent files or not;
the analysis module is used for carrying out file content comparison analysis on the upgrading application file and the corresponding original edition application file if the upgrading application file and the corresponding original edition application file belong to the two-party dependent file, so as to obtain a comparison analysis result; if the upgrade application file and the original edition application file corresponding to the upgrade application file do not belong to the two-party dependent file, identifying modification contents of the upgrade application file and the original edition application file; and
And the combination module is used for combining the comparison analysis result and the modified content after all the upgrading application packages complete the content comparison analysis or identify the modified content to obtain a target analysis result.
8. The application upgrade based application analysis apparatus of claim 7, wherein the analysis module comprises:
the first analysis submodule is used for carrying out class change comparison on the upgrading byte file in the upgrading application file and the original edition byte file in the original edition application file to obtain a first comparison result;
the second analysis submodule is used for comparing the project content of the upgrading project file in the upgrading application file with the project content of the original project file in the original application file to obtain a second comparison result;
the third analysis submodule is used for comparing the attributes of the upgrading configuration file in the upgrading application file with the original edition configuration file in the original edition application file to obtain a third comparison result;
a fourth analysis sub-module, configured to perform resource comparison on the upgrade resource file in the upgrade application file and the original edition resource file in the original edition application file, to obtain a fourth comparison result;
and the integration analysis submodule is used for integrating the first comparison result, the second comparison result, the third comparison result and the fourth comparison result to obtain the comparison analysis result.
9. A computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the application upgrade based application analysis method of any one of claims 1 to 6 when the computer program is executed.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, implements the steps of the application upgrade based application analysis method according to any one of claims 1 to 6.
CN202311427307.5A 2023-10-30 2023-10-30 Application analysis method, device, equipment and storage medium based on application upgrading Pending CN117667668A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311427307.5A CN117667668A (en) 2023-10-30 2023-10-30 Application analysis method, device, equipment and storage medium based on application upgrading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311427307.5A CN117667668A (en) 2023-10-30 2023-10-30 Application analysis method, device, equipment and storage medium based on application upgrading

Publications (1)

Publication Number Publication Date
CN117667668A true CN117667668A (en) 2024-03-08

Family

ID=90065218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311427307.5A Pending CN117667668A (en) 2023-10-30 2023-10-30 Application analysis method, device, equipment and storage medium based on application upgrading

Country Status (1)

Country Link
CN (1) CN117667668A (en)

Similar Documents

Publication Publication Date Title
CN111400061A (en) Data processing method and system
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN113626223A (en) Interface calling method and device
CN116644213A (en) XML file reading method, device, equipment and storage medium
CN111552463A (en) Page jump method and device, computer equipment and storage medium
CN112860662B (en) Automatic production data blood relationship establishment method, device, computer equipment and storage medium
CN112363814A (en) Task scheduling method and device, computer equipment and storage medium
CN117033249A (en) Test case generation method and device, computer equipment and storage medium
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN117667668A (en) Application analysis method, device, equipment and storage medium based on application upgrading
CN114780497A (en) Batch file processing method, apparatus, computer device, medium, and program product
CN112416875A (en) Log management method and device, computer equipment and storage medium
CN111459933A (en) GDB data dynamic expansion method, device and storage medium
CN113656044B (en) Android installation package compression method and device, computer equipment and storage medium
CN116028108B (en) Method, device, equipment and storage medium for analyzing dependent package installation time
CN110908958B (en) File processing method, device, terminal and storage medium
CN116382720A (en) Plug-in processing method, device, computer equipment and storage medium
CN115237761A (en) Incremental code coverage rate statistical method and related equipment thereof
CN118113376A (en) Application program starting method for controlling miner lamp and related equipment
CN116541417A (en) Batch data processing method, device, computer equipment and storage medium
CN117499270A (en) Flow processing method and device, computer equipment and storage medium
CN117290019A (en) Interface calling method and device, computer equipment and storage medium
CN117435267A (en) Form loading method and device based on configuration file, computer equipment and medium
CN116610354A (en) Parameter verification method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination