Service Dependency Analysis Method, Electronic Device, and Storage Medium

The service call is intercepted through the service call entry, and the service call information is obtained and analyzed, which solves the problem of service switching and dependency analysis under the multi-computer room architecture, and realizes the rapid acquisition of service dependencies, ensuring data consistency and service availability.

CN111913764BActive Publication Date: 2025-05-30ZHANGYUE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010788868.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-07
Publication Date
2025-05-30
Estimated Expiration
2040-08-07

AI Technical Summary

Technical Problem

Under the multi-computer room architecture, it is difficult for the existing technology to achieve rapid switching of services and storage in a short time, resulting in data consistency and service availability issues. Service dependency analysis requires full link connection, which is highly required and cannot be used for all services.

Method used

The service call is intercepted through the service call entry, obtain the service context information, analyze the service call information, and report it to the server for analysis, obtain the service dependency relationship. This method does not require full links to the service, simplifying the service dependency analysis process.

Benefits of technology

It realizes rapid acquisition of service dependencies under a multi-computer room architecture, ensures data consistency and service availability, simplifies the service dependency analysis process, and is suitable for a wide range of service scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111913764B_ABST
    Figure CN111913764B_ABST
Patent Text Reader

Abstract

The present invention discloses a service dependency analysis method, an electronic device and a storage medium, the method comprising: intercepting at least one called service according to a service call entry, obtaining context information of at least one service; analyzing the context information of at least one service to obtain corresponding service call information; reporting the service call information to a server for parsing to obtain service dependency. The context information of the service is dynamically obtained through the service call entry for analysis to obtain the service call information, without opening up the entire link of the service. The server can directly obtain the service dependency by parsing based on the service call information, which is simpler and more convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software, and in particular to a service dependency analysis method, an electronic device, and a storage medium. Background Art

[0002] There are more and more Internet service operations and a growing user base. The single data center architecture can no longer meet the service requirements and affects the user experience. Most existing production environments adopt a multi-data center architecture, such as a dual-data center architecture, where both data centers provide services externally to ensure the normal operation of the services. However, in a multi-data center architecture, if multiple data centers simultaneously record reads and writes of user operations, it will lead to data problems. The existing multi-data center methods generally use a single data center for data writing, and other data centers are used as hot spares to synchronize data; or, the user data is partitioned and the users are bound to the data centers, such as user a is bound to data center A, to prevent data confusion and other problems. However, considering the existence of historical data and other factors, data partitioning is not applicable to all multi-data center architectures.

[0003] For a multi-data center architecture, to achieve the effect of real-time dual-active or multi-active, the services and the backend storage need to be able to quickly switch from one data center to another within a short time to ensure the availability of the production environment and data consistency. Therefore, it is necessary to understand the dependency relationships between services to avoid problems such as service unavailability caused by omissions in the dependency relationships during switching. When implementing service dependency analysis in the prior art, it is necessary to fully connect the services in the whole link. This method has high requirements for services and cannot be applied to all service dependency analyses. Summary of the Invention

[0004] In view of the above problems, the present invention is proposed to provide a service dependency analysis method, an electronic device, and a storage medium that overcome the above problems or at least partially solve the above problems.

[0005] According to one aspect of the present invention, there is provided a service dependency analysis method, which includes:

[0006] Intercept at least one service called according to the service call entry, and obtain the context information of at least one service;

[0007] Analyze the context information of at least one service to obtain the corresponding service call information;

[0008] Report the service call information to the server for parsing to obtain the dependency relationship of the service.

[0009] According to another aspect of the present invention, there is provided an electronic device, including: a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus;

[0010] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the following operations:

[0011] Intercepting at least one called service according to a service call entry, and obtaining context information of at least one service;

[0012] Analyze the context information of at least one service to obtain corresponding service call information;

[0013] Report the service call information to the server for analysis to obtain the service dependencies.

[0014] According to another aspect of the present invention, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to perform the following operations:

[0015] Intercepting at least one called service according to a service call entry, and obtaining context information of at least one service;

[0016] Analyze the context information of at least one service to obtain corresponding service call information;

[0017] Report the service call information to the server for analysis to obtain the service dependencies.

