Service deployment graph construction method and device, equipment and storage medium

By obtaining computer port access data, configuration files, call chain logs and source code, a comprehensive network service deployment diagram is built, which solves the problem of inaccurate component access relationship identification in traditional methods, and realizes a more stable software environment.

CN120407430APending Publication Date: 2025-08-01GUOSEN SECURITIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510501644.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In software development and deployment environments, traditional methods find it difficult to accurately identify the access or call relationship between components, resulting in incomplete and inaccurate service deployment graph data.

Method used

By obtaining the access data, configuration files, call chain logs and source code of the computer port, combining network scanning tools and source code scanning tools, determining the access relationship between machines and services, and building a network service deployment diagram.

Benefits of technology

A comprehensive and accurate network service deployment diagram is built, which can mine access relationships at multiple levels to ensure the stability and maintenance of the software environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407430A_ABST
    Figure CN120407430A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, and discloses a service deployment graph construction method and device, equipment and a storage medium, and the method comprises the steps: obtaining access data of all computer ports, and determining a first machine access relationship between computers and a first service access relationship between services based on the access data; determining a second machine access relationship between the computers and a second service access relationship between the services based on the configuration file; determining a third service access relationship between the services based on the call chain log, and determining a fourth service access relationship between the services based on the source code; and constructing a network service deployment diagram according to the first machine access relation, the second machine access relation, the first service access relation, the second service access relation, the third service access relation and the fourth service access relation. Through the above mode, the embodiment of the invention can mine the access relationship more comprehensively, so that a comprehensive and accurate network service deployment graph is constructed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technologies, and particularly to a method, apparatus, device, and storage medium for constructing a service deployment diagram. Background Art

[0002] In the software development and deployment environment, due to the expansion of business, large components are gradually split into smaller components. Each component often needs to call multiple sub-service components to implement its functions, making the call chain complex. At the same time, to ensure software quality, multiple different test environments are usually deployed in the test environment. In these different test environments, how to accurately identify the access or call relationships between components is a current problem. The traditional method of identifying the access or call relationships between components through a single method, for example, identifying the access or call relationships between components through the call chain method, can only obtain relevant access or call data when there is an actual call, resulting in incomplete and inaccurate service deployment diagram data and unable to accurately identify the access or call relationships between components. Summary of the Invention

[0003] In view of the above problems, embodiments of the present invention provide a method, apparatus, device, and storage medium for constructing a service deployment diagram to solve the problems existing in the prior art.

[0004] According to one aspect of embodiments of the present invention, there is provided a method for constructing a service deployment diagram, including:

[0005] Obtaining access data of all computer ports in a predetermined software environment, and determining a first machine access relationship between the computers and a first service access relationship between the services based on the access data;

[0006] Detecting configuration files of service components of all the computers, and determining a second machine access relationship between the computers and a second service access relationship between the services based on the configuration files;

[0007] Obtaining call chain logs and source codes of each service of all the computers, determining a third service access relationship between the services based on the call chain logs, and determining a fourth service access relationship between the services based on the source codes;

[0008] Constructing a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship.

[0009] In an optional manner, the method further includes:

[0010] Obtain a technical design document and determine a fifth service access relationship between the services based on the technical design document;

[0011] Constructing a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship includes:

[0012] Construct the network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, the fourth service access relationship, and the fifth service access relationship.

[0013] In an alternative manner, the obtaining access data of all computer ports in a predetermined software environment and determining the first machine access relationship between the computers and the first service access relationship between the services based on the access data includes:

[0014] Filter non-service access data in the access data to obtain service access data, where the service access data at least includes IP addresses, ports, and service processes;

[0015] Determine the first machine access relationship based on the IP addresses of the service access data;

[0016] Determine a source computer and a target computer accessed and connected to the source computer based on the first machine access relationship, and determine the first service access relationship based on the service access data of the source computer and the service access data of the target computer.

[0017] In an alternative manner, the determining the first service access relationship based on the service access data of the source computer and the service access data of the target computer includes:

[0018] Determine a source port for accessing the target computer and a first service process bound to the source port based on the service access data of the source computer, determine a target port associated with the source computer and a second service process bound to the target port based on the service access data of the target computer, and determine the first service access relationship based on the first service process and the second service process.

[0019] In an alternative manner, detect configuration files of service components of all the computers and determine the second machine access relationship between the computers and the second service access relationship between the services based on the configuration files, including:

