Application compatibility determination method and related device

By obtaining the functional module to call the link diagram and automatically identify the dependencies, the problem of large dependencies and easy leakage in the existing technology of manual detection is solved, and the application compatibility detection is automated, and efficiency and accuracy are improved.

CN119512926APending Publication Date: 2025-02-25MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411355810.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The application of compatibility detection in the prior art depends on manual expertise and experience, resulting in large workloads and easy leakage, making it difficult to ensure detection efficiency and accuracy.

Method used

By obtaining the link diagram of the function module calls, we automatically identify the dependencies, determine the functional modules with version changes, and judge compatibility based on their version changes, so as to achieve automation of compatibility detection.

Benefits of technology

Improve detection efficiency and accuracy, reducing the risk of compatibility issues caused by omissions or misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512926A_ABST
    Figure CN119512926A_ABST
Patent Text Reader

Abstract

The invention provides an application compatibility determination method and a related device. The method comprises the following steps: acquiring a function module calling link diagram; the function module calling link diagram comprises a calling path between the function module of the first application and the function module of the second application; under the condition that the version of the first application is changed, determining a first function module of which the version is changed in the first application; determining a second function module according to the function module calling link diagram and the first function module; the second function module is a function module for calling the first function module in the second application; according to the version change condition of the second function module, the compatibility between the second application and the first application with the version changed is determined. According to the method and the device, the first function module of the first application version change can be automatically identified, the corresponding second function module is positioned by calling the link diagram, the compatibility of the second function module is automatically evaluated, and the risk of a compatibility problem caused by omission or misjudgment is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of application development technology, and in particular to a method for determining application compatibility and related devices. Background Art

[0002] With the continuous development of modern information technology and the increasing complexity of application systems, the dependencies between applications are increasing. In the practice of software development and operation and maintenance, tight integration between different application modules, service components, and even third-party libraries and frameworks has become the norm. Once a critical application fails, it may quickly spread to other related applications, causing a chain reaction, and sometimes even affecting the stability of the entire system. When a problem occurs after the new version of the application is deployed, the application version rollback can quickly restore the application to the previous stable version; in some cases, due to the needs of specific users or scenarios, it may be necessary to provide an old version of the application for specific users or scenarios, which requires the use of historical version delivery applications.

[0003] In related technologies, application compatibility testing is required before rolling back application versions and delivering historical versions of applications to ensure that the new or historical versions of applications can be seamlessly compatible with the existing system environment, dependent services, and user data, and avoid unexpected problems caused by version upgrades. However, application compatibility testing often relies on the deep professional knowledge and rich experience of developers. Since different versions of applications involve a large number of code changes, dependent library upgrades, or configuration adjustments, these changes may affect the compatibility of applications. Manually reviewing code changes and evaluating the compatibility between applications is not only a huge workload, but also prone to omissions, making it difficult to ensure the efficiency and accuracy of application compatibility testing. Summary of the invention

[0004] The embodiments of the present application provide an application compatibility determination method and related devices. The embodiments of the present application can realize the automation of compatibility detection, improve the detection efficiency and detection accuracy, and thus reduce the risk of compatibility problems caused by omissions or misjudgments.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] An embodiment of the present application provides an application compatibility determination method, the method comprising: obtaining a function module call link diagram; the function module call link diagram includes a call path between a function module of a first application and a function module of a second application; in the case where the version of the first application changes, determining a first function module whose version has changed in the first application; determining a second function module based on the function module call link diagram and the first function module; the second function module is a function module in the second application that calls the first function module; and determining the compatibility between the second application and the first application whose version has changed based on the version change of the second function module.

[0007] An embodiment of the present application provides an application compatibility determination device, including: an acquisition module, used to acquire a function module call link diagram; the function module call link diagram includes a call path between a function module of a first application and a function module of a second application; a first determination module, used to determine a first function module of a first application whose version has changed when the version of the first application has changed; a second determination module, used to determine a second function module based on the function module call link diagram and the first function module; the second function module is a function module in the second application that calls the first function module; a third determination module, used to determine the compatibility between the second application and the first application after the version change based on the version change of the second function module.

[0008] An embodiment of the present application provides an electronic device, which includes: a memory for storing computer-executable instructions; and a processor for executing the computer-executable instructions stored in the memory to implement the application compatibility determination method provided in the embodiment of the present application.

[0009] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the application compatibility determination method provided in the embodiment of the present application when executed by a processor.

[0010] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the application compatibility determination method provided by the embodiment of the present application is implemented.

[0011] The embodiments of the present application have the following beneficial effects:

[0012] When the version of the first application changes, the embodiment of the present application can determine the changed first functional module, and automatically identify the second functional module that depends on the first functional module according to the functional module call link diagram, so as to judge whether the second functional module is compatible with the first application after the version change according to the version change of the second functional module, thereby realizing the automation of compatibility detection, improving detection efficiency and detection accuracy, and reducing the risk of compatibility problems caused by omissions or misjudgments. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1A is a flowchart of a method for determining application compatibility provided in an embodiment of the present application;

[0014] Figure 1B is a flowchart of determining the compatibility between a second application and a first application after a version change provided by an embodiment of the present application;

[0015] Figure 1C is another flowchart of determining the compatibility between a second application and a first application after a version change provided by an embodiment of the present application;

[0016] Figure 1D is a flowchart of determining compatibility according to the code of the first functional module provided in an embodiment of the present application;

[0017] Figure 1E is another flowchart of determining compatibility according to the code of the first functional module provided by an embodiment of the present application;

[0018] Figure 1F It is a schematic diagram of a process for generating a function module call link diagram provided in an embodiment of the present application;

[0019] Figure 1G It is a schematic diagram of a process for generating a call relationship provided in an embodiment of the present application;

