Method, device and storage medium for determining service relationship of computer

Through obtaining and grouping service configuration data, generating sub -chart information and determining the service level, solving the problem of difficulty determining service relationships in the service architecture, and realizing the rapid positioning of the service relationship and the rapid positioning of performance problems.

CN114301785BActive Publication Date: 2025-01-24HILLSTONE NETWORKS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111663160.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-01-24
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

It is difficult for prior art to accurately and clearly determine the relationship between computer services in service architectures.

Method used

By obtaining the service configuration data of the computer, each service is grouped according to the dependency relationship between services, subgraph information is generated, and the hierarchical information of the service is determined based on the in-degree value and out-degree value of the service, and finally the relationship between services is displayed. relation.

Benefits of technology

The accurate and clear determination of the relationship between computer services in the service architecture is achieved, and through the drawing and display of the sub -map, it helps quickly locate and solve performance problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114301785B_ABST
    Figure CN114301785B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and storage medium for determining the service relationship of a computer. The method includes: obtaining the service configuration data of the computer; grouping the services contained in each computer according to the dependency relationship to obtain multiple service groups, generating subgraph information corresponding to each service group, and adding the subgraph information contained in the computer to the service configuration data of the computer; determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, and adding the hierarchical information of the service to the subgraph information to obtain the updated service configuration data of the computer; displaying the relationship between the services contained in the computer according to the updated service configuration data of the computer. Through the present application, the problem that the relationship between computer services in the service architecture cannot be accurately and clearly determined in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of the Internet, and in particular to a method, device and storage medium for determining a service relationship of a computer. Background Art

[0002] In large projects, the service architecture will contain dozens or even hundreds of service nodes. Often, a request will be designed to multiple microservices. It becomes an urgent problem to find out which service nodes are passed through in a request link and how each service node performs. Service applications can usually provide some functions to users locally and through the network, such as client / server applications, web servers, database servers, and other server-based applications. Services can be interdependent. When users visit a website, they visit the web service server, and the website's data may be provided by the database server; from the user's perspective, the service is layered, and the user directly faces the web service, while the database service does not interact directly with the user. The APM system can help understand system behavior and tools for analyzing performance problems so that when a failure occurs, the problem can be quickly located and solved. Among them, displaying service dependencies, service quality and other information in the form of relationship diagrams is an important means.

[0003] JavaScript frameworks such as Cytoscape.js and D3.js have been widely used in Web application development and are often used to add a variety of dynamic functions to web pages to provide users with smoother and more interactive browsing effects. In particular, interactive Cavans or Svg-type relationship diagrams can be freely drawn by calling the interface provided by the framework. By using JavaScript drawing framework libraries such as Cytoscape.js and D3.js and writing related Javascript plug-ins, the above-mentioned relationships between computer services can be drawn in the form of relationship diagrams. However, the default built-in drawing schemes of the above frameworks can only draw specific relationship diagrams, such as bundle diagrams, tree diagrams, force-directed diagrams, etc., and cannot intuitively depict the relationship diagrams of computer services with dependency and hierarchical characteristics.

[0004] With respect to the problem in the related art that the relationship between computer services in the service architecture cannot be accurately and clearly determined, no effective solution has been proposed yet. Summary of the invention

[0005] The present application provides a method, device and storage medium for determining service relationships of a computer, so as to solve the problem in the related art that the relationship between computer services in a service architecture cannot be accurately and clearly determined.

[0006] According to one aspect of the present application, a method for determining the service relationship of a computer is provided. The method includes: obtaining the service configuration data of the computer, wherein the service configuration data includes: information of the computer, services included in the computer, and dependency relationships between services, wherein the dependency relationship includes dependency and being depended on; grouping the services included in each computer according to the dependency relationship to obtain multiple service groups, generating subgraph information corresponding to each service group, and adding the subgraph information included in the computer to the service configuration data of the computer, wherein there is no dependency relationship between services in different service groups; determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, and adding the hierarchical information of the service to the subgraph information to obtain the updated service configuration data of the computer; and displaying the relationship between the services included in the computer according to the updated service configuration data of the computer.

[0007] Optionally, the services included in each computer are grouped according to dependencies to obtain multiple service groups, including: obtaining any service that does not carry a first identifier to obtain a first target service, wherein the first identifier is used to indicate that it has not been accessed during the grouping process; obtaining a service that has a dependency relationship with the first target service to obtain a second service, and forming an initial service group based on the first target service and the second service; determining whether there is a second service that does not carry the first identifier in the second service, and if so, obtaining the second service that does not carry the first identifier to obtain the second target service; determining whether there is a service that has a dependency relationship with the second target service and does not carry the first identifier, and if so, obtaining a service that has a dependency relationship with the second target service and does not carry the first identifier to obtain a third service, and updating the initial service group based on the third service until there is no service that does not carry the first identifier in the initial service group, and determining the updated initial service group as a service group.