[0020] Detect the configuration files of the service components of all the computers, obtain access information based on the configuration files, and determine the second machine access relationship between the computers and the second service access relationship between the services based on the access information.

[0021] In an alternative manner, obtain the call chain logs and source codes of each service of all the computers, determine the third service access relationship between the services based on the call chain logs, and determine the fourth service access relationship between the services based on the source codes, including:

[0022] Extract the call chain logs of each service of all the computers, obtain the link IDs of the call chain logs, determine the service access links according to the link IDs, and generate the third service access relationship according to the service access links;

[0023] Scan the source codes of each service of all the computers based on a predetermined source code scanning tool, determine the service call source codes in the source codes, and determine the fourth service access relationship according to the service call source codes.

[0024] In an alternative manner, the constructing of the network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship includes:

[0025] Merge the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship, and delete the duplicate parts to obtain the total access relationship;

[0026] Construct the network service deployment diagram according to the total access relationship and perform visualization processing.

[0027] According to another aspect of the embodiments of the present invention, there is provided a service deployment diagram constructing device, and the service deployment diagram constructing device includes:

[0028] A first determining module, configured to obtain access data of all computer ports in a predetermined software environment, and determine a first machine access relationship between the computers and a first service access relationship between the services based on the access data;

[0029] A second determining module, configured to detect the configuration files of the service components of all the computers, and determine a second machine access relationship between the computers and a second service access relationship between the services based on the configuration files;

[0030] A third determination module, configured to obtain the call chain logs and source codes of each service of all the computers, determine a third service access relationship between the services based on the call chain logs, and determine a fourth service access relationship between the services based on the source codes;

[0031] A construction module, configured to construct a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship.

[0032] According to another aspect of the embodiments of the present invention, there is provided a computer device, including: a processor, a memory, a communication interface, and a communication bus, where the processor, the memory, and the communication interface complete mutual communication through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the method as described above.

[0033] According to another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, where at least one executable instruction is stored in the storage medium, and when the executable instruction runs on a computer device, it causes the computer device to execute the method as described above.

[0034] In this embodiment, the first machine access relationship between computers and the first service access relationship between services are determined by accessing data, the second machine access relationship between computers and the second service access relationship between services are determined by a configuration file, the third service access relationship between services is determined by call chain logs, and the fourth service access relationship between services is determined by source codes. A network service deployment diagram is constructed according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship. This embodiment combines the access data of computer ports, configuration files, call chain logs, and source codes to mine the machine and service access relationships at respective corresponding levels, can more comprehensively mine the access relationships, and thus construct a comprehensive and accurate network service deployment diagram.

[0035] The above description is only an overview of the technical solutions of the embodiments of the present invention. In order to be able to understand the technical means of the embodiments of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the embodiments of the present invention more obvious and understandable, the following specifically gives the specific embodiments of the present invention. Description of the Drawings

[0036] The drawings are only used to illustrate the embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0037] Figure 1 Shows a schematic flowchart of the service deployment diagram construction method provided by an embodiment of the present invention;

[0038] Figure 2 Shows a schematic diagram of determining the first machine access relationship in the service deployment diagram construction method provided by an embodiment of the present invention;

[0039] Figure 3 Shows a schematic structural diagram of the service deployment diagram construction device provided by an embodiment of the present invention;

[0040] Figure 4 Shows a schematic structural diagram of the computer device provided by an embodiment of the present invention. Detailed implementation manners

[0041] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein.

[0042] Figure 1 Shows a flowchart provided by an embodiment of the present invention, as Figure 2 shown, the method includes the following steps:

[0043] Step 101, obtain the access data of all computer ports in a predetermined software environment, and determine the first machine access relationship between the computers and the first service access relationship between the services based on the access data;

[0044] In this embodiment, the predetermined software environment is a software development and deployment environment. For example, it can be a test environment, and the test environment includes an automated test environment, an API test environment, a manual test environment, a stress test environment, etc. In this embodiment, the access data of all computer ports is scanned in real time or at regular intervals using a predetermined network scanning tool. The predetermined network scanning tool can be an Nmap tool and a netstat tool. Of course, other network scanning tools can also be used. The Nmap tool scans the ports of the target computer through various port scanning techniques, such as TCP SYN scanning, TCP Connect scanning, UDP scanning, etc., so as to obtain the relevant data of each port, including the open ports, etc. The netstat tool can be used to check the network connection status of each port of the computer, so as to obtain the access data of the port. Among them, the access data includes information such as service processes, ports, and computer identifiers. Among them, the computer identifier includes at least an IP address. The external access data is the access data of an external computer accessing this computer, and the access to external data is the access data of this computer accessing an external computer.