[0020] Figure 2A is another flowchart of the method for determining application compatibility provided by an embodiment of the present application;

[0021] Figure 2B It is another schematic diagram of a process for generating a function module call link diagram provided by an embodiment of the present application;

[0022] Figure 2C It is a schematic diagram of a function module call chain diagram provided in an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of the structure of an application compatibility determination device provided in an embodiment of the present application;

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

[0025] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0026] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0027] In the following description, the terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0028] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0029] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0030] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.

[0031] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0032] 1) Application is a computer software program designed to perform a series of operations to process data, perform calculations, or provide a user interface to complete a specific function or service. Applications can include a variety of software ranging from simple tools (such as calculators) to complex systems (such as enterprise resource planning systems).

[0033] 2) Functional Module, also known as "method" or "function", refers to an independent part of an application that contains the code and data structures required to implement a specific function. A functional module can be composed of related functions, subroutines, classes or objects to complete a defined task or a group of related tasks.

[0034] 3) Abstract Syntax Tree (AST) is a tree data structure used to represent programming language source code. The AST reflects the grammatical structure of the source code, but does not include most of the details in the source code, such as whitespace, comments, specific grammatical symbols (such as brackets, semicolons, etc.) and the layout and format of the code. The AST can abstract statements, expressions and other language constructs in the source code into nodes, and organize them into a tree structure according to the grammatical structure of the nodes in the source code.

[0035] 4) Comments are a special syntax in programming languages ​​that are used to add information to source code to help programmers understand the logic, design, and functionality of the code. Comments are usually not executed by the compiler or interpreter. Although comments are part of the code, they are not translated into machine code.

[0036] 5) Parameter is a data value or data value reference passed to a function, procedure or method in the field of programming. Parameters are used for calculation, processing or decision-making within the function module and may affect the behavior or return value of the function module.

[0037] 6) Release is the process of releasing the tested and verified software version to the production environment for end users in the field of software development and maintenance. Release usually involves migrating the code from the development environment to the test environment, and finally deploying it to the production environment after a series of tests and verifications.

[0038] 7) Version Rollback refers to the process of restoring a software system or application from the currently running version to a previously known version. This usually occurs when a software system or application fails, has performance issues, or has security vulnerabilities, in order to restore the system to a normal working state.

[0039] In related technologies, application compatibility testing is required before rolling back application versions and delivering historical versions of applications to ensure that the new or historical versions of applications can be seamlessly compatible with the existing system environment, dependent services, and user data, and avoid unexpected problems caused by version upgrades. However, application compatibility testing often relies on the deep professional knowledge and rich experience of developers. Since different versions of applications involve a large number of code changes, dependent library upgrades, or configuration adjustments, these changes may affect the compatibility of applications. Manually reviewing code changes and evaluating the compatibility between applications is not only a huge workload, but also prone to omissions, making it difficult to ensure the efficiency and accuracy of application compatibility testing.

[0040] Based on the above-mentioned problems existing in the related technology, an embodiment of the present application provides an application compatibility determination method. When the version of the first application changes, it can automatically determine the changed first functional module, and identify the second functional module that depends on the first functional module according to the functional module call link diagram, so as to judge whether the second functional module is compatible with the first application after the version change according to whether the version of the second functional module changes, thereby realizing the automation of compatibility detection, improving detection efficiency and reducing detection errors, and reducing the risk of compatibility problems caused by omissions or misjudgments.

[0041] The following is a detailed description of the application compatibility determination method provided in the embodiment of the present application in conjunction with the accompanying drawings.

[0042] See also Figure 1A , Figure 1A This is an optional flow chart of the method for determining application compatibility provided in the embodiment of the present application. Figure 1A The steps shown are explained as Figure 1A As shown, the application compatibility determination method is described by taking the electronic device as an example, and the method includes the following steps 101 to 104:

[0043] Step 101, obtaining a function module call chain diagram; the function module call chain diagram includes a call path between a function module of a first application and a function module of a second application.

[0044] In some embodiments, the function module call link diagram is a graphical representation for displaying the call relationship and interaction process between different function modules within and between applications. In the function module call link diagram, each application can be regarded as a node, each function module can be regarded as a sub-node, and the directed lines (directed edges) between the sub-nodes represent the call paths and call directions between these function modules.

[0045] The first application is an application in the function module call link diagram; the first application may include multiple function modules, and the function modules of the first application may actively call the function modules of other applications, or be called by the function modules of other applications as the called object. The second application is another application in the same function module call link diagram as the first application; the second application may also include multiple function modules, and when one or several function modules in the second application execute corresponding functions, the function modules in the first application will be called, that is, the operation of the second application depends on the first application.

[0046] Step 102: When the version of the first application is changed, determine the first functional module of the first application whose version is changed.

[0047] In some embodiments, first, information about changes in the first application version can be obtained by detecting changes in the application code, detecting application deployment logs, or checking the version number in the application configuration file; then, by parsing version control submission records or comparing the contents of the application code package, it can be identified which functional modules have changed in code, or which functional modules have changed in their identified versions, thereby determining the first functional module whose version has changed.

[0048] For example, the first application is application A, which includes function modules a1, a2 and a3. When it is detected that the version of application A changes from v1 to v2, and it is further detected that the version of function module a1 changes, function module a1 is determined as the first function module.

[0049] Step 103, determining a second functional module according to the functional module call link diagram and the first functional module; the second functional module is a functional module that calls the first functional module in the second application.

[0050] In some embodiments, first, the nodes and directed edges of the functional module call link graph can be traversed to understand the calling relationship between the functional modules; then, the call path related to the first functional module is located in the functional module call link graph, that is, all edges and nodes in the functional module call link graph that directly or indirectly point to the first functional module are searched; then, according to the indication of the call path, the second functional module that calls the first functional module is filtered out from the functional modules of the second application.