[0008] Optionally, before determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, the method also includes: determining a service with an in-degree value of zero in each service group, obtaining a target service, and obtaining a service that has a dependency relationship with the target service, reducing the in-degree value of the service that has a dependency relationship with the target service by one, and obtaining a service with an in-degree value of zero; determining the service with an in-degree value of zero as the updated target service, and executing the steps of obtaining a service that has a dependency relationship with the target service and reducing the in-degree value of the service that has a dependency relationship with the target service by one, until there is no service with an in-degree value of zero in the service group; judging whether there are still services in the service group, and if there are no services in the service group, determining that the subgraph corresponding to the service group is a directed acyclic graph, and if there are services in the service group, determining that the subgraph corresponding to the service group is a directed cyclic graph.

[0009] Optionally, when the subgraph corresponding to the service group is a directed acyclic graph, determining the level information of the service according to the in-degree value and out-degree value of the service in each subgraph information includes: obtaining services with in-degree values ​​of zero in the service group, and determining the level of the services with in-degree values ​​of zero as level one; obtaining services that have a dependency relationship with level one services, and determining the level of the services that have a dependency relationship with the level one services as level two; obtaining services that have a dependency relationship with level two services, and determining the level of the services that have a dependency relationship with the level two services as level three, until there is no next level service.

[0010] Optionally, when the subgraph corresponding to the service group is a directed cyclic graph, determining the hierarchical information of the service based on the in-degree value and out-degree value of the service in each subgraph information includes: obtaining the difference between the in-degree and out-degree of each service in the subgraph information; sorting the services in the service group in descending order according to the difference between the in-degree and out-degree to obtain the sorting result, and determining the hierarchical information of each service based on the sorting result.

[0011] Optionally, displaying the relationship between services included in the computer according to the updated service configuration data of the computer includes: obtaining all sub-graph information included in the updated service configuration data of the computer; generating a relationship graph of the corresponding service group according to each sub-graph information, obtaining multiple relationship graphs, and displaying the multiple relationship graphs.

[0012] Optionally, a relationship graph of a corresponding service group is generated based on each sub-graph information, and multiple relationship graphs are obtained, including: obtaining the services contained in the sub-graph information, the connection relationship between the services, and the hierarchical information of the services; determining a first display width between services of different levels, and determining a second display width between services of the same level; generating a relationship graph of the service group corresponding to the sub-graph information based on the connection relationship between the services, the first display width, and the second display width.

[0013] According to another aspect of the present application, a device for determining the service relationship of a computer is provided. The device includes: an acquisition unit, which is used to acquire the service configuration data of the computer, wherein the service configuration data includes: information of the computer, services included in the computer, and dependencies between services, wherein the dependencies include dependency and dependence; a grouping unit, which is used to group the services included in each computer according to the dependencies, obtain multiple service groups, generate subgraph information corresponding to each service group, and add the subgraph information included in the computer to the service configuration data of the computer, wherein there is no dependency between services in different service groups; a first determination unit, which is used to determine the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, and add the hierarchical information of the service to the subgraph information, to obtain the updated service configuration data of the computer; a display unit, which is used to display the relationship between the services included in the computer according to the updated service configuration data of the computer.

[0014] According to another aspect of an embodiment of the present invention, a nonvolatile storage medium is provided. The nonvolatile storage medium is used to store a program. When the program is running, the device where the nonvolatile storage medium is located is controlled to execute a method for determining a service relationship of a computer.

[0015] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising a processor and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the computer-readable instructions execute a method for determining a service relationship of a computer when executed.

[0016] Through this application, the following steps are adopted: obtaining the service configuration data of the computer, wherein the service configuration data includes: information of the computer, services included in the computer, and dependencies between services, wherein the dependencies include dependency and dependence; grouping the services included in each computer according to the dependencies to obtain multiple service groups, generating subgraph information corresponding to each service group, and adding the subgraph information included in the computer to the service configuration data of the computer, wherein there is no dependency between services in different service groups; determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, and adding the hierarchical information of the service to the subgraph information to obtain the updated service configuration data of the computer; displaying the relationship between the services included in the computer according to the updated service configuration data of the computer, solving the problem that the relationship between computer services in the service architecture cannot be accurately and clearly determined in the related art. By determining the subgraph information, hierarchical information and dependency between services of each service, drawing and displaying the subgraph, and determining the computer corresponding to the service by enriching the configuration information of the service, the effect of accurately and clearly determining the relationship between computer services in the service architecture is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a flowchart of a method for determining a service relationship of a computer provided in an embodiment of the present application;

[0019] Figure 2 It is a dependency graph of an optional computer service provided according to an embodiment of the present application;

[0020] Figure 3 It is a dependency graph of an optional computer service provided according to an embodiment of the present application;

[0021] Figure 4 It is a dependency graph of an optional computer service provided according to an embodiment of the present application;