[0045] Among them, obtaining access data of all computer ports in a predetermined software environment and determining a first machine access relationship between the computers and a first service access relationship between services based on the access data includes:

[0046] Filtering out non-service access data in the access data to obtain service access data, where the service access data at least includes an IP address, a port, and a service process;

[0047] Determining the first machine access relationship based on the IP addresses of the service access data;

[0048] Determining a source computer and a target computer accessed and connected to the source computer based on the first machine access relationship, and determining the first service access relationship based on the service access data of the source computer and the service access data of the target computer.

[0049] In this embodiment, the access data includes service access data and non-service access data. The non-service access data includes machine proxy service data, time synchronization service data, log collection service data, etc. These non-service access data do not involve access to other external computers, so they are filtered out.

[0050] For each computer, its corresponding service access data is obtained by scanning. The access relationship between this computer and other computers can be determined through the IP addresses in the service access data, thereby establishing a first machine access relationship between the computers. Exemplarily, as Figure 2 shown, computer A accesses computer B and D, and computer B accesses computer C. By integrating and merging the access relationships of each computer, the first machine access relationships A - B, D, B - C can be obtained.

[0051] In this embodiment, the source computer and the target computer accessed and connected to the source computer can be determined through the first machine access relationship. Through the service access data of the source computer and the service access data of the target computer, it can be determined which service bound to which port of the source computer accessed which service bound to which port of the target computer, thereby establishing a first service access relationship between the services.

[0052] Among them, determining the first service access relationship based on the service access data of the source computer and the service access data of the target computer includes:

[0053] Determine the source port for accessing the target computer and the first service process bound to the source port based on the service access data of the source computer, determine the target port associated with the source computer and the second service process bound to the target port based on the service access data of the target computer, and determine the first service access relationship based on the first service process and the second service process.

[0054] Among them, there are multiple pieces of service access data for both the source computer and the target computer. Generally, one piece of service access data for each computer corresponds to one network access.

[0055] The service access data of the source computer includes the IP address of the source computer itself, the source port, and the first service process bound to the source port, and also includes the IP address and port of the target computer. The service access data of the target computer includes the IP address of the target computer itself, the target port, and the second service process bound to the target port, and also includes the IP address and port of the source computer.

[0056] Taking the source computer as computer A and the target computer as computer B as an example, computer A (with IP address 1.1.1.1 and port 5000) accesses computer B (with IP address 2.2.2.2 and port 80). The service access data obtained by scanning computer A includes the IP address 1.1.1.1, port 5000, the first service process bound to port 5000, the IP address 2.2.2.2 and port 80 of computer B. The service access data obtained by scanning computer B includes the IP address 2.2.2.2, port 80, the second service process bound to port 80, and the IP address 1.1.1.1 and port 5000 of computer A.

[0057] Then, through the service access data of computer A, it can be determined that the port for accessing computer B is 5000 and the first service process bound to the source port 5000. Through the service access data of computer B, it can be determined that one piece of service access data corresponding to computer A for the IP address 1.1.1.1, and thus the port 80 of computer B and the second service process bound to port 80 can be obtained from this piece of service access data corresponding to the IP address 1.1.1.1. Then, through the service processes bound to ports 80 and 50000, it can be obtained that the first service process bound to port 80 is the A service process, and the second service process bound to port 50000 is the B service process, that is, it can be obtained that the A service of computer A accesses the B service of computer B. By analogy, after integrating and merging the access relationships of the services of each computer, the first service access relationship can be obtained. Among them, each service in the first service access relationship also identifies the computer where the service is located, for example, it identifies the IP address where the service is located.

[0058] In this embodiment, by scanning the access data of all computer ports in the software environment and establishing the first machine access relationship between computers and the first service access relationship between services based on the access data, a comprehensive and accurate access relationship can be obtained at the port access level.

[0059] Step 102: Detect the configuration files of the service components of all the computers, and determine the second machine access relationship between the computers and the second service access relationship between the services based on the configuration files.