[0018] According to the service dependency analysis method, electronic device and storage medium provided by the present invention, at least one called service is intercepted according to the service call entry to obtain the context information of at least one service; the context information of at least one service is analyzed to obtain the corresponding service call information; the service call information is reported to the server for parsing to obtain the dependency relationship of the service. The context information of the service is dynamically obtained through the service call entry for analysis to obtain the service call information, without the need to open up the entire link of the service. And the server can directly obtain the service dependency relationship based on the service call information by parsing, which is simpler and more convenient.

[0019] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0021] Figure 1 Shows a schematic flowchart of a service dependency analysis method according to an embodiment of the present invention;

[0022] Figure 2 Shows a schematic flowchart of a service dependency analysis method according to another embodiment of the present invention;

[0023] Figure 3 Shows a schematic structural diagram of an electronic device according to an embodiment of the present invention. Detailed implementation manners

[0024] Embodiment 1

[0025] Figure 1 Shows a schematic flowchart of a service dependency analysis method according to an embodiment of the present invention, as Figure 1 shown, the method includes the following steps:

[0026] Step S101, intercept at least one called service according to the service call entry, and obtain the context information of at least one service.

[0027] In this embodiment, for service calls, a service call entry is provided. When each service is called, it needs to call the service through the service call entry. The service call entry can be implemented by accessing the service call entry SDK in the project.

[0028] When the service is called, since the service call entry SDK is accessed in the project, the service call entry first intercepts the currently called service. After dynamically obtaining the context information of the service, the service call is normally executed without affecting the subsequent service execution.

[0029] The context information of the service can be pre-configured with the context information of the service when initializing the project and the corresponding service. For example, when initializing the project and the services included in the project, set the service name space, the project to which it belongs, etc. of the service, so that it is convenient for the service call entry to obtain the context information of at least one service after intercepting at least one called service; or, for the project, the project information can also be stored through an image text file, and the services included in the project are deployed in a container. When the service is called, the service call entry intercepts the service and obtains the context information of the service from the container. The above is for illustrative purposes and is specifically set according to the implementation situation, and is not limited here.

[0030] Step S102, analyze the context information of at least one service to obtain the corresponding service call information.

[0031] After obtaining the context information of the service, analyze the context information to obtain service call information therefrom. Among them, the service call information includes the service namespace, the belonging project, the IP address, the port information, the namespace of other services that the service depends on, the number of times of calling other services, the acquisition time, the dependency relationship, etc. The service call information can be as follows:

[0032]

[0033]

[0034] Among them, the IP address and port information record the actual situation of the service call; the service namespace and the belonging project record the information of the currently called service; the namespace of other services that the service depends on, the number of times of calling other services, etc. can be obtained according to the context information obtained from the service call entry, the number of times the service call entry is executed, etc.; the dependency relationship includes the specified dependency relationship, the execution dependency relationship, etc. The specified dependency relationship is the pre-specified dependency relationship between services, which can be directly obtained based on the context information of the service, or when the pre-specified dependency relationship between services is specified, the specified dependency relationship is stored, and when the service is called, the specified dependency relationship is directly obtained; the execution dependency relationship is determined according to the call of other services during the actual execution of the service. The dependency relationship between the service and other services can be the specified dependency relationship according to the actual situation, or the execution dependency relationship, or the dependency relationship between the service and other services includes both the specified dependency relationship and the execution dependency relationship at the same time. For the execution dependency relationship, the number of times of calling other services is obtained according to the number of times the service call entry is executed when actually calling other services; for the specified dependency relationship, the number of times of calling other services is obtained according to the specified number of calls when initializing the service. Further, the service call information can also include the acquisition time, and the acquisition time records the time when the service call information is obtained. The service call information generated at different time points may be different. By recording the service call information of the service at different time points, the service dependency analysis for multiple time periods can be performed on the service.

[0035] Step S103, report the service call information to the server for parsing to obtain the dependency relationship of the service.