[0022] Figure 5 is a relationship diagram of an optional computer service provided according to an embodiment of the present application;

[0023] Figure 6 It is a schematic diagram of a device for determining a service relationship of a computer provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] According to an embodiment of the present application, a method for determining a service relationship of a computer is provided.

[0028] Figure 1 1 is a flow chart of a method for determining a service relationship of a computer according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0029] Step S102, obtaining service configuration data of the computer, wherein the service configuration data includes: information of the computer, services included in the computer, and dependency relationships between services, wherein the dependency relationship includes dependency and being dependent.

[0030] Specifically, as shown in Table 1, the services included in the computer may include configuration data of the service, including a unique identification service ID, a service type (database service, web service, etc.), a unique identification of the computer to which it belongs, a service delay time, a service jitter time, a service packet loss, an out-degree value, an in-degree value, an out-degree difference value, and other information.

[0031] Table 1

[0032] name meaning id Unique service ID type Service type (database service, web service, etc.) vmId Unique ID of the computer delay Service delay time jitter Service jitter time lossrate Service Packet Loss in In-degree value out Out-degree value out_in In-degree difference … …

[0033] As shown in Table 2, the computer information may include the computer's unique identifier, computer name, and other information. Since computer services are distinguished in the form of "IP+port", the service ID may be the service's unique identifier IP+port.

[0034] Table 2

[0035] Object property name meaning vmId Unique service ID Name Computer Name … …

[0036] As shown in Table 3, the dependency information between services may include the dependent service ID and the dependent service ID, wherein the dependent service may be defined as the source in the dependency, and the dependent service may be defined as the target in the dependency. When making a service call, the dependent service needs to obtain information from the dependent service. If an exception occurs in the dependent service, the dependent service will also generate an exception.

[0037] Table 3

[0038] Object property name meaning source Dependent service id target The dependent service id

[0039] Step S104, grouping the services included in each computer according to the dependency relationship to obtain multiple service groups, generating subgraph information corresponding to each service group, and adding the subgraph information included in the computer to the service configuration data of the computer, wherein there is no dependency relationship between services in different service groups.

[0040] Specifically, since each service has a unique service ID, and each dependency relationship can indicate the connection between two services, services can be grouped according to the service ID and the dependency relationship. Two services with a dependency relationship can be grouped together, and multiple services can be grouped together according to the dependency transfer. All services in the group are set to a subgraph, and the subgraph number is set, so that the corresponding subgraph information is added to the configuration data of each service, so that the corresponding subgraph information can be obtained through the configuration data of the service, as shown in Table 4. For example, service A has a dependency relationship with service B, and service B has a dependency relationship with service C. At this time, according to the dependency relationship, service A, service B, and service C can be grouped together, and the subgraph number chainIndex can be set to subgraph. Figure 1 .

[0041] Table 4

[0042] name meaning id Unique service ID type Service type (database service, web service, etc.) vmId Unique ID of the computer delay Service delay time jitter Service jitter time lossrate Service Packet Loss in In-degree value out Out-degree value out_in In-degree difference chainIndex Sub-image number … …

[0043] Step S106, determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, and adding the hierarchical information of the service to the subgraph information to obtain updated service configuration data of the computer.

[0044] Specifically, after obtaining the service corresponding to each subgraph, the level can be determined according to the in-degree value and out-degree value of each service. For example, service A depends on service B. At this time, in the relationship graph, service A can be pointed to service B. The in-degree of service A is 0, and the in-degree of service B is 1. The level of service A can be set to level 1, and the level of service B can be set to level 2. Since service B depends on service C, and the level of service B is level 2, the level of service C can be level 3.

[0045] It should be noted that after the level information of each service in each subgraph is determined, the level information of each service can be added to the configuration data of each service to obtain new configuration data, as shown in Table 5.

[0046] Table 5

[0047] name meaning id Unique service ID type Service type (database service, web service, etc.) vmId Unique ID of the computer delay Service delay time jitter Service jitter time lossrate Service Packet Loss in In-degree value out Out-degree value out_in In-degree difference chainIndex Sub-image number level Tiers … …

[0048] Step S108: displaying the relationship between the services included in the computer according to the updated service configuration data of the computer.

[0049] Specifically, after obtaining the updated service configuration data, the sub-graph style can be drawn according to the service ID, the sub-graph number where the service is located, the service level and the dependency relationship between services. In the event of an exception in a service, the computer information corresponding to the abnormal service and the services affected by the abnormal service can be clearly determined, so as to handle the exception and avoid affecting the normal operation of the request.