[0051] For example, the second application is application B, which includes functional module b1, functional module b2 and functional module b3. When the node of functional module b2 in the search functional module call link diagram directly or indirectly points to functional module a1 (first functional module), functional module b2 is determined as the second functional module.

[0052] Step 104: Determine the compatibility between the second application and the first application after the version change according to the version change of the second functional module.

[0053] Through steps 101 to 104, a function module call link diagram is obtained to clarify the dependency relationship between the first application and the second application, and when the version of the first application changes, the affected first function module and its corresponding second function module are quickly located, and then the compatibility between the second application and the first application after the version change is evaluated according to the version change of the second function module. This series of steps achieves the beneficial effects of clarifying the dependency relationship, quickly locating the impact scope and accurately evaluating the compatibility risk, realizes the automation of compatibility detection, improves efficiency and reduces errors, and reduces the risk of compatibility problems caused by omissions or misjudgments.

[0054] In some embodiments, see Figure 1B , Figure 1A The illustrated step 104 may be implemented through steps 1041A to 1042A, which are described in detail below.

[0055] Step 1041A, detecting the version change of the second functional module within a preset period of time since the version of the first application is changed.

[0056] In some embodiments, the version information of the second functional module can be continuously tracked and recorded within a specific time window, that is, within a preset period of time after the first application version changes, to detect the version change of the second functional module. The preset period of time can be a time period of a certain stage in the application development cycle, such as a few days to a few weeks in the testing phase, the pre-release preparation phase, or the initial user feedback collection phase, to ensure that there is enough time to detect the version change of the second functional module after the first application version changes.

[0057] For example, if application A (first application) releases a new version v2 in the test environment, and the version update involves the modification and update of function module a1, then in a preset period after the new version is released, such as the next day, the function module b2 in application B (second application) that has a call relationship with function module a1 will be continuously monitored. During this period, if it is detected that a new version of function module b2 is released or an update is submitted for function module b2 in the code library, it indicates that the version of function module b2 has changed.

[0058] Step 1042A: Determine the compatibility between the second application and the first application after the version change according to the version change of the second functional module within a preset period of time.

[0059] In some embodiments, if it is detected that the version of the second functional module has not changed within a preset period of time, it means that the current version of the second application is compatible with the first application whose version has changed, that is, the second application is compatible with the first application after the version has changed.

[0060] It should be noted that even if the second application undergoes a version change outside the preset time period, the second application before the version change is still compatible with the first application after the version change; if it is detected that the version of the second functional module has changed within the preset time period, it is necessary to further determine the compatibility between the second application before the version change and the first application after the version change based on the code of the first functional module.

[0061] Through steps 1041A to 1042A, it is ensured that the version change of the second application is detected in time after the version of the first application is changed, effectively avoiding invalid detection caused by the version change of the second application outside the preset time period, thereby saving computing resources and ensuring efficient use of resources.

[0062] In some embodiments, see Figure 1C , Figure 1A The illustrated step 104 may also be implemented through steps 1041B to 1042B, which are described in detail below.

[0063] Step 1041B: when the version of the second functional module has not changed, determine that the second application is compatible with the first application after the version has changed.

[0064] In some embodiments, if the version information of the second functional module has not changed, this indicates that the second functional module is not affected by the version change of the first application, or the second functional module is able to adapt to the version after the change of the first application, that is, the second application is compatible with the first application after the version change.

[0065] For example, it is detected that the function module b2 in application B (second application) which has a calling relationship with function module a1 (first function module) has not changed its version within a preset period of time. This means that although application A (first application) may be upgraded from version v1 to version v2, and involves modification and update of function module a1, the function module b2 in application B maintains the original version and function unchanged. In this case, it can be inferred that the second application (i.e., the current version of application B, assumed to be version x) is already compatible with the first application (i.e., the new version v2 of application A) after the version change. Because the interface call or data exchange method between function module b2 and function module a1 has not changed during the version upgrade process, or even if it has changed, the current version of function module b2 is already able to adapt to these changes. Therefore, it can be determined that the second application (application B version x) is compatible with the first application (application A version v2) after the version change, and the normal interaction between the two applications can be maintained without additional upgrades or modifications to application B.

[0066] Step 1042B, when the version of the second functional module changes, the compatibility between the second application before the version change and the first application after the version change is determined according to the code of the first functional module.

[0067] In some embodiments, if the version of the second functional module changes, this may mean that the second functional module is affected by the version change of the first functional module, and the code of the second functional module is adjusted accordingly, so that the version of the second functional module changes; it is also possible that the version change of the second functional module is not directly caused by the version change of the first functional module, but is for the purpose of optimizing its own function. Therefore, in order to accurately determine the compatibility between the second application and the updated first application, it is necessary to further analyze the code of the first functional module. It should be noted that when the version of the second functional module changes, the version of the second application must also change; in this case, it is necessary to determine whether the second application before the version change is compatible with the updated first application, rather than whether the second application after the version change is compatible with the updated first application.

[0068] In some embodiments, see Figure 1D , Figure 1C The illustrated step 1042B may be implemented through steps 201A to 204A, which are described in detail below.

[0069] Step 201A: perform semantic analysis on the code of the first functional module before the version change to obtain a first syntax tree.

[0070] In some embodiments, the code of the functional module can be read through the semantic analysis model, and the code can be decomposed into the smallest grammatical units; then, according to the grammatical rules in the semantic analysis model, these grammatical units are organized into a hierarchical structure to form an abstract syntax tree. In this process, the semantic analysis model will identify grammatical structures such as variable declarations, function calls, and control flow statements. The first syntax tree is the abstract syntax tree of the first functional module, which is a tree representation of the source code structure of the first functional module.