[0060] In this embodiment, for each service, if the service needs to access other services, configuration information for accessing other services needs to be configured for the service. The configuration file for the service to access other services is generally in the running directory of the service program. In this embodiment, the configuration file is obtained by scanning the running directory of the service program in real time or at regular intervals. The configuration file includes configuration information such as network connection configuration information, service configuration information, and running environment configuration information. Among them, the network connection configuration information includes the access information for the service to access other services. For example, if Service A needs to access the authentication service, information such as the IP address or domain name address of the authentication service machine needs to be configured for Service A.

[0061] Among them, detecting the configuration files of the service components of all the computers and determining the second machine access relationship between the computers and the second service access relationship between the services based on the configuration files includes: detecting the configuration files of the service components of all the computers, obtaining access information based on the configuration files, and determining the second machine access relationship between the computers and the second service access relationship between the services based on the access information.

[0062] In this embodiment, the access information includes location information such as the IP address, domain name, or host name for accessing other services to locate the target service, and also includes the ports for accessing other services, such as port 3306 of the database, port 6379 of Redis, etc. Of course, other information is also included, including the protocol type, etc. By detecting the configuration files corresponding to the service components of all computers, the access information for each service to access other services can be obtained. The second machine access relationship between computers can be constructed through the IP address, domain name, or host name. For example, Computer A accesses Computer B, and Computer B accesses Computer C. After integrating and merging the access relationships of each computer, the second machine access relationship can be obtained; and the second service access relationship between services can be constructed through the IP address, domain name, or host name, etc. For example, Service A of Computer A accesses Service B of Computer B. After integrating and merging the access relationships of the services of each computer, the second service access relationship can be obtained.

[0063] In this embodiment, as long as the access information related to the service component configuration is available, the second machine access relationship between computers and the second service access relationship between services can be established through the access information, so as to further mine accurate access relationships at the service component level.

[0064] Step 103: Obtain the call chain logs and source codes of each service of all the computers, determine the third service access relationship between the services based on the call chain logs, and determine the fourth service access relationship between the services based on the source codes.

[0065] In this embodiment, the call chain logs of each service of each computer are collected in real time or at regular intervals. The call chain logs can be Dapper logs or Zipkin logs, etc. The call chain logs contain information such as services, traceids, and computer identifiers. Through the chain logs, the third service access relationship between services can be determined. For example, service B of computer B accesses service C of computer C. After integrating and merging the access relationships of the services of each computer, the third service access relationship can be obtained.

[0066] In this embodiment, a predetermined source code scanning tool is used to scan and analyze the source codes. Since the source codes may contain the identifiers of the computers but will contain the characteristic information of calling downstream services, by identifying this characteristic information of calling downstream services, the fourth service access relationship between services can be determined. For example, service C of computer C accesses service D of computer D. After integrating and merging the access relationships of the services of each computer, the fourth service access relationship can be obtained.

[0067] Among them, obtaining the call chain logs and source codes of each service of all the computers, determining the third service access relationship between the services based on the call chain logs, and determining the fourth service access relationship between the services based on the source codes includes:

[0068] Extract the call chain logs of each service of all the computers, obtain the link IDs of the call chain logs, determine the service access links according to the link IDs, and generate the third service access relationship according to the service access links; scan the source codes of each service of all the computers using a predetermined source code scanning tool, determine the service call source codes in the source codes, and determine the fourth service access relationship according to the service call source codes.

[0069] In this embodiment, different service requests will have different unique traceids. The call chain logs of all services are aggregated and distinguished by traceid. Services with the same traceid are grouped into a set, thereby sorting out multiple access links to services. Each access link has the same traceid, and different access links have different traceids. For example: Service A -> Service B -> Service C. In this embodiment, the service access relationships covered by the call chain logs can be continuously complemented. In this embodiment, as long as a service has relevant call chain logs, a third service access relationship between services can be established through the call chain logs, so as to further mine accurate access relationships at the level of call chain logs.

[0070] In this embodiment, the service call source code in the source code includes code for accessing other services through the SDK, Http access functions, URL access functions, TCP access functions, remote call functions, and interface code for accessing other services, etc. By detecting whether the code for accessing other services through the SDK appears in the source code, it is determined whether the service of the source code accesses other services. In addition, if Http access functions, URL access functions, TCP access functions, remote call functions, etc. appear in the source code, it can also be determined that the service of the source code accesses other services. In addition, if interface code for accessing other services appears in the source code, it can also be determined that the service of the source code accesses other services. In this embodiment, through the detection of the source code, a fourth service access relationship between services can be established. In this embodiment, through the detection of the source code, accurate access relationships can be further mined at the level of the source code.