[0050] The method for determining the service relationship of a computer provided in an embodiment of the present application obtains the service configuration data of the computer, wherein the service configuration data includes: information of the computer, services included in the computer, and dependency relationships between services, wherein the dependency relationship includes dependency and dependence; grouping the services included in each computer according to the dependency relationship to obtain multiple service groups, generating subgraph information corresponding to each service group, and adding the subgraph information included in the computer to the service configuration data of the computer, wherein there is no dependency relationship between services in different service groups; determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, and adding the hierarchical information of the service to the subgraph information to obtain the updated service configuration data of the computer; displaying the relationship between the services included in the computer according to the updated service configuration data of the computer, solves the problem that the relationship between computer services in the service architecture cannot be accurately and clearly determined in the related art. By determining the subgraph information, hierarchical information and dependency relationship between services of each service, drawing and displaying the subgraph, and determining the computer corresponding to the service by enriching the configuration information of the service, the effect of accurately and clearly determining the relationship between computer services in the service architecture is achieved.

[0051] Optionally, in the method for determining the service relationship of a computer provided in an embodiment of the present application, the services contained in each computer are grouped according to the dependency relationship to obtain multiple service groups, including: obtaining any service that does not carry a first identifier to obtain a first target service, the first identifier being used to indicate that it has not been accessed during the grouping process; obtaining a service that has a dependency relationship with the first target service to obtain a second service, and forming an initial service group based on the first target service and the second service; determining whether there is a second service that does not carry the first identifier in the second service, and if so, obtaining the second service that does not carry the first identifier to obtain the second target service; determining whether there is a service that has a dependency relationship with the second target service and does not carry the first identifier, and if so, obtaining a service that has a dependency relationship with the second target service and does not carry the first identifier to obtain a third service, and updating the initial service group based on the third service until there is no service that does not carry the first identifier in the initial service group, and determining the updated initial service group as a service group.

[0052] Specifically, the subgraphs can be grouped by the following steps:

[0053] Step 1: Set the subgraph number chainIndex of the subgraph to be built to 0, and add all services to the set O = {N1, N2, N3, ..., N n}, (n>1), and add all dependencies between services to the set P={L1,L2,L3,...,L n}, (n>1), at this time, all services in the set O do not carry the first identifier.

[0054] Step 2: Create a new empty stack A, and select any unvisited service from the set O, set it as the first target service, and set the first target service to N; set the subgraph number chainIndex to the subgraph number of the first target service, mark the first target service as visited, and place the first target service on the top of A's stack.

[0055] Step three, obtain multiple services that have a dependency relationship with N and have no sub-graph number, set the multiple services as multiple second services, and place the multiple second services in stack A. At the same time, set the sub-graph number chainIndex to the sub-graph number of the multiple second services, and change the second service at the top of the stack to N.

[0056] Step 4: Repeat step 3, and if a service that has a dependency on N and has no subgraph number cannot be obtained, pop N off the stack, change the service at the top of the stack to N, and repeat step 3 until stack A is empty.

[0057] Step 5. When stack A is empty, delete stack A and group the services with the same subgraph number into one group. At the same time, add 1 to the value of the subgraph number chainIndex. Repeat step 2 until all services in set O have completed the setting of subgraph numbers. At this time, the subgraphs can be grouped by subgraph numbers, and subgraphs can be generated through the services in each group.

[0058] For example, Figure 2 is an optional computer service dependency graph provided according to an embodiment of the present application, such as Figure 2As shown, A depends on B, B depends on C and D, and E depends on F. First, add the AF service to the set O, and place the A service on the top of the A stack, and set the subgraph number of the A service to 1. At this time, add the B service to the A stack through the dependency relationship and place it on the top of the stack. Since the B service has no subgraph number, the subgraph number of the B service is set to 1. Then, add the C service and the D service to the A stack according to the dependency relationship, and set the subgraph numbers of the C service and the D service to 1. At this time, the D service is at the top of the stack because there is no dependency on the D service. There is no service with a dependency relationship and no subgraph number, so service D is popped off the stack. At this time, service C is at the top of the stack. Since there is no service with a dependency relationship and no subgraph number with service C, service C is popped off the stack. At this time, service B is at the top of the stack. Since there is no service with a dependency relationship and no subgraph number with service B, service B is popped off the stack. At this time, service A is at the top of the stack. Since there is no service with a dependency relationship and no subgraph number with service A, service A is popped off the stack. At this time, the stack is empty, so A is deleted. At this time, the subgraph numbers of services A and D are both 1. At this time, services without subgraph numbers are obtained from set O again, service F is obtained, and the subgraph number of service F is set to 2. Stack A is generated again and service F is pushed to the top of the stack. At this time, service D, which has a dependency relationship with service F, is added to stack A, and the above process is repeated until subgraph numbers have been added to services D and F. At this time, all services in set O have subgraph numbers, and the subgraph number setting is completed, and two subgraphs are obtained.