[0071] Step 202A: perform semantic analysis on the code of the first functional module after the version change to obtain a second syntax tree.

[0072] In some embodiments, the second syntax tree is an abstract syntax tree of the second functional module, which is a tree representation of the source code structure of the second functional module.

[0073] Step 203A: When the first syntax tree is identical to the second syntax tree, determine that the second application is compatible with the first application after the version is changed.

[0074] In some embodiments, the structures of the first syntax tree and the second syntax tree are compared to determine whether the first syntax tree and the second syntax tree are identical or highly similar; if the comparison result shows that the first syntax tree and the second syntax tree are completely consistent in structure or the difference is negligible, then it can be reasonably inferred that the second application is compatible with the first application after the version change.

[0075] Step 204A: When the first syntax tree is different from the second syntax tree, determine that the second application is incompatible with the first application after the version change.

[0076] In some embodiments, the structures of the first syntax tree and the second syntax tree are compared to determine whether there are differences between the first syntax tree and the second syntax tree; if the comparison result shows that there are structural differences between the first syntax tree and the second syntax tree, then it can be reasonably inferred that the second application is incompatible with the first application after the version change.

[0077] By performing semantic analysis and abstract syntax tree comparison through steps 201A to 204A, the essence of code changes can be deeply understood, substantial changes can be distinguished from non-substantial changes, and the misjudgment rate can be reduced, thereby more accurately judging compatibility.

[0078] In some embodiments, see Figure 1E , Figure 1C The illustrated step 1042B may be implemented through steps 201B to 202B, which are described in detail below.

[0079] Step 201B: Compare the code of the first functional module before the version change and the code after the version change to obtain a difference code.

[0080] In some embodiments, a static code analysis tool can be used to read and compare the code of the first functional module before and after the version change; the comparison process can involve line-by-line comparison of code lines, as well as consistency checks on elements such as comments, variable names, and function names; and then the difference code in the code of the two versions of the first functional module can be identified, and the difference code refers to the difference between the code of the first functional module before and after the version change, including newly added code, deleted code, modified code, and code structure adjustments.

[0081] For example, for the first functional module a1 whose version has been determined to have changed, a detailed comparative analysis is performed on the codes of version v1 (before the change) and version v2 (after the change). By using a version control tool or a special code comparison tool, the code differences between the two versions can be compared line by line or block by block to extract which code lines are added, deleted or modified.

[0082] Step 202B: Determine the compatibility between the second application and the first application after the version change according to the type of the difference code.

[0083] In some embodiments, the type of difference code refers to different categories of difference codes in structure or content. The type of difference code may include but is not limited to comment adjustment and parameter adjustment. By analyzing the type of difference code, the compatibility between the second application and the first application after the version change can be more accurately evaluated.

[0084] Through step 201B to step 202B, the codes of the first functional module before and after the version change are directly compared to obtain the difference code, and the compatibility is judged according to the type of the difference code. This can quickly locate the changes at the code level, provide a direct basis for compatibility analysis, and classify them according to the type of the difference code, which helps to adopt different processing strategies for different types of changes.

[0085] In some embodiments, the above step 202B may include the following two situations:

[0086] Case 1: When the type of the difference code is comment adjustment, it is determined that the second application is compatible with the first application after the version change.

[0087] The comment adjustment in case 1 refers to the modification of the comment part only in the difference code, such as adding, deleting or modifying the comment content; the comment adjustment will not affect the running logic or interface of the code. Therefore, if the type of the difference code is comment adjustment, it can be determined that the second application is compatible with the first application after the version changes.

[0088] It should be noted that, since the comment adjustment will not affect the actual running logic or interface of the code, through the above solution of situation one, there is no need to conduct in-depth analysis of the running behavior of the code of the first functional module, which reduces the interference caused by the compatibility evaluation due to the non-functional change of the first functional module, and can quickly determine the first application after the compatible version of the second application changes, simplifying the compatibility evaluation process.

[0089] Case 2: When the type of the difference code is parameter adjustment, determine the target parameter to be adjusted; perform parameter parsing on the code of the second functional module before the version change to obtain a parameter list; when the parameter list includes the target parameter, determine that the second application is incompatible with the first application after the version change; when the parameter list does not include the target parameter, determine that the second application is compatible with the first application after the version change.

[0090] The parameter adjustment in the second case refers to the modification of the parameters in the function or method call only in the difference code, such as adding, deleting or modifying the parameter content; the target parameter refers to the parameter that is modified or adjusted in the parameter adjustment. Parameter parsing refers to an in-depth analysis of the function or method call in the code of the second functional module before the version change, so as to determine the parameter list called by the second functional module before the version change. Through parameter parsing, all parameters passed during the operation of the second functional module before the version change can be obtained, that is, the parameter list. If the parameter list includes the target parameter, this means that the second functional module before the version change depends on these adjusted parameters, so it is determined that the second application is incompatible with the first application after the version change, that is, it can be determined that the second application before the version change is incompatible with the first application after the version change; on the contrary, if the parameter list does not include the target parameter, it can be determined that the second application is still compatible with the first application after the version change, that is, the second application before the version change is still compatible with the first application after the version change.

[0091] By implementing the processing flow in the above case 2, the code differences before and after the version change are analyzed in detail, especially for parameter adjustment, which parameter changes will affect the compatibility between different applications or modules can be accurately determined, avoiding unnecessary compatibility testing and waste of resources.

[0092] In some embodiments, see Figure 1F ,exist Figure 1A Before step 101 shown (wherein, Figure 1F A in the figure represents the above steps 101 to 104), and the method further includes steps 301 to 302, which are described in detail below.

