Cross-system interface determination method, device, computer equipment and storage medium
By obtaining the changed code in the source code warehouse and using the interface mapping relationship table, the problem of the inability to timely identify the impact of cross-system interfaces in traditional testing solutions is solved, the timely identification and processing of the impact of interfaces between systems is realized, and the testing efficiency and accuracy are improved. sex.
Patent Information
- Application Number
- CN202011337311.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-25
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2040-11-25
AI Technical Summary
Traditional software testing solutions cannot determine the impact of cross-system interfaces caused by source code changes in a timely manner. Especially when there are calling relationships between multiple systems, it is difficult to accurately determine the impact of changed code on external systems.
By obtaining the changed code in the source code warehouse, determine the system to which the changed code belongs, determine the affected target interface according to the preset interface mapping relationship table, and send prompt information to the external system to ensure timely identification and processing of the interface impact.
This enables timely determination of the impact on other system interfaces when the system source code changes, improves testing efficiency and accuracy, and ensures smooth interaction of interfaces between systems.
Smart Images

Figure CN112416781B
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing technology, and in particular to a method, apparatus, computer equipment and storage medium for determining a cross-system interface. Background Art
[0002] With the development of software testing technology, during the software testing process, if the source code of the system changes, it is necessary to check the interfaces of the system affected by the code change according to the changed code, so as to readjust or test the interfaces.
[0003] In traditional testing solutions, testers regularly check the source code library of the system, screen out interfaces that may be affected by changes in the system source code, and check whether the interfaces are normal one by one.
[0004] As business needs increase, for an interface of a system, there may be interfaces of other systems that have a calling relationship with the system in its upstream and downstream. For multiple systems with such interface calling relationships, changes in the source code of the current system (one of the multiple systems) may affect the external system that has a calling relationship with the current system. Similarly, changes in the source code of the external system that has a calling relationship with the current system may also affect the current system. However, traditional testing solutions cannot promptly determine the cross-system interface impact caused by source code changes. Summary of the invention
[0005] Based on this, it is necessary to provide a cross-system interface determination method, apparatus, computer equipment and storage medium that can timely determine the cross-system interface impact caused by source code changes in order to address the above technical problems.
[0006] A method for determining a cross-system interface, the method comprising:
[0007] Obtain the changed code generated in the source code repository and determine the system to which the changed code belongs;
[0008] When the system to which the changed code belongs is an external system that has a calling relationship with the current system, the first target interface is determined according to the correspondence between the system source code of the external system and the interface of the external system, and the first target interface is the interface of the external system affected by the changed code;
[0009] The second target interface corresponding to the first target interface is determined according to a preset interface mapping relationship table, where the second target interface is an interface of the present system that has a calling relationship with the first target interface.
[0010] A method for determining a cross-system interface, the method comprising:
[0011] Obtain the changed code generated in the source code repository and determine the system to which the changed code belongs;
[0012] When the system to which the changed code belongs is the present system, a fifth target interface is determined according to a correspondence between the system source code of the present system and the interface of the present system, and the fifth target interface is an interface of the present system affected by the changed code;
[0013] Determine a sixth target interface corresponding to the fifth target interface according to a preset interface mapping relationship table, where the sixth target interface is an interface of an external system that has a calling relationship with the fifth target interface;
[0014] The third prompt information is sent to the external system, where the third prompt information includes the interface information of the sixth target interface.
[0015] A cross-system interface determination device, the device comprising:
[0016] A change code determination module is used to obtain the change code generated in the source code repository and determine the system to which the change code belongs;
[0017] an external interface determination module, for determining a first target interface according to a correspondence between a system source code of the external system and an interface of the external system when the system to which the change code belongs is an external system that has a calling relationship with the current system, wherein the first target interface is an interface of the external system affected by the change code;
[0018] The internal interface determination module is used to determine the second target interface corresponding to the first target interface according to a preset interface mapping relationship table, where the second target interface is an interface of the present system that has a calling relationship with the first target interface.
[0019] A cross-system interface determination device, the device comprising:
[0020] The changed code judgment module is used to obtain the changed code generated in the source code repository and determine the system to which the changed code belongs.
[0021] The internal interface determination module is used to determine the fifth target interface according to the correspondence between the system source code of the system and the interface of the system when the system to which the changed code belongs is the current system. The fifth target interface is the interface of the current system affected by the changed code.
[0022] The external interface determination module is used to determine the sixth target interface corresponding to the fifth target interface according to a preset interface mapping relationship table, where the sixth target interface is an interface of an external system that has a calling relationship with the fifth target interface.
[0023] The prompt information sending module is used to send third prompt information to the external system, where the third prompt information includes interface information of the sixth target interface.
[0024] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned cross-system interface determination method when executing the computer program.
[0025] A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned cross-system interface determination method when executed by a processor.
[0026] The above-mentioned cross-system interface determination method, device, computer equipment and storage medium, because an interface mapping relationship table is pre-set, and when determining the system to which the change code belongs based on the change code generated in the source code repository, the target interface affected by the system to which the change code belongs is first determined, and then the interface of other systems that have a calling relationship with the target interface is determined based on the target interface and the preset interface mapping relationship table. Regardless of whether the system to which the change code belongs is the present system or an external system that has a calling relationship with the present system, when the source code of a system changes, the system interfaces of other systems that may be affected are determined in a timely manner. That is, the cross-system interface impact caused by the source code change can be determined in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 An application environment diagram of a method for determining a cross-system interface in an embodiment;
[0028] Figure 2 A schematic diagram of a flow chart of a method for determining a cross-system interface in one embodiment;
[0029] Figure 3 A flowchart of steps for constructing an interface mapping relationship table reflecting the interface call relationship between the interface of the present system and the interface of the external system in one embodiment;
[0030] Figure 4 It is a flowchart of a step of determining a first target interface according to a correspondence between a system source code of an external system and an interface of the external system in one embodiment;
[0031] Figure 5 A flowchart of the steps of obtaining target code associated with the changed code from the system source code of the external system in one embodiment;
[0032] Figure 6 It is a flowchart of a method for determining a cross-system interface in another embodiment;
[0033] Figure 7A technical architecture diagram that identifies the method for cross-system interfaces in an application example;
[0034] Figure 8 A technical framework diagram for constructing an interface mapping relationship table in an application example is shown;
[0035] Fig. 9 A technical architecture diagram showing a method for determining whether there is an interface list affected by a code change in an application example;
[0036] Fig.10 A technical architecture diagram showing a list A of interfaces affected by code changes in an application example;
[0037] Fig.11 A technical architecture diagram showing a list B of interfaces affected by a code change in an application example is shown;
[0038] Fig.12 It is a structural block diagram of a cross-system interface determination device in one embodiment;
[0039] Fig.13 It is a structural block diagram of a cross-system interface determination device in another embodiment;
[0040] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] The cross-system interface determination method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the server of the present system 102 can communicate with the server of the external system 104 through the network. The present system 102 obtains the change code generated in the source code repository, determines the system to which the change code belongs, and when the system to which the change code belongs is the external system 104 that has a call relationship with the present system, determines the first target interface according to the correspondence between the system source code of the external system 104 and the interface of the external system 104, the first target interface is the interface of the external system 104 affected by the change code, and the present system 102 determines the second target interface corresponding to the first target interface according to the preset interface mapping relationship table, the second target interface is the interface of the present system 102 that has a call relationship with the first target interface. The server can be implemented with an independent server or a server cluster consisting of multiple servers.
[0043] In one embodiment, Figure 2As shown, a method for determining a cross-system interface is provided, and the method is applied to Figure 1 The system in the example is used to illustrate, including the following steps:
[0044] Step S202: Obtain the change code generated in the source code repository, and determine the system to which the change code belongs.
[0045] The source code repository includes the system source code of the system and multiple systems of external systems that have a calling relationship with the system. Each system has its own system domain information and source code address, and the system source code of each system can be accessed according to the system domain information and source code address. The changed code refers to the source code that has been changed. The form of the change is not limited and can include addition, modification or deletion.
[0046] Specifically, the system server can monitor the changes of source code in the source code repository through the source code listener. When the source code changes in the source code repository, the changed code is obtained, and the system where the code change occurs can be determined based on the information of the domain where the change code is located, that is, the system to which the change code belongs.
[0047] Step S204: When the system to which the changed code belongs is an external system that has a calling relationship with the current system, a first target interface is determined according to the correspondence between the system source code of the external system and the interface of the external system. The first target interface is the interface of the external system affected by the changed code.
[0048] The first target interface is an interface in an external system to which the change code belongs that is affected by the change code, and there is an interface calling relationship between the external system and the current system.
[0049] Generally speaking, there is a mapping relationship between the source code of a system and the interface of the system, so source code changes may affect some interfaces associated with it. Specifically, when the system to which the change code belongs is an external system that has an interface call relationship with the system, the interface associated with the change code can be determined from the interfaces of the external system as the first target interface affected by the change code based on the mapping relationship between the system source code of the external system to which the change code belongs and the interface of the external system.
[0050] Step S206: determining the second target interface corresponding to the first target interface according to the preset interface mapping relationship table, where the second target interface is an interface of the present system that has a calling relationship with the first target interface.
[0051] The second target interface is an interface in the system that has a calling relationship with the first target interface. The interface mapping relationship table can be set in advance according to business requirements, and the interface mapping relationship table reflects the calling relationship between the interface of the system and the interfaces of its upstream and downstream external systems.
[0052] Specifically, based on the mapping relationship between interfaces stored in the interface mapping relationship table, the first target interface of the external system affected by the code change can be determined to be the mapped interface of the current system as the second target interface. There is a calling or called mapping relationship between the determined second target interface and the first target interface, so the determined second target interface is likely to be affected by the external system code change.
[0053] The above-mentioned cross-system interface determination method, if an external system that has a calling relationship with the present system generates a change code, then the external system interface that may be affected by the change code is determined through the mapping relationship between the system source code of the external system and its system interface, and based on the preset mapping relationship table between the present system interface and the external system interface, the present system interface that may be affected by the change code of the external system is determined, so that the present system can promptly determine the impact of the change of the external system source code on the present system interface.
[0054] In one embodiment, the above method also includes: when the system to which the changed code belongs is the present system, determining a third target interface according to the correspondence between the system source code of the present system and the interface of the present system, the third target interface being the interface of the present system affected by the changed code; determining a fourth target interface corresponding to the third target interface according to a preset interface mapping relationship table, the fourth target interface being the interface of an external system that has a calling relationship with the third target interface.
[0055] In this embodiment, when it is determined that the source code change occurs in the present system, it is also possible to first determine, based on the mapping relationship between the system source code of the present system and the interface of the present system, the interface of the present system affected by the changed code from the interface of the present system as the third target interface, and then, based on a preset interface mapping relationship table, determine the interface of the external system that has a calling relationship with the third target interface as the fourth target interface.
[0056] In this embodiment, when the source code of the system changes, not only the affected interfaces of the system can be determined in a timely manner, but also the interfaces of external systems associated with the affected interfaces of the system can be determined, thereby timely determining the impact of the source code change of the system on the external system interfaces.
[0057] In one embodiment, before obtaining the changed code generated in the source code repository, the method further includes: constructing an interface mapping relationship table reflecting the interface call relationship between the interface of the current system and the interface of the external system.
[0058] In this embodiment, specifically, the calling relationship data between the upstream and downstream external system interfaces of the system interface and the system interface can be pulled from the monitoring platform every day through the basic data pulling task, and the calling relationship data can be recorded. According to the recorded calling relationship data, an interface mapping relationship table can be constructed to reflect the calling or being called association relationship between all or part of the interfaces of the system and its corresponding upstream and downstream external system interfaces.
[0059] In one embodiment, Figure 3 As shown, an interface mapping relationship table reflecting the interface call relationship between the system interface and the external system interface is constructed, including:
[0060] Step S302: Acquire the upstream and downstream external system interfaces corresponding to the current system interface.
[0061] Step S304: Acquire the calling relationship data between the current system interface and the external system interface and the system domain information of the external system interface.
[0062] Step S306: construct an interface mapping relationship table reflecting the mapping relationship between the system interface, the external system interface and the system domain of the external system interface.
[0063] In this embodiment, the interface mapping relationship table includes not only the mapping between the interface of the present system and the interface of the external system, but also the mapping between the interface of the present system and the system domain to which the interface of the external system belongs. The system to which the interface belongs and the source code address of the system can be determined through the system domain information, thereby constructing the association relationship between the system source code of the interface of the present system and the interface of the external system.
[0064] In one embodiment, determining the system to which the change code belongs includes: determining whether the system to which the change code belongs is the system to which the external system interface belongs based on the system domain information of the change code and the system domain information of the external system interface in the interface mapping relationship table; if so, determining that the system to which the change code belongs is an external system that has a calling relationship with the current system.
[0065] In this embodiment, based on the system domain information of the external system interface in the interface mapping relationship table, it can be determined whether the system to which the change code belongs is an external system that has a call relationship with the current system, thereby preliminarily determining whether the change code has the possibility of affecting the external system interface that has a call relationship with the current system. If yes, the external system interface affected by the change code can be further analyzed. If not, it means that the change code will not affect the external system interface that has a call relationship with the current system, and therefore will not involve the interface of the current system, and the processing process can be terminated to avoid the waste of system computing resources caused by invalid calculations.
[0066] In one embodiment, the method further includes: generating first prompt information indicating that an interface is to be checked, the first prompt information including interface information of the second target interface.
[0067] In this embodiment, after determining the second target interface of the system that has a call relationship with the interface of the external system affected by the changed code, prompt information indicating that the second target interface is to be checked can be generated as the first prompt information, and the prompt information can include interface information and other related information. The method of generating the prompt information is not limited. If there are multiple target second interfaces, an interface list including each target second interface can also be generated.
[0068] In this embodiment, by generating prompt information indicating that the interface needs to be checked, the relevant testers of the system can promptly and clearly discover the problems existing in the interface, so that the impact of the change of the source code of the external system on the system can be checked or repaired, thereby improving the efficiency and convenience of the interface error checking of the system, and further ensuring the smooth interaction between the interface of the system and the external system.
[0069] In one embodiment, the above method further includes: starting a health check task, an automated use case execution task and / or an interface performance analysis task of the system according to the first prompt information.
[0070] In this embodiment, the first prompt information can also be used as the startup information of the health check task, automated use case execution task and / or interface performance analysis task of the system, so as to control the automatic execution of various tasks related to the target second interface, realize the self-inspection of the system, and improve the risk perception ability of the system, thereby improving the accuracy and efficiency of the system in solving problems caused by changes in the source code of the external system.
[0071] In one embodiment, the method further includes: generating second prompt information indicating that an interface is to be checked, the second prompt information including interface information of a fourth target interface.
[0072] In this embodiment, after determining the fourth target interface of the external system that has a call relationship with the interface of the system affected by the changed code, prompt information indicating that the fourth target interface is to be checked can be generated as the second prompt information, and the prompt information can include interface information and other relevant information. The method of generating the prompt information is not limited. If there are multiple target fourth interfaces, an interface list including each target fourth interface can also be generated.
[0073] Furthermore, the second prompt information can be sent to the external system corresponding to the target fourth interface, so that the external system can promptly and clearly know the problems with its interface, and thus can check or repair them, thereby improving the efficiency and convenience of external system interface error checking, and thereby ensuring the smooth interaction between this system and the external system interface.
[0074] In one embodiment, Figure 4 As shown, determining the first target interface according to the correspondence between the system source code of the external system and the interface of the external system includes:
[0075] Step S402: Acquire target code associated with the changed code from the system source code of the external system.
[0076] Step S404: According to the mapping relationship between the target code and the interface of the external system, determine the first target interface corresponding to the target code from the interface of the external system.
[0077] Specifically, the system server can use the source code analyzer to obtain the system domain, source code address, and branch of the changed code, and access the source code warehouse based on this information to pull the changed code, the branch code of the changed code, and the system source code of the system domain where the changed code is located from the source code warehouse to the local. Then, according to the analysis result of the changed code, the target code associated with the changed code can be determined from the system source code of the external system pulled to the local, and the first target interface can be determined according to the mapping relationship between the target code and the interface.
[0078] In one embodiment, Figure 5 As shown, the target code associated with the changed code is obtained from the system source code of the external system, including:
[0079] Step S502: Parse the changed code and the branch code of the changed code.
[0080] Step S504: Generate a call relationship list and a call method list of the changed code and the branch code of the changed code according to the analysis result.
[0081] Step S506: acquiring target code associated with the changed code from the system source code of the external system according to the call relationship list and the call method list.
[0082] Specifically, the package name, class name, method name, and method line can be parsed by parsing the changed code and the branch code of the changed code, and the call relationship list and the call method list can be parsed by the abstract syntax tree and other methods, and the target code can be determined one by one by traversing the list. The accuracy of tracing the call relationship can also be improved as required according to the preset call breadth and depth configuration. The parsing method of this embodiment can more accurately and comprehensively determine the interface of the external system affected by the changed code.
[0083] Furthermore, in one embodiment, Figure 6 As shown, the present application also provides a method for determining a cross-system interface, comprising the following steps:
[0084] Step S602: Obtain the change code generated in the source code repository, and determine the system to which the change code belongs.
[0085] Step S604: when the system to which the changed code belongs is the current system, a fifth target interface is determined according to the correspondence between the system source code of the current system and the interface of the current system, and the fifth target interface is the interface of the current system affected by the changed code.
[0086] Step S606: determining a sixth target interface corresponding to the fifth target interface according to a preset interface mapping relationship table, where the sixth target interface is an interface of an external system that has a calling relationship with the fifth target interface.
[0087] In this step, the interface mapping relationship table can be set in advance according to business requirements. The interface mapping relationship table reflects the calling relationship between the interface of the system and the interfaces of its upstream and downstream external systems.
[0088] Step S608: Sending third prompt information to the external system, where the third prompt information includes interface information of the sixth target interface.
[0089] Specifically, the system sends the third prompt information to the external system to which the sixth target interface belongs. After receiving the third prompt information sent by the system, the external system can determine the impact of the source code change of the system on it. Further, the external system can also check or repair the sixth target interface according to the third prompt information to ensure the smooth interface interaction between it and the system.
[0090] The above-mentioned cross-system interface determination method, by determining the system interface affected by the changed code and the external system interface that has a calling relationship with the system interface, and sending prompt information to the corresponding external system, can enable a system to promptly know the impact of source code changes of other systems associated with it in the scenario of cross-system interface interaction.
[0091] Specifically, for external systems, this system sends prompt information to them, so that they can be informed in time of the impact of changes in the source code of this system on their interfaces, and then they can check or repair the affected interfaces in time, etc., to provide guarantees for smooth interaction between cross-system interfaces. For this system, if the external system also sends prompt information to this system according to the above-mentioned cross-system interface determination method after its own source code is changed, this system can also be informed in time of the impact of the change in the source code of the external system on this system, so that it can check or repair the interface in time, to provide guarantees for smooth interaction between cross-system interfaces.
[0092] In one embodiment, before obtaining the changed code generated in the source code repository, it also includes: constructing an interface mapping relationship table reflecting the mapping relationship between the interface calls of the system interface and the external system interface. Please refer to the specific description of the interface mapping relationship table construction in the above embodiment, which will not be repeated here.
[0093] In one embodiment, the fifth target interface is determined according to the correspondence between the system source code of the present system and the interface of the present system, including: obtaining the target code associated with the change code from the system source code of the present system; and determining the fifth target interface corresponding to the target code from the interface of the present system according to the mapping relationship between the target code and the interface of the present system.
[0094] In one embodiment, target code associated with the change code is obtained from the system source code of the present system, including: parsing the change code and branch code of the change code; generating a call relationship list and a call method list of the change code and branch code of the change code according to the parsing results; and obtaining the target code associated with the change code from the system source code of the present system according to the call relationship list and the call method list.
[0095] For detailed descriptions of the parsing of the change code and determination of the target code of the present system, please refer to the descriptions of the parsing of the change code and determination of the target code of the external system in the above embodiments, which will not be repeated here.
[0096] Next, the cross-system interface determination method involved in this application is further described in detail with reference to an application example. Figure 7 As shown, Figure 7The following is a technical architecture diagram of a method for determining a cross-system interface in an application example, which is described in detail as follows:
[0097] (1) Monitor source code changes.
[0098] (2) Determine the system where source code changes have occurred.
[0099] (3) If the system whose source code is changed is an external system, the affected external system interface list A is searched based on the mapping relationship table A between the external system source code and the external system interface.
[0100] (4) If an affected external system interface is found, check whether there is an affected local system interface according to the interface mapping table.
[0101] (5) If the affected system interfaces are found, a list of the affected system interfaces is output.
[0102] (6) If the system whose source code is changed is the present system, the affected interface list B of the present system is searched according to the mapping relationship table B between the source code of the present system and the interface of the present system.
[0103] (7) If the affected system interface is found, check whether there is an affected external system interface according to the interface mapping table.
[0104] (8) If the affected external system interface is found, the list of the affected external system interfaces is output.
[0105] in, Figure 8 A technical framework diagram for constructing an interface mapping relationship table in an application example is shown; Fig. 9 A technical architecture diagram showing a method for determining whether there is an interface list affected by a code change in an application example; Fig.10 A technical architecture diagram showing a list A of interfaces affected by code changes in an application example; Fig.11 The technical architecture diagram for determining the interface list B affected by the code change in an application example is shown.
[0106] It should be understood that although Figure 2-6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-6At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0107] In one embodiment, Fig.12 As shown, a cross-system interface determination device is provided, including: a change code determination module 1210, an external interface determination module 1220 and an internal interface determination module 1230, wherein:
[0108] The changed code determination module 1210 is used to obtain the changed code generated in the source code repository and determine the system to which the changed code belongs;
[0109] The external interface determination module 1220 is used to determine the first target interface according to the correspondence between the system source code of the external system and the interface of the external system when the system to which the changed code belongs is an external system that has a calling relationship with the current system, wherein the first target interface is the interface of the external system affected by the changed code;
[0110] The internal interface determination module 1230 is used to determine the second target interface corresponding to the first target interface according to a preset interface mapping relationship table, where the second target interface is an interface of the system that has a calling relationship with the first target interface.
[0111] In one embodiment, the internal interface determination module 1230 is also used to determine the third target interface according to the correspondence between the system source code of the present system and the interface of the present system when the system to which the changed code belongs is the present system, and the third target interface is the interface of the present system affected by the changed code; the external interface determination module 1220 is also used to determine the fourth target interface corresponding to the third target interface according to a preset interface mapping relationship table, and the fourth target interface is the interface of the external system that has a calling relationship with the third target interface.
[0112] In one embodiment, the apparatus further comprises a mapping relationship construction module 1240 for constructing an interface mapping relationship table reflecting the mapping relationship of interface calls between the system interface and the external system interface before acquiring the changed code generated in the source code repository.
[0113] In one embodiment, the mapping relationship construction module 1240 obtains the upstream and downstream external system interfaces corresponding to the system interface; obtains the calling relationship data between the system interface and the external system interface and the system domain information of the external system interface; and constructs an interface mapping relationship table that reflects the mapping relationship between the system interface, the external system interface and the system domain of the external system interface.
[0114] In one embodiment, the change code judgment module 1210 determines whether the system to which the change code belongs is the system to which the external system interface belongs based on the system domain information of the change code and the system domain information of the external system interface in the interface mapping relationship table. If so, the system to which the change code belongs is determined to be an external system that has a calling relationship with this system.
[0115] In one embodiment, the internal interface determination module 1230 is further used to generate first prompt information indicating that an interface is to be checked; the first prompt information includes interface information of the second target interface;
[0116] In one embodiment, the internal interface determination module 1230 is further used to start a health check task, an automated use case execution task and / or an interface performance analysis task of the system according to the first prompt information.
[0117] In one embodiment, the external interface determination module 1220 is further used to generate second prompt information indicating that an interface is to be checked; the second prompt information includes interface information of the fourth target interface;
[0118] In one embodiment, the external interface determination module 1220 is further configured to send the second prompt information to a corresponding external system.
[0119] In one embodiment, the external interface determination module 1220 obtains target code associated with the change code from the system source code of the external system; and determines the first target interface corresponding to the target code from the interface of the external system according to the mapping relationship between the target code and the interface of the external system.
[0120] In one embodiment, the external interface determination module 1220 parses the change code and the branch code of the change code; generates a call relationship list and a call method list of the change code and the branch code of the change code based on the parsing results; and obtains the target code associated with the change code from the system source code of the external system based on the call relationship list and the call method list.
[0121] In one embodiment, Fig.13 As shown, a cross-system interface determination device is provided, including: a change code determination module 1310, an internal interface determination module 1320, an external interface determination module 1330 and a prompt information sending module 1340, wherein:
[0122] The changed code determination module 1310 is used to obtain the changed code generated in the source code repository and determine the system to which the changed code belongs.
[0123] The internal interface determination module 1320 is used to determine the fifth target interface according to the correspondence between the system source code of the system and the interface of the system when the system to which the changed code belongs is the current system. The fifth target interface is the interface of the current system affected by the changed code.
[0124] The external interface determination module 1330 is used to determine the sixth target interface corresponding to the fifth target interface according to a preset interface mapping relationship table, where the sixth target interface is an interface of an external system that has a calling relationship with the fifth target interface.
[0125] The prompt information sending module 1340 is used to send third prompt information to the external system, where the third prompt information includes interface information of the sixth target interface.
[0126] In one embodiment, the above-mentioned apparatus further includes a mapping relationship construction module 1350, which is used to construct an interface mapping relationship table reflecting the mapping relationship of interface calls between the interface of the current system and the interface of the external system.
[0127] In one embodiment, the internal interface determination module 1320 obtains the target code associated with the changed code from the system source code of the system; and determines the fifth target interface corresponding to the target code from the interface of the system according to the mapping relationship between the target code and the interface of the system.
[0128] In one embodiment, the internal interface determination module 1320 parses the change code and the branch code of the change code; generates a call relationship list and a call method list of the change code and the branch code of the change code based on the parsing results; and obtains the target code associated with the change code from the system source code of the system based on the call relationship list and the call method list.
[0129] For the specific limitations of the cross-system interface determination device, please refer to the limitations of the cross-system interface determination method above, which will not be repeated here. Each module in the above-mentioned cross-system interface determination device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0130] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.14As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store an interface mapping relationship table. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cross-system interface determination method is implemented.
[0131] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0132] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: obtaining a change code generated in a source code repository, and determining a system to which the change code belongs; when the system to which the change code belongs is an external system that has a calling relationship with the present system, determining a first target interface according to a corresponding relationship between a system source code of the external system and an interface of the external system, the first target interface being an interface of the external system affected by the change code; and determining a second target interface corresponding to the first target interface according to a preset interface mapping relationship table, the second target interface being an interface of the present system that has a calling relationship with the first target interface.
[0133] In one embodiment, the processor also implements the following steps when executing the computer program: when the system to which the changed code belongs is the present system, determining a third target interface according to the correspondence between the system source code of the present system and the interface of the present system, the third target interface being the interface of the present system affected by the changed code; determining a fourth target interface corresponding to the third target interface according to a preset interface mapping relationship table, the fourth target interface being the interface of an external system that has a calling relationship with the third target interface.
[0134] In one embodiment, before the processor executes the computer program to obtain the changed code generated in the source code repository, it also implements the following steps: constructing an interface mapping relationship table reflecting the mapping relationship of interface calls between the system interface and the external system interface.
[0135] In one embodiment, when a processor executes a computer program to construct an interface mapping relationship table that reflects the mapping relationship between the interface calls of the present system interface and the external system interface, the following steps are specifically implemented: obtaining the upstream and downstream external system interfaces corresponding to the present system interface; obtaining the call relationship data between the present system interface and the external system interface and the system domain information of the external system interface; and constructing an interface mapping relationship table that reflects the mapping relationship between the present system interface, the external system interface and the system domain of the external system interface.
[0136] In one embodiment, when the processor executes a computer program to determine the system to which the change code belongs, the following steps are specifically implemented: based on the system domain information of the change code and the system domain information of the external system interface in the interface mapping table, it is determined whether the system to which the change code belongs is the system to which the external system interface belongs; if so, it is determined that the system to which the change code belongs is an external system that has a calling relationship with the current system.
[0137] In one embodiment, the processor executes the computer program to further implement the following steps: generating first prompt information indicating that an interface is to be checked; the first prompt information includes interface information of the second target interface.
[0138] In one embodiment, the processor executes the computer program to further implement the following steps: starting a health check task, an automated use case execution task and / or an interface performance analysis task of the system according to the first prompt information.
[0139] In one embodiment, the processor executes the computer program to further implement the following steps: generating second prompt information indicating that an interface is to be checked; and the second prompt information includes interface information of a fourth target interface.
[0140] In one embodiment, the processor executes the computer program to further implement the following steps: sending the second prompt information to a corresponding external system.
[0141] In one embodiment, when a processor executes a computer program to determine a first target interface based on a correspondence between a system source code of an external system and an interface of the external system, the following steps are specifically implemented: obtaining a target code associated with the change code from the system source code of the external system; and determining a first target interface corresponding to the target code from the interface of the external system based on a mapping relationship between the target code and the interface of the external system.
[0142] In one embodiment, a processor executes a computer program to obtain target code associated with the change code from system source code of an external system, specifically implementing the following steps: parsing the change code and branch code of the change code; generating a call relationship list and a call method list of the change code and branch code of the change code based on the parsing results; and obtaining the target code associated with the change code from the system source code of the external system based on the call relationship list and the call method list.
[0143] In one embodiment, the processor implements the following steps when executing the computer program: obtaining the change code generated in the source code repository, and determining the system to which the change code belongs; when the system to which the change code belongs is the present system, determining a fifth target interface according to the correspondence between the system source code of the present system and the interface of the present system, the fifth target interface being the interface of the present system affected by the change code; determining a sixth target interface corresponding to the fifth target interface according to a preset interface mapping relationship table, the sixth target interface being the interface of an external system that has a calling relationship with the fifth target interface; and sending a third prompt message to the external system, the third prompt message including the interface information of the sixth target interface.
[0144] In one embodiment, when the processor executes a computer program to determine the fifth target interface based on the correspondence between the system source code of the present system and the interface of the present system, the following steps are specifically implemented: obtaining the target code associated with the change code from the system source code of the present system; and determining the fifth target interface corresponding to the target code from the interface of the present system based on the mapping relationship between the target code and the interface of the present system.
[0145] In one embodiment, when the processor executes a computer program to obtain target code associated with the change code from the system source code of the system, the following steps are specifically implemented: parsing the change code and the branch code of the change code; generating a call relationship list and a call method list of the change code and the branch code of the change code based on the parsing results; and obtaining the target code associated with the change code from the system source code of the system based on the call relationship list and the call method list.
[0146] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a change code generated in a source code repository, and determining a system to which the change code belongs; when the system to which the change code belongs is an external system that has a calling relationship with the present system, determining a first target interface according to a corresponding relationship between a system source code of the external system and an interface of the external system, the first target interface being an interface of the external system affected by the change code; determining a second target interface corresponding to the first target interface according to a preset interface mapping relationship table, the second target interface being an interface of the present system that has a calling relationship with the first target interface.
[0147] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the system to which the changed code belongs is the present system, a third target interface is determined based on the correspondence between the system source code of the present system and the interface of the present system, and the third target interface is the interface of the present system affected by the changed code; a fourth target interface corresponding to the third target interface is determined based on a preset interface mapping relationship table, and the fourth target interface is the interface of an external system that has a calling relationship with the third target interface.
[0148] In one embodiment, before the computer program is executed by the processor to obtain the changed code generated in the source code repository, the following steps are also implemented: constructing an interface mapping relationship table reflecting the mapping relationship between the interface calls of the system interface and the external system interface.
[0149] In one embodiment, when a computer program is executed by a processor to implement construction of an interface mapping relationship table reflecting the mapping relationship between the interface of the present system and the interface of an external system, the following steps are specifically implemented: obtaining the upstream and downstream external system interfaces corresponding to the interface of the present system; obtaining the call relationship data between the interface of the present system and the external system interface and the system domain information of the external system interface; and constructing an interface mapping relationship table reflecting the mapping relationship between the interface of the present system, the external system interface and the system domain of the external system interface.
[0150] In one embodiment, when a computer program is executed by a processor to determine the system to which a change code belongs, the following steps are specifically implemented: based on the system domain information of the change code and the system domain information of the external system interface in the interface mapping table, it is determined whether the system to which the change code belongs is the system to which the external system interface belongs; if so, it is determined that the system to which the change code belongs is an external system that has a calling relationship with the current system.
[0151] In one embodiment, the computer program is executed by the processor to further implement the following steps: generating first prompt information indicating that an interface is to be checked; the first prompt information includes interface information of the second target interface.
[0152] In one embodiment, the computer program is executed by the processor to further implement the following steps: starting a health check task, an automated use case execution task and / or an interface performance analysis task of the system according to the first prompt information.
[0153] In one embodiment, the computer program is executed by the processor to further implement the following steps: generating second prompt information indicating that an interface is to be checked; and the second prompt information includes interface information of a fourth target interface.
[0154] In one embodiment, the computer program is executed by the processor to further implement the following steps: sending the second prompt information to a corresponding external system.
[0155] In one embodiment, when a computer program is executed by a processor to determine a first target interface based on a correspondence between a system source code of an external system and an interface of the external system, the following steps are specifically implemented: obtaining a target code associated with the change code from the system source code of the external system; and determining a first target interface corresponding to the target code from the interface of the external system based on a mapping relationship between the target code and the interface of the external system.
[0156] In one embodiment, a computer program is executed by a processor to obtain target code associated with a change code from a system source code of an external system, specifically implementing the following steps: parsing the change code and branch codes of the change code; generating a call relationship list and a call method list of the change code and branch codes of the change code based on the parsing results; and obtaining the target code associated with the change code from the system source code of the external system based on the call relationship list and the call method list.
[0157] In one embodiment, when the computer program is executed by a processor, the following steps are implemented: obtaining the change code generated in the source code repository, and determining the system to which the change code belongs; when the system to which the change code belongs is the present system, determining a fifth target interface according to the correspondence between the system source code of the present system and the interface of the present system, the fifth target interface being the interface of the present system affected by the change code; determining a sixth target interface corresponding to the fifth target interface according to a preset interface mapping relationship table, the sixth target interface being the interface of an external system that has a calling relationship with the fifth target interface; and sending a third prompt message to the external system, the third prompt message including the interface information of the sixth target interface.
[0158] In one embodiment, when a computer program is executed by a processor to determine the fifth target interface based on the correspondence between the system source code of the present system and the interface of the present system, the following steps are specifically implemented: obtaining a target code associated with the change code from the system source code of the present system; and determining the fifth target interface corresponding to the target code from the interface of the present system based on the mapping relationship between the target code and the interface of the present system.
[0159] In one embodiment, when a computer program is executed by a processor to obtain target code associated with a change code from a system source code of the system, the following steps are specifically implemented: parsing the change code and branch code of the change code; generating a call relationship list and a call method list of the change code and branch code of the change code based on the parsing results; and obtaining the target code associated with the change code from the system source code of the system based on the call relationship list and the call method list.
[0160] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0161] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0162] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for determining a cross-system interface, the method include: Get the upstream and downstream external system interfaces corresponding to this system interface; Acquire the call relationship data between the system interface and the external system interface and the system domain information of the external system interface; construct an interface mapping relationship table reflecting the mapping relationship between the system interface, the external system interface and the system domain of the external system interface; Obtain the change code generated in the source code repository, and determine whether the system to which the change code belongs is the system to which the external system interface belongs according to the system domain information of the change code and the system domain information of the external system interface in the interface mapping relationship table; if so, determine that the system to which the change code belongs is an external system that has a calling relationship with the current system; When the system to which the change code belongs is an external system that has a calling relationship with the current system, a first target interface is determined according to a correspondence between a system source code of the external system and an interface of the external system, wherein the first target interface is an interface of the external system affected by the change code; Wherein, the determining of the first target interface according to the correspondence between the system source code of the external system and the interface of the external system comprises: obtaining the system domain, source code address, and change code branch information of the change code by using a source code analyzer, accessing a source code repository according to the system domain, source code address, and change code branch information of the change code, and pulling the change code, the branch code of the change code, and the system source code of the system domain where the change code is located from the source code repository; parsing the change code and the branch code of the change code; generating a call relationship list and a call method list of the change code and the branch code of the change code according to the parsing result; obtaining the target code associated with the change code from the system source code of the external system according to the call relationship list and the call method list; and determining the first target interface corresponding to the target code from the interface of the external system according to the mapping relationship between the target code and the interface of the external system; The second target interface corresponding to the first target interface is determined according to a preset interface mapping relationship table, where the second target interface is an interface of the present system that has a calling relationship with the first target interface.
2. The method according to claim 1, It is characterized in that The method further comprises: When the system to which the change code belongs is the present system, determining a third target interface according to a correspondence between a system source code of the present system and an interface of the present system, wherein the third target interface is an interface of the present system affected by the change code; A fourth target interface corresponding to the third target interface is determined according to a preset interface mapping relationship table, wherein the fourth target interface is an interface of an external system that has a calling relationship with the third target interface.
3. The method according to claim 1, It is characterized in that The method further comprises: Generate first prompt information indicating that an interface is to be checked; the first prompt information includes interface information of the second target interface; The health check task, automated use case execution task and / or interface performance analysis task of the system are started according to the first prompt information.
4. The method according to claim 2, It is characterized in that The method further comprises: Generate second prompt information indicating that an interface is to be checked; the second prompt information includes interface information of the fourth target interface; The second prompt information is sent to the corresponding external system.
5. A cross-system interface determination device, It is characterized in that The device comprises: A change code judgment module is used to obtain the upstream and downstream external system interfaces corresponding to the interface of the present system; obtain the call relationship data between the interface of the present system and the external system interface and the system domain information of the external system interface; construct an interface mapping relationship table reflecting the mapping relationship between the interface of the present system, the external system interface and the system domain of the external system interface; obtain the change code generated in the source code repository, and judge whether the system to which the change code belongs is the system to which the external system interface belongs according to the system domain information of the change code and the system domain information of the external system interface in the interface mapping relationship table, and if so, judge that the system to which the change code belongs is an external system that has a call relationship with the present system; an external interface determination module is used to determine the first target interface according to the correspondence between the system source code of the external system and the interface of the external system when the system to which the change code belongs is an external system that has a call relationship with the present system, and the first target interface is the one affected by the change code. the interface of the external system affected by the change code; wherein, determining the first target interface according to the correspondence between the system source code of the external system and the interface of the external system comprises: using a source code analyzer to obtain the system domain, source code address, and change code branch information of the change code, accessing a source code repository according to the system domain, source code address, and change code branch information of the change code, and pulling the change code, the branch code of the change code, and the system source code of the system domain where the change code is located from the source code repository; parsing the change code and the branch code of the change code; generating a call relationship list and a call method list of the change code and the branch code of the change code according to the parsing result; acquiring the target code associated with the change code from the system source code of the external system according to the call relationship list and the call method list; and determining the first target interface corresponding to the target code from the interface of the external system according to the mapping relationship between the target code and the interface of the external system; The internal interface determination module is used to determine the second target interface corresponding to the first target interface according to a preset interface mapping relationship table, where the second target interface is an interface of the present system that has a calling relationship with the first target interface.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