[0059] Optionally, in the method for determining the service relationship of a computer provided in an embodiment of the present application, before determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, the method also includes: determining a service with an in-degree value of zero in each service group, obtaining a target service, and obtaining a service having a dependency relationship with the target service, reducing the in-degree value of the service having a dependency relationship with the target service by one, and obtaining a service with an in-degree value of zero; determining the service with an in-degree value of zero as the updated target service, and executing the steps of obtaining a service having a dependency relationship with the target service and reducing the in-degree value of the service having a dependency relationship with the target service by one, until there is no service with an in-degree value of zero in the service group; judging whether there are still services in the service group, and if there are no services in the service group, determining that the subgraph corresponding to the service group is a directed acyclic graph, and if there are services in the service group, determining that the subgraph corresponding to the service group is a directed cyclic graph.

[0060] Specifically, after grouping the services according to the subgraph number, it is necessary to determine whether the subgraph in each service group is a directed acyclic graph or a directed cyclic graph. All services in a certain service group can be obtained, and all services are grouped into a set O. A service with an in-degree value of 0 in the set O is obtained to obtain the target service; all dependencies of the target service are traversed, and the in-degree values ​​of the services with dependencies on the target service are reduced by 1, and the target service is deleted from the set O. At this time, a service with an in-degree value of 0 in the set O is obtained again, and the above operation is repeated until there is no service with an in-degree value of 0 in the set O.

[0061] It should be noted that, when there is no service with an in-degree value of 0 in set O, it is confirmed whether there are any services in set O. When there are no services in set O, it is determined that the subgraph corresponding to the current service group is a directed acyclic graph. When there are services in set O, it is determined that the subgraph corresponding to the current service group is a directed cyclic graph.

[0062] Optionally, in the method for determining the service relationship of a computer provided in an embodiment of the present application, when the subgraph corresponding to the service group is a directed acyclic graph, determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information includes: obtaining services with an in-degree value of zero in the service group, and determining the hierarchy of the services with an in-degree value of zero as level one; obtaining services that have a dependency relationship with the level one service, and determining the hierarchy of the services that have a dependency relationship with the level one service as level two, obtaining services that have a dependency relationship with the level two service, and determining the hierarchy of the services that have a dependency relationship with the level two service as level three, until there is no next level service.

[0063] Specifically, when it is determined that the subgraph corresponding to the service group is a directed acyclic graph, a service with an undetermined level and an in-degree value of 0 in the service group is obtained, the target service is obtained, and the level of the service on which the target service depends is set to 1, and the level of the service on which the service with level 1 depends is set to 2, and the level setting of the service is performed in this way until the level setting of all services in the service group is completed.

[0064] It should be noted that when setting a level for a service, if the service has already been set to a level, the new level will be compared with the original level, and the higher level will be set as the level of the service. For example, Figure 3 is an optional computer service dependency graph provided according to an embodiment of the present application, such as Figure 3 As shown, the level of service A has been set to 2 through the dependency relationship with service B. At this time, the level of service A is again set to 3 through the dependency relationship with service C. Since 3 is greater than 2, the level of service A is set to 3.

[0065] Optionally, in the method for determining the service relationship of a computer provided in an embodiment of the present application, when the subgraph corresponding to the service group is a directed cyclic graph, determining the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information includes: obtaining the difference between the in-degree and out-degree of each service in the subgraph information; sorting the services in the service group in descending order according to the difference between the in-degree and out-degree to obtain the sorting result, and determining the hierarchical information of each service according to the sorting result.

[0066] Specifically, when it is determined that the subgraph corresponding to the service group is a directed cyclic graph, the difference between the in-degree value and the out-degree value (out-degree value - in-degree value) of each service in the service group is obtained, and they are sorted according to the difference. The service with the largest difference is set as the first layer, and the setting levels are increased in descending order according to the decreasing difference, so as to generate the subgraph corresponding to the current service group.

[0067] For example, Figure 4 is an optional computer service dependency graph provided according to an embodiment of the present application, such as Figure 4 As shown, the difference of service B is 1, the difference of service A is 0, and the difference of service C is -1, then service B is set as the first layer, service A is set as the second layer, and service C is set as the third layer.

[0068] Optionally, in the method for determining the service relationship of a computer provided in an embodiment of the present application, displaying the relationship between services included in the computer according to the updated service configuration data of the computer includes: obtaining all sub-graph information included in the updated service configuration data of the computer; generating a relationship graph of the corresponding service group according to each sub-graph information, obtaining multiple relationship graphs, and displaying the multiple relationship graphs.

[0069] Specifically, since the same computer can have different services belonging to different subgraphs and levels, it is necessary to traverse the services, find the computer to which each service belongs according to the vmId recorded in the service configuration data, and create new computer information with nvmId as the index, so as to obtain the corresponding relationship between each service and the computer, and add the subgraph number of the service to the computer information to obtain the updated computer information, as shown in Table 6:

[0070] Table 6

[0071] Object property name meaning nvmId New unique identifier of the computer vmId The unique identifier of the old computer Name Computer Name chainIndex Computer belongs to submap

[0072] Then update the service configuration data, as shown in Table 7:

[0073] Table 7