[0093] Step 301, based on the code of the first application and the code of the second application, determine a first calling relationship between functional modules in the first application, a second calling relationship between functional modules in the second application, and a third calling relationship between functional modules in the second application and functional modules in the first application.

[0094] In some embodiments, the application code can first be read and parsed through a program or an automated tool to identify all functional modules in the first application and the second application; then, the calling relationship between the functional modules is extracted from the application code, including direct calls and indirect calls; finally, the extracted calling relationship is divided into a first calling relationship between the functional modules in the first application, a second calling relationship between the functional modules in the second application, and a third calling relationship between the functional modules of the two applications, to ensure the correctness and completeness of the calling relationship.

[0095] In some embodiments, see Figure 1G , Figure 1F The illustrated step 301 can be implemented through steps 3011 to 3013, which are described in detail below.

[0096] Step 3011, perform functional analysis on the code of the first application, obtain first input and output parameter data of the functional module in the first application, and determine the first calling relationship based on the first input and output parameter data.

[0097] In some embodiments, the first calling relationship is the calling relationship between different functional modules in the first application. In the implementation process of step 3011, firstly, the code of the first application can be parsed using a static code analysis tool to identify different functional modules such as functions, methods, and classes in the code; then, the input parameters (input parameters) and output parameters (output parameters) of each functional module are extracted, and the parameter type, parameter name, and parameter order of each functional module are determined; then, based on the extracted input and output parameter data, the first calling relationship between the functional modules in the first application is determined, that is, the function call and data transfer in the code of the first application are analyzed, and which functional module calls another functional module, as well as the direction of the call and the parameter transfer situation are identified.

[0098] For example, suppose the first application is an e-commerce system A, which contains multiple functional modules, such as a user management module, a commodity management module, and an order management module. First, the code base of the e-commerce system A is fully scanned by a static code analysis tool to identify different functional modules such as a user management module, a commodity management module, and an order management module. Then, the tool extracts the input and output parameter data of each module. For example, the registration function of the user management module may receive a user name, a password, and an email address as input parameters, and return a user ID as an output parameter. Then, based on these input and output parameter data, the calling relationship between modules is analyzed. For example, in the order management module, the function of creating an order may call the function of obtaining user information of the user management module to verify the validity of the ordering user. In this calling process, the order management module, as the caller, provides the user ID as an input parameter to the called user management module; the user management module returns the detailed information of the user as an output parameter to the order management module. Therefore, the first calling relationship between the order management module and the user management module can be determined, that is, the function of the order management module calls the function of the user management module and passes the necessary parameters.

[0099] Step 3012, perform functional analysis on the code of the second application to obtain second input and output parameter data of the functional module in the second application, and determine the second calling relationship based on the second input and output parameter data.

[0100] In some embodiments, the second calling relationship is the calling relationship between different functional modules in the second application. In the implementation process of step 3012, firstly, the code of the second application can be parsed using a static code analysis tool to identify different functional modules such as functions, methods, and classes in the code; then, the input parameters (input parameters) and output parameters (output parameters) of each functional module are extracted, and the parameter type, parameter name, and parameter order of each functional module are determined; then, based on the extracted input and output parameter data, the second calling relationship between the functional modules in the second application is determined, that is, the function call and data transfer in the code of the second application are analyzed, and which functional module calls another functional module, as well as the direction of the call and the parameter transfer situation are identified.

[0101] Step 3013, determine the third calling relationship based on the first input and output parameter data and the second input and output parameter data.

[0102] In some embodiments, the third calling relationship is a calling relationship between a function module of the first application and a function module of the second application. In the implementation process of step 3013, firstly, according to the input and output parameter data of the function modules in the first application and the second application, the data transfer between the function modules in the two applications can be analyzed to identify which function module of the first application calls which function module of the second application, as well as the direction of the call and the parameter transfer, so as to determine the third calling relationship between the function module in the first application and the function module in the second application.

[0103] Through steps 3011 to 3013, input and output parameter data are automatically obtained, and calling relationships between functional modules within different applications and between applications are established, which reduces the workload of manual analysis, improves efficiency, and provides a solid foundation for compatibility analysis.

[0104] Next, see Figure 1F , and the description continues with step 301 above.

[0105] Step 302: According to the first calling relationship, the second calling relationship and the third calling relationship.

[0106] In some embodiments, the first call relationship, the second call relationship and the third call relationship can be integrated first to ensure that the call relationship of each functional module is correctly recorded; then, based on the integrated call relationship data, the call link between the functional modules is constructed; then, the constructed call link is represented in a graphical form, each application can be regarded as a node, each functional module can be regarded as a sub-node, and the directed lines (directed edges) between the sub-nodes represent the call path and call direction between these functional modules.

[0107] Through step 301 to step 302, the calling relationship between the functional modules within different applications and between applications is determined, providing structured support for the generation of the functional module call chain diagram, so that the generated call chain diagram is helpful for the accurate determination of subsequent compatibility.

[0108] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.

[0109] The present application provides a method for determining application compatibility. Based on the dependencies between different applications, the compatibility between different versions of multiple applications is evaluated during the application release and upgrade process. When performing an application rollback or providing a historical version, the previously generated application dependency topology diagram and version compatibility information can be used to determine whether the current operation may bring risks. Figure 2A As shown, the method includes the following steps 401 to 404:

[0110] Step 401, automatically construct a function module call link diagram.

[0111] Use automated tools to scan the application code, identify and parse the interface call relationship at the method level, and generate a cross-application interface function module call chain diagram. The function module call chain diagram clearly shows how the function modules of multiple applications call each other.

[0112] Step 402: monitor and identify a first application version update.

[0113] Continuously monitor the version release status of the called application (i.e., the first application). Once a new version is detected, automatically record and extract the update details, including new features, modified content, fixed issues, and any changes that may affect interface compatibility.