[0071] Step 104, construct a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship.

[0072] This embodiment specifically includes: merging the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship, and deleting the duplicate parts to obtain the total access relationship; constructing the network service deployment diagram according to the total access relationship and performing visualization processing.

[0073] In this embodiment, first, the first machine access relationship and the second machine access relationship are merged, and the duplicate parts are deleted, so as to obtain an overall machine access relationship. At the same time, the first service access relationship and the second service access relationship are merged, and the duplicate parts are deleted, so as to obtain an overall service access relationship. Then, the overall machine access relationship is compared with the overall service access relationship. The duplicate parts of the two can be deleted, and it is confirmed whether there are any omissions or inconsistencies between the two, so as to obtain the access relationship after comparison. Finally, based on the third service access relationship and the fourth service access relationship, the above-mentioned access relationship after comparison is checked and complemented to obtain the total access relationship. According to the total access relationship, a network service deployment diagram is constructed and visualized, so that the network service deployment diagram can be intuitively displayed.

[0074] In this embodiment, various methods are used to mine the call access relationship. Once an incorrect or missing access relationship is found, it can be automatically complemented, so as to realize the construction of a complete network service deployment diagram, which is crucial for the stable maintenance of the software environment, can effectively cope with the challenges faced in the current software development and testing processes, and provide strong support for the software environment maintenance.

[0075] In this embodiment, the first machine access relationship between computers and the first service access relationship between services are determined through access data, the second machine access relationship between computers and the second service access relationship between services are determined through a configuration file, the third service access relationship between services is determined through call chain logs, and the fourth service access relationship between services is determined through source code. A network service deployment diagram is constructed according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship. This embodiment combines the access data of computer ports, configuration files, call chain logs, and source code to mine the machine and service access relationships at various corresponding levels, and can more comprehensively mine the access relationships, so as to construct a comprehensive and accurate network service deployment diagram.

[0076] In one embodiment, on the basis of the above embodiment, the service deployment diagram construction method further includes:

[0077] Obtain a technical design document, and determine the fifth service access relationship between the services based on the technical design document;

[0078] Constructing a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship includes: constructing the network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, the fourth service access relationship, and the fifth service access relationship.

[0079] In this embodiment, when each service or function is designed technically, the specific implementation details of the service will be determined, including API calls, database access, etc., and they will be recorded in the technical design document. By identifying the technical design document in this embodiment, relevant data such as API calls and database access can be obtained. Through these data such as API calls and database access, the fifth service access relationship between services can be obtained. For example, the D service of computer D accesses the E service of computer E. After integrating and merging the access relationships of the services of each computer, the fifth service access relationship can be obtained. In this embodiment, by identifying the technical design document, the fifth service access relationship between services can be established. In this embodiment, through the identification of the technical design document, the accurate access relationship can be further mined at the level of the technical design document.

[0080] Further, based on the third service access relationship, the fourth service access relationship, and the fifth service access relationship, this embodiment checks and completes the above-mentioned compared access relationships to obtain the total access relationship, constructs a network service deployment diagram according to the total access relationship, and further obtains a more comprehensive and accurate network service deployment diagram.

[0081] Figure 3 The structural schematic diagram of the service deployment diagram construction device according to the embodiment of the present invention is shown. As Figure 3 shown, the service deployment diagram construction device 300 includes:

[0082] A first determination module 301, configured to obtain access data of all computer ports in a predetermined software environment, and determine the first machine access relationship between the computers and the first service access relationship between the services based on the access data;

[0083] A second determination module 302, configured to detect configuration files of service components of all the computers, and determine the second machine access relationship between the computers and the second service access relationship between the services based on the configuration files;

[0084] A third determination module 303, configured to obtain the call chain logs and source codes of the services of all the computers, determine a third service access relationship between the services based on the call chain logs, and determine a fourth service access relationship between the services based on the source codes;

[0085] A construction module 304, configured to construct a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship.

[0086] Wherein, the embodiments of the service deployment diagram construction apparatus 300 are basically the same as the embodiments of the above service deployment diagram construction method, and reference can be made to the above embodiments.