[0074] name meaning id Unique service ID type Service type (database service, web service, etc.) vmId The unique identifier of the old computer delay Service delay time jitter Service jitter time lossrate Service Packet Loss nvmId New unique identifier of the computer in degree out out degree out_in Difference in in-out chainIndex Sub-image number level Tiers … …

[0075] The nvmId in Table 6 and Table 7 can be used to associate computers and services, so that each service can correspond to each computer when drawing a relationship diagram.

[0076] Optionally, in the method for determining the service relationship of a computer provided in an embodiment of the present application, a relationship graph of a corresponding service group is generated according to each sub-graph information, and multiple relationship graphs are obtained, including: obtaining the services contained in the sub-graph information, the connection relationship between the services, and the hierarchical information of the services; determining a first display width between services of different levels, and determining a second display width between services of the same level; generating a relationship graph of the service group corresponding to the sub-graph information according to the connection relationship between the services, the first display width, and the second display width.

[0077] Specifically, the Cytoscap.js framework provides an interface for determining the position of a graphic in a diagram based on the coordinate position with the upper left corner of the canvas as the origin. The interface can also be used to place the graphic at the coordinate. When the Cytoscap.js framework is introduced into a Web application, the perset layout method can be used to construct a JavaScript method to draw a relationship diagram.

[0078] Figure 5 is a relationship diagram of an optional computer service provided according to an embodiment of the present application, such as Figure 5 As shown, first, the configuration data of the updated service, the updated computer information, and the dependencies between the services are obtained, and the origin and fixed length are set. The services of the first layer are placed, and the vertical interval between each service can be a fixed length. The services of the next layer are placed horizontally, and a fixed horizontal interval is set between services of different layers. At the same time, the relationship between each service and each computer is corresponded to complete the drawing of each sub-graph, and it is displayed when a service fails, and the affected services are marked and displayed.

[0079] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0080] The embodiment of the present application also provides a device for determining the service relationship of a computer. It should be noted that the device for determining the service relationship of a computer in the embodiment of the present application can be used to execute the method for determining the service relationship of a computer provided in the embodiment of the present application. The device for determining the service relationship of a computer provided in the embodiment of the present application is introduced below.

[0081] Figure 6Schematic diagram of a device for determining a service relationship of a computer according to an embodiment of the present application. Figure 6 As shown, the device includes: an acquisition unit 61, a grouping unit 62, a first determination unit 63, and a display unit 64.

[0082] The acquisition unit 61 is used to acquire service configuration data of the computer, wherein the service configuration data includes: information of the computer, services included in the computer and dependency relationships between services, wherein the dependency relationship includes dependency and being depended on.

[0083] The grouping unit 62 is used to group the services contained in each computer according to the dependency relationship to obtain multiple service groups, generate sub-graph information corresponding to each service group, and add the sub-graph information contained in the computer to the service configuration data of the computer, wherein there is no dependency relationship between services in different service groups.

[0084] The first determining unit 63 is used to determine the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, and add the hierarchical information of the service to the subgraph information to obtain updated service configuration data of the computer.

[0085] The display unit 64 is used to display the relationship between the services included in the computer according to the updated service configuration data of the computer.

[0086] The device for determining the service relationship of a computer provided in an embodiment of the present application is used to obtain the service configuration data of the computer through an acquisition unit 61, wherein the service configuration data includes: information of the computer, services included in the computer, and dependencies between services, wherein the dependencies include dependency and dependence. A grouping unit 62 is used to group the services included in each computer according to the dependencies, obtain multiple service groups, generate subgraph information corresponding to each service group, and add the subgraph information included in the computer to the service configuration data of the computer, wherein there is no dependency between services in different service groups. A first determination unit 63 is used to determine the hierarchical information of the service according to the in-degree value and out-degree value of the service in each subgraph information, and add the hierarchical information of the service to the subgraph information to obtain the updated service configuration data of the computer. A display unit 64 is used to display the relationship between the services included in the computer according to the updated service configuration data of the computer. The problem that the relationship between computer services in the service architecture cannot be accurately and clearly determined in the related art is solved. By determining the subgraph information, hierarchical information and dependencies between services of each service, the subgraph is drawn and displayed, and the computer corresponding to the service is determined by enriching the configuration information of the service, thereby achieving the effect of accurately and clearly determining the relationship between computer services in the service architecture.

[0087] Optionally, in the device for determining the service relationship of a computer provided in an embodiment of the present application, the grouping unit 62 includes: a first acquisition module, used to acquire any service that does not carry a first identifier, and obtain a first target service, wherein the first identifier is used to indicate that it has not been accessed during the grouping process; a second acquisition module, used to acquire a service that has a dependency relationship with the first target service, and obtain a second service, and form an initial service group based on the first target service and the second service; a judgment module, used to determine whether there is a second service that does not carry the first identifier in the second service, and if so, acquire the second service that does not carry the first identifier to obtain the second target service; a second judgment module, used to determine whether there is a service that has a dependency relationship with the second target service and does not carry the first identifier, and if so, acquire a service that has a dependency relationship with the second target service and does not carry the first identifier to obtain a third service, and update the initial service group based on the third service until there is no service that does not carry the first identifier in the initial service group, and the updated initial service group is determined as a service group.