[0114] Step 403: Evaluate the compatibility of the second application with the new version of the first application.

[0115] Based on the constructed call link topology diagram and the update details of the first application, a preset compatibility calculation algorithm is used to automatically evaluate whether the caller application (ie, the second application) is compatible with the new version of the first application, and a compatibility evaluation result is generated.

[0116] Step 404, receiving manual verification confirmation results.

[0117] If the automatic evaluation results show that there may be incompatibility issues, the manual verification process will be triggered. R&D personnel can manually confirm whether the second application is indeed incompatible with the new version of the first application based on the automatically generated compatibility evaluation results, combined with the actual business logic and system architecture.

[0118] In the implementation of the compatibility calculation algorithm, in order to ensure the accuracy of the evaluation, it is first necessary to determine whether the first application and the second application have undergone version changes in the same change cycle (i.e., the above-mentioned preset time period). During the implementation process, if the second application also undergoes a version update within the preset time period when the first application version changes, the changes of the two applications are considered to be in the same change cycle. Among them, the preset time period can be adjusted according to the actual application development needs; for example, the preset time period can be the time point when the first application version changes to the time point of zero o'clock the next day after the time point when the first application version changes, or the time point when the first application version changes to the time point of 72 hours after the first application version changes; in short, the preset time period is the time period starting from the time point when the first application version changes to a certain target time point; the target time point can be flexibly adjusted according to actual needs, such as being set to zero o'clock the next day after the first application version changes, the 72nd hour after the first application version changes, or a combination of specific days and hours after the change.

[0119] The compatibility judgment logic within the change cycle is as follows:

[0120] Unilateral change: If only the first application changes its version within the same change cycle, while the second application remains unchanged, it can usually be considered that the current version of the second application is compatible with the new version of the first application. This is because the second application has not undergone any changes that may affect its calling of the first application's functional module.

[0121] Changes on both sides: If both the first application and the second application have version changes in the same change cycle, it is necessary to further analyze the changes to determine compatibility. At this point, directly assuming incompatibility may lead to misjudgment, so more detailed change content judgment rules need to be introduced to eliminate those scenarios that do not actually affect compatibility. The specific change content judgment rules are as follows:

[0122] 1) Call chain-independent changes: If the call chain affected by the code changes of the first application is not directly called by the second application, these changes are transparent to the second application and do not affect compatibility.

[0123] 2) No parameter changes: If the first application only changes the input and output parameters, but the functional modules of the second application do not actually use these parameters, then these parameter changes have no effect on the second application and can be considered compatible.

[0124] 3) Comments and non-functional changes: If the changes to the first application are limited to non-functional aspects or aspects that do not affect the code logic, such as comments, adding / deleting unused variable declarations, changing the loop body declaration method, equivalent conversion of control structures (such as if and switch), and adjusting log output, then these changes will not affect the calling compatibility of the second application and should be deemed as no substantial changes.

[0125] 4) Semantic analysis: Through in-depth semantic analysis, further confirm whether the changes in the first application have truly changed the logical behavior of the code. If the analysis results show that the changes have no substantial impact on the functional logic that the second application relies on, it should also be considered compatible.

[0126] In summary, the embodiments of the present application can more accurately determine the compatibility between the new version of the first application and the current version of the second application by comprehensively considering the change cycle, change content and its impact scope, while reducing unnecessary compatibility issues caused by misjudgment.

[0127] The generation process of the function module call link diagram is as follows: Figure 2BAs shown. First, user 610-1 can initialize the application code in the code repository 620, and user 610-2 can change the application version in the code repository 620, that is, update the code; then the code analysis system 630 can read the application code, and use the corresponding syntax analysis tools (for example, for Java language, use the open source framework Javaparser) to analyze the application code for different development languages, parse all the functional modules of all applications, and the input and output parameters corresponding to each functional module, and then connect the call links of a single application from top to bottom from the interface of the functional module exposed by the application, connect the call links of the functional modules of different applications, and parse the call relationship between the functional modules through the syntax analysis tool, and then store the call relationship between the functional modules in the database 640; then, the link analysis system 650 reads the call relationship between the functional modules, generates and stores the functional module call link graph in the database 640.

[0128] The schematic diagram of the function module call link diagram is as follows Figure 2C As shown. Application 710 includes function module 711, function module 712, function module 713, function module 714 and function module 715, application 720 includes function module 721, function module 722, function module 723, function module 724 and function module 725, application 730 includes function module 731, function module 732, function module 733, function module 734 and function module 735, function module 713 calls function module 722, function module 722 calls function module 724 and function module 725, function module 724 calls function module 731, function module 731 calls function module 732 and function module 733.

[0129] In some embodiments, the compatibility of the second application with the first application before the version change can be automatically calculated according to the following rules, and the developer can also manually modify the result calculated by the system. The compatibility between application 710, application 720 and application 730 is used as an example for explanation:

[0130] Case 1: Calculated by the time interval between application releases.

[0131] Assume that function module 732 (v1 version) of application 730 (v1 version) changes to function module 732 (v2 version), and application 730 (v1 version) also changes to application 730 (v2 version).

[0132] If function module 724 (v1 version) and function module 722 (v1 version) of application 720 (v1 version) do not undergo version changes due to code updates within the change cycle, then it can be inferred that function module 724 (v1 version) and function module 722 (v1 version) of application 720 (v1 version) are compatible with function module 732 (v2 version) of application 730 (v2 version), and further, it can be inferred that application 720 (v1 version) is compatible with application 730 (v2 version).