[0036] The service call information can be reported in the form of UDP packets. When reporting the service call information to the server, the service call information is reported regularly through the connectionless transport protocol. The connectionless transport protocol ensures that the reporting of service call information does not occupy network resources. For single-machine reporting, no connection needs to be established, which will not affect the normal execution of the service and will not affect the service performance, etc. Moreover, service calls will generate corresponding service call information. Especially when there are many service calls, the order of magnitude of the generated service call information will also be large. Reporting the service call information regularly through the connectionless transport protocol can effectively solve problems such as high concurrency caused by the server needing to establish multiple connections to receive service call information.

[0037] Furthermore, an Agent can be pre-deployed on the server. The Agent corresponds to a specified port, and the UDP packet is reported to the specified port of the server, which is convenient for the Agent to process the reported UPD packet. Specifically, after receiving the reported service message dependency package, the Agent can store the service call information in the distributed message queue. Then, the service call information stored in the distributed message queue is parsed in sequence, and the dependency relationship of the service can be extracted correspondingly. The parsed service dependency relationship includes the project, service, and the service depending on other services, thereby determining the dependency relationship of the service on other services in the project. For convenient storage, the service dependency relationship can be stored in the form of key-value pairs to facilitate quickly finding the service dependency relationship. On the other hand, the key-value pair storage method can reduce the occupation of storage space.

[0038] In addition to including the project, service, and the service depending on other services, the service dependency relationship can also determine the dependency relationship of the service on other services at different time points according to the acquisition time. When the service dependency relationship changes, the service dependency relationship for past time points may no longer be stored, and other services on which the service depends can be adjusted according to the service dependency relationship at a time point closer to the current time point. The service dependency relationship can be updated, deleted, etc. regularly according to the acquisition time to ensure that the service dependency relationship conforms to the actual dependency relationship of the services running in the project.

[0039] In an optional embodiment, the service can specifically be the business function that can be actually executed; in addition to other business functions, other services also include components, middleware, etc., such as mysql, codis, etc. When switching computer rooms, according to the dependency relationship between the business function and other business functions, components, middleware, other business functions, components, and middleware are correspondingly adjusted to the switched computer room to ensure the normal operation of the service.

[0040] According to the service dependency analysis method provided by the present invention, at least one called service is intercepted based on the service call entry, and the context information of at least one service is obtained; the context information of at least one service is analyzed to obtain the corresponding service call information; the service call information is reported to the server for parsing to obtain the service dependency relationship. By dynamically obtaining the context information of the service through the service call entry for analysis, the service call information can be obtained without fully connecting the entire service link. And based on the service call information, the server can directly obtain the service dependency relationship through parsing, which is more concise and convenient. Further, the service call information is reported regularly through the connectionless transport protocol, which ensures that the network resources are not occupied when reporting the service call information. The single-machine reporting does not require establishing a connection, will not affect the normal execution of the service, and does not affect the service performance, etc.

[0041] Embodiment 2

[0042] Figure 2 The flowchart of the service dependency analysis method according to another embodiment of the present invention is shown, as Figure 2 shown, and the method includes the following steps:

[0043] Step S201, obtain the service namespace passed in during the service call according to the service call entry.

[0044] During the service call, the service call entry obtains the service namespace passed in by the service call. Among them, the service namespace corresponds to the service, and each service has its own service namespace.

[0045] Step S202, obtain the context information of at least one service according to the service namespace.

[0046] According to the service namespace, the service call entry can obtain the context information of the service corresponding to the service namespace.

[0047] Step S203, analyze the context information of at least one service to obtain the service call information.

[0048] Analyze the context information of the service, and obtain the service call information according to the analysis. Among them, the service call information includes the service namespace, the project it belongs to, the IP address, the port information, the namespace of the service that the service depends on other services, the number of times of calling other services, the acquisition time, the dependency relationship, etc.

[0049] Step S204, report the service call information to the server for parsing to obtain the service dependency relationship.

[0050] When parsing service call information, in addition to determining the service dependency relationship based on the service name space, the project to which it belongs, and the name spaces of other services on which the service depends, a call timestamp can also be generated during parsing. The call timestamp records the calls made by the service to other services at that call timestamp, and the strength of the dependency relationship between the service and other services can be calculated based on the number of calls to other services and the call timestamp. For example, by accumulating the cumulative number of calls made by the service to other services within a certain time period based on the call timestamp, the strength of the dependency relationship between the service and other services can be determined according to the cumulative number of calls made to other services. If the cumulative number of calls made to other services exceeds a preset threshold, it indicates that the strength of the dependency relationship between the service and other services is a strong dependency; if the cumulative number of calls made to other services is lower than the preset threshold, it indicates that the strength of the dependency relationship between the service and other services is a weak dependency.

