Method, system and equipment for generating application topology calling relation
By splitting and storing the application topology node and its calling relationship with the business request call data, and using topology hash fields and link hash fields to solve the problems of inaccurate topology relationships and high computing resource consumption in the existing technology, efficient and accurate topology call relationship query and metric data acquisition are achieved.
Patent Information
- Application Number
- CN202510221734.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2045-02-27
AI Technical Summary
In complex application systems, the call relationship between applications varies with time and the user access services. The prior art cannot effectively exclude call data that is unrelated to the central node, resulting in inaccurate topological relationships and their indicator data. At the same time, the prior art requires full storage of topological data, resulting in high computing resource consumption and long query time.
A method for generating a topological call relationship is proposed. The topological node and its call relationship are split and stored with the business request call data through the preset topological relationship table and the preset topological call index table, and the two data tables are associated with the topological hash field and the link hash field. The query stage is based on the central node and the target time period as the condition, and accurately matches the target topology call relationship and target indicator data related to the central node.
Ensure the correctness of topological call relationships and the accuracy of indicator data, reduces computing resource overhead and improves query efficiency, and avoids the inefficient query mode of full table scanning in traditional methods.
Smart Images

Figure CN119719116A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data network technology, and in particular to a method, system and device for generating an application topology calling relationship. Background Art
[0002] As technologies such as cloud computing and big data become increasingly mature, microservice architecture has gradually come into people's attention. Full-link performance monitoring plays an important role in microservice architecture. Full-link performance monitoring covers mobile terminals, network terminals, and service terminals, and comprehensively counts the performance indicators of business requests of applications on each terminal. The association relationship and call chain between applications are displayed through a topology diagram. Each node (Node) in the topology diagram represents a service or application instance, and the connection (Edge) between nodes represents the call relationship between services or applications. With the help of the topology diagram, operation and maintenance personnel can quickly identify the performance bottlenecks, failure points, and dependencies of the application.
[0003] However, in complex application systems, the calling relationship between applications will change over time and with the different services accessed by users. The calling relationship of the application topology in the related technology only stores the direct relationship data between the calling node and the called node. When querying the application topology, it is impossible to effectively exclude the calling data that is not related to the central node, resulting in inaccurate topological relationships and their indicator data. In addition, the related technology usually stores the application topology nodes and their calling relationship data in the same database table as the business request calling data. Since the indicator calculation of the application topology depends on the fully stored business request calling data, the topology data also needs to be stored in full. In the scenario of massive topological data, this storage method brings high computing resource consumption and long query time, which is difficult to meet high performance requirements.
[0004] Therefore, it is urgent to propose a method for accurately generating application topology call relations to solve the above problems. Summary of the invention
[0005] In view of this, the present invention proposes a method, system and device for generating application topology call relationships, which solves the problem that when performing application topology queries on massive topology data, the query results cannot only include call data related to the central node, ensures the correctness of the topology call relationship and the accuracy of its indicator data, reduces computing resource overhead and improves query efficiency.
[0006] Based on the above purpose, an embodiment of the present invention provides a method for generating an application topology calling relationship, which specifically includes the following steps: In response to receiving a topology query request, obtaining a central node and a target time period corresponding to the topology query request; Based on a preset topology relationship table, query a target topology hash value that matches the central node and the target time period; Based on the target topology hash value, determining a number of target link hash values; Based on the preset topology calling indicator table, querying the target indicator data corresponding to each of the target link hash values; Based on all the target link hash values and their corresponding target indicator data, a target topology map including target call relationships is generated.
[0007] In some implementations, the method for generating the application topology call relationship further includes constructing the preset topology relationship table and the preset topology call index table based on the following steps: In response to receiving a number of request data sent by the probe, for each of the request data, using the corresponding tracking identifier as a key field and the request data as a value field, the request data is stored in the first cache, and a preset timer corresponding to the tracking identifier is triggered; In response to the first cache receiving the tracking identifier, checking based on the preset timer whether all the request data corresponding to the tracking identifier are all cached; In response to all the corresponding request data being cached, obtaining all the call pairs and the indicator data corresponding to each of the call pairs based on all the corresponding request data; Constructing a first call relationship array according to all the call pairs, and determining a first topology hash value and a plurality of first link hash values based on the first call relationship array; The preset topology relationship table is constructed based on the first topology hash value, all the first link hash values and all the call pairs, and the preset topology call index table is constructed based on the first topology hash value, all the first link hash values and all the index data.
[0008] In some implementations, the step of determining a first topology hash value based on the first call relationship array includes: Performing topological sorting on all the call pairs in the first call relationship array to obtain a target call relationship array containing a plurality of first node identifiers; Obtaining a seed value corresponding to the target call relation array, and initializing a preset hash algorithm based on the seed value; Based on the initialized preset hash algorithm, each of the first node identifiers in the target call relationship array is converted into an integer to obtain an integer array; The integer array is converted based on a preset function to obtain the first topological hash value.
[0009] In some implementations, the step of determining a plurality of first link hash values based on the first call relationship array includes: Based on each of the call pairs in the first call relationship array, obtaining an initiating node identifier and a receiving node identifier included therein; Based on the initialized preset hash algorithm, convert the first topology hash value to obtain a first integer, convert the initiating node identifier to obtain a second integer, and convert the receiving node identifier to obtain a third integer; An array including the first integer, the second integer, and the third integer is converted based on a preset function to obtain a first link hash value.
[0010] In some implementations, the step of generating a target topology graph including a target call relationship based on all the target link hash values and their corresponding target indicator data includes: Based on a preset search algorithm, all the target link hash values are restored to obtain a number of the target call relationships; Based on the aggregation query algorithm, query the target indicator data to obtain the topology call indicator data corresponding to each target call relationship; Based on all the target call relationships and their corresponding topology call index data, the indexes of all edges, nodes and edges are determined to construct the target topology graph.
[0011] In some implementations, the step of querying a target topology hash value matching the central node and the target time period based on a preset topology relationship table includes: According to the central node identifier of the central node, query the preset topological relationship table for all first topological relationship data whose initiating node identifier field value or receiving node identifier field value matches the central node identifier and whose time field value satisfies the target time period; The topology hash field values in all the first topology relationship data are deduplicated, and the target topology hash value is determined based on the processing result.
[0012] In some implementations, the step of determining a plurality of target link hash values based on the target topology hash value includes: Searching the preset topology relationship table for all second topology relationship data whose topology hash field value matches the target topology hash value; The link hash field value in each of the second topology relationship data is used as a target link hash value.
[0013] In some implementations, the method for generating an application topology call relationship further includes: The application node to be queried input by the user is used as the central node corresponding to the topology query request, and the time period to be queried is used as the target time period corresponding to the topology query request.
[0014] Another aspect of the embodiment of the present invention further provides a system for generating an application topology call relationship, including: an acquisition unit, configured to, in response to receiving a topology query request, acquire a central node and a target time period corresponding to the topology query request; A first query unit, configured to query a target topology hash value matching the central node and the target time period based on a preset topology relationship table; A determination unit configured to determine a number of target link hash values based on the target topology hash value; A second query unit is configured to call the indicator table based on a preset topology to query the target indicator data corresponding to each of the target link hash values; A generating unit is configured to generate a target topology map including a target call relationship based on all the target link hash values and their corresponding target indicator data.
[0015] According to another aspect of an embodiment of the present invention, a computer device is provided, comprising: at least one processor; and a memory, wherein the memory stores a computer program executable on the processor, and the computer program implements the steps of the above method when executed by the processor.
[0016] The present invention has at least the following beneficial technical effects: the method for generating application topology call relationships of the present invention pre-splits the topology nodes and their call relationships from the business request call data into a preset topology relationship table and a preset topology call index table, and associates the two data tables through a topology hash field and a link hash field, thereby avoiding full storage of business request data. In the query phase, the target topology hash value matching the central node is obtained by querying the preset topology relationship table based on the central node and the target time period, thereby removing the call relationship data not associated with the central node, narrowing the query scope, and improving the query throughput. The target link hash value corresponding to the target call relationship related to the central node is determined according to the target topology hash value, thereby quickly querying the preset topology call index table to obtain the target index data of each target call relationship, using the topology hash field and the link hash field to accurately match the topology call relationship and the index data, thereby reducing the number of database scans, thereby avoiding the inefficient query mode of full table scans in traditional methods, optimizing the storage structure of topology relationship data, and improving the query method of topology relationship data, thereby reducing computing resource consumption, improving query efficiency, and ensuring that the generated topology relationship data is accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of an embodiment of an application call topology for multiple request call transactions occurring within a period of time; Figure 2 A schematic diagram of an embodiment of an application topology relationship and its index data queried with node C as the central node in the related art; Figure 3 A block diagram of an embodiment of the application topology fast query method provided by the present invention; Figure 4 A schematic diagram of an embodiment of a system architecture provided by the present invention; Figure 5 A schematic diagram of an embodiment of an application topology call relationship query code provided by the present invention; Figure 6 A schematic diagram of an embodiment of the application topology relationship and its index data queried with node C as the central node provided by the present invention; Figure 7 A schematic diagram of an embodiment of the execution process of the topological hash value generation algorithm provided by the present invention; Figure 8 A schematic diagram of an embodiment of the execution process of the method for generating application topology call relationship provided by the present invention; Fig. 9 A schematic diagram of an embodiment of a system for generating application topology call relationships provided by the present invention; Fig.10 A schematic structural diagram of an embodiment of a computer device provided by the present invention. DETAILED DESCRIPTION
[0019] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0020] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0021] In related technologies, the calling relationship between applications will change over time and with the different services accessed by users, such as Figure 1 FIG. 1 is a schematic diagram of an embodiment of an application call topology of multiple request call transactions within a period of time. Figure 1 For example, assuming that node C is the central node to query its corresponding application topology relationship and indicator data, since the calling relationship of the application topology in the related technology only stores the direct relationship data between the calling node and the called node, the query results are as follows Figure 2 As shown, nodes Y, H, and K that have no direct or indirect calling relationship with node C are included incorrectly. It can be seen that the related technology has the following problems when querying the application topology calling relationship and its related indicator data within a specific time range: (1) The topology call relationship is inaccurate. When the application topology is generated with a certain node as the center, irrelevant nodes appear in the application topology; (2) The topology call index data is inaccurate. Because the call relationship of irrelevant nodes cannot be eliminated, the call index data is incorrect.
[0022] In view of the above problems, the first aspect of the embodiment of the present invention provides a method for generating an application topology calling relationship. Figure 3 As shown, the method for generating an application topology calling relationship of the present invention comprises the following steps: Step S100, in response to receiving a topology query request, obtaining a central node and a target time period corresponding to the topology query request; Step S200, based on the preset topology relationship table, query the target topology hash value that matches the central node and the target time period; Step S300, determining a number of target link hash values based on the target topology hash value; Step S400, calling the indicator table based on the preset topology, querying the target indicator data corresponding to each target link hash value; Step S500, based on all target link hash values and their corresponding target indicator data, a target topology graph including target call relationships is generated.
[0023] In some embodiments, Figure 4 As shown, the execution process of the method of the present invention involves a probe, an application topology data processing system, a database, and an application topology query system. The application topology query system receives a topology query request based on a central node and a target time period, wherein the central node is the application to be queried input by the user, and the target time period is the time range to be queried input by the user. The application identifier of the topology node included in the topology query request is used as the identifier of the central node. Figure 5As shown, with the target time period and the identifier of the central node as conditions, all topo_hashes (i.e., target topology hash values) corresponding to the central node in the target time period are queried from the preset topology relationship table. The application call topology relationship identified by the queried topo_hash only contains topology nodes that have direct or indirect call relationships with the central node. This step eliminates topology nodes that are not related to the central node. Then, with the target time period and the queried topo_hash as conditions, all link_hashes (i.e., target link hash values) and their corresponding from_appid (calling node) and to_appid (called node) are queried from the preset topology relationship table. Further, for each queried link_hash, it is restored to obtain the target call relationship through algorithms such as DFS (depth first search) or BFS (breadth first search), and with the target time period and the link_hash as conditions, the target indicator data corresponding to the target call relationship is aggregated and queried from the preset topology call indicator table, and all target call relationships and their target indicator data are assembled to obtain the target topology graph. By splitting the preset topology relationship table and the preset topology call index table, the index data queries of the application topology call relationship and the topology call relationship are separated. The target index data can be queried from the preset topology call index table with large amounts of data in an on-demand query manner, reducing the system overhead. Figure 5 In the figure, "app_topology" is the preset topology relationship table, "C" is the central node identifier of the example, and "ts>=1736153640" and "ts<=1736153700" are the target time periods of the example.
[0024] In some embodiments, Figure 1 For example, assuming that node C is the central node to query its corresponding application topology relationship and indicator data, the results obtained by the above method of the present invention are as follows Figure 6 As shown, the calling relationship data not associated with the central node C is excluded, and the correct application topology calling relationship and its indicator data are generated.
[0025] The method for generating application topology call relationships of the present invention pre-splits the topology nodes and their call relationships with the business request call data into a preset topology relationship table and a preset topology call index table, and associates the two data tables through a topology hash field and a link hash field, thereby avoiding the full storage of business request data. In the query phase, the target topology call relationship and its target index data related to the central node are accurately matched based on the central node and the target time period, combining the topology hash field and the link hash field, thereby reducing the number of database scans and avoiding the inefficient query mode of full table scans in traditional methods. The storage structure of the topology relationship data is optimized and the query method of the topology relationship data is improved, thereby reducing the consumption of computing resources, improving the query efficiency and ensuring the accuracy of the generated topology relationship data.
[0026] In some embodiments, a method for generating a topological call relationship is applied, and steps for constructing a preset topological relationship table and a preset topological call indicator table include: in response to receiving a number of request data sent by a probe, for each request data, using its corresponding tracking identifier as a key field and the request data as a value field, storing them in a first cache, and triggering a preset timer corresponding to the tracking identifier; in response to the first cache receiving the tracking identifier, checking whether all request data corresponding to the tracking identifier are all cached based on a preset timer; in response to all corresponding request data being all cached, obtaining all call pairs and the indicator data corresponding to each call pair based on all corresponding request data; constructing a first call relationship array based on all call pairs, and determining a first topology hash value and several first link hash values based on the first call relationship array; constructing a preset topological relationship table based on the first topology hash value, all first link hash values and all call pairs, and constructing a preset topology call indicator table based on the first topology hash value, all first link hash values and all indicator data.
[0027] In some embodiments, after the probe collects a business request, such as a request for service A to call service B, the call relationship data (such as the calling node and the called node), the traceid (i.e., tracing identifier) field, and the appid (application identifier) field corresponding to the call relationship data in the business request are encapsulated into request data (i.e., request data), and then the request data is sent in batches to the application topology data processing system.
[0028] In some embodiments, a preset topology relationship table and a preset topology call index table are constructed and maintained by an application topology data processing system. The application topology data processing system starts a topology-related thread pool and initializes the cache therein, namely, the first cache. When the application topology data processing system ingests the request data sent by the probe, the traceid field and the appid field in the request data are extracted. Since the data sent by multiple probes are sequential, in order to process the request data in an orderly manner, the topology-related thread adds the received request data to the first cache with traceid as the key (key field), and sets a preset timer for the traceid. The preset timer duration can be configured according to actual application requirements, for example, set to 30 seconds. When the first cache receives each request data, the preset timer corresponding to the traceid in the request data is triggered. When the timer is triggered, check whether all request data corresponding to the traceid in the first cache have arrived. If there is still unreached request data for the traceid, reset the preset timer corresponding to the traceid and continue to wait for other timers to be triggered. If all request data corresponding to the traceid has arrived, then all request data corresponding to the traceid are taken out from the first cache, and based on the call relationship data (i.e., call pairs) in all the request data taken out, the call pairs record the appid of the calling node and the appid of the called node, and all the call pairs are put into an array to obtain the first call relationship array. Among them, traceid is used to identify a complete request call transaction. For example, when a request initiated by a user passes through multiple service or application instances, all request requests of all service or application instances share the same traceid, so that the flow of the entire business request can be tracked to determine the overall link.
[0029] In some implementations, all request data in a request call transaction can be used to form an application call topology for a single request call transaction. However, due to the emergence of system architecture, complex balancing strategies, fault switching, and other reasons, multiple request call transactions initiated at different times may generate the same or different application call topologies. Therefore, the first call relationship array can be used to generate a unique topo_hash through a preset algorithm to distinguish different application call topologies, and further generate a unique link_hash to distinguish each business request in different application call topologies.
[0030] In some implementations, in order to reduce the query overhead of application call topology and indicator data, the application call topology data and the topology call indicator data are stored in two tables respectively. The preset topology relationship table only stores ts (timestamp), topo_hash, link_hash, from_appid and to_appid fields, as shown in Table 1 below. The preset topology call indicator table only stores ts, topo_hash, link_hash, count, and other indicator fields, as shown in Table 2 below. Among them, ts is rounded to the minute level to reduce the amount of data. For example, the initial ts is expressed as 1736153679 (2025 / 01 / 06 16:54:39), and the ts after minute rounding is expressed as 1736153640. Figure 1 Taking the application call topology of multiple business calls as an example, the topology call relationship data of each application call topology is deduplicated and stored in the database in the structure of Table 1 below. The topology call indicator data is pre-aggregated and stored in the database in the structure of Table 2 to reduce the amount of data. The count field in Table 2 records the number of calls, the slow field indicates the slow number, and dur indicates the average response time.
[0031] Table 1
[0032] Table 2
[0033] The method for generating application topology call relations of the present invention is to optimize storage and query efficiency. The application topology data processing system adopts a preset topology relationship table to store topology nodes and their call relationship data, adopts a preset topology call index table to store specific business request call data, and associates the two database tables through topo_hash and link_hash. Since the nodes and call relationships of the application call topology as a whole are relatively fixed in a long period, the topo_hash and link_hash values are relatively fixed and have a small cardinality, and then the pre-aggregation technology can be used to ensure that the data volume of the database table storing the application topology nodes and their call relationship data is small, and then the computing resources and query time overhead of the application topology call relationship query will be very small. Then, the topo_hash and link_hash fields in the query results can be used to accurately aggregate the query topology call index data, avoiding redundant database scanning operations and meeting high performance requirements.
[0034] In some embodiments, the step of determining the first topological hash value based on the first call relationship array includes: performing topological sorting on all call pairs in the first call relationship array to obtain a target call relationship array containing several first node identifiers; obtaining a seed value corresponding to the target call relationship array, and initializing a preset hash algorithm based on the seed value; based on the initialized preset hash algorithm, converting each first node identifier in the target call relationship array into an integer to obtain an integer array; and converting the integer array based on a preset function to obtain a first topological hash value.
[0035] In some embodiments, Figure 7 As an example, the topo_hash generation process is explained. The full-link application call topology is a directed acyclic graph (DAG), whose vertices are applications (appids) and edges are request data (call pairs). The first call relationship array is topologically sorted using the Kahn (graph topological sorting algorithm) algorithm to generate an appid array that conforms to the actual call relationship, that is, the target call relationship array, such as Figure 7 In the array "[B,C,D,F,X]", each appid in the appid array is the first node identifier. Because the topological sorting is performed based on the call relationship data in the request data, it is ensured that even if the request call transactions pass through the same application, different target call relationship arrays will be generated due to different call relationship data. In order to avoid the situation where different request call transactions pass through the same applications but have different call relationships with each other, the first node identifier in the target call relationship array may be highly similar, resulting in a hash collision in the generated topo_hash, a dynamic generation of hash seed values and a double hashing mechanism are introduced to solve the above situation. A seed value of MurmurHash3 (i.e., the preset hash algorithm) is generated based on the generated target call relationship array. The seed value is used to initialize the hash value. Different seed values will cause MurmurHash3 to generate different hash sequences, thereby improving the randomness of the generated topo_hash. Based on the MurmurHash3 algorithm initialized with the dynamically generated seed value, each first node identifier in the target call relationship array is converted into an integer to obtain an integer array, and the integer array is converted into a final topo_hash corresponding to a request call transaction, i.e., the first topological hash value, through the SHA1 (cryptographic hash function) algorithm. For example, the seed value generated according to the generated target call relationship array can be generated by serializing the array into a string and converting the serialized string into a seed through a simple hash algorithm.
[0036] The method for generating application topology call relationships of the present invention, by sorting all associated nodes in a distributed business request call transaction according to the call relationship in an application topology data processing system and calculating a hash value topo_hash, uses topo_hash to uniquely identify the application call topology corresponding to different request call transactions, so as to facilitate subsequent optimization of the storage structure of topology relationship data and improve the query method of topology relationship data, so as to reduce computing resource consumption, improve query efficiency and ensure the accuracy of the generated topology relationship data.
[0037] In some embodiments, based on the first call relationship array, the step of determining several first link hash values includes: based on each call pair in the first call relationship array, obtaining the initiating node identifier and the receiving node identifier included therein; based on the initialized preset hash algorithm, converting the first topology hash value to obtain a first integer, converting the initiating node identifier to obtain a second integer, and converting the receiving node identifier to obtain a third integer; based on a preset function, converting the array containing the first integer, the second integer, and the third integer to obtain a first link hash value; wherein, each call pair has a first link hash value corresponding to it, and the first topology hash value has one or more first link hash values corresponding to it.
[0038] In some implementations, for each request call transaction, the corresponding topo_hash is converted into an integer through the MurmurHash3 algorithm after the above initialization to obtain a first integer. For each call relationship data in the request call transaction, the appid of the calling node (i.e., the initiating node identifier) and the appid of the called node (i.e., the receiving node identifier) are respectively converted into integers through the MurmurHash3 algorithm after the above initialization to obtain a second integer and a third integer. The first integer, the second integer, and the third integer are converted into the final link_hash corresponding to a call relationship in a request call transaction, i.e., the first link hash value, through the SHA1 algorithm.
[0039] The method for generating application topology call relationships of the present invention calculates a hash value for each call relationship data in a distributed business request call transaction in an application topology data processing system and uses the hash value as link_hash, and uses link_hash to uniquely identify different call relationships in different request call transactions, so as to facilitate subsequent optimization of the storage structure of the topology relationship data and improve the query method of the topology relationship data, so as to reduce computing resource consumption, improve query efficiency and ensure the accuracy of the generated topology relationship data.
[0040] In some embodiments, based on all target link hash values and their corresponding target indicator data, the step of generating a target topology graph including target call relationships includes: based on a preset search algorithm, restoring all target link hash values to obtain a number of target call relationships; based on an aggregate query algorithm, querying in the target indicator data to obtain topology call indicator data corresponding to each target call relationship; based on all target call relationships and their corresponding topology call indicator data, determining the indicators of all edges, nodes, and edges to construct a target topology graph.
[0041] In some embodiments, the topology map is usually composed of nodes and edges, each node usually represents an application, the attributes of the node may include the service name of the application, instance status, response time, number of errors and number of calls, etc. The edge represents the call relationship between applications, and the indicators on the edge may include average response time, throughput and number of calls, etc. The preset search algorithm includes the DFS algorithm and the BFS algorithm. For all the target link hash values queried, the target call relationship is restored by algorithms such as DFS or BFS, so as to determine all the nodes and all the edges of the application call topology. And based on the target time period and the target link hash value as conditions, the target indicator data corresponding to the target call relationship is aggregated and queried from the preset topology call indicator table, and the indicators of all the edges of the full-link application call topology can be determined. The target topology map is constructed by all the nodes, all the edges and all the edge indicators determined above, and the target topology map only includes the application topology call relationship associated with the central node and the call indicator data is accurate.
[0042] The method for generating application topology call relationships of the present invention can efficiently restore and analyze application topology call relationships related to central nodes, and use them for applications such as visualization, performance analysis or anomaly detection.
[0043] In some embodiments, based on a preset topology relationship table, the step of querying a target topology hash value that matches a central node and a target time period includes: according to a central node identifier of the central node, querying in a preset topology relationship table all first topology relationship data whose initiating node identifier field value or receiving node identifier field value matches the central node identifier and whose time field value satisfies the target time period; deduplicating the topology hash field values in all the first topology relationship data, and determining the target topology hash value based on the processing result.
[0044] In some embodiments, based on the target topology hash value, the step of determining several target link hash values includes: querying a preset topology relationship table for all second topology relationship data whose topology hash field values match the target topology hash value; and taking the link hash field value in each second topology relationship data as a target link hash value.
[0045] In some embodiments, Figure 5 , Table 1 and Table 2 as examples, with node C as the central node, "ts>=1736153640" and "ts<=1736153700" as the limited target time period, each row of data in Table 1 whose ts field value (i.e., time field value) is within the target time period and whose from_appid field value is 'C' or to_appid field value is 'C' is taken as a first topological relationship data. The topo_hash field values of all the queried first topology relationship data are obtained and all topo_hash field values are deduplicated, and the target topology hash values corresponding to node C are obtained as "bf79a01a19c05f322ce07ecb863ba2772d59d6cd", "7eb592dfcfbd5769abaf2f051d609d1bf003a4b4" and "28806b3e735dbbbaa92e7037501036653a76f376". Based on the target topology hash value and the target time period, each row of data in Table 1 whose topo_hash field value is the target topology hash value and whose ts field value is within the target time period is taken as a second topology relationship data, and the link_hash field values of all the queried second topology relationship data are obtained to obtain all the target link hash values.
[0046] The method for generating application topology call relationships of the present invention is aimed at the full-link application call topology of the operation and maintenance industry. When querying, topo_hash is used to determine whether each call relationship in the call transaction is related to the central node, so as to exclude call relationship data that is not associated with the central node, and link_hash is used to obtain the indicator data stored in the edge of the relevant call relationship, thereby generating a topological graph including the correct application topology relationship and its indicator data, reducing resource consumption during query and improving query efficiency.
[0047] In some implementations, the method for generating an application topology call relationship further includes: using the application node to be queried input by the user as the central node corresponding to the topology query request, and the time period to be queried as the target time period corresponding to the topology query request.
[0048] In some embodiments, Figure 8The diagram is a schematic diagram of an embodiment of the generation process of the application topology call relationship provided by the present invention. The request data sent by the probe is processed by the application topology data processing system, and the topology nodes and their call relationships are pre-split and stored with the business request call data into a preset topology relationship table and a preset topology call index table, and the two data tables are associated by generating topo_hash and link_hash. The topology query system receives a topology query request based on the central node and the target time period, and accurately queries the topology hash field and link hash field that match the central node in the preset topology relationship table and the preset topology call index table, thereby determining all target topology call relationships and their target index data that are only related to the central node, and finally restoring the query results to the correct topology map. The above process avoids the inefficient query mode of full table scanning in the traditional method, greatly reduces the computing resource consumption during the query, improves the query efficiency, and ensures the accuracy of the generated topology relationship data.
[0049] Based on the same inventive concept, according to another aspect of the present invention, Fig. 9 As shown, an embodiment of the present invention further provides a system for generating an application topology call relationship, and the system for generating an application topology call relationship includes: An acquiring unit 110 is configured to, in response to receiving a topology query request, acquire a central node and a target time period corresponding to the topology query request; The first query unit 120 is configured to query a target topology hash value matching the central node and the target time period based on a preset topology relationship table; A determining unit 130, configured to determine a number of target link hash values based on a target topology hash value; The second query unit 140 is configured to call the indicator table based on the preset topology to query the target indicator data corresponding to each target link hash value; The generating unit 150 is configured to generate a target topology graph including target call relationships based on all target link hash values and their corresponding target indicator data.
[0050] The system for generating application topology call relationships of the present invention pre-splits topology nodes and their call relationships from business request call data and stores them in a preset topology relationship table and a preset topology call index table, and associates the two data tables through a topology hash field and a link hash field, thereby avoiding full storage of business request data. In the topology call relationship query stage, according to the central node and time period, the preset topology relationship table is first queried to obtain a target topology hash value matching the central node, thereby narrowing the query range and improving the query throughput, and the target link hash value corresponding to the target call relationship related to the central node is determined according to the target topology hash value, and then the preset topology call index table is quickly queried according to the target link hash value to obtain the target index data corresponding to each target call relationship, and the topology hash field and the link hash field are used to accurately match the topology call relationship and the index data, thereby reducing the number of database scans and avoiding the inefficient query mode of full table scans in traditional methods. The above scheme optimizes the storage structure of topology relationship data and improves the query method of topology relationship data, thereby reducing computing resource consumption, improving query efficiency and ensuring the accuracy of the generated topology relationship data.
[0051] Based on the same inventive concept, according to another aspect of the present invention, Fig.10 As shown, an embodiment of the present invention further provides a computer device 30, which includes a processor 310 and a memory 320. The memory 320 stores a computer program 321 that can be run on the processor. When the processor 310 executes the program, the steps of the above method are performed.
[0052] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned any method embodiments.
[0053] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0054] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0055] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0056] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for generating an application topology calling relationship, characterized in that: include: In response to receiving a topology query request, obtaining a central node and a target time period corresponding to the topology query request; Based on a preset topology relationship table, query a target topology hash value that matches the central node and the target time period; Based on the target topology hash value, determining a number of target link hash values; Based on the preset topology calling indicator table, querying the target indicator data corresponding to each of the target link hash values; Based on all the target link hash values and their corresponding target indicator data, a target topology map including target call relationships is generated.
2. The method for generating application topology call relations according to claim 1, characterized in that: The preset topology relationship table and the preset topology call index table are constructed based on the following steps: In response to receiving a number of request data sent by the probe, for each of the request data, using the corresponding tracking identifier as a key field and the request data as a value field, the request data is stored in the first cache, and a preset timer corresponding to the tracking identifier is triggered; In response to the first cache receiving the tracking identifier, checking based on the preset timer whether all the request data corresponding to the tracking identifier are all cached; In response to all the corresponding request data being cached, obtaining all the call pairs and the indicator data corresponding to each of the call pairs based on all the corresponding request data; Constructing a first call relationship array according to all the call pairs, and determining a first topology hash value and a plurality of first link hash values based on the first call relationship array; The preset topology relationship table is constructed based on the first topology hash value, all the first link hash values and all the call pairs, and the preset topology call index table is constructed based on the first topology hash value, all the first link hash values and all the index data.
3. The method for generating application topology call relations according to claim 2, characterized in that: The step of determining a first topology hash value based on the first call relationship array includes: Performing topological sorting on all the call pairs in the first call relationship array to obtain a target call relationship array containing a plurality of first node identifiers; Obtaining a seed value corresponding to the target call relation array, and initializing a preset hash algorithm based on the seed value; Based on the initialized preset hash algorithm, each of the first node identifiers in the target call relationship array is converted into an integer to obtain an integer array; The integer array is converted based on a preset function to obtain the first topological hash value.
4. The method for generating application topology call relations according to claim 3, characterized in that: The step of determining a plurality of first link hash values based on the first call relationship array includes: Based on each of the call pairs in the first call relationship array, obtaining an initiating node identifier and a receiving node identifier included therein; Based on the initialized preset hash algorithm, convert the first topology hash value to obtain a first integer, convert the initiating node identifier to obtain a second integer, and convert the receiving node identifier to obtain a third integer; An array including the first integer, the second integer, and the third integer is converted based on a preset function to obtain a first link hash value.
5. The method for generating application topology call relations according to claim 1, characterized in that: The step of generating a target topology graph including a target call relationship based on all the target link hash values and the corresponding target indicator data includes: Based on a preset search algorithm, all the target link hash values are restored to obtain a number of the target call relationships; Based on the aggregation query algorithm, query the target indicator data to obtain the topology call indicator data corresponding to each target call relationship; Based on all the target call relationships and their corresponding topology call index data, the indexes of all edges, nodes and edges are determined to construct the target topology graph.
6. The method for generating application topology call relations according to claim 1, characterized in that: The step of querying the target topology hash value matching the central node and the target time period based on the preset topology relationship table includes: According to the central node identifier of the central node, query the preset topological relationship table for all first topological relationship data whose initiating node identifier field value or receiving node identifier field value matches the central node identifier and whose time field value satisfies the target time period; The topology hash field values in all the first topology relationship data are deduplicated, and the target topology hash value is determined based on the processing result.
7. The method for generating application topology call relations according to claim 1, characterized in that: The step of determining a plurality of target link hash values based on the target topology hash value comprises: Searching the preset topology relationship table for all second topology relationship data whose topology hash field value matches the target topology hash value; The link hash field value in each of the second topology relationship data is used as a target link hash value.
8. The method for generating application topology call relations according to claim 1, characterized in that: Also includes: The application node to be queried input by the user is used as the central node corresponding to the topology query request, and the time period to be queried is used as the target time period corresponding to the topology query request.
9. A system for generating application topology call relations, characterized in that: include: an acquisition unit, configured to, in response to receiving a topology query request, acquire a central node and a target time period corresponding to the topology query request; A first query unit, configured to query a target topology hash value matching the central node and the target time period based on a preset topology relationship table; A determination unit configured to determine a number of target link hash values based on the target topology hash value; A second query unit is configured to call the indicator table based on a preset topology to query the target indicator data corresponding to each of the target link hash values; A generating unit is configured to generate a target topology map including a target call relationship based on all the target link hash values and their corresponding target indicator data.
10. A computer device comprising: at least one processor; as well as A memory storing a computer program executable on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 8 when executing the program.
Citation Information
Patent Citations
Topological node change tracking method, system and equipment
CN119271849A
Quick query method, system and equipment for application topology
CN119441320A
Block chain index storage method and apparatus, computer device and medium
WO2022143540A1