[0133] If function module 724 (v1 version) or function module 722 (v1 version) of application 720 (v1 version) changes due to code update within the change cycle and becomes function module 724 (v2 version) or function module 722 (v2 version), then it can be inferred that function module 724 (v1 version) or function module 722 (v1 version) of application 720 (v1 version) is incompatible with function module 732 (v2 version) of application 730 (v2 version), that is, application 720 (v1 version) is incompatible with application 730 (v2 version).

[0134] The change cycle can be set within the same day, but different projects can be adjusted according to actual conditions. Some projects may not need to consider the impact on users when they are not actually put into use, so they may not be deployed online within the same day.

[0135] Case 2: Calculation by changing the content.

[0136] If no code changes occur on the calling link of application 730, that is, function module 724 (v1 version) and function module 722 (v1 version) of application 720, function module 713 (v1 version) and function module 711 (v1 version) of application 710, the above function modules are compatible with function module 732 (v2 version) of application 730.

[0137] If function module 732 (v2 version) of application 730 of the first application only deletes parameters not used by function module 724 (v1 version) of application 720 and there is no other code change, function module 724 (v1 version) of application 720 is compatible with function module 732 (v2 version) of application 730.

[0138] If the function module 732 (v1 version) of the application 730 has only the addition and deletion of comments, it is determined that the function modules on the call link are all compatible with the function module 732 (v2 version) of the application 730.

[0139] If, through semantic analysis, there is no logic change in the function module 732 (v2 version) of the application 730, the function modules on the call link are all compatible with the function module 732 (v2 version) of the application 730.

[0140] The embodiments of the present application can determine the compatibility between multiple applications and between different applications and different versions. When rolling back the code version of any application, it can be determined whether there are other applications that need to be rolled back together, thereby reducing the workload of R&D personnel. Especially in production emergency scenarios, it is possible to achieve rapid rollback of versions and improve response speed. In addition, viewing the application call link through the function module call link diagram helps R&D personnel to clearly sort out the call relationship and improve the efficiency of problem location and resolution.

[0141] The following describes an exemplary structure of an application compatibility determination device provided in an embodiment of the present application implemented as a software module. In some embodiments, Figure 3 As shown, the software modules in the application compatibility determination device 455 may include: an acquisition module 4551, used to obtain a function module call link diagram; the function module call link diagram includes a call path between the function module of the first application and the function module of the second application; a first determination module 4552, used to determine the first function module whose version has changed in the first application when the version of the first application has changed; a second determination module 4553, used to determine the second function module according to the function module call link diagram and the first function module; the second function module is a function module in the second application that calls the first function module; a third determination module 4554, used to determine the compatibility between the second application and the first application after the version change according to the version change of the second function module.

[0142] In some embodiments, the third determination module 4554 is also used to: when the version of the second functional module has not changed, determine whether the second application is compatible with the first application after the version has changed; when the version of the second functional module has changed, determine the compatibility between the second application before the version change and the first application after the version change based on the code of the first functional module.

[0143] In some embodiments, the third determination module 4554 is also used to: perform semantic analysis on the code of the first functional module before the version change to obtain a first syntax tree; perform semantic analysis on the code of the first functional module after the version change to obtain a second syntax tree; when the first syntax tree is the same as the second syntax tree, determine that the second application is compatible with the first application after the version change; when the first syntax tree is different from the second syntax tree, determine that the second application is incompatible with the first application after the version change.

[0144] In some embodiments, the third determination module 4554 is also used to: compare the code of the first functional module before the version change and the code after the version change to obtain a difference code; and determine the compatibility between the second application and the first application after the version change based on the type of the difference code.

[0145] In some embodiments, the third determination module 4554 is further used to: when the type of the difference code is comment adjustment, determine the first application after the second application is compatible with the changed version.

[0146] In some embodiments, the third determination module 4554 is also used to: when the type of the difference code is parameter adjustment, determine the target parameter to be adjusted; perform parameter parsing on the code of the second functional module to obtain a parameter list; when the parameter list includes the target parameter, determine the first application after the incompatible version of the second application changes; when the parameter list does not include the target parameter, determine the first application after the compatible version of the second application changes.

[0147] In some embodiments, the device also includes: a functional module call link diagram generation module, which is used to determine, based on the code of the first application and the code of the second application, a first calling relationship between functional modules in the first application, a second calling relationship between functional modules in the second application, and a third calling relationship between functional modules in the second application and functional modules in the first application; and generate a functional module call link diagram based on the first calling relationship, the second calling relationship and the third calling relationship.

[0148] In some embodiments, the function module call link diagram generation module is also used to: perform functional analysis on the code of the first application, obtain the first input and output parameter data of the function module in the first application, and determine the first call relationship based on the first input and output parameter data; perform functional analysis on the code of the second application, obtain the second input and output parameter data of the function module in the second application, and determine the second call relationship based on the second input and output parameter data; determine the third call relationship based on the first input and output parameter data and the second input and output parameter data.

[0149] In some embodiments, the third determination module 4554 is also used to: detect the version change of the second functional module within a preset time period since the version of the first application changed; and determine the compatibility between the second application and the first application after the version change based on the version change of the second functional module within the preset time period.

[0150] It should be noted that the description of the device of the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment, so it is not repeated. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.

[0151] Correspondingly, an embodiment of the present application provides an electronic device for implementing the method for determining application compatibility in the above embodiment. Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the electronic device 1200 includes at least: a processor 1201 , a communication interface 1202 , and a storage medium 1203 configured to store executable instructions, wherein: the processor 1201 generally controls the overall operation of the electronic device 1200 .

[0152] The communication interface 1202 enables the electronic device to communicate with other terminals or servers through a network.

[0153] The storage medium 1203 is configured to store instructions and applications executable by the processor 1201, and can also cache data to be processed or processed by the processor 1201 and each module in the electronic device 1200, which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0154] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer program or the computer executable instruction from the computer-readable storage medium, and the processor executes the computer program or the computer executable instruction, so that the electronic device executes the application compatibility determination method described in the embodiment of the present application.

