Topology change detection method and device for distributed service and electronic equipment
Through the method of serialization and editing distance calculation, the problems of high detection cost and poor intuitiveness of distributed service topology change are solved, the effect of reducing resource requirements and detection costs is achieved, and the intuitive topology change display is provided.
Patent Information
- Application Number
- CN202411742981.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-04
AI Technical Summary
In the prior art, the detection of distributed service topology change relies on log analysis and real-time monitoring of data, resulting in high demand for computing resources and storage space, high detection costs, and the inability to intuitively display the changes in topology structure, making it difficult to trace the root cause of the problem.
The current and historical topology maps are obtained by obtaining the tag information based on distributed services, serializing the two, calculating the editing distance and editing operations, and then determining the degree of change between the topology maps.
It reduces the demand for computing resources and storage space, reduces detection costs, and intuitively displays topological changes through visual rendering, which facilitates problem positioning and solving.
Smart Images

Figure CN119766660A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed technology, and in particular to a method, device and electronic device for detecting topology changes of distributed services. Background Art
[0002] Distributed services are service systems composed of multiple independent service components. Each component is distributed on different computers or servers and cooperates with each other through the network to complete tasks together. At present, the existing distributed service topology change detection mainly relies on log analysis and real-time monitoring data or manual identification. These methods usually require a lot of computing resources and storage space, have high detection costs, and cannot intuitively display the changes in the topology structure, making it difficult to trace the root cause of the problem.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The main purpose of the present application is to provide a distributed service topology change detection method, device and electronic device, so as to at least solve the technical problem that the distributed service topology change detection in the prior art mainly relies on log analysis and real-time monitoring data, requires a large amount of computing resources and storage space, and has a high detection cost.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for detecting topology changes of distributed services is provided, including: obtaining a current topology map and a historical topology map of the distributed service based on the label information of the distributed service; serializing the current topology map and the historical topology map respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map; determining an edit distance and an edit operation between the current topology map and the historical topology map based on the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence; determining a detection result based on the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map.
[0006] Furthermore, the detection result is determined based on the edit distance and the edit operation, including: comparing the edit distance with a preset threshold to obtain a comparison result; judging whether the edit operation belongs to a preset operation set to obtain a judgment result; and determining the detection result based on the comparison result and the judgment result.
[0007] Furthermore, the detection result is determined based on the comparison result and the judgment result, including: if the comparison result is that the edit distance is less than a preset threshold, and / or the judgment result is that the editing operation belongs to a preset operation set, then the smaller degree of change between the current topology map and the historical topology map is used as the detection result; if the comparison result is that the edit distance is greater than or equal to the preset threshold, and / or the judgment result is that the editing operation does not belong to the preset operation set, then the larger degree of change between the current topology map and the historical topology map is used as the detection result.
[0008] Furthermore, the editing distance and editing operation between the current topology map and the historical topology map are determined based on the first sequence and the second sequence, including: performing a difference comparison on the first sequence and the second sequence to obtain a comparison result; and determining the editing distance and editing operation based on the comparison result.
[0009] Furthermore, the current topology map and the historical topology map are serialized respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map, including: traversing the current topology map and the historical topology map respectively through a depth-first search algorithm or a breadth-first search algorithm, recording the sequence information of nodes and edges, and obtaining the first sequence and the second sequence.
[0010] Furthermore, before obtaining the current topology map and historical topology map of the distributed service based on the label information of the distributed service, the method also includes: obtaining current call data of the distributed service based on the label information of the distributed service, and generating a current topology map based on the current call data; obtaining historical topology data of the distributed service from a relational database based on the label information of the distributed service, and generating a historical topology map based on the historical topology data.
[0011] Furthermore, after determining the detection results based on the edit distance and the edit operation, the method also includes: marking the changed topological structure and the detection results corresponding to the changed topological structure in the current topological map; and displaying the changed topological structure and the detection results corresponding to the changed topological structure through visual rendering.
[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a topology change detection device for a distributed service is also provided, including: a first acquisition unit, used to acquire a current topology map and a historical topology map of a distributed service based on the label information of the distributed service; a processing unit, used to serialize the current topology map and the historical topology map respectively, and obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map; a first determination unit, used to determine the edit distance and the edit operation between the current topology map and the historical topology map based on the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence; a second determination unit, used to determine the detection result based on the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map.
[0013] Furthermore, the second determination unit includes: a comparison subunit, used to compare the edit distance with a preset threshold to obtain a comparison result; a judgment subunit, used to judge whether the editing operation belongs to a preset operation set to obtain a judgment result; and a first determination subunit, used to determine the detection result based on the comparison result and the judgment result.
[0014] Furthermore, the first determination subunit includes: a first determination module, which is used to take the smaller degree of change between the current topology map and the historical topology map as the detection result if the comparison result is that the edit distance is less than a preset threshold, and / or the judgment result is that the editing operation belongs to a preset operation set; a second determination module, which is used to take the larger degree of change between the current topology map and the historical topology map as the detection result if the comparison result is that the edit distance is greater than or equal to the preset threshold, and / or the judgment result is that the editing operation does not belong to the preset operation set.
[0015] Furthermore, the first determination unit includes: a comparison subunit, used to compare the differences between the first sequence and the second sequence to obtain a comparison result; and a second determination subunit, used to determine the edit distance and the edit operation based on the comparison result.
[0016] Furthermore, the processing unit includes: a processing subunit, which is used to traverse the current topology graph and the historical topology graph respectively through a depth-first search algorithm or a breadth-first search algorithm, record the sequence information of nodes and edges, and obtain a first sequence and a second sequence.
[0017] Furthermore, the device also includes: a second acquisition unit, which is used to acquire current call data of the distributed service based on the label information of the distributed service before acquiring the current topology map and historical topology map of the distributed service based on the label information of the distributed service, and generate a current topology map based on the current call data; a third acquisition unit, which is used to acquire historical topology data of the distributed service from a relational database based on the label information of the distributed service, and generate a historical topology map based on the historical topology data.
[0018] Furthermore, the device also includes: a marking unit, which is used to mark the changed topological structure and the detection result corresponding to the changed topological structure in the current topological map after determining the detection result based on the editing distance and the editing operation; and a display unit, which is used to display the changed topological structure and the detection result corresponding to the changed topological structure through visual rendering.
[0019] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer program product is further provided, including a computer program, which implements the above-mentioned distributed service topology change detection method when executed by a processor.
[0020] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned distributed service topology change detection method when running.
[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is also provided, which includes one or more processors; a memory for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors are implemented to run the programs, wherein the program is configured to execute the above-mentioned distributed service topology change detection method at runtime.
[0022] In an embodiment of the present application, a method of topology change detection is adopted through edit distance and edit operation. First, the current topology map and the historical topology map of the distributed service are obtained based on the label information of the distributed service, and then the current topology map and the historical topology map are serialized respectively to obtain the first sequence corresponding to the current topology map and the second sequence corresponding to the historical topology map. Then, the edit distance and the edit operation between the current topology map and the historical topology map are determined based on the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence. Then, the detection result is determined based on the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map. By serializing the current topology map and the historical topology map, the edit distance and the edit operation between the current topology map and the historical topology map can be determined, so as to achieve the purpose of reducing the demand for computing resources and storage space, thereby achieving the technical effect of reducing the detection cost, and then solving the technical problem that the distributed service topology change detection in the prior art mainly relies on log analysis and real-time monitoring data, requires a large amount of computing resources and storage space, and has a high detection cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] 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:
[0024] Figure 1 is a flowchart of an optional distributed service topology change detection method according to an embodiment of the present application;
[0025] Figure 2 is a schematic diagram of the structure of an optional topology change detection system according to an embodiment of the present application;
[0026] Figure 3 is a schematic diagram of an optional distributed service topology change detection device according to an embodiment of the present application;
[0027] Figure 4 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] 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.
[0029] 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 sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. 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.
[0030] It should be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with relevant laws, regulations and standards, necessary confidentiality measures are taken, and public order and good customs are not violated, and corresponding operation entrances are provided for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0031] Example 1
[0032] According to an embodiment of the present application, an embodiment of a method for detecting topology changes of distributed services is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0033] Figure 1 is a flowchart of an optional distributed service topology change detection method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0034] Step S101: acquiring a current topology map and a historical topology map of a distributed service based on label information of the distributed service.
[0035] In the above steps, the application system, processor, electronic device and other devices can be used as the execution subject. Optionally, the topology change detection system of the distributed service can be used as the execution subject. First, the current topology map and the historical topology map of the distributed service are obtained based on the label information of the distributed service. Among them, the topology map is a directed graph used to represent the call relationship between each service component in the distributed service. The node represents the service component, the edge represents the call relationship between the services, and the overall call relationship represents a certain business scenario. The label information is used to identify the distributed service. For example, the label information can be the service name of the distributed service.
[0036] In an optional embodiment, before obtaining the current topology map and historical topology map of the distributed service based on the tag information of the distributed service, the current call data of the distributed service is obtained based on the tag information of the distributed service, and the current topology map is generated based on the current call data; the historical topology data of the distributed service is obtained from a relational database based on the tag information of the distributed service, and the historical topology map is generated based on the historical topology data.
[0037] Optionally, the current call data of the distributed service is obtained based on the tag information of the distributed service, and the current topology map can be generated based on the current call data. The historical topology data of the distributed service is obtained from the relational database based on the tag information of the distributed service, and the historical topology map can be generated based on the historical topology data. For example, based on the tag information of "transaction A", the current call data of transaction A is collected to generate the current topology map, and the historical topology data of transaction A is obtained from the relational database to generate the historical topology map.
[0038] Optionally, by collecting the call data of distributed services (including the call relationship between services, etc.), the service call relationship can be generated as a topology map, and the constructed topology map can be stored in chronological order using a relational database. For example, the nodes and edges in the topology map are stored in different data tables respectively, and the time information of the topology map generation is recorded at the same time.
[0039] It should be noted that the constructed topology map is stored in chronological order using a relational database, which provides a data basis for subsequent difference comparison.
[0040] Step S102, serializing the current topology map and the historical topology map respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map.
[0041] Optionally, before performing the edit distance calculation, the topology map is first represented as a sequence, that is, the current topology map and the historical topology map are serialized respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map. For example, the first sequence is {B→C→D}, and the second sequence is {B→C→E}.
[0042] In an optional embodiment, the current topology map and the historical topology map are serialized respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map, including: traversing the current topology map and the historical topology map respectively through a depth-first search algorithm or a breadth-first search algorithm, recording the sequence information of nodes and edges, and obtaining the first sequence and the second sequence.
[0043] Optionally, the current topology graph and the historical topology graph are traversed respectively by a depth-first search (DFS) algorithm or a breadth-first search (BFS) algorithm, the sequence information of the nodes and edges is recorded, and they are arranged into sequences in the order of traversal, so as to obtain a first sequence and a second sequence.
[0044] It should be noted that by representing the topological graph as a sequence, a data basis is provided for the subsequent determination of the edit distance and the edit operation.
[0045] Step S103, determining the edit distance and edit operation between the current topology map and the historical topology map based on the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence.
[0046] Optionally, the editing distance and editing operation between the current topology map and the historical topology map can be determined based on the first sequence and the second sequence. For example, the first sequence is {B→C→D}, and the second sequence is {B→C→E}. The minimum number of operation steps (i.e., the editing distance) required to make the first sequence the same as the second sequence is 2, and the editing operation is: delete E and add D.
[0047] In an optional embodiment, determining the edit distance and edit operation between the current topology map and the historical topology map based on the first sequence and the second sequence includes: performing a difference comparison on the first sequence and the second sequence to obtain a comparison result; and determining the edit distance and edit operation based on the comparison result.
[0048] Optionally, the first sequence and the second sequence are compared to obtain a comparison result, and then the edit distance and the editing operation are determined based on the comparison result. For example, {B→C→D} and {B→C→E} are compared to obtain a comparison result: C→E changes to C→D, and the editing operation is: delete E, add D, and the edit distance is 2, that is, the number of operation steps is 2.
[0049] It should be noted that by adding, deleting, and replacing elements in a sequence, the minimum number of operation steps required to transform from one sequence to another can be calculated, and the structural differences between the two graphs can be determined, such as missing nodes or edges, additional nodes or edges, and modified nodes or edges, which reduces the demand for computing resources and storage space and reduces detection costs.
[0050] Step S104, determining a detection result according to the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map.
[0051] Optionally, a detection result may be determined based on the edit distance and the edit operation, for example, the structural difference between the two images and the degree of the difference change.
[0052] In an optional embodiment, the detection result is determined based on the edit distance and the edit operation, including: comparing the edit distance with a preset threshold to obtain a comparison result; judging whether the edit operation belongs to a preset operation set to obtain a judgment result; and determining the detection result based on the comparison result and the judgment result.
[0053] In an optional embodiment, the detection result is determined based on the comparison result and the judgment result, including: if the comparison result is that the edit distance is less than a preset threshold, and / or the judgment result is that the editing operation belongs to a preset operation set, then the degree of change between the current topology map and the historical topology map is smaller as the detection result; if the comparison result is that the edit distance is greater than or equal to the preset threshold, and / or the judgment result is that the editing operation does not belong to the preset operation set, then the degree of change between the current topology map and the historical topology map is larger as the detection result.
[0054] Optionally, the edit distance is compared with a preset threshold to obtain a comparison result, for example, the preset threshold is set to the total number of nodes in the topology graph * the total number of edges * 10%, and the edit distance is compared with the preset threshold. Then, it is determined whether the edit operation belongs to a preset operation set to obtain a determination result, for example, the preset operation set is a set of simple insertion, deletion or replacement operations.
[0055] Optionally, the detection result can be determined based on the comparison result and the judgment result. For example, if the comparison result is that the edit distance is less than a preset threshold, and / or the judgment result is that the edit operation belongs to a preset operation set, that is, the edit distance is small and the edit operation is simple, then the two graphs are considered to be topologically similar, and the small degree of change between the current topology graph and the historical topology graph can be used as the detection result. If the comparison result is that the edit distance is greater than or equal to the preset threshold, and / or the judgment result is that the edit operation does not belong to the preset operation set, that is, the edit distance is large, and the edit operation includes complex structural changes, then the two graphs are considered to have large differences, and the large degree of change between the current topology graph and the historical topology graph can be used as the detection result.
[0056] It should be noted that determining the detection result based on the edit distance and the edit operation reduces the demand for computing resources and storage space, and reduces the detection cost.
[0057] Based on the scheme defined by the above steps S101 to S104, it can be known that in an embodiment of the present application, a method of topology change detection is adopted through editing distance and editing operation. First, the current topology map and the historical topology map of the distributed service are obtained based on the label information of the distributed service, and then the current topology map and the historical topology map are serialized respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map. Then, the editing distance and editing operation between the current topology map and the historical topology map are determined based on the first sequence and the second sequence, wherein the editing distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the editing operation is the operation required to make the first sequence the same as the second sequence. Then, the detection result is determined based on the editing distance and the editing operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map. By serializing the current topology map and the historical topology map, the editing distance and editing operations between the current topology map and the historical topology map can be determined, thereby achieving the purpose of reducing the demand for computing resources and storage space, thereby achieving the technical effect of reducing detection costs, and further solving the technical problem that the distributed service topology change detection in the prior art mainly relies on log analysis and real-time monitoring data, requires a large amount of computing resources and storage space, and has a high detection cost.
[0058] In an optional embodiment, after determining the detection result based on the edit distance and the edit operation, the changed topological structure and the detection result corresponding to the changed topological structure are marked in the current topological map; the changed topological structure and the detection result corresponding to the changed topological structure are displayed through visual rendering.
[0059] Optionally, after determining the detection results based on the edit distance and the editing operation, the changed topological structure and the detection results corresponding to the changed topological structure can be marked in the current topological map. For example, the difference points and the conclusions corresponding to the difference points (i.e., whether the changes are significant) can be marked with different colors in the current topological map, and then the changed topological structure and the detection results corresponding to the changed topological structure can be displayed through visual rendering.
[0060] It should be noted that the detection results are displayed to users in a visual manner, which makes it possible to intuitively display the changes in the business topology structure, facilitate user analysis and understanding, and enable users to clearly see the changes between the historical topology and the latest topology, thereby identifying the changed transaction scenarios or service nodes, and tracing historical topology changes, which helps to locate and solve problems.
[0061] Figure 2 is a schematic diagram of the structure of an optional topology change detection system according to an embodiment of the present application, such as Figure 2 As shown, the system includes a data acquisition module, a topology construction module, a historical topology storage module, a topology comparison module, and a difference visualization module. Optionally, the data acquisition module collects the call data of the distributed service through the service call data collection device, sends the call data to the topology construction module through the data transmission device, the topology construction module generates a topology map according to the received data through the topology generation device, sends the generated topology map to the historical topology storage module through the topology data transmission device, the historical topology storage module uses the relational database storage device to store the topology map in the relational database in chronological order, sends the topology map data to the topology comparison module through the storage data transmission device, the topology comparison module compares the latest topology map received with the historical topology map through the edit distance calculation device, sends the comparison result to the difference visualization module through the difference data transmission device, and the difference visualization module displays the comparison result to the user in a visual way through the visualization rendering device, so as to help the user clearly understand the changes between the historical topology and the latest topology, and notify the relevant business operation and maintenance personnel.
[0062] In an embodiment of the present application, a method of topology change detection is adopted through edit distance and edit operation. First, the current topology map and the historical topology map of the distributed service are obtained based on the label information of the distributed service, and then the current topology map and the historical topology map are serialized respectively to obtain the first sequence corresponding to the current topology map and the second sequence corresponding to the historical topology map. Then, the edit distance and the edit operation between the current topology map and the historical topology map are determined based on the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence. Then, the detection result is determined based on the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map. By serializing the current topology map and the historical topology map, the edit distance and the edit operation between the current topology map and the historical topology map can be determined, so as to achieve the purpose of reducing the demand for computing resources and storage space, thereby achieving the technical effect of reducing the detection cost, and then solving the technical problem that the distributed service topology change detection in the prior art mainly relies on log analysis and real-time monitoring data, requires a large amount of computing resources and storage space, and has a high detection cost.
[0063] Example 2
[0064] According to an embodiment of the present application, an embodiment of a distributed service topology change detection device is provided, wherein: Figure 3 is a schematic diagram of an optional distributed service topology change detection device according to an embodiment of the present application, such as Figure 3 As shown, the device includes: a first acquisition unit 301, a processing unit 302, a first determination unit 303, and a second determination unit 304.
[0065] A first acquisition unit 301 is used to acquire a current topology map and a historical topology map of a distributed service based on label information of the distributed service;
[0066] The processing unit 302 is used to serialize the current topology map and the historical topology map respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map;
[0067] A first determining unit 303 is used to determine an edit distance and an edit operation between the current topology map and the historical topology map according to the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence;
[0068] The second determining unit 304 is used to determine a detection result according to the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map.
[0069] In an embodiment of the present application, a current topology map and a historical topology map of a distributed service are acquired based on the label information of the distributed service by a first acquisition unit 301; a processing unit 302 serializes the current topology map and the historical topology map respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map; a first determination unit 303 determines an edit distance and an edit operation between the current topology map and the historical topology map based on the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence; a second determination unit 304 determines a detection result based on the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map.
[0070] The method of topology change detection by editing distance and editing operation is adopted. First, the current topology map and the historical topology map of the distributed service are obtained based on the label information of the distributed service. Then, the current topology map and the historical topology map are serialized respectively to obtain the first sequence corresponding to the current topology map and the second sequence corresponding to the historical topology map. Then, the editing distance and editing operation between the current topology map and the historical topology map are determined based on the first sequence and the second sequence, wherein the editing distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the editing operation is the operation required to make the first sequence the same as the second sequence. Then, the detection result is determined based on the editing distance and the editing operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map. By serializing the current topology map and the historical topology map, the editing distance and editing operation between the current topology map and the historical topology map can be determined, so as to achieve the purpose of reducing the demand for computing resources and storage space, thereby achieving the technical effect of reducing the detection cost, and then solving the technical problem that the distributed service topology change detection in the prior art mainly relies on log analysis and real-time monitoring data, requires a large amount of computing resources and storage space, and has a high detection cost.
[0071] It should be noted that the above-mentioned first acquisition unit 301, processing unit 302, first determination unit 303, and second determination unit 304 correspond to steps S101 to S104 in the above-mentioned embodiment, and the examples and application scenarios implemented by the four units and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0072] Optionally, the second determination unit includes: a comparison subunit, used to compare the edit distance with a preset threshold to obtain a comparison result; a judgment subunit, used to judge whether the editing operation belongs to a preset operation set to obtain a judgment result; and a first determination subunit, used to determine the detection result based on the comparison result and the judgment result.
[0073] Optionally, the first determination subunit includes: a first determination module, which is used to take the smaller degree of change between the current topology map and the historical topology map as the detection result if the comparison result is that the edit distance is less than a preset threshold, and / or the judgment result is that the editing operation belongs to a preset operation set; a second determination module, which is used to take the larger degree of change between the current topology map and the historical topology map as the detection result if the comparison result is that the edit distance is greater than or equal to the preset threshold, and / or the judgment result is that the editing operation does not belong to the preset operation set.
[0074] Optionally, the first determination unit includes: a comparison subunit, used to perform a difference comparison on the first sequence and the second sequence to obtain a comparison result; and a second determination subunit, used to determine the edit distance and the edit operation based on the comparison result.
[0075] Optionally, the processing unit includes: a processing subunit, used to traverse the current topology graph and the historical topology graph respectively through a depth-first search algorithm or a breadth-first search algorithm, record the sequence information of nodes and edges, and obtain the first sequence and the second sequence.
[0076] Optionally, the device also includes: a second acquisition unit, used to acquire current call data of the distributed service based on the label information of the distributed service, and generate a current topology map based on the current call data before acquiring the current topology map and historical topology map of the distributed service based on the label information of the distributed service; and a third acquisition unit, used to acquire historical topology data of the distributed service from a relational database based on the label information of the distributed service, and generate a historical topology map based on the historical topology data.
[0077] Optionally, the device also includes: a marking unit, used to mark the changed topological structure and the detection result corresponding to the changed topological structure in the current topological map after determining the detection result based on the editing distance and the editing operation; and a display unit, used to display the changed topological structure and the detection result corresponding to the changed topological structure through visual rendering.
[0078] Example 3
[0079] An embodiment of the present application may provide an electronic device, Figure 4 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 (only one is shown) processor 402, memory 404, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0080] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0081] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: obtain the current topology map and the historical topology map of the distributed service based on the tag information of the distributed service; serialize the current topology map and the historical topology map respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map; determine the edit distance and edit operation between the current topology map and the historical topology map based on the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence; determine the detection result based on the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map.
[0082] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: compare the edit distance with the preset threshold to obtain a comparison result; determine whether the edit operation belongs to the preset operation set to obtain a judgment result; determine the detection result based on the comparison result and the judgment result.
[0083] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: if the comparison result is that the edit distance is less than a preset threshold, and / or the judgment result is that the editing operation belongs to a preset operation set, then the degree of change between the current topology map and the historical topology map is smaller as the detection result; if the comparison result is that the edit distance is greater than or equal to the preset threshold, and / or the judgment result is that the editing operation does not belong to the preset operation set, then the degree of change between the current topology map and the historical topology map is larger as the detection result.
[0084] The processor can also call the information and application program stored in the memory through the transmission device to perform the following steps: perform a difference comparison on the first sequence and the second sequence to obtain a comparison result; and determine the edit distance and the edit operation based on the comparison result.
[0085] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: traverse the current topology map and the historical topology map respectively through the depth-first search algorithm or the breadth-first search algorithm, record the sequence information of the nodes and edges, and obtain the first sequence and the second sequence.
[0086] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: before obtaining the current topology map and historical topology map of the distributed service based on the tag information of the distributed service, obtain the current call data of the distributed service based on the tag information of the distributed service, and generate the current topology map based on the current call data; obtain the historical topology data of the distributed service from the relational database based on the tag information of the distributed service, and generate the historical topology map based on the historical topology data.
[0087] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: after determining the detection result based on the editing distance and the editing operation, mark the changed topological structure and the detection result corresponding to the changed topological structure in the current topological map; through visual rendering, display the changed topological structure and the detection result corresponding to the changed topological structure.
[0088] By adopting the embodiment of the present application, a scheme of a topology change detection method for distributed services is provided. By adopting the method of topology change detection through edit distance and edit operation, firstly, the current topology map and the historical topology map of the distributed service are obtained based on the label information of the distributed service, and then the current topology map and the historical topology map are serialized respectively to obtain the first sequence corresponding to the current topology map and the second sequence corresponding to the historical topology map, and then the edit distance and edit operation between the current topology map and the historical topology map are determined according to the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence, and then the detection result is determined according to the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map. By serializing the current topology map and the historical topology map, the edit distance and edit operation between the current topology map and the historical topology map can be determined, so as to achieve the purpose of reducing the demand for computing resources and storage space, thereby achieving the technical effect of reducing the detection cost, and then solving the technical problem that the distributed service topology change detection in the prior art mainly relies on log analysis and real-time monitoring data, requires a large amount of computing resources and storage space, and has a high detection cost.
[0089] It can be understood by those skilled in the art that Figure 4The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 4 The structure of the electronic device is not limited. Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations shown.
[0090] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0091] Example 4
[0092] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the distributed service topology change detection method provided in the first embodiment.
[0093] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0094] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the topology change detection method for distributed services.
[0095] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0096] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0097] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0098] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0099] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0100] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0101] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for detecting topology changes of distributed services, characterized in that: include: Acquire a current topology map and a historical topology map of the distributed service based on the label information of the distributed service; Sequencing the current topology map and the historical topology map respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map; Determining an edit distance and an edit operation between the current topology map and the historical topology map according to the first sequence and the second sequence, wherein the edit distance is the minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is the operation required to make the first sequence the same as the second sequence; A detection result is determined according to the edit distance and the edit operation, wherein the detection result is used to characterize a degree of change between the current topology map and the historical topology map.
2. The method according to claim 1, characterized in that: Determining a detection result according to the edit distance and the edit operation includes: Comparing the edit distance with a preset threshold to obtain a comparison result; Determine whether the editing operation belongs to a preset operation set, and obtain a determination result; The detection result is determined according to the comparison result and the judgment result.
3. The method according to claim 2, characterized in that Determining the detection result according to the comparison result and the judgment result includes: If the comparison result is that the edit distance is less than the preset threshold, and / or the judgment result is that the edit operation belongs to the preset operation set, the smaller degree of change between the current topology map and the historical topology map is taken as the detection result; If the comparison result is that the edit distance is greater than or equal to the preset threshold, and / or the judgment result is that the edit operation does not belong to the preset operation set, the greater degree of change between the current topology map and the historical topology map is taken as the detection result.
4. The method according to claim 1, characterized in that Determining the edit distance and edit operation between the current topology map and the historical topology map according to the first sequence and the second sequence includes: Performing a difference comparison on the first sequence and the second sequence to obtain a comparison result; The edit distance and the edit operation are determined based on the comparison result.
5. The method according to claim 1, characterized in that: Sequencing the current topology map and the historical topology map respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map, including: The current topology graph and the historical topology graph are traversed respectively by a depth-first search algorithm or a breadth-first search algorithm, and sequence information of nodes and edges is recorded to obtain the first sequence and the second sequence.
6. The method according to claim 1, characterized in that Before acquiring the current topology map and the historical topology map of the distributed service based on the label information of the distributed service, the method further includes: Acquire current call data of the distributed service based on the label information of the distributed service, and generate the current topology map according to the current call data; The historical topology data of the distributed service is acquired from a relational database based on the label information of the distributed service, and the historical topology map is generated according to the historical topology data.
7. The method according to claim 1, characterized in that After determining the detection result according to the edit distance and the edit operation, the method further includes: Marking the changed topological structure and the detection result corresponding to the changed topological structure in the current topological map; The changed topological structure and the detection result corresponding to the changed topological structure are displayed through visual rendering.
8. A distributed service topology change detection device, characterized in that: include: A first acquisition unit, configured to acquire a current topology map and a historical topology map of the distributed service based on the label information of the distributed service; A processing unit, configured to serialize the current topology map and the historical topology map respectively to obtain a first sequence corresponding to the current topology map and a second sequence corresponding to the historical topology map; A first determining unit, configured to determine an edit distance and an edit operation between the current topology map and the historical topology map according to the first sequence and the second sequence, wherein the edit distance is a minimum number of operation steps required to make the first sequence the same as the second sequence, and the edit operation is an operation required to make the first sequence the same as the second sequence; The second determining unit is used to determine a detection result according to the edit distance and the edit operation, wherein the detection result is used to characterize the degree of change between the current topology map and the historical topology map.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the distributed service topology change detection method described in any one of claims 1 to 7 when running.
10. An electronic device, characterized in that: The electronic device includes one or more processors; A memory for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the operation of the programs, wherein the programs are configured to execute the method for detecting topology changes of distributed services described in any one of claims 1 to 7 at runtime.
Citation Information
Patent Citations
Network topology estimation method based on simulated annealing
CN106685686A
Inverse time limit interactive mass power grid topology similarity rapid sorting method
CN115329117A
Edit distance based spellcheck
US10402490B1
Cited By
Network topology change detection method and device, electronic equipment and storage medium
CN120639658A
Charging pile power distribution method and charging system
CN121084233A
Charging pile power distribution method and charging system
CN121084233B