CN114285756A - Service call dependency relationship analysis method and related device - Google Patents

Service call dependency relationship analysis method and related device Download PDF

Info

Publication number
CN114285756A
CN114285756A CN202010980270.9A CN202010980270A CN114285756A CN 114285756 A CN114285756 A CN 114285756A CN 202010980270 A CN202010980270 A CN 202010980270A CN 114285756 A CN114285756 A CN 114285756A
Authority
CN
China
Prior art keywords
service
link
interface
analyzed
dependency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010980270.9A
Other languages
Chinese (zh)
Inventor
彭章龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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/CN114285756A/en
Publication of CN114285756A publication Critical patent/CN114285756A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method and a related device for analyzing a service calling dependency relationship, which are used for obtaining a complete calling relationship link of a link to be analyzed and carrying out fault simulation and service function test on each service interface according to the sequence of the service interfaces in the link from top to bottom. And analyzing a test result corresponding to the service interface of the fault simulation, and determining the dependency relationship between the service interface and the service interface for 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. The scheme automatically analyzes to obtain the dependency relationship between the service interfaces with the calling relationship in the calling link, does not need manual carding analysis, avoids the condition of omission of analysis codes or inaccurate analysis, and thus effectively improves the accuracy and the analysis efficiency of the dependency analysis result.

Description