[0051] Store the call timestamp to facilitate viewing other services that the service needs to call based on the call timestamp. Store the strength of the dependency relationship to ensure the normal startup of the service according to the strength of the dependency relationship when switching computer rooms. Specifically, when switching computer rooms, before starting the service, it is necessary to check the dependency relationship between the service and other services, start other services on which the service depends first, and then start the service to ensure the normal startup of the service. When the strength of the dependency relationship between the service and other services is a weak dependency, the failure to start other services with a weak dependency has a relatively small impact on the startup of the service; when the strength of the dependency relationship between the service and other services is a strong dependency, the failure to start other services with a strong dependency has a relatively large impact on the startup of the service, and may even cause the service to fail to start. For other services with a strong dependency, it is necessary to ensure that other services start normally before starting the service. Therefore, before starting the service, the normal startup of the service can be effectively ensured according to the strength of the dependency relationship, avoiding service startup failures, etc.

[0052] Step S205, display the dependency relationship of the service.

[0053] For the obtained dependency relationship of the service, the dependency relationship of the service can be displayed in a visual way to facilitate viewing other services called by the service at a glance. Specifically, the project to be queried, the service name space, etc. can be selected through a page, and according to the project to be queried and the service name space, the dependency relationship of the service corresponding to the service name space is queried and displayed. When displaying, it can be displayed according to the classification of the dependency relationship. For example, other services with a specified dependency relationship with the service and other services with an execution dependency relationship are displayed separately; or, when displaying, the call time to be queried is selected, and the dependency relationship of the service whose call timestamp belongs to the call time range is found and displayed, etc.

[0054] Further, when displaying the dependency relationships of services, to avoid overly complex displays, only the single-level dependency relationships of services are shown, preventing issues such as overly complex service dependency management and potential circular dependencies. For the possible multi-level dependency relationships of services, the next-level dependency relationships of services can be shown by selecting any other service in the single-level dependency relationships displayed on the page and querying to display the single-level dependency relationships of the selected other service.

[0055] According to the service dependency analysis method provided by the present invention, the service call information of services is parsed to obtain the dependency relationships of services. Based on the services, projects, and other services on which the services depend in the dependency relationships of services, the normal startup of services can be ensured when switching between different computer rooms. At the same time, visualizing the dependency relationships of services can make it easier to understand the dependency relationships of services and display the dependency relationships of corresponding services according to different query requirements.

[0056] Embodiment III

[0057] Embodiment III of the present application provides a non-volatile computer storage medium. The computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the service dependency analysis method in any of the above method embodiments.

[0058] The executable instruction can specifically be used to cause the processor to perform the following operations: intercept at least one called service according to the service call entry, and obtain the context information of at least one service; analyze the context information of at least one service to obtain service call information; report the service call information to the server for parsing to obtain the dependency relationships of services.

[0059] In an alternative embodiment, the executable instruction further causes the processor to perform the following operations: construct an image text file to store project information, and deploy the services corresponding to the project in a container; intercept at least one called service according to the service call entry, and obtain the context information of at least one service from the container.

[0060] In an alternative embodiment, the executable instruction further causes the processor to perform the following operations: initialize the project and the corresponding services, and pre-configure the context information of the services.

[0061] In an alternative embodiment, the executable instruction further causes the processor to perform the following operations: obtain the service name space passed in during service call according to the service call entry; according to the service name space, obtain the context information of at least one service.

[0062] In an alternative embodiment, the service call information includes a service namespace, the belonging project, an IP address, port information, the namespaces of other services that the service depends on, the number of times of calling other services, the acquisition time, and / or the dependency relationship; the dependency relationship includes a specified dependency relationship and / or an execution dependency relationship.