[0088] Optionally, in the device for determining the service relationship of a computer provided in an embodiment of the present application, the device also includes: a second determination unit, used to determine a service with an in-degree value of zero in each service group, obtain a target service, and obtain a service having a dependency relationship with the target service, reduce the in-degree value of the service having a dependency relationship with the target service by one, and obtain a service with an in-degree value of zero; a third determination unit, used to determine the service with an in-degree value of zero as the updated target service, and execute the steps of obtaining a service having a dependency relationship with the target service and reducing the in-degree value of the service having a dependency relationship with the target service by one, until there is no service with an in-degree value of zero in the service group; a fourth determination unit, used to determine whether there are still services in the service group, and if there are no services in the service group, determine that the subgraph corresponding to the service group is a directed acyclic graph, and if there are services in the service group, determine that the subgraph corresponding to the service group is a directed cyclic graph.

[0089] Optionally, in the device for determining the service relationship of a computer provided in an embodiment of the present application, the first determination unit 63 includes: a third acquisition module, used to acquire services with an in-degree value of zero in a service group, and determine the level of the services with an in-degree value of zero to be level one; a fourth acquisition module, used to acquire services that have a dependency relationship with the level one service, and determine the level of the services that have a dependency relationship with the level one service to be level two, acquire services that have a dependency relationship with the level two service, and determine the level of the services that have a dependency relationship with the level two service to be level three, until there is no next level service.

[0090] Optionally, in the device for determining the service relationship of a computer provided in an embodiment of the present application, the first determination unit 63 includes: a fifth acquisition module, used to obtain the difference between the out-degree and in-degree of each service in the subgraph information; a sorting module, used to sort the services in the service group in order from large to small according to the difference between the out-degree and in-degree, obtain the sorting result, and determine the hierarchical information of each service according to the sorting result.

[0091] Optionally, in the device for determining the service relationship of a computer provided in an embodiment of the present application, the display unit 64 includes: a sixth acquisition module, used to obtain all sub-graph information contained in the updated service configuration data of the computer; a generation module, used to generate a relationship diagram of the corresponding service group according to each sub-graph information, obtain multiple relationship diagrams, and display the multiple relationship diagrams.

[0092] Optionally, in the device for determining the service relationship of a computer provided in an embodiment of the present application, a generation module includes: an acquisition sub-module, used to acquire the services contained in the sub-graph information, the connection relationship between the services, and the hierarchical information of the services; a determination sub-module, used to determine the first display width between services of different levels, and determine the second display width between services of the same level; a generation sub-module, used to generate a relationship diagram of the service group corresponding to the sub-graph information according to the connection relationship between the services, the first display width, and the second display width.

[0093] The device for determining the service relationship of the above-mentioned computer includes a processor and a memory. The above-mentioned acquisition unit 61, grouping unit 62, first determination unit 63, display unit 64, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.

[0094] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of not being able to accurately and clearly determine the relationship between computer services in the service architecture in the related art is solved by adjusting the kernel parameters.

[0095] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0096] An embodiment of the present application further provides a non-volatile storage medium, which is used to store a program, wherein when the program is running, a device where the non-volatile storage medium is located is controlled to execute a method for determining a service relationship of a computer.

[0097] The embodiment of the present application also provides an electronic device, comprising a processor and a memory; the memory stores computer-readable instructions, and the processor is used to run the computer-readable instructions, wherein when the computer-readable instructions are run, a method for determining a service relationship of a computer is executed. The electronic device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0098] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0099] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0100] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0102] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0103] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0104] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0105] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0106] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for determining a service relationship of a computer, characterized in that: include: Acquire service configuration data of the computer, wherein the service configuration data includes: information of the computer, services included in the computer, and dependency relationships between services, wherein the dependency relationships include dependency and being depended upon; Grouping the services included in each computer according to the dependency relationship to obtain a plurality of service groups, generating subgraph information corresponding to each service group, and adding the subgraph information included in the computer to the service configuration data of the computer, wherein the services in different service groups do not have the dependency relationship; Determine the hierarchical information of the service according to the in-degree value and out-degree value of the service in each of the subgraph information, and add the hierarchical information of the service to the subgraph information to obtain updated service configuration data of the computer, wherein, when the subgraph corresponding to the service group is a directed acyclic graph, determine the hierarchical information of the service according to the in-degree value of the service and the dependency relationship between the services, and when the subgraph corresponding to the service group is a directed cyclic graph, determine the hierarchical information of the service according to the sorting result of the difference between the in-degree and out-degree of the service; The relationship between the services included in the computer is displayed according to the updated service configuration data of the computer.