Service call dependency relationship analysis method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and a related apparatus for analyzing a service invocation dependency relationship.
Background
In the related art, the service invocation dependency relationship analysis scheme generally analyzes processing logic of all invocation relationships on a link after a caller invokes a called party to perform communication exception failure (for example, invocation timeout, other party refusing service, etc.) through manually reading codes so as to obtain a dependency relationship between two service interfaces with the invocation relationship.
The service invocation dependency analysis scheme has low automation degree due to the existence of manual intervention, and has the conditions of omission of analysis codes or inaccurate analysis, so that the accuracy of an analysis result is low, and the analysis efficiency is low.
Disclosure of Invention
In view of this, the present application provides a method and a related device for analyzing a service invocation dependency relationship, so as to solve the technical problems of inaccurate analysis result and low analysis efficiency in the related art due to the adoption of a manual analysis code, and a disclosed technical scheme includes:
in a first aspect, the present application provides a method for analyzing a dependency relationship of a service invocation, including:
acquiring a complete call relation link of each service interface contained in a link to be analyzed;
sequentially carrying out fault simulation on the service interfaces according to the sequence of the service interfaces in the complete call relation link from top to bottom, and sequentially carrying out service function test on the link after fault simulation to obtain a test result;
analyzing the test result corresponding to the simulated fault of each service interface in the link to be analyzed to obtain the dependence analysis result among all the service interfaces in the link to be analyzed, wherein the dependence analysis result includes the dependence degree among the service interfaces with the calling relation.
In a possible implementation manner of the first aspect, the sequentially performing fault simulation on the service interfaces according to an order from top to bottom of the service interfaces in the complete call relationship link includes:
when the current service interface is determined to be a strong dependence interface, all the service interfaces with a calling relationship at the next layer of the current service interface are set to be in an invokable state in sequence, so that fault simulation is carried out on the service interfaces.
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, and determining a target service interface of a type of target mutation 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 the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result, and determining a target service interface of a type where a target mutation occurs in a dependency relationship in the link to be analyzed includes:
comparing the latest dependency analysis result with the historical dependency analysis result, and determining an interface as the target service interface if a new enhanced dependency relationship exists in the latest dependency analysis result or the interface is converted 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 has a new service interface, and the new service interface and any existing service interface in the link to be analyzed have a strong dependency relationship.
In a possible implementation manner of the first aspect, the analyzing a test result corresponding to each service interface in the link to be analyzed after the fault simulation to obtain a dependency analysis result of the link to be analyzed includes:
if the corresponding test result after the fault simulation of the current service interface is failure, determining that the current service interface is a strong dependence interface;
and if the corresponding test result after the fault simulation of the current service interface is successful, determining that the current service interface and all service interfaces having a calling relationship behind 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 weakly dependent interface in the link to be analyzed.
In a second aspect, the present application further provides a device for analyzing a dependency relationship of a service invocation, 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 of the service interfaces in the complete call relation link from top to bottom, and sequentially carrying out service function test on the link after the fault simulation to obtain a test result;
and the dependency analysis module is used for analyzing a test result corresponding to each service interface in the link to be analyzed after fault simulation to obtain a dependency analysis result among all service interfaces in the link to be analyzed, wherein the dependency analysis result comprises a dependency degree among the service interfaces with a calling relation.
In a third aspect, the present application further provides an apparatus for running a method for analyzing relationships when a service is called, including:
a processor and a memory;
wherein the processor is configured to execute a program stored in the memory;
the memory is to store a program to at least:
acquiring a complete call relation link of each service interface contained in a link to be analyzed;
sequentially carrying out fault simulation on the service interfaces according to the sequence of the service interfaces in the complete calling relation link from top to bottom, and sequentially carrying out service function test on the link after fault simulation to obtain a test result;
analyzing the test result corresponding to the simulated fault of each service interface in the link to be analyzed to obtain the dependence analysis result among all the service interfaces in the link to be analyzed, wherein the dependence analysis result includes the dependence degree among the service interfaces with the calling relation.
In a fourth aspect, the present application further provides a storage medium, where computer-executable instructions are stored, and when the computer-executable instructions are loaded and executed by a processor, the method for analyzing a dependency relationship of a service call is implemented as described in any one of the first aspect.
In a fifth aspect, the present application further provides a computer program product, which when executed on a computer device, causes the computer device to execute the service call dependency analysis method of any one of the first aspect.
According to the service call dependency relationship analysis method, the complete call relationship link of the link to be analyzed is obtained, and fault simulation and service function test are sequentially performed 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 of the fault simulation, and determining the dependency relationship between the service interface and the service interface for 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 process, the scheme can automatically analyze the dependency relationship between the service interfaces with the calling relationship in the calling link, manual carding analysis is not needed, the automation degree is high, the condition that analysis codes are omitted or the analysis is inaccurate is avoided, and therefore the accuracy and the analysis efficiency of the dependency analysis result are effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on the provided drawings without creative efforts.
Fig. 1 illustrates a system structure diagram for running a service call dependency analysis according to an embodiment of the present application;
fig. 2 is a schematic structural diagram illustrating a complete call relation tree corresponding to a call link according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for analyzing a dependency relationship of a service call according to an embodiment of the present application;
FIG. 4 is a flow chart illustrating another method for analyzing service call dependency provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram illustrating a service call dependency relationship analysis apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram illustrating another service call dependency relationship analysis apparatus provided in an embodiment of the present application;
fig. 7 shows a schematic structural diagram of an apparatus for executing a service call dependency analysis method according to an embodiment of the present application.
Detailed Description
The application provides a service calling 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 the 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 calling the service interface. By utilizing the scheme, the dependency relationship among all service interfaces with the calling relationship on the link to be analyzed can be quickly analyzed, and the condition of omission or inaccurate analysis in manual analysis can be avoided, so that the dependency analysis result is more accurate and the analysis speed is higher.
Before describing the service call dependency analysis method provided by the present application in detail, the following description is made with reference to fig. 1 to describe the entire system architecture.
Referring to fig. 1, a schematic structural diagram of a system for performing service invocation dependency analysis according to an embodiment of the present application is shown, where the system includes a business system 1, a model invocation system 2, and an analysis system 3.
The service system 1 can generally provide a plurality of service functions, and each service function generally needs to call a plurality of service modules, for example, the service Server1 calls the Server2 and the Server n. The plurality of service modules realize mutual calling through the service interfaces, and the calling relationship among the plurality of service interfaces called by one service function is a calling link.
The module dispatching system 2 is used for analyzing the calling data reported by the service system to obtain the complete calling relation corresponding to each calling link.
In a possible implementation manner, the service system 1 generates msgno (also called staining ID) for the top stream of each call link, then call data generated by each service call on the call link carries the msgno of the link, all the service call data carrying the msgno are reported to the modular modulation system 2, and finally, the modular modulation system 2 performs aggregation 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 for each call link.
In a possible implementation manner, a complete calling relationship corresponding to a calling link may be represented by a tree structure, see fig. 2, which shows a structural schematic diagram of a complete calling relationship tree corresponding to a calling 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 calling relationship between interfaces, an interface pointed by the arrow is a called interface (which may also be referred to as a called party), and an interface in the opposite direction is a service interface which calls the called interface and may also be referred to as a calling party.
The dependency relationship analysis system 3 performs dependency relationship analysis by using the complete call relationship of the call link obtained by the modular call system 2 to obtain the dependency relationship of the service interface with the call relationship in the call link.
Wherein the dependency analysis system 3 may be run in a cluster of devices comprising at least one computer device. The specific analysis process of the dependency analysis system will be described in detail below with reference to fig. 3. As shown in fig. 3, the service call dependency analysis method may include the steps of:
and S11, acquiring the 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 analyzing using the model call system 2 in fig. 1.
And S12, sequentially carrying out fault simulation on the service interfaces according to the sequence of the service interfaces in the complete call relation link from top to bottom, and carrying out service function test on the link after fault simulation to obtain a test result.
Fault simulation refers to making a called interface currently in a state that cannot be called.
There are many ways to simulate a failure of a service interface, for example, in a business system based on a microservice architecture, a failure can be simulated by temporarily suspending a certain service on a service discovery platform. Or, the fault simulation component carries out fault simulation so that the calling party cannot call the called interface.
In one possible implementation, the called interface can be made to be in a state of being unable to be called by simulating a network failure that may occur when a certain interface is called. For example, a network failure occurring when a service interface is called, such as a failure of an IP address or a port, may be simulated, such as a packet loss timeout, a network denial of access, and the like.
And after fault simulation is carried out on a certain interface, carrying out service function test on the link to be analyzed to obtain a test result corresponding to the service interface. And then, repeating the interface fault simulation and the service function test until all service interfaces in the link to be analyzed are covered. And finally, obtaining test results corresponding to all service interfaces in the link to be analyzed.
If the corresponding test result is successful after a certain interface fails, the link to be analyzed can still normally realize the corresponding service function after the interface fails, so that the interface and the interface for calling the interface are in a weak dependence relationship; on the contrary, if the corresponding test result is a failure after a certain interface fails, it indicates that the link to be analyzed cannot realize the normal service function after the interface fails, and therefore, the interface and the upper layer interface are in a strong dependence relationship.
The inventor discovers that in the process of researching the application: in the calling link, if the current service interface and the calling interface of the upper layer are in weak dependency relationship, the service interfaces behind the current service interface are also in weak dependency relationship.
In a possible implementation manner, in the process of analyzing the dependency relationship, if a certain service interface and an upper layer service interface are in a weak dependency relationship, all interfaces that are subsequent to the service and have a call relationship may be directly marked as weak dependencies (as shown by dashed lines with arrows in fig. 2), and it is not necessary to perform fault simulation and service function test on the service interfaces.
If a service interface is strongly dependent on an upper interface (as shown by a solid line with an arrow in fig. 2), fault simulation and service function test are continuously performed on all interfaces of a lower layer of the interface until the interface is determined to be weakly dependent, or until all interfaces of a branch where the interface is located are analyzed.
For example, the dependency analysis process is described by taking the leftmost call branch Server → Server0_ service0 → Server3_ service0 → … … → Server _ service0 in the call relation tree shown in fig. 2 as an example:
firstly, fault simulation is carried out on an interface Server0_ service0 of a first layer, service function test is carried out on the whole calling link after the fault simulation, finally, the corresponding test result is failure after the fault of the Server0_ service0, and the interface of the Server0_ service0 is determined to be the interface which is strongly dependent 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, finally, the corresponding test result after the fault of the Server3_ service0 is obtained is successful, and the weak dependency relationship between the interface of the Server3_ service0 and the Server0_ service0 of the previous layer is determined.
Because the second layer interface Server3_ service0 interface is a weak dependent interface, the steps of fault simulation and service function test on the Server3_ service0 and all the interfaces after the Server are not needed, and the interfaces are directly marked as the weak dependent interfaces.
For another example, the 2 nd link branch Server → Server0_ service0 → Server4_ service1 → … … → Server _ service1 on the left side in fig. 2 exemplifies the dependency analysis process:
firstly, performing fault simulation on an untested interface Server4_ service1 in a link branch according to the sequence from top to bottom, performing service function test on the whole link after the fault simulation, and determining that the interface of the Server4_ service1 and the interface of the Server0_ service0 on the upper layer are in strong dependence relationship if the test result is failure. 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 a strong dependency relationship if the test result still fails, and continuing to analyze the lower-layer interface until determining that the interface of a certain layer is in a weak dependency relationship, or until all the interfaces in the link branch are analyzed.
In addition, in order to avoid the influence of the full link dependency analysis process on the online service system, the dependency analysis process is carried out in the environment of the internal sand measuring box, namely, the service and the configuration of the online service system are synchronized to the environment of the internal sand measuring box, so that the service and the configuration of the environment of the internal sand measuring box are completely consistent with the environment of the online service system.
The sandbox (also called sandbox or sandbox) is a virtual system program, and the sandbox environment can be used for realizing the service function which is completely the same as that of the online service system, and the sandbox environment is isolated from the online service system in function, that is, the online service system is not influenced.
And S13, analyzing the test result corresponding to each service interface in the link to be analyzed after the fault simulation, and obtaining the dependence analysis result among all the service interfaces in the link to be analyzed.
The dependency analysis result includes a dependency degree between service interfaces having a call relation, and the dependency relation may include a strong dependency and a weak dependency according to the dependency degree.
If the corresponding test result after the fault simulation of the current service interface is failure, determining that the current service interface is a strong dependence interface; and if the corresponding test result after the fault simulation of the current service interface is successful, determining that the current service interface and all service interfaces having a calling relationship behind the current service interface are weak dependent interfaces.
For example, in fig. 2, there is a weak dependency relationship between the Server3_ service0 and the Server0_ service0 at the previous layer, all the interfaces called after the Server3_ service0 are determined to be interfaces that are if-dependent.
And obtaining the dependency relationship between each interface and the interface of the previous 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 a possible implementation manner, for service interfaces with different dependencies, the corresponding interfaces on the calling relationship tree may be displayed as different colors, respectively. For example, the strongly dependent interface is displayed as a first preset color (e.g., red) and the weakly dependent interface is displayed as a second preset color (e.g., blue), and on the basis that the dependency relationship between the service interfaces is obtained through automatic analysis, the strongly dependent interface and the weakly dependent interface are further automatically distinguished and displayed.
The method for analyzing the service invocation dependency relationship provided by this embodiment obtains a complete invocation relationship link of a link to be analyzed, and sequentially performs fault simulation and service function test on 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 of the fault simulation, and determining the dependency relationship between the service interface and the service interface for 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. The scheme automatically analyzes to obtain the dependency relationship between the service interfaces with the calling relationship in the calling link, does not need manual carding analysis, has higher automation degree, avoids the condition of omission of analysis codes or inaccurate analysis, and thus effectively improves the accuracy and the analysis efficiency of the dependency analysis result.
Referring to fig. 4, a flowchart of another method for analyzing a dependency relationship of a service call provided in the embodiment of the present application is shown, where the method may further include the following steps based on the embodiment shown in fig. 3:
and S21, 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 type of the target mutation of the dependency relationship in the link to be analyzed.
The dependency analysis result of the whole link obtained by each analysis is stored in a background database so as to track the change condition of the dependency relationship in the following.
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 historical dependency analysis result obtained last time, and analyzing a service interface of a type of target mutation of the dependency relationship in the link to be analyzed, wherein the service interface is called a target service interface.
Wherein, the target mutation type can comprise a new enhanced dependence, and a change from an original weak dependence to a strong dependence. The newly increased strong dependence comprises the following two conditions, namely that the two service interfaces A and B originally have no dependence relationship, and the analysis finds that the A and B are in the strong dependence relationship; and secondly, a service interface C is newly added, and the interface C and the original interface B are in a strong dependence relationship.
And S22, generating alarm information according to the target service interface and the target mutation type.
When the latest dependency analysis result is found to have the interface of the target mutation type, alarm information is generated to inform a service responsible person of relevant processing, and the continuous stability and high availability of a service system are ensured.
The alarm information may include an identifier of the target service interface and a type of a sudden change in a dependency relationship corresponding to the interface. For example, if the original dependency relationship between the interface a and the interface B is weak and the original dependency relationship turns into strong dependency, the alarm information includes the identifiers of the interface a and the interface B and the type of the abrupt change in the dependency relationship.
According to the service invocation dependency relationship analysis method provided by the embodiment, the interface with the sudden change of the dependency relationship in the link to be analyzed can be found in time by comparing the latest dependency analysis result with the historical dependency analysis result, the concerned sudden change type is recorded, and the corresponding alarm information is generated, so that the analysis and tracking of the server side are facilitated, the analysis accuracy is improved, the service responsible personnel are prompted to process in time, and the continuous stability and the high availability of the service system are ensured.
Corresponding to the embodiment of the service invocation dependency relationship analysis method, the application also provides an embodiment of a service invocation dependency relationship analysis device.
Referring to fig. 5, a schematic structural diagram of a service call dependency relationship analysis apparatus provided in an embodiment of the present application is shown, where the apparatus operates 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 invoking relation obtaining module 110 is configured to obtain a complete invoking 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 a service function test on the link after the fault simulation to obtain a test result.
In a possible implementation manner, the interface fault simulation and test module 120 is specifically configured to, when performing fault simulation on the service interface in the link to be analyzed in sequence according to the order of the call relations in the complete link call relation from top to bottom:
and if the current service interface is a strong dependence interface, setting all service interfaces with a calling relationship at the next layer of the current service interface into a state which can not be called in sequence so as to realize fault simulation of the service interfaces.
There are many ways to simulate a failure of a service interface, for example, in a business system based on a microservice architecture, a failure can be simulated by temporarily suspending a certain service on a service discovery platform. Or, the fault simulation component carries out fault simulation so that the calling party cannot call the called interface. Or, the network fault occurring when the service interface is called is simulated by simulating the fault of the IP address or the port, for example, packet loss timeout, network access denial, and the like.
After the service interface in the link to be analyzed is subjected to fault simulation, the interface fault simulation and test module 120 is continuously utilized to perform service test on the link subjected to fault simulation, and whether the link can normally realize a corresponding service function after a certain service interface is in fault is tested, so that a test result is obtained.
The dependency analysis module 130 is configured to analyze a test result corresponding to the simulated fault of each service interface in the link to be analyzed, so as to obtain a dependency analysis result between all service interfaces in the link to be analyzed.
The dependency analysis result includes a degree of dependency between service interfaces having a calling relationship.
And if the test result is successful, determining that the service interface of the current fault simulation and the interface for calling the interface are in weak dependency relationship.
And if the test result is failure, determining that the service interface of the current fault simulation and the interface calling the interface are in a strong dependency relationship, and simultaneously determining that all the interfaces with the calling relationship behind the current service interface are weak dependency interfaces.
In one embodiment of the application, a strongly dependent interface in a complete calling relationship tree corresponding to a link to be analyzed is displayed as a first preset color; and displaying the interface with weak dependence in the complete call relation tree of the link to be analyzed as a second preset color different from the first preset color.
The device for analyzing the service invocation dependency relationship provided in this embodiment obtains a complete invocation relationship link of a link to be analyzed, and sequentially performs fault simulation and service function test on 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 of the fault simulation, and determining the dependency relationship between the service interface and the service interface for 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. The scheme automatically analyzes to obtain the dependency relationship between the service interfaces with the calling relationship in the calling link, does not need manual carding analysis, avoids the condition of missing analysis codes or inaccurate analysis, and thus effectively improves the accuracy and the analysis efficiency of the dependency analysis result.
In another embodiment of the present application, the dependency analysis results of the links are obtained through each analysis and then stored in the database, and the latest dependency analysis results are compared with the historical dependency analysis results, so as to find out the dependency relationship of the sudden change in the links in time.
Referring to fig. 6, a schematic structural diagram of another service invocation dependency relationship analysis apparatus provided in the embodiment of the present application is shown, where each time a latest dependency analysis result is obtained, the latest dependency analysis result is compared with a historical dependency analysis result. As shown in fig. 6, the apparatus further includes a comparison module 210 and an alarm module 220 based on the embodiment shown in fig. 5.
A comparing module 210, 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 of a type where a target mutation occurs in the dependency relationship in the link to be analyzed.
In a possible implementation manner, comparing the latest dependency analysis result with the historical dependency analysis result obtained last time, and if the new enhanced dependency relationship or the interface from weak dependency to strong dependency in the latest dependency analysis result is an interface, determining that the interface is the target service interface;
the newly increased strong dependency relationship comprises a newly increased strong dependency relationship between two existing service interfaces in the link to be analyzed, or the link to be analyzed has a newly increased service interface, and the newly increased service interface and any existing service interface in the link to be analyzed have a strong dependency relationship.
And 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 invocation dependency relationship analysis method provided by the embodiment, by comparing the latest dependency analysis result with the last historical dependency analysis result, the interface with the mutation of the dependency relationship in the link to be analyzed can be found in time, the concerned mutation type is recorded, and the corresponding alarm information is generated, so that the service responsible personnel can process the information in time, and the continuous stability and the high availability of the service system are ensured.
On the other hand, the present application further provides an apparatus for running the service invocation dependency analysis method, as shown in fig. 7, which shows a schematic structural diagram of an electronic apparatus of the present application, where the electronic apparatus of this 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 communication bus 706.
The processor 701, the memory 702, the communication interface 703, the input unit 704, and the display 705 all communicate with each other via the communication bus 706.
In the embodiment of the present application, the processor 701 may be a Central Processing Unit (CPU), an application specific integrated circuit, a digital signal processor, an off-the-shelf programmable gate array, or other programmable logic device.
The processor may call a program stored in the memory 702. Specifically, the processor may perform operations performed by the application server side in the following embodiments of the message sending method.
The memory 702 is used for storing one or more programs, which may include program codes including computer operation instructions, and in this embodiment, the memory stores at least the programs for implementing the following functions:
a service invocation dependency analysis method is characterized by comprising the following steps:
acquiring a complete call relation link of call relations among all service interfaces contained in a link to be analyzed;
sequentially carrying out fault simulation on the service interfaces according to the sequence of the call relations in the complete call relation link from top to bottom, and sequentially carrying out service function test on the link after the fault simulation to obtain a test result;
analyzing the test result corresponding to the simulated fault of each service interface in the link to be analyzed to obtain the dependence analysis result among all the service interfaces in the link to be analyzed, wherein the dependence analysis result includes the dependence degree among the service interfaces with the calling relation.
In a possible implementation manner, the sequentially performing fault simulation on the service interfaces according to the order of the service interfaces from top to bottom in the complete call relationship link includes:
if the current service interface is determined to be a strong dependence interface, all service interfaces with a calling relationship at the next layer of the current service interface are enabled to be in an invokable state in sequence so as to realize fault simulation of the service interfaces;
in another possible implementation manner, the method further includes:
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 of a type of target mutation 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, the comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result to determine the target service interface with the target type mutation in the dependency relationship in the link to be analyzed includes:
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 which is converted from weak dependency to strong dependency exists in the latest dependency analysis result, determining the interface as 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 has a new service interface, and the new service interface and any existing service interface in the link to be analyzed have a strong dependency relationship.
In another possible implementation manner, the analyzing the test result corresponding to the simulated fault of each service interface in the link to be analyzed to obtain the result of analyzing the dependence between all service interfaces in the link to be analyzed includes:
if the corresponding test result after the fault simulation of the current service interface is failure, determining that the current service interface is a strong dependence interface;
and if the corresponding test result after the fault simulation of the current service interface is successful, determining that the current service interface and all service interfaces having a calling relationship behind the current service interface are weak dependent interfaces.
In another possible implementation manner, 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 weakly dependent interface in the link to be analyzed.
In one possible implementation, the memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as an image playing function, etc.), and the like; the storage data area may store data created according to the use of the computer, such as user data and image data, etc.
Further, 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 present application may also include a display 704 and an input unit 705, and the like.
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 some components in combination in practical applications.
On the other hand, an embodiment of the present application further provides a storage medium, where computer-executable instructions are stored in the storage medium, and when the computer-executable instructions are loaded and executed by a processor, the method for analyzing a dependency relationship of a service call according to any one of the above embodiments is implemented.
In another aspect, this embodiment of the present application further provides a computer program product, which, when executed on a computer device, causes the computer device to execute the service call dependency analysis method according to any one of the above embodiments.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the 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 only a preferred embodiment of the present invention, and it should be noted that it is obvious to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.