[0155] The present application embodiment provides a computer-readable storage medium in which computer executable instructions or computer programs are stored. When the computer executable instructions or computer programs are executed by a processor, the processor will execute the application compatibility determination method provided by the present application embodiment, for example, Figure 1A A method for determining application compatibility is shown.

[0156] In some embodiments, the computer-readable storage medium may be a memory such as RAM, read-only memory (ROM), flash memory, magnetic surface memory, optical disk, or compact disc read-only memory (CD-ROM); or it may be various devices including one or any combination of the above memories.

[0157] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0158] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0159] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0160] To sum up, when the version of the first application changes, the changed first functional module can be determined, and the second functional module that depends on the first functional module can be automatically identified according to the functional module call link diagram, so as to judge whether the second functional module is compatible with the first application after the version change according to whether the version of the second functional module changes, thereby realizing the automation of compatibility detection, improving detection efficiency and detection accuracy, and reducing the risk of compatibility problems caused by omissions or misjudgments.

[0161] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for determining application compatibility, characterized in that: The method comprises: Acquire a function module call chain diagram; the function module call chain diagram includes a call path between a function module of a first application and a function module of a second application; In the case where a version of the first application changes, determining a first functional module in the first application whose version has changed; Determine a second functional module according to the functional module call link diagram and the first functional module; the second functional module is a functional module that calls the first functional module in the second application; The compatibility between the second application and the first application after the version change is determined according to the version change of the second functional module.

2. The method according to claim 1, characterized in that The determining, according to the version change of the second functional module, the compatibility between the second application and the first application after the version change, includes: In a case where the version of the second functional module has not changed, determining that the second application is compatible with the first application after the version has changed; In the case where the version of the second functional module is changed, the compatibility between the second application before the version change and the first application after the version change is determined according to the code of the first functional module.

3. The method according to claim 2, characterized in that The determining, according to the code of the first functional module, the compatibility between the second application before the version change and the first application after the version change includes: Performing semantic analysis on the code of the first functional module before the version change to obtain a first syntax tree; Performing semantic analysis on the code of the first functional module after the version change to obtain a second syntax tree; When the first syntax tree is the same as the second syntax tree, determining that the second application before the version change is compatible with the first application after the version change; When the first syntax tree is different from the second syntax tree, it is determined that the second application before the version change is incompatible with the first application after the version change.

4. The method according to claim 2, characterized in that: The determining, according to the code of the first functional module, the compatibility between the second application before the version change and the first application after the version change includes: Comparing the code of the first functional module before the version is changed with the code of the first functional module after the version is changed to obtain a difference code; The compatibility between the second application before the version change and the first application after the version change is determined according to the type of the difference code.

5. The method according to claim 4, characterized in that The determining, according to the type of the difference code, the compatibility between the second application before the version change and the first application after the version change includes: In a case where the type of the difference code is comment adjustment, it is determined that the second application before the version change is compatible with the first application after the version change.

6. The method according to claim 4, characterized in that The determining, according to the type of the difference code, the compatibility between the second application before the version change and the first application after the version change includes: In the case where the type of the difference code is parameter adjustment, determining a target parameter to be adjusted; Parse the parameters of the code of the second functional module before the version change to obtain a parameter list; In a case where the parameter list includes the target parameter, determining that the second application before the version change is incompatible with the first application after the version change; In a case where the parameter list does not include the target parameter, it is determined that the second application before the version change is compatible with the first application after the version change.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine, according to the code of the first application and the code of the second application, a first calling relationship between functional modules in the first application, a second calling relationship between functional modules in the second application, and a third calling relationship between functional modules in the second application and functional modules in the first application; The function module call chain diagram is generated according to the first call relationship, the second call relationship and the third call relationship.

8. The method according to claim 7, characterized in that The determining, according to the code of the first application and the code of the second application, a first calling relationship between the function modules in the first application, a second calling relationship between the function modules in the second application, and a third calling relationship between the function modules in the second application and the function modules in the first application includes: Performing functional analysis on the code of the first application to obtain first input and output parameter data of a functional module in the first application, and determining the first calling relationship according to the first input and output parameter data; Performing functional analysis on the code of the second application to obtain second input and output parameter data of the functional module in the second application, and determining the second calling relationship according to the second input and output parameter data; Determine the third calling relationship based on the first input and output parameter data and the second input and output parameter data.

9. The method according to any one of claims 1 to 6, characterized in that: The determining, according to the version change of the second functional module, the compatibility between the second application and the first application after the version change, includes: Detecting a version change of the second functional module within a preset period of time since the version of the first application changes; The compatibility between the second application and the first application after the version change is determined according to the version change of the second functional module within the preset period.

10. An application compatibility determination device, characterized in that: The device comprises: An acquisition module, used to acquire a function module call chain diagram; the function module call chain diagram includes a call path between a function module of a first application and a function module of a second application; A first determining module, configured to determine, when the version of the first application changes, a first functional module in the first application whose version has changed; A second determining module, configured to determine a second functional module according to the functional module call link diagram and the first functional module; the second functional module is a functional module that calls the first functional module in the second application; The third determination module is used to determine the compatibility between the second application and the first application after the version change according to the version change of the second functional module.

11. An electronic device, characterized in that: include: A memory for storing computer executable instructions; The processor is used to implement the application compatibility determination method described in any one of claims 1 to 9 when executing the computer executable instructions stored in the memory.

12. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the application compatibility determination method according to any one of claims 1 to 9 is implemented.

13. A computer program product comprising computer executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the application compatibility determination method according to any one of claims 1 to 9 is implemented.