Data processing method and device, computer device, and storage medium
By encoding and identifying application call topology graphs and deleting data from cyclic call branches, the problem of excessive storage overhead is solved, and the efficiency of topology graph queries is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MASHANG CONSUMER FINANCE CO LTD
- Filing Date
- 2022-09-08
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the application of topology graphs results in excessive storage overhead due to circular calls, making them difficult to manage and query effectively.
By encoding the data nodes in each call level of the application call topology, generating corresponding strings, and identifying and deleting cyclic call branch data that meet preset conditions.
This reduces the storage overhead of applications calling the topology graph and improves the efficiency and performance of topology graph queries.
Smart Images

Figure CN117707714B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information technology, and in particular to a data processing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] With the continuous development of information technology, various business requests typically require extensive data support from numerous applications to fulfill the corresponding business functions. Consequently, executing these requests often involves multiple layers of calls to various applications.
[0003] In related applications, in order to quickly determine the dependencies between applications called layer by layer when executing business requests, a full-link application call topology system can be used to collect Hypertext Transfer Protocol (HTTP) requests between various applications and method calls within the applications. This allows the call data of the same business request to be aggregated across different applications, constructing an application call topology graph for that business request, and storing the application call topology graph in a graph database.
[0004] However, if an application makes circular calls to other applications or middleware during the execution of a method, a large amount of circular call branch data will appear in the application call topology graph, resulting in excessive storage overhead for the application call topology graph. Summary of the Invention
[0005] This application provides a data processing method, apparatus, computer equipment, and storage medium to overcome the technical problem of excessive storage overhead in the application calling topology graph in the prior art.
[0006] In a first aspect, embodiments of this application provide a data processing method, the method comprising:
[0007] Obtain the application call topology graph corresponding to the target object, wherein the application call topology graph includes the call relationship between multiple data nodes called when the target object is executed;
[0008] Each data node in each call level of the application call topology is encoded to generate a string corresponding to each call level. The call levels are divided according to the call order between the data nodes in the application call topology. Each character in the string corresponds one-to-one with a data node in the call level corresponding to the string.
[0009] Determine the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph. The target substring is used to represent the data node that is called cyclically in the call level and meets the preset conditions. The branch data includes the first data node corresponding to the target substring, the second data node that has a call relationship with the first data node, and the call relationship between the first data node and the second data node.
[0010] The application calls the topology graph to delete the branch data.
[0011] Secondly, embodiments of this application provide a data processing apparatus, the apparatus comprising:
[0012] The acquisition unit is used to acquire the application call topology graph corresponding to the target object, wherein the application call topology graph includes the call relationship between multiple data nodes called when the target object is executed;
[0013] The processing unit is configured to encode the data nodes in each call level of the application call topology graph, generate a string corresponding to each call level, wherein the call levels are divided according to the call order between the data nodes in the application call topology graph, and each character in the string corresponds one-to-one with a data node in the call level corresponding to the string; determine the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph, wherein the target substring is used to characterize the data node that is called cyclically in the call level and meets the preset conditions, and the branch data includes the first data node corresponding to the target substring, the second data node that has a call relationship with the first data node, and the call relationship between the first data node and the second data node;
[0014] A pruning unit is used to delete the branch data in the application's topology graph.
[0015] Thirdly, embodiments of this application provide a computer device, including: at least one processor and a memory;
[0016] The memory stores computer-executed instructions;
[0017] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the data processing method designed as described in the first aspect above.
[0018] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the data processing method designed in the first aspect above.
[0019] The aforementioned data processing method encodes multiple data nodes in each call level of the application call topology graph to determine the string corresponding to each call level. From this string, it identifies the target substring representing the data node that is cyclically called within the call level and meets preset conditions. This substring is then used to delete the branch data corresponding to the target substring from the application call topology graph. By deleting the cyclically called branch data, the storage overhead of the application call topology graph can be reduced. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A schematic diagram illustrating the implementation environment of a data processing method provided in this application embodiment;
[0022] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0023] Figure 3 A schematic diagram of an application call topology provided in an embodiment of this application;
[0024] Figure 4 This is a trimmed application call topology diagram provided in the embodiments of this application;
[0025] Figure 5 A flowchart illustrating a method for establishing an application call topology graph, provided in an embodiment of this application;
[0026] Figure 6 A schematic diagram of another application call topology provided in an embodiment of this application;
[0027] Figure 7 A flowchart illustrating another data processing method provided in an embodiment of this application;
[0028] Figure 8 A structural block diagram of a data processing apparatus provided in an embodiment of this application;
[0029] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0030] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0031] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0032] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0033] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0034] With the continuous development of information technology, various business requests typically require extensive data support from numerous applications to fulfill the corresponding business functions. Consequently, executing these requests often involves a complex chain of calls between numerous applications. Due to the intricate dependencies between these applications, when problems arise during execution, it is often difficult to quickly identify the relevant dependencies to pinpoint the issue.
[0035] To quickly determine the dependencies between applications called layer by layer when executing business requests, thereby improving the accuracy and effectiveness of problem localization, a full-link application call topology system can typically be used to collect Hypertext Transfer Protocol (HTTP) requests between various applications and method calls within the applications. This aggregates the call data of the same business request across different applications, constructing an application call topology graph for that business request. This application call topology graph can then be stored as a directed graph of dependencies between applications in a graph database.
[0036] For example, in a microservice architecture, the above-mentioned end-to-end application call topology system can be implemented using an application performance monitor (APM). APM tracks the call chain of microservices.
[0037] However, if an application makes circular calls to other applications or middleware during the execution of its methods, a large amount of circular call branch data will appear in the application call topology graph, resulting in excessive storage overhead for the application call topology graph.
[0038] To address the aforementioned problems, embodiments of this application provide a data processing method, apparatus, computer device, and storage medium. By encoding multiple data nodes in each call level of an application call topology graph, a string corresponding to each call level of the application call topology graph is determined. From this string, a target substring representing a data node that is cyclically called at a call level and meets preset conditions is identified. This deletes branch data corresponding to the target substring from the application call topology graph. This branch data includes a first data node corresponding to the target substring, a second data node with a call relationship to the first data node, and the call relationship between the first and second data nodes. By deleting the cyclically called branch data, the storage overhead of the application call topology graph can be reduced.
[0039] The following describes the application scenarios of the data processing methods provided in this disclosure.
[0040] In some embodiments, the data processing method provided in this application can be applied to business request invocation scenarios. When a business request needs to be executed, applications that provide data support for the business request can be invoked layer by layer, and an application call topology graph can be generated and stored based on the call data between applications. Subsequently, the data processing method described above is used to trim the branch data of the circular calls in the application call topology graph, and the trimmed application call topology graph is used for subsequent topology queries.
[0041] It should be noted that the above two application scenarios do not constitute a limitation on this application. The loop call processing method provided in this application can be applied to any business request call scenario.
[0042] Figure 1 This is a schematic diagram illustrating the implementation environment of a data processing method provided in an embodiment of this application. For example... Figure 1 As shown, the implementation environment of this data processing method may include terminal device 101, or terminal device 101 and server 102. Terminal device 101 can be connected to server 102 via a wireless or wired network.
[0043] When a business request is executed, the terminal device 101 can collect the call data between various applications during the execution of the business request, and generate an application call topology based on the call data. Subsequently, the terminal device 101 executes the above data processing method to process the application call topology to remove the branch data of circular calls.
[0044] Alternatively, terminal device 101 can interact with server 102. Terminal device 101 can send the collected call data to server 102, which will then generate an application call topology graph and execute the aforementioned data processing method to prune the branches of cyclic calls in the application call topology graph. Subsequently, server 102 can store the pruned application call topology graph in its corresponding storage device, or it can send the pruned application call topology graph back to terminal device 101.
[0045] Among them, the terminal device 101 can be a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in a smart home, etc.
[0046] In this embodiment, the device for implementing the functions of the terminal device can be a terminal or a device capable of supporting the terminal in implementing the functions, such as a chip system, which can be installed in the terminal. In this embodiment, the chip system can be composed of chips or can include chips and other discrete devices.
[0047] Server 102 can be, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of computers or network servers. Among them, cloud computing is a type of distributed computing, which is a super virtual computer composed of a group of loosely coupled computers.
[0048] It is understood that the above data processing method can be executed by the computer equipment provided in the embodiments of this application, which may refer to the terminal device 101 or the server 102 mentioned above.
[0049] The technical solutions of the embodiments of this application will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0050] refer to Figure 2 , Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application. The execution subject of this embodiment is a computer device, and this embodiment relates to the process of pruning branch data in a loop call within an application call topology graph. The data processing method includes:
[0051] S201: Obtain the application call topology graph corresponding to the target object. The application call topology graph includes the call relationships between multiple data nodes called when the target object is executed.
[0052] In this application, when executing the target object, multiple data nodes can be called layer by layer to provide data support. After executing the target object, the computer device can obtain the application call topology diagram corresponding to the target business, generated by the call relationships between multiple data nodes.
[0053] The data node includes the application or application interface invoked when the target object is executed. For example, if application A makes a call request to another application through interface 1, then application A can be the aforementioned data node, and application A's interface 1 can also be the aforementioned data node.
[0054] It should be understood that the embodiments of this application do not limit the target object described above, and it can be any service in any application. For example, the target object can be a video playback service in a shopping application, or a voice call service in an instant messaging application, etc.
[0055] In some embodiments, the application call topology may include multiple data nodes, which may be connected based on call relationships to form different data branches.
[0056] For example, Figure 3 This is a schematic diagram of an application call topology provided in an embodiment of this application. For example... Figure 3 As shown, the application call topology includes data nodes applications A, B, C, D, E, F, and G. Applications A and B have call relationships; applications B have call relationships with applications C, D, and E; applications C and F have call relationships; applications D and G have call relationships; and applications E and H have call relationships. These call relationships connect the data nodes, thus forming multiple data branches of the application call topology.
[0057] S202: Encode the data nodes in each call level of the application call topology graph to generate a string corresponding to each call level.
[0058] In this application, when a computer device obtains the application call topology graph corresponding to the target service, it can determine the branch data of the circular call in the application call topology graph by encoding the data nodes in each call level of the application call topology graph.
[0059] It should be noted that, in this application implementation, the call hierarchy is divided according to the call order among the data nodes in the application call topology diagram. In some embodiments, based on the call order among data nodes, the number of calls required before each data node is called can be determined, and then data nodes that require the same number of calls before being called are grouped into the same call hierarchy.
[0060] For example, continue to refer to Figure 3 In the application call topology, application A first calls application B, then application B calls applications C, D, and E. Finally, application C calls application F, and there are call relationships between application D and application G. Application E calls application H.
[0061] Since application A is not invoked before being called, it is classified as the first invocation level. Since application B only needs to be called once before being invoked, it is classified as the second invocation level. Since applications C, D, and E require two invocations (to applications A and B) before being invoked, they are classified as the third invocation level. Since applications F, G, and H require three invocations before being invoked, they are classified as the fourth invocation level.
[0062] It should be understood that the embodiments of this application do not limit how data nodes are encoded. In some embodiments, the computer device can generate a string corresponding to each calling level based on the encoding identifier corresponding to the data node in each calling level, wherein the encoding identifier corresponding to the same data node is the same.
[0063] For example, if an application calls a topology graph containing a data node application A, then all applications A called by that application in the topology graph will have the same encoded identifier.
[0064] In this application embodiment, there is no restriction on the type of encoding identifier; numbers or letters can be used as encoding identifiers.
[0065] In some embodiments, each character in the string corresponds one-to-one with a data node in the call hierarchy corresponding to the string. The number of data nodes in the call hierarchy is the same as the number of characters in the string.
[0066] For example, continue to refer to Figure 3 We can assign code identifier 0 to data nodes using C, code identifier 1 to data nodes using D, and code identifier 2 to data nodes using E. The list L3 of data nodes contained in the third call level is [C, D, E, C, D, E, C, D, E, C, D, E]. Based on the assigned code identifiers in the third call level, the generated string S3 corresponding to the third call level can be "012012012012". The number and order of data nodes in the string and the data node columns can be consistent.
[0067] In some embodiments, if the data node is an application interface called by the target application during execution, different encoding identifiers can be assigned to different interfaces of the same application when assigning encoding identifiers.
[0068] S203: Determine the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph. The target substring is used to represent the data node that is called in a loop in the call level and meets the preset conditions.
[0069] In this step, after the computer device generates the string corresponding to each call level, it can determine the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph.
[0070] It should be understood that the embodiments of this application do not impose limitations on how the target substring is determined. In some embodiments, the computer device may first determine multiple substrings in the string corresponding to each calling level and the number of consecutive repetitions of each substring. Subsequently, the target substring is determined from the substrings based on the number of consecutive repetitions of each substring.
[0071] Optionally, the multiple substrings in the string corresponding to each call level can be any substring in the string corresponding to each call level.
[0072] In this context, substrings within a string can be identified by iterating through the string. For example, if the string is "012012012012", then by iterating through the string, the substrings that can be identified include: "012012012012", "12012012012", "120", "2012012012", "201", "012012012", "12012012", "2012012", "012012", "12012", "2", "012", "12", and "2".
[0073] In some embodiments, after determining the number of consecutive repetitions of each substring, the computer device can also determine the starting position of the substring in the string corresponding to the calling level, so that the branch data corresponding to the substring can be quickly found during subsequent pruning, thereby improving the pruning speed.
[0074] For example, Table 1 is a table of consecutive repetitions of substrings provided in the embodiments of this application. Table 1 lists all substrings in the string corresponding to the calling level and counts the consecutive repetitions and starting positions of the substrings.
[0075] Table 1
[0076] substring Number of consecutive repetitions Starting position 012012012012 1 0 12012012012 1 1 120 3 1 2012012012 1 2 201 3 2 012012012 1 3 12012012 1 4 2012012 1 5 012012 2 0 12012 1 1 2012 1 2 012 4 0 12 1 / 2 1 /
[0077] For example, a computer device can compare the number of consecutive repetitions of each substring with a second threshold to determine whether a substring is a target substring. If the number of consecutive repetitions of a substring is greater than or equal to the second threshold, the substring is determined to be a target substring. If the number of consecutive repetitions of a substring is less than the second threshold, the substring is determined not to be a target substring.
[0078] The second threshold can be determined based on the search precision of the loop. For example, the second threshold can be set to a value such as 2 or 3.
[0079] For example, if the second threshold is set to 2, it can be determined by referring to Table 1 that the target substrings in the substrings contained in the string "012012012012" can include "012", "120", "201" and "012012".
[0080] In some embodiments, the computer can also sort the target substrings, for example, first sorting by the number of consecutive repetitions and then by the starting position, to obtain the target substring table as shown in Table 2.
[0081] Table 2
[0082] substring Number of consecutive repetitions Starting position 012 4 0 120 3 1 210 3 2 012012 2 0
[0083] It should be noted that the branch data involved in the embodiments of this application includes the first data node corresponding to the target substring, the second data node that has a calling relationship with the first data node, and the calling relationship between the first data node and the second data node.
[0084] It should be understood that in this application, after encoding the data nodes in each call level, a string corresponding to that call level can be obtained. Each string contains multiple substrings, and each substring corresponds to a combination of data nodes. When a certain substring is determined to be a target substring, it can be determined that the data node corresponding to the target substring is called cyclically in the application call topology graph. Accordingly, the first data node corresponding to the target substring, the second data node that has a call relationship with the first data node, and the call relationship between the first data node and the second data node are the branch data.
[0085] In some embodiments, before determining the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph, the computer device may first determine whether branch data exists in the application call topology graph. The computer device may first count the number of calls to the data nodes in the application call topology graph. If the number of calls to the data nodes in the application call topology graph is greater than or equal to a first threshold, then it is determined that branch data exists in the application call topology graph. If the number of calls to the data nodes in the application call topology graph is less than the first threshold, then it is determined that branch data exists in the application call topology graph.
[0086] The first threshold can be set according to the actual situation; for example, the first threshold can be set to 3.
[0087] In some embodiments, since the number of calls to the target data node with the most calls in the application call topology graph is less than a first threshold, the number of calls to all data nodes in the application call topology graph is also less than the first threshold. Therefore, the presence of branch data in the application call topology graph can also be determined by the number of calls to the target data node. If the number of calls to the target data node is greater than or equal to the first threshold, it is determined that branch data exists in the application call topology graph. If the number of calls to the target data node is less than the first threshold, it is determined that no branch data exists in the application call topology graph.
[0088] For example, if application A is the data node with the most calls in the application call topology graph, and application A is called 4 times, then since the number of calls to application A is greater than the first threshold of 3, it can be determined that there is branch data in the application call topology graph.
[0089] In other embodiments, the computer device can first compare the number of calls to data nodes in the application call topology graph with a first threshold to determine whether branch data exists in the application call topology graph. Once branch data exists, the computer device then determines the substrings in the string corresponding to each call level and the number of consecutive repetitions of each substring, thereby determining the target substring from the substrings based on the number of consecutive repetitions of each substring. Because the existence of branch data is determined first based on the first threshold, and the target substring is only determined when branch data exists, querying for branch data when the application call topology graph has no branch data can be avoided, thus improving data processing efficiency.
[0090] S204: Delete branch data in the application call topology graph.
[0091] In this application, once the computer device determines the branch data corresponding to the target substring in the application call topology graph, the branch data can be deleted from the application call topology graph.
[0092] It should be understood that the embodiments of this application do not limit how branch data is deleted. In some embodiments, the computer can retain only the branch data that appears once in the application call topology graph and delete all other duplicate branch data.
[0093] In some embodiments, if there are multiple target substrings and correspondingly multiple branch data, the branch data of each target substring can be traversed sequentially based on the sorting of the target substrings and deleted respectively.
[0094] For example, Figure 4 This is a cropped application call topology diagram provided in the embodiments of this application. Based on the target substrings "012", "120", "201", and "012012", it is possible to... Figure 3 The application call topology diagram shown is used to prune the branch data of the loop calls and simplify the application call topology diagram as follows: Figure 4 As shown.
[0095] In this application, by removing duplicate branch data from the application call topology graph, the number of topology links in the application call topology graph can be significantly reduced. If an application contains a circular call with n iterations and d call depth, then before deleting branch data using the above data processing method, the number of topology links in the application call topology graph is C = n. dAs the number of iterations increases, the total number of topologies increases exponentially. After deleting branch data using the above data processing method, the overall number of topologies called by the application in the topology graph remains within a constant range, unaffected by the number of iterations. This significantly reduces the number of topologies generated by the same business request, thereby reducing the storage overhead of the underlying graph database storing the application's topology graph.
[0096] The method for handling circular calls provided in this application embodiment involves the following steps: First, the computer device obtains an application call topology graph corresponding to the target object. This graph includes the call relationships between multiple data nodes invoked when the target object is executed. Second, the computer device encodes the data nodes in each call level of the application call topology graph, generating a string corresponding to each call level. Third, the computer device determines the target substring in each call level's string and the corresponding branch data in the application call topology graph. The target substring represents the data node that is cyclically invoked in the call level and satisfies preset conditions. The branch data includes a first data node, a second data node with a call relationship to the first data node, and the call relationship between the first and second data nodes. Finally, the computer device deletes the branch data from the application call topology graph. This method allows for the determination of cyclically invoked branch data by encoding data nodes, thereby pruning the branch data and reducing the storage overhead of the application call topology graph.
[0097] Based on the above embodiments, the following explains how to establish the application call topology graph corresponding to the target object. Figure 5 This is a flowchart illustrating a method for establishing an application call topology graph, provided as an embodiment of this application. Figure 5 As shown, the application calls the following methods to create the topology graph:
[0098] S301. Collect and call data. The call data is the data generated when the target object calls multiple data nodes during the execution of the target object.
[0099] It should be understood that the embodiments of this application do not limit how the above-mentioned call data is collected. In some embodiments, it can be implemented using an application performance monitor (APM). When the target object can be executed, APM collects HTTP requests between multiple data nodes and internal system method calls as call data between multiple data nodes.
[0100] S302. Parse the call data to determine the call order and call relationship between multiple data nodes.
[0101] It should be noted that, since the target object typically involves multiple data nodes during execution, each data node can act as the initiating data node or the called data node in different calling relationships. Furthermore, there is a certain order in which these data nodes are called.
[0102] For example, if the call data includes applications A calling application C via HTTP request, applications A calling application B via HTTP request, and applications A calling application D via HTTP request, then it contains the call relationships between applications A and B, between applications A and C, and between applications A and D. Application A can be the data node initiating the call, and applications B, C, and D can be the data nodes being called.
[0103] S303. Determine the calling level of each data node according to the calling order.
[0104] It should be understood that the embodiments of this application do not limit how to determine the calling level to which a data node belongs. In some embodiments, based on the calling order between data nodes, the number of calls required before each data node is called can be determined. Then, data nodes that require the same number of calls before being called are grouped into the same calling level.
[0105] For example, if the call sequence during the execution of the target service includes: first, application A calls application B, then application B calls applications C, D, and E. Subsequently, application C calls application F, application D calls application G, and application E calls application H. Correspondingly, if the number of calls before application A is 0, then application A is in the first call level; if the number of calls before application B is 1, then application B is in the second call level; if the number of calls before applications C, D, and E is 2, then application B is in the third call level; and if the number of calls before applications F, G, and H is 3, then application B is in the fourth call level.
[0106] S304. Based on the call relationships and the call hierarchy to which multiple data nodes belong, construct the application call topology diagram corresponding to the target object.
[0107] In some embodiments, when building an application call topology graph, the computer device can set data nodes with the same call level in the same layer of the application call topology graph, and then build branch data between different data nodes based on the call relationship.
[0108] For example, Figure 6 This is a schematic diagram of another application call topology provided in an embodiment of this application. For example... Figure 6As shown, based on the call data, a first call level and a second call level are determined. The first call level includes application A, and the second call level includes applications B, C, and D. Since applications A calls applications B, C, and D, branch data between applications A and B, between applications A and C, and between applications A and D are respectively constructed in the application call topology graph.
[0109] In some embodiments, when executing a target business function, the application may make cyclical calls, and the corresponding application call topology graph will contain branch data of cyclical calls. (Continue to refer to...) Figure 5 Because application A calls applications B, C, and D in a loop, the branch data between application A and application B, between application A and application C, and between application A and application D all contain branch data that is called in a loop, that is, duplicate branch data.
[0110] It should be noted that the computer device that establishes the application call topology graph and the computer device that executes the loop call processing method can be the same computer device or different computer devices. This application embodiment does not limit this.
[0111] Based on the above embodiments, the following explains how to determine the branch data of the application call topology graph that has circular calls. Figure 7 This is a flowchart illustrating another data processing method provided in an embodiment of this application. Figure 7 As shown, the processing methods for this loop call include:
[0112] S401. Obtain the application call topology graph corresponding to the target object. The application call topology graph includes the call relationships between multiple data nodes called when the target object is executed.
[0113] S402. Determine the number of times the application calls data nodes in the topology graph.
[0114] In some embodiments, a data node includes an application or application interface invoked when executing a target object. Accordingly, if a data node is an application interface invoked when executing a target object, then during statistics, only calls where both the invoked application and the invoked application interface are the same will be counted as calls to that data node.
[0115] For example, if a data node is an application called when executing a target object, and the application call topology contains seven data nodes, applications A to F, then after counting the number of calls for each application node as shown in Table 3, the maximum number of calls can be determined to be 4.
[0116] Table 3
[0117] Data Node Number of calls Application A 1 Application B 1 Application C 4 Application D 4 Application E 4 Application F 4 Application G 4 Application H 4
[0118] S403. Determine whether the number of times the application calls the data nodes in the topology graph is greater than or equal to the first threshold.
[0119] If yes, then execute S405; otherwise, execute S404.
[0120] The first threshold can be set according to the specific situation; for example, it can be set to 3. If the number of times the application calls a data node in the topology graph is greater than or equal to the first threshold, it can be determined that there are cyclically called branches in the application call topology graph, which need to be pruned. If the number of times the application calls a data node in the topology graph is less than the first threshold, it can be determined that there are no cyclically called branches in the application call topology graph, and the process ends.
[0121] S404. Determine that there is no branch data in the application call topology graph.
[0122] S405. Determine that there is branch data in the application call topology graph.
[0123] S406. Encode the data nodes in each call level of the application call topology graph to generate a string corresponding to each call level.
[0124] S407. Determine the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph.
[0125] S408. Delete branch data in the application's topology graph.
[0126] The method for handling circular calls provided in this application embodiment involves a computer device acquiring an application call topology graph corresponding to a target object. This graph includes the call relationships between multiple data nodes invoked when the target object is executed. Next, the computer device encodes the data nodes in each call level of the application call topology graph, generating a string corresponding to each call level. Then, the computer device determines the target substring in each call level's string and the corresponding branch data in the application call topology graph. The target substring represents the data node that is cyclically invoked and meets preset conditions at the call level. The branch data includes a first data node, a second data node with a call relationship to the first data node, and the call relationship between the first and second data nodes. Finally, the computer device deletes the branch data in the application call topology graph. This method allows for the determination of cyclically invoked branch data by encoding data nodes, thereby pruning the branch data and reducing the storage overhead of the application call topology graph. Furthermore, by pruning the branch data in the application call topology graph, subsequent topology graph queries using the application call topology graph can improve query performance and speed.
[0127] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.
[0128] Corresponding to the loop call handling method in the above embodiment, Figure 8 This is a structural block diagram of a data processing apparatus provided in an embodiment of this application. For ease of explanation, only the parts relevant to the embodiments of this application are shown. (Refer to...) Figure 8 The processing device 500 that is called in a loop includes: an acquisition unit 501, a processing unit 502 and a trimming unit 503.
[0129] The acquisition unit 501 is used to acquire the application call topology graph corresponding to the target object. The application call topology graph includes the call relationship between multiple data nodes called when the target object is executed.
[0130] Processing unit 502 is used to encode the data nodes in each call level of the application call topology graph, generate a string corresponding to each call level, the call levels are divided according to the call order between the data nodes in the application call topology graph, and each character in the string corresponds one-to-one with the data node in the call level corresponding to the string; determine the target substring in the string corresponding to each call level and the branch data of the target substring in the application call topology graph, the target substring is used to represent the data node that is called in a loop in the call level and meets the preset conditions, and the branch data includes the data of the data node corresponding to the target substring and the data of the call relationship involved by the data node corresponding to the target substring.
[0131] The pruning unit 503 is used to delete branch data in the application call topology graph.
[0132] In some embodiments, a data node includes an application or application interface invoked when executing a target object.
[0133] In some embodiments, the processing unit 502 is specifically configured to generate a string corresponding to each calling level based on the encoding identifier corresponding to the data node in each calling level, wherein the encoding identifier corresponding to the same data node is the same.
[0134] In some embodiments, the processing unit 502 is further configured to determine that there is branch data in the application call topology graph if the number of calls to a data node in the application call topology graph is greater than or equal to a first threshold.
[0135] In some embodiments, the processing unit 502 is specifically used to determine multiple substrings in the string corresponding to each calling level and the number of consecutive repetitions of each substring; and to determine the target substring from the substrings based on the number of consecutive repetitions of each substring.
[0136] In some embodiments, the processing unit 502 is specifically configured to determine the substring as the target substring if the number of consecutive repetitions of the substring is greater than or equal to a second threshold.
[0137] In some embodiments, the processing unit 502 is further configured to collect call data, which is data generated when the target object calls multiple data nodes when executing the target object; parse the call data to determine the call order and call relationship between the multiple data nodes; determine the call level to which the multiple data nodes belong according to the call order; and construct the application call topology diagram corresponding to the target object according to the call relationship and the call level to which the multiple data nodes belong.
[0138] The data processing device provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects are similar, and will not be described again here.
[0139] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 9 As shown, the computer device may include: multiple processors 601 and memory 602. Figure 9 This refers to a computer device with a single processor as an example.
[0140] The memory 602 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions.
[0141] The memory 602 may include high-speed RAM memory, and may also include non-volatile memory, such as multiple disk drives.
[0142] The processor 601 is used to execute computer execution instructions stored in the memory 602 to implement the above-described data processing method.
[0143] The processor 601 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0144] Optionally, in specific implementations, if the communication interface, memory 602, and processor 601 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.
[0145] Optionally, in a specific implementation, if the communication interface, memory 602, and processor 601 are integrated on a single chip, then the communication interface, memory 602, and processor 601 can communicate through an internal interface.
[0146] This application also provides a chip, including a processor and an interface. The interface is used to input and output data or instructions processed by the processor. The processor is used to execute the data processing methods provided in the above method embodiments.
[0147] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores program information, which is used in the above-described data processing method.
[0148] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method as described above.
[0149] This application also provides a computer program that causes a computer to perform the above-described data processing method.
[0150] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data processing method, characterized in that, The method includes: Obtain the application call topology graph corresponding to the target object, wherein the application call topology graph includes the call relationship between multiple data nodes called when the target object is executed; Each data node in each call level of the application call topology is encoded to generate a string corresponding to each call level. The call levels are divided according to the call order between the data nodes in the application call topology. Each character in the string corresponds one-to-one with a data node in the call level corresponding to the string. Determine the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph. The target substring is used to represent the data node that is called cyclically in the call level and meets the preset conditions. The branch data includes the first data node corresponding to the target substring, the second data node that has a call relationship with the first data node, and the call relationship between the first data node and the second data node. The application calls the topology graph to delete the branch data.
2. The method according to claim 1, characterized in that, The data node includes the application or application interface invoked when the target object is executed.
3. The method according to claim 1, characterized in that, The step of encoding the data nodes in each call level of the application call topology graph to generate a string corresponding to each call level includes: Based on the encoding identifier corresponding to the data node in each calling level, a string corresponding to each calling level is generated, wherein the encoding identifiers corresponding to the same data node are the same.
4. The method according to any one of claims 1-3, characterized in that, Before determining the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph, the method further includes: If the number of times the application calls a data node in the topology graph is greater than or equal to the first threshold, then it is determined that the branch data exists in the application call topology graph.
5. The method according to any one of claims 1-3, characterized in that, Determining the target substring in the string corresponding to each calling level includes: Determine multiple substrings in the string corresponding to each call level and the number of consecutive repetitions of each substring; The target substring is determined from the substrings based on the number of consecutive repetitions of each substring.
6. The method according to claim 5, characterized in that, The step of determining the target substring from the substrings based on the consecutive repetition count of each substring includes: If the number of consecutive repetitions of the substring is greater than or equal to the second threshold, then the substring is determined to be the target substring.
7. The method according to claim 1, characterized in that, Before obtaining the application call topology graph corresponding to the target object, the method further includes: Collect and call data, wherein the call data is the data generated when the target object calls multiple data nodes during the execution of the target object; Parse the call data to determine the call order and call relationship among the multiple data nodes; Based on the calling order, the calling level to which the multiple data nodes belong is determined respectively; Based on the call relationships and the call levels to which the multiple data nodes belong, construct the application call topology diagram corresponding to the target object.
8. A data processing apparatus, characterized in that, The device includes: The acquisition unit is used to acquire the application call topology graph corresponding to the target object, wherein the application call topology graph includes the call relationship between multiple data nodes called when the target object is executed; The processing unit is configured to encode the data nodes in each call level of the application call topology graph, generate a string corresponding to each call level, wherein the call levels are divided according to the call order between the data nodes in the application call topology graph, and each character in the string corresponds one-to-one with a data node in the call level corresponding to the string; determine the target substring in the string corresponding to each call level and the branch data corresponding to the target substring in the application call topology graph, wherein the target substring is used to characterize the data node that is called cyclically in the call level and meets the preset conditions, and the branch data includes the first data node corresponding to the target substring, the second data node that has a call relationship with the first data node, and the call relationship between the first data node and the second data node; A pruning unit is used to delete the branch data in the application's topology graph.
9. A computer device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1 to 7.