2. The method according to claim 1, characterized in that The services included in each computer are grouped according to the dependency relationship to obtain multiple service groups including: Obtain any service that does not carry a first identifier to obtain a first target service, where the first identifier is used to indicate that the service has not been accessed during the grouping process; Acquire a service that has a dependency relationship with the first target service, obtain a second service, and form an initial service group according to the first target service and the second service; Determine whether there is a second service that does not carry the first identifier in the second service, and if so, obtain the second service that does not carry the first identifier to obtain a second target service; Determine whether there is a service that has a dependency on the second target service and does not carry the first identifier. If so, obtain a service that has a dependency on the second target service and does not carry the first identifier, obtain a third service, and update the initial service group according to the third service until there is no service that does not carry the first identifier in the initial service group, and determine the updated initial service group as a service group.

3. The method according to claim 1, characterized in that Before determining the level information of the service according to the in-degree value and the out-degree value of the service in each of the subgraph information, the method further includes: Determine a service with an in-degree value of zero in each of the service groups, obtain a target service, obtain services that have a dependency relationship with the target service, reduce the in-degree value of the services that have a dependency relationship with the target service by one, and obtain a service with an in-degree value of zero; Determine the service with the zero in-degree value as the updated target service, and perform the steps of obtaining the service having a dependency relationship with the target service and reducing the in-degree value of the service having a dependency relationship with the target service by one, until there is no service with the zero in-degree value in the service group; Determine whether there are any services in the service group. If there are no services in the service group, determine that the subgraph corresponding to the service group is a directed acyclic graph. If there are services in the service group, determine that the subgraph corresponding to the service group is a directed cyclic graph.

4. The method according to claim 3, characterized in that In the case where the subgraph corresponding to the service group is a directed acyclic graph, determining the hierarchical information of the service according to the in-degree value and the out-degree value of the service in each of the subgraph information includes: Acquire a service with an in-degree value of zero in the service group, and determine that the level of the service with an in-degree value of zero is level one; Obtain a service that has a dependency relationship with a first-level service, and determine the level of the service that has a dependency relationship with the first-level service as level two; obtain a service that has a dependency relationship with a second-level service, and determine the level of the service that has a dependency relationship with the second-level service as level three, until there is no next-level service.

5. The method according to claim 3, characterized in that: In the case where the subgraph corresponding to the service group is a directed cyclic graph, determining the hierarchical information of the service according to the in-degree value and the out-degree value of the service in each of the subgraph information includes: Obtaining the difference between the out-degree and in-degree of each service in the subgraph information; The services in the service group are sorted in descending order according to the difference between the out-degree and the in-degree to obtain a sorting result, and the level information of each service is determined according to the sorting result.

6. The method according to claim 1, characterized in that Displaying the relationship between services included in the computer according to the updated service configuration data of the computer includes: Acquire all subgraph information contained in the updated service configuration data of the computer; A relationship graph of the corresponding service group is generated according to each of the sub-graph information to obtain a plurality of relationship graphs, and the plurality of relationship graphs are displayed.

7. The method according to claim 6, characterized in that Generate a relationship graph of the corresponding service group according to each of the sub-graph information, and obtain multiple relationship graphs including: Obtaining services, connection relationships between services, and hierarchical information of services included in the subgraph information; Determining a first display width between services at different levels, and determining a second display width between services at the same level; A relationship graph of the service group corresponding to the subgraph information is generated according to the connection relationship between the services, the first display width, and the second display width.

8. A device for determining a service relationship of a computer, characterized in that: include: An acquisition unit, configured to acquire service configuration data of a computer, wherein the service configuration data includes: information of the computer, services included in the computer, and dependency relationships between services, wherein the dependency relationships include dependency and dependency; a grouping unit, configured to group the services included in each computer according to the dependency relationship to obtain a plurality of service groups, generate subgraph information corresponding to each service group, and add the subgraph information included in the computer to the service configuration data of the computer, wherein the services in different service groups do not have the dependency relationship; A first determining unit is used to determine the hierarchical information of the service according to the in-degree value and out-degree value of the service in each of the subgraph information, and add the hierarchical information of the service to the subgraph information to obtain updated service configuration data of the computer, wherein, when the subgraph corresponding to the service group is a directed acyclic graph, the hierarchical information of the service is determined according to the in-degree value of the service and the dependency relationship between the services, and when the subgraph corresponding to the service group is a directed cyclic graph, the hierarchical information of the service is determined according to the sorting result of the difference between the out-degree and the in-degree of the service; A display unit is used to display the relationship between the services included in the computer according to the updated service configuration data of the computer.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium is used to store a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the method for determining the service relationship of a computer as described in any one of claims 1 to 7.

10. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the computer-readable instructions, when executed, execute the method for determining the service relationship of a computer as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for constructing service dependency graph and storage medium

    CN109587255A

  • Service updating method and device, storage medium and electronic device

    CN112379906A