[0087] Figure 4 The structural schematic diagram of the computer device embodiment of the present invention is shown, and the specific implementation of the computer device in the specific embodiments of the present invention is not limited.

[0088] As Figure 4 shown, the computer device may include: a processor 402, a communication interface 404, a memory 406, and a communication bus 408.

[0089] Wherein: the processor 402, the communication interface 404, and the memory 406 communicate with each other through the communication bus 408. The communication interface 404 is used to communicate with network elements of other computer devices such as clients or other servers. The processor 402 is configured to execute the program 410, and specifically may execute the relevant steps in the computer device embodiments described above.

[0090] Specifically, the program 410 may include program codes, and the program codes include computer-executable instructions.

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

[0092] A memory 406 for storing a program 410. The memory 406 may include high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.

[0093] The program 410 can be specifically called by the processor 402 to cause the computer device to perform the following operations:

[0094] Obtain access data of all computer ports in a predetermined software environment, and determine a first machine access relationship between the computers and a first service access relationship between the services based on the access data;

[0095] Detect configuration files of service components of all the computers, and determine a second machine access relationship between the computers and a second service access relationship between the services based on the configuration files;

[0096] Obtain call chain logs and source codes of each service of all the computers, determine a third service access relationship between the services based on the call chain logs, and determine a fourth service access relationship between the services based on the source codes;

[0097] Construct a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship.

[0098] In an alternative manner, the method further includes:

[0099] Obtain a technical design document, and determine a fifth service access relationship between the services based on the technical design document;

[0100] The constructing the network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship includes:

[0101] Construct the network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, the fourth service access relationship, and the fifth service access relationship.

[0102] In an alternative manner, the obtaining access data of all computer ports in a predetermined software environment and determining a first machine access relationship between the computers and a first service access relationship between the services based on the access data includes:

[0103] Filter out non-service access data in the access data to obtain service access data, where the service access data includes at least an IP address, a port, and a service process;

[0104] Determine the first machine access relationship based on the IP address of the service access data;

[0105] Determine the source computer and the target computer accessed and connected to the source computer based on the first machine access relationship, and determine the first service access relationship based on the service access data of the source computer and the service access data of the target computer.

[0106] In an alternative approach, the determining the first service access relationship based on the service access data of the source computer and the service access data of the target computer includes:

[0107] Determine the source port for accessing the target computer and the first service process bound to the source port based on the service access data of the source computer, determine the target port associated with the source computer and the second service process bound to the target port based on the service access data of the target computer, and determine the first service access relationship based on the first service process and the second service process.

[0108] In an alternative approach, detecting configuration files of service components of all the computers and determining the second machine access relationship between the computers and the second service access relationship between the services based on the configuration files includes:

[0109] Detect configuration files of service components of all the computers, obtain access information based on the configuration files, and determine the second machine access relationship between the computers and the second service access relationship between the services based on the access information.

[0110] In an alternative approach, obtaining call chain logs and source codes of each service of all the computers, determining the third service access relationship between the services based on the call chain logs, and determining the fourth service access relationship between the services based on the source codes includes:

[0111] Extract call chain logs of each service of all the computers, obtain the link ID of the call chain logs, determine the service access link according to the link ID, and generate the third service access relationship according to the service access link;

[0112] Scan the source codes of each service of all the computers based on a predetermined source code scanning tool, determine the service call source codes in the source codes, and determine the fourth service access relationship according to the service call source codes.

[0113] In an alternative approach, constructing a network service deployment diagram based on the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship includes:

[0114] Merge the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship, and delete the duplicate parts to obtain the total access relationship;

[0115] Construct the network service deployment diagram according to the total access relationship and perform visualization processing.

[0116] An embodiment of the present invention provides a computer-readable storage medium. The storage medium stores at least one executable instruction. When the executable instruction runs on a computer device, the computer device is caused to execute any of the above method embodiments.

[0117] An embodiment of the present invention provides a computer program. The computer program can be called by a processor to cause a computer device to execute any of the above method embodiments.

[0118] An embodiment of the present invention provides a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions run on a computer, the computer is caused to execute any of the above method embodiments.

[0119] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings provided herein. The structure required to construct such a system will be apparent from the above description. In addition, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the present invention described herein can be implemented using various programming languages, and the descriptions of specific languages above are for disclosing the best mode of the present invention.