[0063] In an alternative embodiment, the service call information is a UDP packet; the executable instruction further causes the processor to perform the following operations: reporting the service call information to a specified port of the server at regular intervals through a connectionless transport protocol; storing the service call information in a distributed message queue; parsing the service call information stored in the distributed message queue in sequence, and correspondingly extracting the dependency relationship of the service, and storing the dependency relationship of the service in a key-value pair manner.

[0064] In an alternative embodiment, the executable instruction further causes the processor to perform the following operations: generating a call timestamp, and calculating the strength of the dependency relationship based on the number of times of calling other services and the call timestamp; storing the call timestamp of the service and the strength of the dependency relationship.

[0065] In an alternative embodiment, the executable instruction further causes the processor to perform the following operations: querying the dependency relationship of the service corresponding to the service namespace according to the project and service namespace to be queried; presenting the dependency relationship of the service.

[0066] Embodiment 4

[0067] Figure 3 FIG. shows a schematic structural diagram of an electronic device according to Embodiment 4 of the present invention. The specific implementation of the electronic device in the specific embodiments of the present invention is not limited.

[0068] As Figure 3 shown, the electronic device may include: a processor 302, a communication interface 304, a memory 306, and a communication bus 308.

[0069] Wherein:

[0070] The processor 302, the communication interface 304, and the memory 306 communicate with each other through the communication bus 308.

[0071] The communication interface 304 is used to communicate with network elements of other devices such as clients or other servers.

[0072] The processor 302 is used to execute the program 310, and specifically may execute the relevant steps in the embodiments of the above service dependency analysis method.

[0073] Specifically, the program 310 may include program code that includes computer operation instructions.

[0074] The processor 302 may be a central processing unit (CPU), or a specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. One or more processors included in the server may be of the same type, such as one or more CPUs; or may be of different types, such as one or more CPUs and one or more ASICs.

[0075] The memory 306 is used to store the program 310. The memory 306 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.

[0076] The program 310 is specifically used to cause the processor 302 to perform the following operations:

[0077] Intercept at least one called service according to the service call entry, obtain the context information of at least one service; analyze the context information of at least one service to obtain service call information; report the service call information to the server for parsing to obtain the dependency relationship of the service.

[0078] In an alternative embodiment, the program 310 is used to cause the processor 302 to construct an image text file to store project information, deploy the services corresponding to the project in a container; intercept at least one called service according to the service call entry, and obtain the context information of at least one service from the container.

[0079] In an alternative embodiment, the program 310 is used to cause the processor 302 to initialize the project and the corresponding services, and pre-configure the context information of the services.

[0080] In an alternative embodiment, the program 310 is used to cause the processor 302 to obtain the service namespace passed in during service call according to the service call entry; according to the service namespace, obtain the context information of at least one service.

[0081] In an alternative embodiment, the service call information includes service namespace, belonging project, IP address, port information, service dependency on other service namespaces, number of times of calling other services, acquisition time, and / or dependency relationship; the dependency relationship includes specified dependency relationship and / or execution dependency relationship.

[0082] In an alternative embodiment, the service call information is a UDP packet; the program 310 is used to cause the processor 302 to report the service call information to the specified port of the server at regular intervals through the connectionless transport protocol; store the service call information in the distributed message queue; and sequentially parse the service call information stored in the distributed message queue, and correspondingly extract the dependency relationship of the service, and store the dependency relationship of the service in the form of key-value pairs.

[0083] In an alternative embodiment, the program 310 is used to cause the processor 302 to generate a call timestamp, and calculate the strength of the dependency relationship according to the number of times of calling other services and the call timestamp; store the call timestamp of the service and the strength of the dependency relationship.

[0084] In an alternative embodiment, the program 310 is used to cause the processor 302 to query the dependency relationship of the service corresponding to the service namespace according to the item to be queried and the service namespace; display the dependency relationship of the service.

[0085] For the specific implementation of each step in the program 310, reference may be made to the corresponding descriptions in the corresponding steps in the foregoing service dependency analysis embodiment, which will not be elaborated here. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described devices and modules can refer to the corresponding process descriptions in the foregoing method embodiments, which will not be elaborated here.