Claims (10)

1. A service invocation dependency analysis method is characterized by comprising the following steps:
acquiring a complete call relation link of each service interface contained in a link to be analyzed;
sequentially carrying out fault simulation on the service interfaces according to the sequence of the service interfaces in the complete calling relation link from top to bottom, and sequentially carrying out service function test on the link after fault simulation to obtain a test result;
analyzing the test result corresponding to the simulated fault of each service interface in the link to be analyzed to obtain the dependence analysis result among all the service interfaces in the link to be analyzed, wherein the dependence analysis result includes the dependence degree among the service interfaces with the calling relation.
2. The method of claim 1, wherein the sequentially performing fault simulation on the service interfaces according to the order of the service interfaces in the complete call relation link from top to bottom comprises:
when the current service interface is determined to be a strong dependence interface, all the service interfaces with the calling relationship at the next layer of the current service interface are set to be in the state of being incapable of being called in sequence, so that the fault simulation of the service interfaces is realized.
3. The method of claim 1, further comprising:
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 of a type of target mutation 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 according to claim 3, wherein the comparing the latest dependency analysis result corresponding to the link to be analyzed with the historical dependency analysis result to determine the target service interface of the type where the target mutation occurs in the dependency relationship in the link to be analyzed comprises:
comparing the latest dependency analysis result with the historical dependency analysis result, and determining an interface as the target service interface if a new enhanced dependency relationship exists in the latest dependency analysis result or the interface is converted 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 has a new service interface, and the new service interface and any existing service interface in the link to be analyzed have a strong dependency relationship.
5. The method according to claim 1, wherein the analyzing the test result corresponding to the simulated fault of each service interface in the link to be analyzed to obtain the result of analyzing the dependency between all service interfaces in the link to be analyzed comprises:
if the corresponding test result after the fault simulation of the current service interface is failure, determining that the current service interface is a strong dependence interface;
and if the corresponding test result after the fault simulation of the current service interface is successful, determining that the current service interface and all service interfaces having a calling relationship behind the current service interface are weak dependent interfaces.
6. The method of claim 1, further comprising:
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 weakly dependent interface in the link to be analyzed.
7. 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 of the service interfaces in the complete call relation link from top to bottom, and sequentially carrying out service function test on the link after the fault simulation to obtain a test result;
and the dependency analysis module is used for analyzing a test result corresponding to each service interface in the link to be analyzed after fault simulation to obtain a dependency analysis result among all service interfaces in the link to be analyzed, wherein the dependency analysis result comprises a dependency degree among the service interfaces with a calling relation.
8. The apparatus of claim 7, further comprising:
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 of a type of target mutation 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. An apparatus for running a service call-up 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 to store a program to at least:
acquiring a complete call relation link of each service interface contained in a link to be analyzed;
sequentially carrying out fault simulation on the service interfaces according to the sequence of the service interfaces in the complete call relation link from top to bottom, and sequentially carrying out service function test on the link after fault simulation to obtain a test result;
analyzing the test result corresponding to the simulated fault of each service interface in the link to be analyzed to obtain the dependence analysis result among all the service interfaces in the link to be analyzed, wherein the dependence analysis result includes the dependence degree among the service interfaces with the calling relation.
10. A storage medium having stored thereon computer-executable instructions that, when loaded and executed by a processor, implement a service call dependency analysis method as claimed in any one of claims 1 to 6.
CN202010980270.9A 2020-09-17 2020-09-17 Service call dependency relationship analysis method and related device Pending CN114285756A (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN114285756A true CN114285756A (en) 2022-04-05

Family

ID=80867350

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN114285756A (en)

Cited By (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

Cited By (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

Similar Documents

Publication Publication Date Title
TW201941058A (en) Anomaly detection method and device
JP2018185808A (en) Apparatus for and method of testing smart agreement based on block chain
CN110287696B (en) Detection method, device and equipment for rebound shell process
US7502716B2 (en) Closed-loop diagnostic method
CN104899016A (en) Call stack relationship obtaining method and call stack relationship obtaining device
CN111782524A (en) Application testing method and device, storage medium and electronic device
CN109815119A (en) A kind of test method and device of APP link channel
CN112035344A (en) Multi-scenario test method, device, equipment and computer readable storage medium
CN111858296A (en) Interface test method, device, equipment and storage medium
CN114285756A (en) Service call dependency relationship analysis method and related device
CN112241362A (en) Test method, test device, server and storage medium
CN115729724A (en) Fault injection method, fault test system, electronic device and readable storage medium
CN110297854B (en) APP domain name verification method and system
CN114157662A (en) Cloud platform parameter adaptation method and device, terminal equipment and storage medium
CN113377682A (en) Service testing method and device
CN113163059A (en) IPPBX performance detection method, terminal device and storage medium
CN112199275A (en) Component interface test analysis method and device, server and storage medium
CN112306848A (en) Architecture view generation method and device of micro-service system
CN111198721A (en) Application program running method and device
CN115391127A (en) Dial testing method and device, storage medium and chip
CN117389903A (en) Method, device and system for detecting abnormity of running environment of distributed combined application
CN117170963A (en) Pin-based fault monitoring method, system, equipment and medium
CN117472618A (en) Fault injection method, device, processor, storage medium and program product
CN114866405A (en) Module configuration method, communication module, electronic device, and storage medium
CN117311713A (en) Page object configuration method, device, electronic equipment, storage medium and product

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