[0120] In the specification provided herein, a large number of specific details are set forth. 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 have not been shown in detail so as not to obscure the understanding of this specification.

[0121] Similarly, it should be understood that, in order to streamline the present invention and assist in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into 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.

[0122] Those skilled in the art can understand that the modules in the computer device in the embodiments can be adaptively changed and arranged in one or more computer devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and 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 used 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 computer 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 that provides the same, equivalent, or similar purpose.

[0123] 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 claim. 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. In the unit claims listing several devices, several of these devices can be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.

Claims

1. A method for constructing a service deployment diagram, characterized in that The method includes: Obtaining access data of all computer ports in a predetermined software environment, and determining a first machine access relationship between the computers and a first service access relationship between the services based on the access data; Detecting configuration files of service components of all the computers, and determining a second machine access relationship between the computers and a second service access relationship between the services based on the configuration files; Obtaining call chain logs and source codes of each service of all the computers, determining a third service access relationship between the services based on the call chain logs, and determining a fourth service access relationship between the services based on the source codes; Constructing a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship.

2. The method according to claim 1, characterized in that, The method further includes: Obtaining a technical design document, and determining a fifth service access relationship between the services based on the technical design document; The constructing a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship includes: Constructing the network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, the fourth service access relationship, and the fifth service access relationship.

3. The method according to claim 1, characterized in that The obtaining access data of all computer ports in a predetermined software environment, and determining a first machine access relationship between the computers and a first service access relationship between the services based on the access data includes: Filtering non-service access data in the access data to obtain service access data, where the service access data at least includes an IP address, a port, and a service process; Determining the first machine access relationship based on the IP addresses of the service access data; Determining a source computer and a target computer accessed and connected to the source computer based on the first machine access relationship, and determining the first service access relationship based on the service access data of the source computer and the service access data of the target computer.

4. The method according to claim 3, characterized in that, The determining the first service access relationship based on the service access data of the source computer and the service access data of the target computer includes: Determining a source port accessing the target computer and a first service process bound to the source port based on the service access data of the source computer, determining a target port associated with the source computer and a second service process bound to the target port based on the service access data of the target computer, and determining the first service access relationship based on the first service process and the second service process.

5. The method according to claim 1, wherein Detecting configuration files of service components of all the computers, and determining a second machine access relationship between the computers and a second service access relationship between the services based on the configuration files includes: Detect the configuration files of the service components of all the computers, obtain access information based on the configuration files, and determine the second machine access relationship between the computers and the second service access relationship between the services based on the access information.

6. The method according to claim 1, characterized in that, Obtain the call chain logs and source codes of each service of all the computers, determine the third service access relationship between the services based on the call chain logs, and determine the fourth service access relationship between the services based on the source codes, including: Extract the call chain logs of each service of all the computers, obtain the link IDs of the call chain logs, determine the service access links according to the link IDs, and generate the third service access relationship according to the service access links; Scan the source codes of each service of all the computers based on a predetermined source code scanning tool, determine the service call source codes in the source codes, and determine the fourth service access relationship according to the service call source codes.

7. The method according to claim 1, characterized in that, Construct a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship, including: Merge the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship, and delete the duplicate parts to obtain the total access relationship; Construct the network service deployment diagram according to the total access relationship and perform visualization processing.

8. A service deployment diagram construction device, characterized in that, The service deployment diagram construction device includes: A first determination module, configured to obtain access data of all computer ports in a predetermined software environment, and determine the first machine access relationship between the computers and the first service access relationship between the services based on the access data; A second determination module, configured to detect the configuration files of the service components of all the computers, and determine the second machine access relationship between the computers and the second service access relationship between the services based on the configuration files; A third determination module, configured to obtain the call chain logs and source codes of each service of all the computers, determine the third service access relationship between the services based on the call chain logs, and determine the fourth service access relationship between the services based on the source codes; A construction module, configured to construct a network service deployment diagram according to the first machine access relationship, the second machine access relationship, the first service access relationship, the second service access relationship, the third service access relationship, and the fourth service access relationship.

9. A computer device, characterized in that, Including: A processor, a memory, a communication interface, and a communication bus, and 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 execute the method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, At least one executable instruction is stored in the storage medium, and when the executable instruction runs on a computer device, the computer device is caused to execute the method according to any one of claims 1-7.