[0086] Through the solution provided in this embodiment, at least one service called is intercepted according to the service call entry, and the context information of at least one service is obtained; the context information of at least one service is analyzed to obtain the corresponding service call information; the service call information is reported to the server for parsing to obtain the dependency relationship of the service. By dynamically obtaining the context information of the service through the service call entry for analysis to obtain the service call information, there is no need to fully connect the service link. And the server can directly obtain the service dependency relationship based on the service call information through parsing, which is more concise and convenient. Further, the service call information is reported regularly through the connectionless transport protocol, which ensures that the network resources are not occupied when reporting the service call information. There is no need to establish a connection for single-machine reporting, which will not affect the normal execution of the service and the service performance.

[0087] In the specification provided here, a large number of specific details are described. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies are not shown in detail so as not to obscure the understanding of this specification.

[0088] Similarly, it should be understood that, for the purpose of streamlining the present disclosure and assisting in understanding one or more of the various inventive aspects, in the foregoing description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected by the claims, the inventive aspects lie in less than all of the features of the single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate embodiment of the present invention.

[0089] Those skilled in the art will appreciate that the modules in the devices in the embodiments can be adaptively changed and disposed in one or more devices different from those of the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be adopted to combine all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature providing the same, equivalent, or similar purpose.

[0090] In addition, those skilled in the art will be able to understand that, although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of the present invention and forms different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.

[0091] It should be noted that the above embodiments illustrate the present invention rather than limit the present invention, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names.

Claims

1. A service dependency analysis method, which includes: Intercept at least one called service according to the service call entry, and obtain the context information of the at least one service from the container; wherein, the service is deployed in the container; Analyze the context information of the at least one service to obtain service call information; the service call information includes service namespace, the namespace of the service that the service depends on other services, and the number of times of calling other services; Report the service call information to the server for parsing to obtain the dependency relationship of the service; wherein, a call timestamp is generated, and the strength of the dependency relationship is calculated according to the number of times of calling other services and the call timestamp.

2. The method according to claim 1, wherein, the method further includes: Construct an image text file to store project information, and deploy the service corresponding to the project in the container.

3. The method according to claim 1, wherein, the method further includes: Initialize the project and the corresponding service, and pre-configure the context information of the service.

4. The method according to any one of claims 1-3, wherein, The intercepting at least one called service according to the service call entry and obtaining the context information of the at least one service further includes: Obtain the service namespace passed in during the service call according to the service call entry; According to the service namespace, obtain the context information of the at least one service.

5. The method according to any one of claims 1-3, wherein, The service call information further includes the project to which it belongs, ip address, port information, acquisition time, and / or dependency relationship; the dependency relationship includes a specified dependency relationship and / or an execution dependency relationship.

6. The method according to any one of claims 1-3, wherein, The service call information is a UDP packet; The reporting the service call information to the server for parsing to obtain the dependency relationship of the service further includes: Regularly report the service call information to the specified port of the server through a connectionless transport protocol; Store the service call information in a distributed message queue; Parse the service call information stored in the distributed message queue in sequence, and correspondingly extract the dependency relationship of the service, and store the dependency relationship of the service in a key-value pair manner.

7. The method according to claim 6, wherein, The parsing the service call information stored in the distributed message queue in sequence, and correspondingly extracting the dependency relationship of the service, and storing the dependency relationship of the service in a key-value pair manner further includes: Generate a call timestamp, and calculate the strength of the dependency relationship according to the number of times of calling other services and the call timestamp; Store the call timestamp and the strength of the dependency relationship of the service.

8. The method according to any one of claims 1-3, wherein, the method further includes: Query the dependency relationship of the service corresponding to the service namespace according to the project and service namespace to be queried; Display the dependency relationship of the service.

9. An electronic device, including: A processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the following operations: Intercept at least one called service according to a service call entry, and obtain context information of the at least one service from a container; wherein, the service is deployed in the container; Analyze the context information of the at least one service to obtain service call information; the service call information includes a service namespace, a namespace of other services on which the service depends, and the number of times of calling other services; Report the service call information to a server for parsing to obtain the dependency relationship of the service; wherein, a call timestamp is generated, and the strength of the dependency relationship is calculated according to the number of times of calling other services and the call timestamp.

