CN114285756B - Service call dependency analysis method and related device - Google Patents

Service call dependency analysis method and related device Download PDF

Info

Publication number
CN114285756B
CN114285756B CN202010980270.9A CN202010980270A CN114285756B CN 114285756 B CN114285756 B CN 114285756B CN 202010980270 A CN202010980270 A CN 202010980270A CN 114285756 B CN114285756 B CN 114285756B
Authority
CN
China
Prior art keywords
service
link
interface
dependency
analyzed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010980270.9A
Other languages
Chinese (zh)
Other versions
CN114285756A (en
Inventor
彭章龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010980270.9A priority Critical patent/CN114285756B/en
Publication of CN114285756A publication Critical patent/CN114285756A/en
Application granted granted Critical
Publication of CN114285756B publication Critical patent/CN114285756B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a service call dependency analysis method and a related device, which are used for obtaining a complete call relation link of a link to be analyzed and carrying out fault simulation and service function test on each service interface according to the sequence from top to bottom of the service interface in the link. And analyzing a test result corresponding to the service interface simulated by the fault, and determining the dependency relationship between the service interface and the service interface calling the service interface. And repeating the process until the dependency relationship among all the service interfaces in the whole link to be analyzed is analyzed, and obtaining a dependency analysis result corresponding to the whole link to be analyzed. According to the scheme, the dependency relationship among the service interfaces with the calling relationship in the calling link is obtained through automatic analysis, manual combing analysis is not needed, the condition that analysis codes are omitted or the analysis is inaccurate is avoided, and therefore accuracy and analysis efficiency of the dependency analysis result are effectively improved.

Description

Service call dependency analysis method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service call dependency analysis method and a related device.
Background
In the related art, a service call dependency analysis scheme generally analyzes processing logic of all call relationships on a link after a caller calls a communication exception failure of a callee (such as call timeout, opposite party refusing service, etc.) through manually reading codes, so as to obtain a dependency relationship between two service interfaces with the call relationship.
According to the service call dependency relationship analysis scheme, due to the fact that manual intervention exists, the degree of automation is low, and the conditions of omission of analysis codes or inaccurate analysis exist, the accuracy of analysis results is low, and the analysis efficiency is low.
Disclosure of Invention
In view of the above, the present application provides a service call dependency analysis method and related device, so as to solve the technical problems of inaccurate analysis result and low analysis efficiency existing in the related technology by adopting manual analysis codes, and the disclosed technical scheme includes:
In a first aspect, the present application provides a service call dependency analysis method, including:
acquiring a complete call relation link of each service interface contained in a link to be analyzed;
Sequentially performing fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relation link, and sequentially performing service function test on the links after fault simulation to obtain test results;
analyzing the test results corresponding to the simulated faults of each service interface in the link to be analyzed to obtain the dependency analysis results among all the service interfaces in the link to be analyzed, wherein the dependency analysis results comprise the dependency degree among the service interfaces with calling relations.
In a possible implementation manner of the first aspect, the performing fault simulation on the service interfaces sequentially from top to bottom in the complete call relationship link includes:
When the current service interface is determined to be a strongly dependent interface, all service interfaces with calling relations in the next layer of the current service interface are set to be in a non-calling state in sequence, so that fault simulation on the service interfaces is realized.
In a possible implementation manner of the first aspect, the method further includes:
Comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result to determine a target service interface with a target mutation type of the dependency relationship in the link to be analyzed;
and generating alarm information according to the target service interface and the target mutation type.
In a possible implementation manner of the first aspect, comparing a latest dependency analysis result corresponding to the link to be analyzed with a historical dependency analysis result, and determining a target service interface of a target mutation type of a dependency relationship in the link to be analyzed includes:
Comparing the latest dependency analysis result with the historical dependency analysis result, and determining the interface as the target service interface if a new enhanced dependency relationship exists in the latest dependency analysis result or the interface is changed from weak dependency to strong dependency;
the new enhanced dependency relationship includes a new enhanced dependency relationship between two existing service interfaces in the link to be analyzed, or the link to be analyzed adds a new service interface, and the new enhanced service interface is a strong dependency relationship with any existing service interface in the link to be analyzed.
In a possible implementation manner of the first aspect, the analyzing the test result corresponding to each service interface fault simulation in the link to be analyzed to obtain the dependency analysis result of the link to be analyzed includes:
if the corresponding test result after the current service interface fault simulation is failure, determining that the current service interface is a strongly dependent interface;
if the corresponding test result after the current service interface fault simulation is successful, determining that the current service interface and all service interfaces with calling relations after the current service interface are weak dependent interfaces.
In a possible implementation manner of the first aspect, the method further includes:
displaying a first preset color for a strongly dependent interface in the link to be analyzed;
Displaying a second preset color different from the first preset color for the weak dependent interface in the link to be analyzed.
In a second aspect, the present application further provides a service call dependency analysis apparatus, including:
The call relation acquisition module is used for acquiring a complete call relation link of each service interface contained in the link to be analyzed;
The interface fault simulation and test module is used for sequentially carrying out fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relation link, and sequentially carrying out service function test on the links after the fault simulation to obtain test results;
The dependency analysis module is used for analyzing the test results corresponding to the failure simulation of each service interface in the link to be analyzed to obtain the dependency analysis results among all the service interfaces in the link to be analyzed, wherein the dependency analysis results comprise the dependency degree among the service interfaces with calling relations.
In a third aspect, the present application also provides an apparatus for running a service call relationship analysis method, comprising:
A processor and a memory;
wherein the processor is configured to execute a program stored in the memory;
the memory is used for storing a program, and the program is used for at least:
acquiring a complete call relation link of each service interface contained in a link to be analyzed;
Sequentially performing fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relation link, and sequentially performing service function test on the links after fault simulation to obtain test results;
analyzing the test results corresponding to the simulated faults of each service interface in the link to be analyzed to obtain the dependency analysis results among all the service interfaces in the link to be analyzed, wherein the dependency analysis results comprise the dependency degree among the service interfaces with calling relations.
In a fourth aspect, the present application also provides a storage medium having stored therein computer executable instructions which, when loaded and executed by a processor, implement the service invocation dependency analysis method according to any one of the first aspects above.
In a fifth aspect, the present application also provides a computer program product, which when executed on a computer device, causes the computer device to perform the service invocation dependency analysis method as defined in any one of the first aspects above.
The service call dependency relationship analysis method provided by the application obtains the complete call relationship link of the link to be analyzed, and fault simulation and service function test are sequentially carried out on the service interfaces according to the sequence from top to bottom of the service interfaces in the link. And analyzing a test result corresponding to the service interface simulated by the fault, and determining the dependency relationship between the service interface and the service interface calling the service interface. Repeating the above processes until all the dependency relations among all the service interfaces in the whole link to be analyzed are analyzed, and obtaining the dependency analysis result corresponding to the whole link to be analyzed. According to the scheme, the dependency relationship between the service interfaces with the calling relationship in the calling link can be automatically obtained through analysis, manual carding analysis is not needed, the degree of automation is high, the condition that analysis codes are omitted or the analysis is inaccurate is avoided, and therefore accuracy and analysis efficiency of the dependency analysis result are effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present application, and other drawings may be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a system architecture for running service call dependency analysis according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a complete call relationship tree corresponding to a call link according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for analyzing service call dependencies provided by an embodiment of the application;
FIG. 4 is a flow chart illustrating another method of service invocation dependency analysis provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram of a service call dependency analysis device according to an embodiment of the present application;
FIG. 6 is a schematic diagram of another service call dependency analysis apparatus according to an embodiment of the present application;
Fig. 7 is a schematic structural diagram of an apparatus for running a service call dependency analysis method according to an embodiment of the present application.
Detailed Description
The application provides a service call dependency relationship analysis method and a related device, wherein a service interface of a link to be analyzed is subjected to fault simulation according to a sequence from top to bottom, a service function test is performed on the link to be analyzed after the fault simulation, and a test result is analyzed to obtain the dependency relationship between the service interface of the current fault simulation and the service interface for calling the service interface. By using the scheme, the dependency relationship among all the service interfaces with the calling relationship on the link to be analyzed can be rapidly analyzed, and the scheme can avoid the condition of omission or inaccurate analysis during manual analysis, so that the dependency analysis result is more accurate and the analysis speed is faster.
Before describing the service call dependency analysis method provided by the present application in detail, the following describes the entire system architecture with reference to fig. 1.
Referring to fig. 1, a schematic diagram of a system for performing service call dependency analysis according to an embodiment of the present application is shown, where the system includes a service system 1, a modular debug system 2, and an analysis system 3.
The service system 1 is generally capable of providing multiple service functions, and each service function generally needs to call multiple service modules for implementation, for example, the service Server1 calls servers 2 and ServerN. The service modules are mutually called through the service interfaces, and the calling relation among the service interfaces called by one service function is called a link.
The modular call system 2 is used for analyzing call data reported by the service system to obtain a complete call relation corresponding to each call link.
In one possible implementation manner, the service system 1 generates msgno (also referred to as a dye ID) for the most upstream of each call link, then, msgno carrying the link is included in call data generated by each service call on the call link, all service call data carrying msgno is reported to the modular call system 2, and finally, the modular call system 2 performs aggregate analysis on a large amount of service call data reported by the service system 1 to obtain a complete call relationship from top to bottom of each call link.
In a possible implementation manner, a complete call relationship corresponding to a call link may be represented by a tree structure, referring to fig. 2, which shows a schematic structural diagram of a complete call relationship tree corresponding to a call link provided in an embodiment of the present application, as shown in fig. 2, a box represents a service interface, a line segment with an arrow represents a call relationship between interfaces, an interface pointed by the arrow is a called interface (may also be called party), and an interface in the opposite direction is a service interface for calling the called interface, which may also be called party.
The dependency analysis system 3 performs dependency analysis by using the complete call relationship of the call link obtained by the modular call system 2, and obtains the dependency of the service interface with the call relationship in the call link.
Wherein the dependency analysis system 3 may be run in a device cluster comprising at least one computer device. The specific analysis process of the dependency analysis system will be described in detail below in conjunction with fig. 3. As shown in fig. 3, the service call dependency analysis method may include the steps of:
s11, obtaining a complete call relation link of each service interface contained in the link to be analyzed.
The link to be analyzed is usually a call link corresponding to a key service function in the whole service system, and can be determined according to real-time application requirements.
The complete call relation link corresponding to the link to be analyzed can be obtained by analysis by using the modular system 2 in fig. 1.
And S12, sequentially carrying out fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relation link, and carrying out service function test on the link after fault simulation to obtain a test result.
Fault simulation refers to the current state of the called interface that cannot be called.
There are many ways to simulate a service interface in a fault, for example, in a business system based on a micro service architecture, a fault may be simulated by temporarily suspending a service on a service discovery platform. Or performing fault simulation through a fault simulation component so that the calling party cannot call the called interface.
In one possible implementation, the called interface may be placed in a state that cannot be called by simulating a network failure that may occur when a certain interface is called. For example, network failures that occur when a service interface is invoked, such as packet loss timeout, network access denial, etc., may be simulated by simulating failure of an IP address or port, etc.
And after fault simulation is carried out on a certain interface, carrying out service function test on the link to be analyzed, and obtaining a test result corresponding to the service interface. Then, the interface fault simulation and the service function test are repeated until all service interfaces in the link to be analyzed are covered. And finally, obtaining test results corresponding to all the service interfaces in the link to be analyzed.
If the corresponding test result after the interface fails is successful, the link to be analyzed after the interface fails still can normally realize the corresponding service function, so that the interface and the interface calling the interface are in weak dependency relationship; otherwise, if the corresponding test result after the interface fails, the link to be analyzed after the interface fails can not realize the normal service function, so that the interface and the upper layer interface are in a strong dependency relationship.
The inventors found in the course of studying the present application that: in the call link, if the current service interface and the call interface of the upper layer are in weak dependency, the service interfaces after the current service interface are also in weak dependency.
In one possible implementation manner, in the process of dependency analysis, if a weak dependency relationship exists between a certain service interface and an upper layer service interface, the service and all interfaces with call relationships after the service can be marked as weak dependencies (as shown by arrow dotted lines in fig. 2), and fault simulation and service function test on the service interfaces are not needed.
If a strong dependence (shown by solid lines with arrows in fig. 2) exists between a certain service interface and an upper layer interface, fault simulation and service function test are continued for all interfaces of a next layer of the interface until a certain interface is determined to be a weak dependence interface or until all interfaces of branches where the interface is located are analyzed.
For example, taking the leftmost call branch server→server0_service0→server3_service0→ … … → ServerN _service0 in the call relationship tree shown in fig. 2 as an example, the dependency analysis process is described:
Firstly, performing fault simulation on an interface server0_service0 of a first layer, performing service function test on the whole call link after fault simulation, and finally determining that a corresponding test result after the server0_service0 has a fault is failure and that a server0_service0 interface is a strongly dependent interface in the link.
Then, fault simulation is carried out on the interface server3_service0 of the second layer, service function test is carried out on the whole link after the fault, a test result corresponding to the server3_service0 after the fault is successful is finally obtained, and weak dependency relationship between the server3_service0 interface and the server0_service0 of the upper layer is determined.
Because the second layer interface server3_service0 interface is a weak dependency interface, the steps of fault simulation and service function test on server3_service0 and all the following interfaces are not needed, and the interfaces are marked as weak dependency interfaces directly.
As another example, the left side 2 nd link branch Server→Server0_Service0→Server4_Service1→ … … → ServerN _Service1 in FIG. 2 is an example of a dependency analysis process:
Firstly, performing fault simulation on an untested interface server4_service1 in the link branch according to the sequence from top to bottom, and performing service function test on the whole link after fault simulation to obtain a test result of failure, and determining that a strong dependency relationship exists between a server4_service1 interface and a server0_service0 of the upper layer. And continuing to perform fault simulation and service function analysis on the third layer interface in the link branch, determining that the third layer interface and the second layer interface are also in strong dependency relationship if the test result is still failure, and continuing to analyze the interfaces of the lower layer until the interfaces of a certain layer are determined to be in weak dependency relationship or until all the interfaces in the link branch are analyzed.
In addition, in order to avoid the influence of the all-link dependency analysis process on the online service system, the dependency analysis process is performed in the online sandbox environment, namely, the service and the configuration of the online service system are synchronized into the online sandbox environment, so that the service and the configuration of the online sandbox environment are ensured to be completely consistent with the environment of the online service system.
Sandboxie (also called sandbox and sand table), namely a virtual system program, can realize the service functions which are completely the same as those of the online service system by utilizing the sandbox environment, and is functionally isolated from the online service system, namely, the online service system is not affected.
S13, analyzing the corresponding test results after the fault simulation of each service interface in the link to be analyzed to obtain the dependency analysis results among all the service interfaces in the link to be analyzed.
The dependency analysis result includes the degree of dependency between service interfaces with calling relationships, and the dependency relationship may include strong dependency and weak dependency according to the degree of dependency.
If the corresponding test result after the current service interface fault simulation is failure, determining that the current service interface is a strongly dependent interface; if the corresponding test result after the current service interface fault simulation is successful, determining that the current service interface and all service interfaces with calling relations after the current service interface are weak dependent interfaces.
For example, if the server3_service0 in fig. 2 has a weak dependency relationship with the server0_service0 in the upper layer, it is determined that all interfaces called after server3_service0 are the interfaces that are dependent.
And obtaining the dependency relationship between each interface and the interface of the upper layer according to the test result of each service interface in the whole link to be analyzed, thereby obtaining the dependency analysis result of the whole link.
In one possible implementation, for service interfaces of different dependencies, corresponding interfaces on the call relationship tree may be displayed as different colors, respectively. For example, the strong-dependency interface is displayed in a first preset color (e.g. red), and the weak-dependency interface is displayed in a second preset color (e.g. blue), so that the automatic distinction and display of the strong-dependency interface and the weak-dependency interface are further realized on the basis of the automatic analysis to obtain the dependency relationship between the service interfaces.
The service call dependency relationship analysis method provided by the embodiment obtains the complete call relationship link of the link to be analyzed, and fault simulation and service function test are sequentially carried out on the service interfaces according to the sequence from top to bottom of the service interfaces in the link. And analyzing a test result corresponding to the service interface simulated by the fault, and determining the dependency relationship between the service interface and the service interface calling the service interface. And repeating the process until the dependency relationship among all the service interfaces in the whole link to be analyzed is analyzed, and obtaining a dependency analysis result corresponding to the whole link to be analyzed. According to the scheme, the dependency relationship among the service interfaces with the calling relationship in the calling link is obtained through automatic analysis, manual carding analysis is not needed, the degree of automation is high, the condition that analysis codes are omitted or the analysis is inaccurate is avoided, and therefore accuracy and analysis efficiency of the dependent analysis result are effectively improved.
Referring to fig. 4, a flowchart of another service call dependency analysis method according to an embodiment of the present application is shown, where the method may further include the following steps based on the embodiment shown in fig. 3:
s21, comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result, and determining a target service interface with a target mutation type of the dependency relationship in the link to be analyzed.
And storing the dependency analysis result of the whole link obtained by each analysis in a background database so as to monitor the change condition of the dependency relationship subsequently.
In one possible implementation, the dependency analysis process may be performed once a day, or triggered at any time as needed.
And comparing the latest dependency analysis result with the last obtained historical dependency analysis result, and analyzing a service interface of which the dependency relationship in the link to be analyzed has a target mutation type, namely a target service interface.
The target mutation type can comprise a new enhancement dependence and a change from original weak dependence to strong dependence. The new enhancement dependence comprises the following two conditions, namely, the two service interfaces A and B have no dependence relationship originally, and the analysis discovers that the A and the B are in a strong dependence relationship; secondly, a service interface C is newly added, and the interface C and the original interface B are in a strong dependency relationship.
S22, generating alarm information according to the target service interface and the target mutation type.
When the latest dependence analysis result is found to have the interface of the target mutation type, alarm information is generated to inform a service responsible person of carrying out related processing, so that the continuous stability and high availability of the service system are ensured.
The alarm information may include an identifier of the target service interface and a dependency mutation type corresponding to the interface. For example, if the interface a and the interface B are originally in a weak dependency relationship and are later turned into a strong dependency relationship, the alarm information includes the identifiers of the interface a and the interface B and the type of the abrupt change of the dependency relationship.
According to the service call dependency relationship analysis method provided by the embodiment, the interface with the dependency relationship in the link to be analyzed having mutation can be timely found by comparing the latest dependency analysis result with the historical dependency analysis result, the concerned mutation type is recorded, the corresponding alarm information is generated, the analysis and the monitoring of the service end are facilitated, the analysis accuracy is improved, the prompt of service responsible personnel for timely processing is facilitated, and the continuous stability and the high availability of the service system are ensured.
Corresponding to the embodiment of the service call dependency analysis method, the application also provides an embodiment of the service call dependency analysis device.
Referring to fig. 5, a schematic structural diagram of a service call dependency analysis apparatus provided in an embodiment of the present application is shown, where the apparatus is operated in the analysis system 3 in fig. 1, and as shown in fig. 5, the apparatus may include a call relationship obtaining module 110, an interface fault simulation and test module 120, and a dependency analysis module 130.
The call relation obtaining module 110 is configured to obtain a complete call relation link of each service interface included in the link to be analyzed.
And the interface fault simulation and test module 120 is configured to sequentially perform fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relationship link, and sequentially perform service function test on the link after the fault simulation to obtain a test result.
In one possible implementation manner, the interface fault simulation and test module 120 is configured to, in order from top to bottom in the call relationship in the complete link call relationship, perform fault simulation on the service interfaces in the link to be analyzed in sequence, specifically:
If the current service interface is a strongly dependent interface, all service interfaces with calling relations in the next layer of the current service interface are set to be in a non-callable state in sequence, so that fault simulation of the service interfaces is realized.
There are many ways to simulate a service interface in a fault, for example, in a business system based on a micro service architecture, a fault may be simulated by temporarily suspending a service on a service discovery platform. Or performing fault simulation through a fault simulation component so that the calling party cannot call the called interface. Or network failures such as packet loss timeout, network access denial, etc., that occur when service interface calls are simulated by simulating failure of an IP address or port, etc.
After fault simulation is performed on the service interface in the link to be analyzed, the interface fault simulation and test module 120 is continuously utilized to perform service test on the link after fault simulation, and whether the link can normally realize corresponding service functions after a certain service interface is in fault is tested, so that a test result is obtained.
And the dependency analysis module 130 is configured to analyze the test results corresponding to the simulated faults of the service interfaces in the link to be analyzed, and obtain dependency analysis results among all the service interfaces in the link to be analyzed.
The dependency analysis results include a degree of dependency between service interfaces having a call relationship.
And if the test result is successful, determining that the service interface simulated by the current fault and the interface calling the interface are in weak dependency relationship.
If the test result is failure, determining that the service interface simulated by the current failure and the interface calling the interface are in a strong dependency relationship, and simultaneously determining that all interfaces with calling relationship behind the current service interface are weak dependency interfaces.
In one embodiment of the application, the strongly dependent interfaces in the complete call relationship tree corresponding to the link to be analyzed are displayed as a first preset color; and displaying the weakly dependent interfaces in the complete call relation tree of the link to be analyzed as a second preset color different from the first preset color.
The service call dependency relationship analysis device provided by the embodiment obtains a complete call relationship link of a link to be analyzed, and fault simulation and service function test are sequentially carried out on service interfaces in the link according to the sequence from top to bottom of the service interfaces in the link. And analyzing a test result corresponding to the service interface simulated by the fault, and determining the dependency relationship between the service interface and the service interface calling the service interface. Repeating the above processes until all the dependency relations among all the service interfaces in the whole link to be analyzed are analyzed, and obtaining the dependency analysis result corresponding to the whole link to be analyzed. According to the scheme, the dependency relationship among the service interfaces with the calling relationship in the calling link is obtained through automatic analysis, manual combing analysis is not needed, the condition that analysis codes are omitted or the analysis is inaccurate is avoided, and therefore accuracy and analysis efficiency of the dependency analysis result are effectively improved.
In another embodiment of the present application, each time a dependency analysis result of a link is obtained by analysis, the dependency analysis result is stored in a database, and the latest dependency analysis result is compared with a history dependency analysis result, so as to discover a dependency relationship with a mutation in the link in time.
Referring to fig. 6, a schematic structural diagram of another service call dependency relationship analysis apparatus according to an embodiment of the present application is shown, and in this embodiment, the latest dependency analysis result is obtained each time and then compared with the historical dependency analysis result. As shown in fig. 6, the apparatus further includes a comparison module 210 and an alarm module 220 on the basis of the embodiment shown in fig. 5.
And the comparison module 210 is configured to compare the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result, and determine a target service interface in which the dependency relationship in the link to be analyzed has a target mutation type.
In one possible implementation manner, comparing the latest dependency analysis result with the last obtained historical dependency analysis result, and if the dependency relationship is newly enhanced or the weak dependency is changed into the strong dependency interface in the latest dependency analysis result, determining that the interface is the target service interface;
The new enhanced dependency relationship includes a new enhanced dependency relationship between two existing service interfaces in the link to be analyzed, or the link to be analyzed is added with a new service interface, and the new enhanced service interface is a strong dependency relationship with any existing service interface in the link to be analyzed.
The alarm module 220 is configured to generate alarm information according to the target service interface and the target mutation type.
According to the service call dependency relationship analysis method provided by the embodiment, the interface with the dependency relationship in the link to be analyzed having mutation can be timely found by comparing the latest dependency analysis result with the last historical dependency analysis result, the mutation type concerned is recorded, and corresponding alarm information is generated, so that service responsible personnel can timely process the information, and the continuous stability and high availability of the service system are ensured.
On the other hand, the present application also provides a device for running the service call dependency analysis method, as referring to fig. 7, which shows a schematic diagram of a composition structure of the electronic device of the present application, where the electronic device of the present embodiment may include: a processor 701 and a memory 702.
Optionally, the terminal may further comprise a communication interface 703, an input unit 704 and a display 705 and a communication bus 706.
The processor 701, the memory 702, the communication interface 703, the input unit 704, the display 705, all perform communication with each other via the communication bus 706.
In an embodiment of the present application, the processor 701 may be a central processing unit (Central Processing Unit, CPU), an asic, a dsp, an off-the-shelf programmable gate array, or other programmable logic device.
The processor may call programs stored in the memory 702. In particular, the processor may perform the operations performed by the application server side in the following embodiments of the messaging method.
The memory 702 is used to store one or more programs, and the programs may include program code that includes computer operation instructions, and in an embodiment of the present application, at least the programs for implementing the following functions are stored in the memory:
A method for analyzing service call dependencies, comprising:
acquiring a complete call relation link of call relations among all service interfaces contained in a link to be analyzed;
Sequentially performing fault simulation on the service interfaces according to the sequence from top to bottom of the calling relation in the complete calling relation link, and sequentially performing service function test on the links after fault simulation to obtain test results;
analyzing the test results corresponding to the simulated faults of each service interface in the link to be analyzed to obtain the dependency analysis results among all the service interfaces in the link to be analyzed, wherein the dependency analysis results comprise the dependency degree among the service interfaces with calling relations.
In one possible implementation manner, the sequentially performing fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relationship link includes:
if the current service interface is determined to be a strongly dependent interface, all service interfaces with calling relations in the next layer of the current service interface are in a state of being incapable of being called in sequence, so that fault simulation of the service interfaces is realized;
In another possible implementation, the method further includes:
Comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result to determine a target service interface with a target mutation type of the dependency relationship in the link to be analyzed;
And generating alarm information according to the target service interface and the target mutation type.
In another possible implementation manner, comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result to determine a target service interface with a target type mutation in the dependency relationship in the link to be analyzed, including:
comparing the latest dependency analysis result with the historical dependency analysis result, and if a new enhanced dependency relationship exists in the latest dependency analysis result or an interface is changed from weak dependency to strong dependency, determining that the interface is the target service interface;
the new enhanced dependency relationship includes a new enhanced dependency relationship between two existing service interfaces in the link to be analyzed, or the link to be analyzed adds a new service interface, and the new enhanced service interface is a strong dependency relationship with any existing service interface in the link to be analyzed.
In another possible implementation manner, the analyzing the test result corresponding to each service interface fault simulation in the link to be analyzed to obtain the dependency analysis result between all service interfaces in the link to be analyzed includes:
if the corresponding test result after the current service interface fault simulation is failure, determining that the current service interface is a strongly dependent interface;
if the corresponding test result after the current service interface fault simulation is successful, determining that the current service interface and all service interfaces with calling relations after the current service interface are weak dependent interfaces.
In another possible implementation, the method further includes:
Displaying a first preset color for the interfaces with strong dependence in the link to be analyzed;
displaying a second preset color different from the first preset color for the weakly dependent interface in the link to be analyzed.
In one possible implementation, the memory 702 may include a storage program area and a storage data area, where the storage program area may store an operating system, and at least one application program required for a function (such as an image playing function, etc.), and so on; the storage data area may store data created during use of the computer, such as user data, image data, and the like.
In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or other volatile solid-state storage device.
The communication interface 703 may be an interface of a communication module, such as an interface of a GSM module.
The application may also include a display 704 and an input unit 705, etc.
Of course, the structure of the terminal shown in fig. 7 is not limited to the terminal in the embodiment of the present application, and the terminal may include more or less components than those shown in fig. 7 or may combine some components in practical applications.
On the other hand, the embodiment of the application also provides a storage medium, wherein the storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by a processor, the service call dependency analysis method according to any one of the embodiments is realized.
In yet another aspect, an embodiment of the present application further provides a computer program product, which when executed on a computer device, causes the computer device to perform the service call dependency analysis method according to any one of the embodiments above.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. For the apparatus class embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference is made to the description of the method embodiments for relevant points.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (13)

1. A method for analyzing service call dependencies, comprising:
acquiring a complete call relation link of each service interface contained in a link to be analyzed;
Sequentially performing fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relation link, and sequentially performing service function test on the links after fault simulation to obtain test results;
Analyzing the test results corresponding to each service interface fault simulation in the link to be analyzed to obtain the dependency analysis results among all the service interfaces in the link to be analyzed, wherein the method specifically comprises the steps of determining that the current service interface is a strong dependency interface if the test results corresponding to the current service interface fault simulation are failed; if the corresponding test result after the current service interface fault simulation is successful, determining that the current service interface and all service interfaces with calling relations behind the current service interface are weak dependent interfaces; the dependency analysis results include a degree of dependency between service interfaces having a calling relationship.
2. The method of claim 1, wherein the sequentially performing fault simulation on the service interfaces in the complete call relationship link from top to bottom includes:
when the current service interface is determined to be a strongly dependent interface, all service interfaces with calling relations in the next layer of the current service interface are set to be in a non-callable state in sequence, so that fault simulation of the service interface is realized.
3. The method according to claim 1, wherein the method further comprises:
Comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result to determine a target service interface with a target mutation type of the dependency relationship in the link to be analyzed;
and generating alarm information according to the target service interface and the target mutation type.
4. The method of claim 3, wherein the comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result, and determining the target service interface of the target mutation type of the dependency relationship in the link to be analyzed, includes:
Comparing the latest dependency analysis result with the historical dependency analysis result, and determining the interface as the target service interface if a new enhanced dependency relationship exists in the latest dependency analysis result or the interface is changed from weak dependency to strong dependency;
the new enhanced dependency relationship includes a new enhanced dependency relationship between two existing service interfaces in the link to be analyzed, or the link to be analyzed adds a new service interface, and the new enhanced service interface is a strong dependency relationship with any existing service interface in the link to be analyzed.
5. The method according to claim 1, wherein the method further comprises:
displaying a first preset color for a strongly dependent interface in the link to be analyzed;
Displaying a second preset color different from the first preset color for the weak dependent interface in the link to be analyzed.
6. A service invocation dependency analysis apparatus, comprising:
The call relation acquisition module is used for acquiring a complete call relation link of each service interface contained in the link to be analyzed;
The interface fault simulation and test module is used for sequentially carrying out fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relation link, and sequentially carrying out service function test on the links after the fault simulation to obtain test results;
the dependency analysis module is used for analyzing the test results corresponding to the failure simulation of each service interface in the link to be analyzed to obtain the dependency analysis results among all the service interfaces in the link to be analyzed, and specifically comprises the steps of determining that the current service interface is a strong dependency interface if the test results corresponding to the failure simulation of the current service interface are failed; if the corresponding test result after the current service interface fault simulation is successful, determining that the current service interface and all service interfaces with calling relations behind the current service interface are weak dependent interfaces; the dependency analysis results include a degree of dependency between service interfaces having a calling relationship.
7. The device according to claim 6, wherein the interface fault simulation and test module is specifically configured to:
If the current service interface is a strongly dependent interface, all service interfaces with calling relations in the next layer of the current service interface are set to be in a non-calling state in sequence, so that fault simulation of the service interfaces is realized.
8. The apparatus of claim 6, wherein the apparatus further comprises:
the comparison module is used for comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result and determining a target service interface with a target mutation type of the dependency relationship in the link to be analyzed;
and the alarm module is used for generating alarm information according to the target service interface and the target mutation type.
9. The apparatus according to claim 8, wherein the comparing module is specifically configured to:
Comparing the latest dependency analysis result with the historical dependency analysis result, and determining the interface as the target service interface if a new enhanced dependency relationship exists in the latest dependency analysis result or the interface is changed from weak dependency to strong dependency;
the new enhanced dependency relationship includes a new enhanced dependency relationship between two existing service interfaces in the link to be analyzed, or the link to be analyzed adds a new service interface, and the new enhanced service interface is a strong dependency relationship with any existing service interface in the link to be analyzed.
10. The apparatus of claim 6, wherein the apparatus is further configured to:
displaying a first preset color for a strongly dependent interface in the link to be analyzed;
Displaying a second preset color different from the first preset color for the weak dependent interface in the link to be analyzed.
11. An apparatus for running a service invocation-relationship analysis method, comprising:
A processor and a memory;
wherein the processor is configured to execute a program stored in the memory;
the memory is used for storing a program, and the program is used for at least:
acquiring a complete call relation link of each service interface contained in a link to be analyzed;
Sequentially performing fault simulation on the service interfaces according to the sequence from top to bottom of the service interfaces in the complete call relation link, and sequentially performing service function test on the links after fault simulation to obtain test results;
Analyzing the test results corresponding to each service interface fault simulation in the link to be analyzed to obtain the dependency analysis results among all the service interfaces in the link to be analyzed, wherein the method specifically comprises the steps of determining that the current service interface is a strong dependency interface if the test results corresponding to the current service interface fault simulation are failed; if the corresponding test result after the current service interface fault simulation is successful, determining that the current service interface and all service interfaces with calling relations behind the current service interface are weak dependent interfaces; the dependency analysis results include a degree of dependency between service interfaces having a calling relationship.
12. A storage medium having stored therein computer executable instructions which when loaded and executed by a processor implement the service invocation dependency analysis method as claimed in any one of claims 1 to 5.
13. A computer program product, characterized in that it, when executed on a computer device, causes the computer device to perform the service invocation dependency analysis method as claimed in any one of the preceding claims 1-5.
CN202010980270.9A 2020-09-17 2020-09-17 Service call dependency analysis method and related device Active CN114285756B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010980270.9A CN114285756B (en) 2020-09-17 2020-09-17 Service call dependency analysis method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010980270.9A CN114285756B (en) 2020-09-17 2020-09-17 Service call dependency analysis method and related device

Publications (2)

Publication Number Publication Date
CN114285756A CN114285756A (en) 2022-04-05
CN114285756B true CN114285756B (en) 2024-06-25

Family

ID=80867350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010980270.9A Active CN114285756B (en) 2020-09-17 2020-09-17 Service call dependency analysis method and related device

Country Status (1)

Country Link
CN (1) CN114285756B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115150279A (en) * 2022-07-06 2022-10-04 中国银行股份有限公司 Method and device for acquiring service link information

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488267A (en) * 2019-01-25 2020-08-04 北京搜狗科技发展有限公司 Interface test script generation method and device and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system
CN108768793B (en) * 2018-07-11 2021-09-17 郑州云海信息技术有限公司 Storage dual-active link fault testing method and device
CN110858810B (en) * 2018-08-24 2021-07-30 中国移动通信集团四川有限公司 Network link state monitoring method, device, system and medium
CN110351136B (en) * 2019-07-04 2022-06-28 创新先进技术有限公司 Fault positioning method and device
CN110532168B (en) * 2019-07-05 2024-03-29 中国平安财产保险股份有限公司 Full-link interface pressure measurement method and device, computer equipment and storage medium
CN111385147B (en) * 2020-03-06 2021-07-27 腾讯科技(深圳)有限公司 Fault simulation method, device and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488267A (en) * 2019-01-25 2020-08-04 北京搜狗科技发展有限公司 Interface test script generation method and device and electronic equipment

Also Published As

Publication number Publication date
CN114285756A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
JP2018185808A (en) Apparatus for and method of testing smart agreement based on block chain
CN105005532B (en) A kind of system and method for automatic test application programming interfaces stability
US11093374B2 (en) System and method for continuous testing and delivery of software
CN108509212B (en) Application program update test method and device, terminal equipment and storage medium
TW201941058A (en) Anomaly detection method and device
CN109815119B (en) APP link channel testing method and device
CN112631846A (en) Fault drilling method and device, computer equipment and storage medium
CN111290941A (en) Method and device for testing multiple interfaces, computing equipment and medium
CN110865941A (en) Interface test case generation method, device and system
CN109828920A (en) A kind of log analysis method, device and computer readable storage medium
CN107733710A (en) Construction method, device, computer equipment and the storage medium of link call relation
CN110941632A (en) Database auditing method, device and equipment
CN114285756B (en) Service call dependency analysis method and related device
CN111858354A (en) Method and device for automatically generating test report, storage medium and electronic equipment
CN111708712A (en) User behavior test case generation method, flow playback method and electronic equipment
CN111221721B (en) Automatic recording and executing method and device for unit test cases
CN113238935A (en) Application testing method, system, device, medium, and computer program product
CN109274533B (en) Web service fault positioning device and method based on rule engine
CN111158979A (en) Service dial testing method, system, device and storage medium
CN113934642B (en) Software compatibility testing method based on dynamic and static combination
CN113238901B (en) Multi-device automatic testing method and device, storage medium and computer device
CN116010244A (en) Automatic test method, device, electronic equipment and storage medium
CN114385503A (en) Interface test method, device, equipment and storage medium
CN113032255A (en) Response noise recognition method, model, electronic device, and computer storage medium
CN113377682A (en) Service testing method and device

Legal Events

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