10. The electronic device according to claim 9, wherein the executable instruction further causes the processor to perform the following operations: Construct an image text file to store project information, and deploy the service corresponding to the project in a container.

11. The electronic device according to claim 9, wherein the executable instruction further causes the processor to perform the following operations: Initialize the project and the corresponding service, and pre-configure the context information of the service.

12. The electronic device according to any one of claims 9-11, wherein the executable instruction further causes the processor to perform the following operations: Obtain the service namespace passed in during service call according to the service call entry; Obtain the context information of the at least one service according to the service namespace.

13. The electronic device according to any one of claims 9-11, wherein the service call information further includes the project to which it belongs, an IP address, port information, acquisition time, and / or dependency relationship; the dependency relationship includes a specified dependency relationship and / or an execution dependency relationship.

14. The electronic device according to any one of claims 9-11, wherein the service call information is a UDP packet; The executable instruction further causes the processor to perform the following operations: Regularly report the service call information to a specified port of the server through a connectionless transport protocol; Store the service call information in a distributed message queue; Parse the service call information stored in the distributed message queue in sequence, and correspondingly extract the dependency relationship of the service, and store the dependency relationship of the service in a key-value pair manner.

15. The electronic device according to claim 14, wherein the executable instruction further causes the processor to perform the following operations: Generate a call timestamp, and calculate the strength of the dependency relationship according to the number of times of calling other services and the call timestamp; Store the call timestamp and the strength of the dependency relationship of the service.

16. The electronic device according to any one of claims 9-11, wherein the executable instruction further causes the processor to perform the following operations: Query the dependency relationship of the service corresponding to the service namespace according to the project and service namespace to be queried; Display the dependency relationship of the service.

17. A computer storage medium stores at least one executable instruction, and the executable instruction causes a processor to perform the following operations: Intercept at least one service called according to a service call entry, and obtain context information of the at least one service from a container; Wherein, The service is deployed in a container; Analyze the context information of the at least one service to obtain service call information; The service call information includes a service namespace, a namespace of other services on which the service depends, and the number of times of calling other services; Report the service call information to a server for parsing to obtain the dependency relationship of the service; wherein, a call timestamp is generated, and the strength of the dependency relationship is calculated according to the number of times of calling other services and the call timestamp.

18. The computer storage medium according to claim 17, wherein the executable instruction further causes the processor to perform the following operations: Construct an image text file to store project information, and deploy the service corresponding to the project in a container.

19. The computer storage medium according to claim 17, wherein the executable instruction further causes the processor to perform the following operations: Initialize the project and the corresponding service, and pre-configure the context information of the service.

20. The computer storage medium according to any one of claims 17-19, wherein the executable instruction further causes the processor to perform the following operations: Obtain the service namespace passed in during service call according to the service call entry; Obtain the context information of the at least one service according to the service namespace.

21. The computer storage medium according to any one of claims 17-19, wherein the service call information further includes the project to which it belongs, an IP address, port information, acquisition time, and / or a dependency relationship; the dependency relationship includes a specified dependency relationship and / or an execution dependency relationship.

22. The computer storage medium according to any one of claims 17-19, wherein the service call information is a UDP packet; The executable instruction further causes the processor to perform the following operations: Regularly report the service call information to a specified port of the server through a connectionless transport protocol; Store the service call information in a distributed message queue; Parse the service call information stored in the distributed message queue in sequence, and correspondingly extract the dependency relationship of the service, and store the dependency relationship of the service in a key-value pair manner.

23. The computer storage medium according to claim 22, wherein the executable instruction further causes the processor to perform the following operations: Generate a call timestamp, and calculate the strength of the dependency relationship according to the number of times of calling other services and the call timestamp; Store the call timestamp and the strength of the dependency relationship of the service.

24. The computer storage medium according to any one of claims 17-19, wherein the executable instruction further causes the processor to perform the following operations: Query the dependency relationship of the service corresponding to the service namespace according to the project and service namespace to be queried; Display the dependency relationship of the service.

Citation Information

Patent Citations

  • Service calling link analysis method and system

    CN106790718A

  • Task execution method, device and equipment and storage medium

    CN109491777A