Method, apparatus, system, electronic device, and storage medium for processing call link
The method of generating and utilizing a target link identifier with a first node and tracing identifier in service call tracing addresses the complexity of microservices call relationships, enabling swift and precise problem resolution.
Patent Information
- Application Number
- CN202211193485.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-08-19
- Filing Date
- 2022-09-28
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-09-28
AI Technical Summary
In the microservice architecture, the call relationship between services is complicated, which makes it difficult to improve the speed and accuracy of problem positioning.
By generating a target link identifier containing the first node identifier and the tracking identifier, the starting service node of the call link is quickly positioned, and by tracking the call relationship between the service nodes, the fast and accurate tracking and analysis of the call link is achieved.
It improves the positioning speed and accuracy of the call link, simplifies the problem positioning process, saves storage resources and reduces the use of server resources.
Smart Images

Figure CN115567607B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing, and more particularly to the field of service call link analysis. Background Art
[0002] Today, with the rapid development of microservices, the design of loose coupling emerges in an endless stream, bringing great convenience to simplify services. Developers only need to care about the version iteration and online deployment of their own modules, and the business directions are clearly divided. However, with the expansion of the entire business architecture, the number of services has shown an explosive growth in the past two years.
[0003] A single request often involves multiple service calls. These services may be developed by different teams, may be written in different languages, and may also involve different servers. Due to the above reasons, the call relationships between services are intricate. If the call relationships between services can be quickly sorted out, the speed and accuracy of problem positioning can be improved. Summary of the Invention
[0004] The present disclosure provides a method, apparatus, system, device, and storage medium for processing call links.
[0005] According to one aspect of the present disclosure, a method for processing a call link is provided, including:
[0006] Obtaining an access request to be processed;
[0007] Generating a target link identifier for the call link of the access request to be processed;
[0008] Wherein, the target link identifier is used to resolve the call link, and the target link identifier includes a first node identifier and a trace identifier; the call link includes multiple service nodes, and the first node identifier is used to mark the starting service node among the multiple service nodes; when any service node in the call link calls a called service node, the trace identifier is used to be passed from any service node to the called service node, and the trace identifier is used to resolve the call relationship between the service nodes in the call link.
[0009] According to another aspect of the present disclosure, a method for processing a call link is provided, including:
[0010] Obtaining a target link identifier;
[0011] Parsing the first node identifier and the trace identifier from the target link identifier;
[0012] Resolving the call relationship between the service nodes in the call link based on the trace identifier;
[0013] Generate a call link starting from the service node corresponding to the first node identifier and including the call relationships between service nodes.
[0014] According to another aspect of the present disclosure, a method for processing a call link is provided, including:
[0015] Obtain a to-be-processed access request;
[0016] Generate a target link identifier for the call link of the to-be-processed access request; wherein, the target link identifier includes a first node identifier and a trace identifier; in the call link, when any service node calls a called service node, the trace identifier is used to be passed from any service node to the called service node;
[0017] Obtain the target link identifier;
[0018] Parse out the first node identifier and the trace identifier from the target link identifier;
[0019] Parse the call relationships between service nodes in the call link based on the trace identifier;
[0020] Generate a call link starting from the service node corresponding to the first node identifier and including the call relationships between service nodes.
[0021] According to another aspect of the present disclosure, a call link processing apparatus is provided, including:
[0022] A first acquisition module, configured to obtain a to-be-processed access request;
[0023] A first generation module, configured to generate a target link identifier for the call link of the to-be-processed access request;
[0024] Wherein, the target link identifier is used to parse the call link, the target link identifier includes a first node identifier and a trace identifier; the call link includes multiple service nodes, the first node identifier is used to mark the starting service node among the multiple service nodes; in the call link, when any service node calls a called service node, the trace identifier is used to be passed from any service node to the called service node, and the trace identifier is used to trace and parse the call relationships between service nodes in the call link.
[0025] According to another aspect of the present disclosure, a call link processing apparatus is provided, including:
[0026] A second acquisition module, configured to obtain the target link identifier;
[0027] A first parsing module, configured to parse out the first node identifier and the trace identifier from the target link identifier;
[0028] A second parsing module, configured to parse the call relationships between service nodes in the call chain based on the tracking identifier;
[0029] A second generation module, configured to generate a call chain starting from the service node corresponding to the first node identifier and including the call relationships between service nodes.
[0030] According to another aspect of the present disclosure, there is provided a call chain processing apparatus, including:
[0031] A third acquisition module, configured to acquire a to-be-processed access request;
[0032] A third generation module, configured to generate a target link identifier of the call chain of the to-be-processed access request; wherein, the target link identifier includes a first node identifier and a tracking identifier; when any service node in the call chain calls a called service node, the tracking identifier is used to be passed from any service node to the called service node;
[0033] A fourth acquisition module, configured to acquire the target link identifier;
[0034] A third parsing module, configured to parse the first node identifier and the tracking identifier from the target link identifier;
[0035] A fourth parsing module, configured to parse the call relationships between service nodes in the call chain based on the tracking identifier; a fourth generation module, configured to generate a call chain starting from the service node corresponding to the first node identifier and including the call relationships between service nodes.
[0036] According to another aspect of the present disclosure, there is provided a call chain processing system, including:
[0037] A gateway, configured to execute the method of the first aspect in the present disclosure;
[0038] A link parsing server, configured to execute the method of the second aspect in the present disclosure.
[0039] According to another aspect of the present disclosure, there is provided an electronic device, including:
[0040] At least one processor; and
[0041] A memory communicatively connected to the at least one processor; wherein,
[0042] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the methods of the first aspect and / or the second aspect in the present disclosure.
[0043] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to the above-mentioned first aspect and / or second aspect of the present disclosure.
[0044] According to another aspect of the present disclosure, there is provided a computer program product, including a computer program which, when executed by a processor, implements the method according to the above-mentioned first aspect and / or second aspect of the present disclosure.
[0045] The solution provided in this embodiment can quickly obtain a call link through the target link identifier and the first node identifier it contains. Based on the first node identifier, the starting service node of the call link can be quickly located. Through the tracing identifier, the call relationship of the entire call link can be resolved. Thus, the method can quickly and accurately obtain the call link.
[0046] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0048] Figure 1 is a schematic diagram of an application scenario applicable to an embodiment of the present disclosure;
[0049] Figure 2 is a flowchart of a method for processing a call link provided by an embodiment of the present disclosure;
[0050] Figure 3 is a schematic diagram of a possible application scenario provided by an embodiment of the present disclosure;
[0051] Figure 4 is a call link topology diagram provided by an embodiment of the present disclosure;
[0052] Figure 5 is a flowchart of a method for processing a call link provided by another embodiment of the present disclosure;
[0053] Figure 6 is a flowchart of a method for processing a call link provided by another embodiment of the present disclosure;
[0054] Figure 7 is a flowchart of a method for processing a call link provided by another embodiment of the present disclosure;
[0055] Figure 8 is a flowchart of a method for processing a call link provided by yet another embodiment of the present disclosure;
[0056] Figure 9 It is a schematic flowchart of a processing method for a call link according to another embodiment of the present disclosure;
[0057] Figure 10 It is a visualization interface diagram for screening target link identifiers provided by an embodiment of the present disclosure;
[0058] Figure 11 It is a schematic flowchart of a processing method for a call link provided by another embodiment of the present disclosure;
[0059] Figure 12 It is a schematic diagram of an application scenario provided by another embodiment of the present disclosure;
[0060] Figure 13 It is a schematic diagram of a composition structure of a call link processing device provided by an embodiment of the present disclosure;
[0061] Figure 14 It is another schematic diagram of a composition structure of a call link processing device provided by another embodiment of the present disclosure;
[0062] Figure 15 It is a schematic diagram of a composition structure of a call link processing device provided by an embodiment of the present disclosure;
[0063] Figure 16 It is a block diagram of an electronic device for implementing the method for processing a call link in an embodiment of the present disclosure. Detailed implementation manners
[0064] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0065] Terms such as "first" and "second" in the present disclosure are used to distinguish similar objects and do not necessarily describe a specific order or sequence. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a method, system, product, or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0066] In order to quickly locate problems, embodiments of the present disclosure provide a call link tracking method and a parsing method.Figure 1 It is a schematic diagram of an application scenario applicable to the parsing method and the tracking method. In Figure 1 it includes: a terminal 101, a gateway 102, and a content server 103. A user can access the content server 103 through the terminal 101 and obtain network content from the content server 103. For example, the user accesses a web page provided by the content server 103 through the terminal 101, and the user can click on a link in the web page. Thereby, the terminal 101 generates a request to the gateway 102, and the gateway 102 invokes a corresponding microservice in the content server 103 to process the request. When processing the request, the microservice of the content server 103 may call other services and may obtain the processing result of the request after multiple service calls, and then return the processing result to the terminal 101.
[0067] It should be noted that Figure 1 it is only used to illustrate the embodiments of the present disclosure and does not limit the scenarios applicable to the embodiments of the present disclosure.
[0068] Since the call chain of a request is relatively long, how to trace a call chain is an issue of concern in the industry. Therefore, the first aspect of the embodiments of the present disclosure provides a method for tracking a call chain. As Figure 2 shown, it is a flowchart of the method, and this method is applicable to the gateway 102 as Figure 1 shown, including:
[0069] S201. Obtain a to-be-processed access request.
[0070] In some embodiments, Figure 1 the network architecture shown can be divided into an access layer, an operation layer, and a call chain layer. Among them, the gateway 102 is located between the access layer and the operation layer, and the content server 103 is located between the operation layer and the call chain layer. The operation layer of the gateway 102 and the operation layer of the server are used to implement the interaction between the gateway 102 and the server. Taking Figure 1 as an example, after the user's request reaches the access layer of the gateway 102, the access layer generates a call request to a service node in the operation layer based on this request. Among them, the call request is the to-be-processed access request in step S201. It should be noted that for a request sent by the client, one call request may be generated in the access layer of the gateway 102, or multiple call requests may be generated. The situation of generating multiple call requests is, for example Figure 3As shown, the terminal 101 displays Web page 1, which includes multiple links and multiple recommended images. Among them, Link 1 is used to obtain a document, and on the page 2 corresponding to the link, the document corresponding to Link 1 needs to be displayed, and recommended content also needs to be displayed. When the user clicks Link 1, the terminal 101 generates a content acquisition request for Web page 2 to the gateway 102. The access layer of the gateway 102 needs to call service node 1 in the operation layer to obtain the document for this request, and also needs to call service node 2 in the operation layer for content recommendation. Therefore, the gateway 102 generates call requests for service node 1 and service node 2 respectively.
[0071] When there are multiple call requests, each call request can be used as the to-be-processed access request in step S201 and the call link tracing method provided by the embodiments of the present disclosure is executed on it. For ease of understanding, an example will be given for one to-be-processed access request later. The processing methods for other to-be-processed access requests are the same, and the embodiments of the present disclosure will not elaborate.
[0072] S202. Generate a target link identifier for the call link of the to-be-processed access request; wherein, the target link identifier includes a first node identifier and a tracing identifier; the call link includes multiple service nodes, and the first node identifier is used to mark the starting service node among the multiple service nodes.
[0073] In the call link, when any service node calls a called service node, the tracing identifier is used to be passed from any service node to the called service node, and the tracing identifier is used to resolve the call relationship between the service nodes in the call link.
[0074] In the embodiments of the present disclosure, the starting service node in a call link can be quickly located through the first node identifier, and the same call link can be traced through the tracing identifier, thereby realizing quick positioning of the call link, clarifying the call relationship between service nodes, and further helping to more quickly complete the positioning of problems.
[0075] For example, as Figure 4 shown, an interface schematic diagram of a call link is shown. The service node A marked with the target link identifier T in the call link is the starting service node of the call link, indicating that the to-be-accessed request starts to be processed from service node A in the call link.
[0076] For another example, still taking Figure 1For example, a target link identifier is generated at the access layer of the gateway 102. When calling a service node in the operation layer, the access layer of the gateway 102 passes the trace identifier in the target link identifier to the service node in the operation layer. When a service node in the operation layer needs to call another service node, the service node in the operation layer passes the trace identifier to the service node it calls. And so on, the transfer of the same trace identifier between different service nodes is realized. Thus, the same trace identifier links different service nodes together.
[0077] In some possible implementation manners, when transmitting the trace identifier to the called service node, the trace identifier can be carried in the request header and passed to the called service node. Still taking Figure 1 as an example, the access layer sends a network request to the microservice (i.e., a service node) of the content server 103 in the operation layer. The access layer of the gateway 102 can carry the trace identifier in the request header of the network request to pass the trace identifier to the microservice in the operation layer.
[0078] In some possible implementation manners, each call link has a target link identifier that uniquely identifies the call link to ensure the global uniqueness of the target link identifier. As Figure 5 shown, the target link identifier of the call link for the to-be-processed access request can be generated based on the following method:
[0079] S501: Divide the time information of the to-be-processed access request into first part information and second part information; wherein, the time information includes the generation time and / or the sending time of the to-be-processed access request.
[0080] S502: Generate a trace identifier based on the first part information.
[0081] In the embodiments of the present disclosure, the total number of bits of the trace identifier is greater than 1, and it can be represented in decimal. An example of generating a trace identifier is as follows:
[0082] In some embodiments, the minutes, seconds, and milliseconds can be used as the first part information, and the total number of milliseconds of the first part information is used as the first N bits of the trace identifier. For example, the time information is August 3, 2022, 14:25:31.145. At this time, the first part information is 25:31.145, and the total number of milliseconds obtained in milliseconds is 1531145 milliseconds. Then 1531145 is used as the first 7 bits of the trace identifier. The last M bits of the trace identifier are sequentially incremented and assigned by an M-bit counter. When the counter reaches the maximum value, it returns to the minimum value. When M = 3, a cycle can be achieved every 60 hours. There is only a one in a hundred thousand probability of repetition in each cycle, and theoretically, it can be ensured that there is no repetition in 100 years. Therefore, using this method can generate a globally unique trace identifier.
[0083] It should be noted that the above method is only used to illustrate the implementation manner of generating a tracking identifier based on time information in the examples of the present disclosure. The present disclosure does not specifically limit the method of generating a tracking identifier.
[0084] S503. Generate a target link identifier based on the second part of information, the tracking identifier, and the first node identifier.
[0085] Similarly, the target link identifier in the embodiments of the present disclosure includes multiple digits and can be represented in decimal.
[0086] In the embodiments of the present disclosure, the time information itself has uniqueness. Using the time information to generate the target link identifier can ensure the global uniqueness of the target link identifier as much as possible. Generating the target link identifier based on the first node identifier enables the target link identifier to carry the starting point information of the call link, so as to facilitate parsing the first node identifier from the target link identifier, thereby achieving the purpose of locating the starting service node of the call link. In addition, generating the tracking identifier based on the first part of information also makes the tracking identifier globally unique, so as to make the call link have a unique tracking identifier, thereby ensuring the unique association between the target link identifier and the call link.
[0087] In some embodiments, in order to compress the data volume of the target link identifier as much as possible, in the embodiments of the present disclosure, step S503 of generating the target link identifier based on the second part of information, the tracking identifier, and the first node identifier can be implemented as Figure 5 shown, including:
[0088] S5031. When the first node identifier contains characters, convert the first node identifier into a digital identifier.
[0089] Among them, since multiple call links can share the same starting service node, the first node identifier used to mark the starting service node does not need to correspond one-to-one with the call link. However, in the embodiments of the present disclosure, the first node identifier can shorten the data volume through digitization. Taking the first node identifier as an IP address as an example, the process of digitizing the IP address is illustrated. For example, if the IP address is "a.b.c.d", the digitized IP address is 256 3 *a + 256 2 *b + 256 1 *c + 2560*d. Since the ranges of a, b, c, and d are all 1 - 255, multiplying by different powers of 256 will generate different orders of magnitude, thereby ensuring the uniqueness of the generated digital address.
[0090] On the one hand, if the "." in the IP address is retained, it will increase the data volume of the target link identifier, thus consuming more storage resources. In the case of a huge number of call links, compressing the data volume of the target link identifier will save a large amount of storage resources. On the other hand, if the "." in the IP address is not retained, ambiguity will occur. For example, the numbers after removing the "." from the IP address 101.1.101.1 and the IP address 10.11.10.11 are the same, and it is impossible to determine which IP address it is. Therefore, it is necessary to convert the IP address with the character "." into a digital address.
[0091] S5032. Compile the second part of the information, the trace identifier, and the digital identifier into a digital string to obtain the target link identifier.
[0092] For example, the time information is August 3, 2022, 14:25:31.145, and the IP corresponding to the first node identifier is 1.8.27.64. In the case where the three-dimensional random number is 123, the trace identifier generated by the method described in S502 is 1531145123, and the digital identifier generated by the method described in S5031 is 0017308480. The second part of the information is 14:00 on August 3, 2022. Since the year can be defaulted to the current year, the year in the second part of the information can be removed, and the month, day, and hour in the second part of the information are compiled into 080314 (hereinafter referred to as the time value). Then, arranged in the order of the trace identifier, the first node identifier, and the time value, the obtained target link identifier is:
[0093] 15311451230017308480080314.
[0094] It should be noted that the above method is only used to illustrate an implementation manner of compiling the second part of the information, the trace identifier, and the digital identifier into a digital string to obtain the target link identifier in the embodiments of the present disclosure. The embodiments of the present disclosure do not specifically limit the method for generating the target link identifier. For example, the arrangement order of the trace identifier, the first node identifier, and the time value can be changed to generate the target link identifier.
[0095] In summary, by digitizing the first node identifier, the target link identifier can be stored with less storage resources, and the uniqueness of the target link identifier is also ensured, thereby ensuring the unique association between the target link identifier and the call link.
[0096] In some embodiments, the target link identifier and its corresponding call link can be centrally stored in a server. However, storing these data centrally, on the one hand, the huge amount of these data will occupy a large amount of server resources, and on the other hand, if the problem needs to be resolved quickly, it is necessary to search and call the data in the server, and the processing time is relatively long. Therefore, in order to save storage resources and achieve quick problem location, in some possible implementation manners, the second node identifier of the called service node can be saved in the local instance when the service node is called. For example, if service node A calls service node B, the second node identifier of service node B is saved in the local instance of service node A.
[0097] In the embodiments of the present disclosure, saving the second node identifier of the called service node in the local instance can understand the call relationship of different service nodes according to the second node identifier. And storing the second node identifier in the local instance can avoid saving the call relationship of different service nodes in a centralized storage manner, thereby saving storage resources.
[0098] Among them, the saving duration of the second node identifier can be set according to requirements. For example, after a problem occurs, if it takes less than one day to discover that there is a problem, the saving duration can be set to one day, and the life cycle of the second node identifier in the local instance can be managed flexibly. Thus, the second node identifier is temporarily saved in the instance instead of being persisted to the server, which can save storage resources.
[0099] In some embodiments, the second node identifier is an IP address, and using the IP address can understand the call relationship of different services. When there are multiple service nodes in a device with the same IP address, in order to facilitate accurate distinction of different service nodes. In the embodiments of the present disclosure, the second node identifier includes the IP address and port number of the called service node, that is, different service nodes in the same IP address correspond to different port numbers.
[0100] In some embodiments, when the access layer of the gateway 102 calls the operation layer, the trace identifier is passed to the operation layer. When the operation layer in the server calls a service node, the trace identifier can be passed to the called service node, but when any service node calls the called service node based on a network request, the trace identifier can be carried in the request header of the network request. In some embodiments, when the called service node is called based on a message queue, the trace identifier is passed to the called service node by an explicit transmission method. For example, when storing a message in the message queue, the trace identifier can be recorded in the form of tagging the message, and then when the downstream consumes the message, the trace identifier recorded in the tag will be passed to the downstream together, thereby realizing the transmission of the trace identifier.
[0101] In some embodiments, when transmitting a tracing identifier, the tracing identifier is determined through the following priorities:
[0102] Check whether a tracing identifier is defined in the target script; the tracing identifier in the target script can be defined by the user himself, so that the called service node can inherit the tracing identifier. For example, during testing, the tester can customize the tracing identifier to facilitate the completion of the test.
[0103] In the target script, if no tracing identifier is defined and the request header carries a tracing identifier, the tracing identifier in the request header will be used as the tracing identifier transmitted to the next service node;
[0104] If no tracing identifier is carried in the above two positions, a new tracing identifier will be generated as the tracing identifier transmitted to the next service node.
[0105] After completing the tracing of the call link, when locating a problem, the target link identifier will be parsed.
[0106] The foregoing describes the tracing method of the call link. Based on the same technical concept, according to the embodiments of the second aspect of the present disclosure, a method for parsing a call link is further provided. Figure 6 The flow diagram of this method includes:
[0107] S601. Obtain a target link identifier.
[0108] S602. Parse the first node identifier and the tracing identifier from the target link identifier.
[0109] S603. Trace the call relationship between service nodes in the call link based on the tracing identifier.
[0110] In some embodiments, the following method can be used to trace the call relationship between service nodes in the call link: the same tracing identifier is carried in the logs of each service node on the call link. By searching for the logs carrying this tracing identifier, all service nodes on the call link can be found. At the same time, when the upper-level service node calls the lower-level service node, the upper-level service node will retain the second node identifier (such as the IP address) of the lower-level service node in the local instance of the upper-level service node. Thus, by viewing the local instance, the call relationship between service nodes can be known. Based on this, determining the call relationship between service nodes can be implemented as Figure 7 shown as:
[0111] S701. Obtain multiple service nodes that record the tracing identifier.
[0112] S702. For each service node, respectively obtain the second node identifier of the called service node called by the service node from the local instance of the service node.
[0113] S703. Determine the call relationships between service nodes in the call chain based on each service node and the second node identifiers of the called service nodes called by each service node.
[0114] Using the second node identifiers stored in the local instance to resolve the call relationships of different service nodes in the call chain simplifies many steps compared to calling from the server, effectively reducing the time cost and the use of server resources. At the same time, directly using the resources of the local instance also reduces the error operation rate.
[0115] S604. Generate a call chain with the service node corresponding to the first node identifier as the starting service node and including the call relationships between service nodes.
[0116] In the embodiments of the present disclosure, by parsing the target link identifier, the first node identifier and the tracking identifier are obtained, and then the call chain between service nodes is obtained. Tracking the call chain based on the tracking identifier improves the speed and accuracy of determining the call chain. The call chain starts from the service node corresponding to the first node identifier, which improves the speed and accuracy of locating the starting position of the link. Combining the above two aspects, the embodiments of the present disclosure have certain improvements in both the speed and accuracy of obtaining the target call chain.
[0117] In some possible implementation manners, the first node identifier and the tracking identifier are parsed from the target link identifier, such as Figure 8 shown, and can be implemented as:
[0118] S6021. Parse the tracking identifier from the first target position of the target link identifier.
[0119] S6022. Parse the digital identifier from the second target position of the target link identifier.
[0120] In the embodiments of the present disclosure, the target link identifier includes multiple digits and can be represented in decimal. The first target position and the second target position can respectively include consecutive multiple digits in the target link identifier. For example, the first target position includes the first ten digits of the target link identifier, and the second target position includes the eleventh to twentieth digits of the target link identifier. The total number of specific digits of the target link identifier, as well as the total number of digits included in the first target position and the second target position, are not specifically limited. Moreover, the order relationship of the first target position and the second target position in the target link identifier is not limited. Even the first target position and the second target position can intersect. For example, the first digit of the first target position is the 1st digit of the target link identifier, the first digit of the second target position is the 2nd digit of the target link identifier, the second digit of the first target position is the 3rd digit of the target link identifier, and so on.
[0121] S6023. Decompile the digital identifier to obtain the first node identifier.
[0122] In the embodiments of the present disclosure, the tracking identifier and the digital identifier can be parsed from different positions in the target link identifier, so as to restore the first node identifier. Among them, the digital identifier can identify the first node identifier with less data volume, saving the storage resources for storing the target link identifier.
[0123] A timestamp is a complete and verifiable piece of data that can represent that a piece of data has existed at a specific point in time, and it is important information for log analysis. Cross-platform conversion of time information can be achieved through timestamps. In some possible implementation manners, the time information can be parsed and then a timestamp can be generated, as Figure 9 shown, including:
[0124] S901. Parse the first part of the time information from the tracking identifier; the time information is the generation time or the sending time of the access request to be processed.
[0125] S902. Parse the second part of the time information from the third target position of the target link identifier.
[0126] S903. Generate a timestamp of the time information based on the first part of the information and the second part of the information.
[0127] Among them, the time information is generated from the first part of the information and the second part of the information, and then the timestamp is generated using the time information. The following introduces a method for generating a timestamp based on the Java language: vartimestamp = new Date().getTime(); where Date and Time are preset dates and times, and in this embodiment, they are the time information. It should be noted that timestamps can also be generated using other languages, which will not be elaborated here.
[0128] The time information can be parsed from the tracking identifier to obtain a timestamp. On the one hand, when obtaining the call link, filtering can be performed according to time, reducing the workload. On the other hand, it is not necessary to generate and store timestamps specifically for each call link. In the embodiments of the present disclosure, the target link identifier can be reused to obtain the timestamp, which also saves the resources of the server.
[0129] For ease of understanding, the following is an example of how to parse out the tracking identifier, the first node identifier, and the timestamp. For example, if the target link identifier is 15311451230017308480080314, taking the 1st - 10th digits as the first target position, the tracking identifier can be parsed out as 1531145123. Decompiling the tracking identifier and extracting its first 7 digits, 1531145, we get a duration represented by the total number of milliseconds. Converting the duration into the format of minutes, seconds, and milliseconds, we obtain the first part of the information, which is 25:31.145. Taking the 11th - 20th digits in the target link identifier as the second target position, the digital identifier can be parsed out as 0017308480. Decompiling the digital identifier to get the first node identifier. The specific decompiling process is as follows: first divide the digital identifier 0017308480 by 256 3 , the quotient is 1; then divide the remainder by 256 2 , the quotient is 8, and then divide by 256 2 divide the obtained remainder by 256 1 , the quotient is 27 and the remainder is 64. Concatenating these results in sequence, the first node identifier is obtained as 1.8.27.64; taking the 21st - 26th digits as the third target position, since the default year is the current year, the second part of the information can be parsed out as 14:00 on August 3, 2022. Combining the first part of the information with the second part of the information, the time information can be obtained as 14:25:31.145 on August 3, 2022, and then the timestamp can be obtained.
[0130] In some embodiments, a method for retrieving the target link identifier is also provided, which can be implemented as: based on the target link identifier screening conditions, screening out at least one target link identifier to obtain a target link identifier set; and selecting a target link identifier from the target link identifier set.
[0131] Among them, the target link identifier screening conditions used include at least one of the following: access layer type, geographical range, status code, domain name, and IP address, etc. The page used for screening is as shown in Figure 10 . The user can select the screening conditions through the visual interface. Among them, the access layer can include router and inrouter. In the embodiments of the present disclosure, the target link identifier is used to indicate whether it is the router or inrouter of the gateway 102 that is started. The access layer type refers to whether it is the router or inrouter that is started; the geographical range (i.e., Figure 10The geographical region (in the middle) can be defined according to actual needs. For example, the geographical range is used to limit the geographical range where the gateway 102 is located; the status code is information determined by the server response when calling the service node. For example, 2xx indicates that the request has been successfully received by the server, 3xx represents that further operations need to be taken to complete the request, 4xx represents that an error occurred in the request, and 5xx represents that an error occurred in the server; the domain name is the domain name of the current web page when the request is sent, and the IP address is the IP address of the starting service node. Figure 10 Among them, the time option is used to limit the time range for screening. For example, screening for target link identifiers generated within the last hour. In the embodiments of the present disclosure, the logs of each service node can be segmented by hour, that is, a log is obtained every hour. Thus, when screening, it is convenient to screen out the target link identifiers from the logs according to the time range.
[0132] Diverse screening conditions can accurately retrieve the required target link identifiers, improving the efficiency of problem positioning.
[0133] In some possible implementation manners, at least one target link identifier can be screened out from a specified location based on the target link identifier screening conditions. The specified location includes at least one of the following: logs, reported error events, request headers recorded in the browser's console, etc. Among them, each service call will record this call in the log, and once an error occurs during the service call, an error event will be generated, so the target link identifier can be screened out from the error event. Screening in multiple locations can increase the possibility of screening out the target node identifier and improve the efficiency of problem positioning.
[0134] In summary, using the target link identifier obtained by condition screening can basically ensure that the call link where the problem lies can be clearly identified as much as possible after the problem occurs. There is no need to check all the call links of the relevant services, greatly improving the efficiency of problem troubleshooting.
[0135] In summary, based on the embodiments of the present disclosure, the generated call link can be displayed in the interface. As Figure 4 shown by a call link. After selecting any one of the service nodes, the details of the service node will be displayed. The details include, for example: the name of the service node; the type of the service node; the server address; whether the service node belongs to the operation layer or the access layer, etc. For example, in Figure 4 after selecting service node D, the relevant details of service node D are displayed.
[0136] In addition, multiple call chains can be displayed on the same interface in the embodiments of the present disclosure. To facilitate observing the same call chain, other call chains can be hidden on the interface when a target call chain is selected. If there is a service node with a fatal error or a node that generates a warning message in the call chain, such key service nodes can be marked with different colors. As Figure 4 shown, service node C is a service node with a fatal error, and service node B is a service node that generates a warning.
[0137] Based on the same technical concept, according to the third aspect of the embodiments of the present disclosure, a method for processing a call chain is further provided, as Figure 11 shown, including:
[0138] S1101. Obtain a to-be-processed access request.
[0139] S1102. Generate a target link identifier for the call chain of the to-be-processed access request; wherein, the target link identifier includes a first node identifier and a tracking identifier; when any service node in the call chain calls a called service node, the tracking identifier is used to be passed from any service node to the called service node.
[0140] S1103. Obtain the target link identifier.
[0141] S1104. Parse the first node identifier and the tracking identifier from the target link identifier.
[0142] S1105. Parse the call relationship between service nodes in the call chain based on the tracking identifier.
[0143] S1106. Generate a call chain with the service node corresponding to the first node identifier as the starting service node and including the call relationship between service nodes.
[0144] In summary, in the embodiments of the present disclosure, an entire call chain can be concatenated based on the target link identifier and the tracking identifier. By parsing the target link identifier, the first node identifier and the tracking identifier are obtained, and then the call chain between service nodes is obtained. The call chain is tracked based on the tracking identifier, which improves the speed and accuracy of determining the call chain. The call chain uses the service node corresponding to the first node identifier as the starting service node, which improves the speed and accuracy of positioning the starting position of the link. Combining the above two aspects, the embodiments of the present disclosure have certain improvements in both the speed and accuracy of obtaining the target call chain.
[0145] In some embodiments, generating the target link identifier for the call chain of the to-be-processed access request includes:
[0146] Dividing the time information of the to-be-processed access request into first part information and second part information;
[0147] Generate a tracking identifier based on the first part of the information;
[0148] Generate a target link identifier based on the second part of the information, the tracking identifier, and the first node identifier.
[0149] In some embodiments, generating a target link identifier based on the second part of the information, the tracking identifier, and the first node identifier includes:
[0150] When the first node identifier contains characters, compile the first node identifier into a numerical identifier;
[0151] Compile the second part of the information, the tracking identifier, and the numerical identifier into a numerical string to obtain the target link identifier.
[0152] In some embodiments, parsing the first node identifier and the tracking identifier from the target link identifier includes:
[0153] Parse the tracking identifier from the first target position of the target link identifier;
[0154] Parse the numerical identifier from the second target position of the target link identifier;
[0155] Decompile the numerical identifier to obtain the first node identifier.
[0156] In some embodiments, the method further includes:
[0157] Parse the first part of the time information from the tracking identifier;
[0158] Parse the second part of the time information from the third target position of the target link identifier;
[0159] Generate a timestamp of the time information based on the first part of the information and the second part of the information.
[0160] In some embodiments, parsing the call relationship between service nodes in the call link based on the tracking identifier includes:
[0161] Obtain multiple service nodes recording the tracking identifier;
[0162] For each service node, respectively obtain the second node identifier of the called service node called by the service node from the local instance of the service node;
[0163] Determine the call relationship based on each service node and the second node identifier of each called service node.
[0164] In some embodiments, obtaining the target link identifier includes:
[0165] Based on the target link identifier screening conditions, at least one target link identifier is screened out to obtain a set of target link identifiers;
[0166] A target link identifier is selected from the set of target link identifiers.
[0167] In some embodiments, screening out at least one target link identifier based on the target link identifier screening conditions includes:
[0168] Based on the target link identifier screening conditions, at least one target link identifier is screened out from the specified information;
[0169] The specified information includes at least one of the following: logs, reported error events, request headers recorded in the browser's console;
[0170] The screening conditions include at least one of the following:
[0171] Access layer type, geographical range, status code, domain name, and IP address.
[0172] For the descriptions of the examples of each step in the method embodiments, reference can be made to the relevant descriptions of the corresponding steps in the method embodiments of the first aspect and the second aspect above, and details are not described herein again.
[0173] Based on the same technical concept, an embodiment of the present disclosure also provides a processing system for call links. The system includes a gateway, a content server, and a link parsing server, where:
[0174] The gateway can execute the method in the first aspect embodiment of the present disclosure, such as obtaining a to-be-processed access request; generating a target link identifier of the call link of the to-be-processed access request; where the target link identifier contains a first node identifier and a trace identifier; when calling a service node of the content server, passing the trace identifier to the service node of the content server;
[0175] The content server is used to pass the trace identifier from any service node to the called service node when any service node in the call link calls the called service node;
[0176] The link parsing server can execute the method in the second aspect of the present disclosure, such as obtaining the target link identifier; parsing out the first node identifier and the trace identifier from the target link identifier; parsing the call relationship between each service node in the call link based on the trace identifier; generating a call link with the service node corresponding to the first node identifier as the starting service node and including the call relationship between each service node.
[0177] It should be noted that when any service node in the content server calls the called service node, the any service node can save the second node identifier of the called service node in the local instance.
[0178] To facilitate the system's understanding of the processing method of the call link provided by the embodiments of the present disclosure, the following will be described in conjunction with Figure 12 the following application scenario schematic diagram. In Figure 12 , in addition to the terminal 101 and the gateway 102, there is a content server (represented by Figure 12 service node A, service node B, and service node C in
[0179] ), and a link parsing server 104. The request 1 sent by the user at the terminal 101 generates a call request 2 at the gateway 102 to call service node A. The gateway 102 generates a target link identifier a for the call request 2, which includes a trace identifier b and a first node identifier c. The gateway 102 calls service node A based on the call request 2, and at the same time passes the trace identifier b in the target link identifier a to service node A through an HTTP request. For example, the trace identifier can be carried in the request header of the HTTP request, and this HTTP request is sent to service node A as a request to call service node A. Thus, service node A can parse out the trace identifier b from the request header of this HTTP request.
[0180] It should be noted that different service nodes can be located in the same server or in different services. For example, a microservice is a service node, and a single server can provide multiple microservices. In the case where there is a call relationship between these multiple microservices, then the trace identifier will be passed between different microservices on the same server.
[0181] When calling the next service node based on a message queue, there is no HTTP request between the next service node and the previous service node. Then, the trace identifier b can be explicitly passed to the next service node through the message queue. For example, when service node A calls service node B through a message queue, service node A stores the task S that needs to be processed by service node B in the message queue, and can establish an association relationship between the trace identifier b and the task S. When service node B retrieves the task S from the message queue, it can also obtain the trace identifier b associated with the task S. Thus, the trace identifier b is explicitly passed to service node B.
[0182] When any service node needs to call a called service node, it will save the second node identifier of the called service node to the local instance. As Figure 12As shown, when the gateway 102 invokes the service node A, the node identifier of the service node A is saved in the local instance. When the service node A invokes the service node B, the service node A saves the node identifier of the service node B in the local instance of the service node A, and so on. To save storage resources, in the embodiments of the present disclosure, the node identifiers of each service node may be represented in the form of IP + port number. That is, when multiple service nodes are provided in the same server, each service node can be distinguished by the port number.
[0183] When it is necessary to parse this call link, the link parsing server 104 first obtains the target link identifier a, and then parses the target link identifier a to obtain the trace identifier b and the first node identifier c. Based on the first node identifier c, the starting service node gateway 102 is found. Among them, the gateway includes router (routing) and inrouter (another type of routing). In the embodiments of the present disclosure, inrouter can be uniformly used as the starting service node.
[0184] Based on the trace identifier, the call relationships between the service nodes in the call link are parsed to obtain the call link L. For example, the trace identifier b is parsed from the target link identifier a. Then all the service nodes with the trace identifier b are obtained, such as obtaining Figure 12 the service nodes A, B, and C therein. To clarify the call relationships between the service nodes, the node identifiers of the called service nodes stored in the local instances of each service node can be viewed. For example, the node identifier of the service node A can be queried in the inrouter, thereby determining that the inrouter invokes the service node A. The node identifiers of the service node B and the service node C are queried in the local instance of the service node A, and thus it can be determined that the service node A invokes the service node B and the service node C. And so on, the call relationships between different service nodes on an entire call link L can be parsed to obtain the call link L.
[0185] After obtaining the call link L, a call link topology diagram as shown in Figure 4 can be generated. In this call link topology diagram, the starting service node is displayed, and the call relationships between different service nodes on the entire call link L are displayed.
[0186] In addition, in order to obtain the important information of the timestamp of call request 2, in the embodiments of the present disclosure, when the gateway 102 generates the target link identifier, it obtains the time information of call request 2, such as the sending time. Then the time information is divided into the first part of information and the second part of information. The first part of information is the minutes and seconds, and the second part of information is the month, day, and hour. The year can be defaulted to the current year. Then a trace identifier is generated based on the first part of information; a target link identifier is generated based on the second part of information, the trace identifier, and the first node identifier. When parsing the timestamp, the first part of the time information (such as minutes and seconds) is parsed from the trace identifier, and the second part of the time information (such as month, day, and hour) is parsed from the third target position of the target link identifier. The year is defaulted to the current year, and thus the time information is obtained. Then a timestamp of the time information can be generated. The generated timestamp can be displayed in the call link topology diagram. For example, it can be used as one piece of information in the details of the starting service node.
[0187] In summary, in the system provided by the embodiments of the present disclosure, an entire call link can be connected in series based on the target link identifier and the trace identifier. By parsing the target link identifier, the first node identifier and the trace identifier are obtained, and then the call link between service nodes is obtained. The call link is traced based on the trace identifier, which improves the speed and accuracy of determining the call link. The call link starts from the service node corresponding to the first node identifier as the starting service node, which improves the speed and accuracy of locating the starting position of the link. Combining the above two aspects, the embodiments of the present disclosure have certain improvements in both the speed and accuracy of obtaining the target call link.
[0188] Based on the same technical concept, the embodiments of the present disclosure also provide a processing device for a call link, such as Figure 13 shown, including:
[0189] A first acquisition module 1301, configured to acquire an access request to be processed;
[0190] A first generation module 1302, configured to generate a target link identifier of a call link of the access request to be processed;
[0191] Wherein, the target link identifier is used to parse the call link, and the target link identifier includes a first node identifier and a trace identifier; the call link includes multiple service nodes, and the first node identifier is used to mark the starting service node among the multiple service nodes; in the case where any service node in the call link calls the called service node, the trace identifier is used to be passed from any service node to the called service node, and the trace identifier is used to trace and parse the call relationship between each service node in the call link.
[0192] In a possible implementation manner, the first generation module 1302 includes:
[0193] The first sub-module for dividing the time information of the access request to be processed into first part information and second part information;
[0194] The first generation sub-module for generating a tracking identifier based on the first part information;
[0195] The second generation sub-module for generating a target link identifier based on the second part information timestamp, the tracking identifier, and the first node identifier.
[0196] In a possible implementation, the second generation sub-module is configured to:
[0197] When the first node identifier contains characters, compile the first node identifier into a digital identifier;
[0198] Compile the second part information, the tracking identifier, and the digital identifier into a digital string to obtain the target link identifier.
[0199] In a possible implementation, the apparatus further includes:
[0200] The first saving module for saving the second node identifier of the called service node in the local instance when calling the service node.
[0201] Based on the same technical concept, this embodiment also provides a processing apparatus for a call link, as Figure 14 shown, including:
[0202] The second obtaining module 1401 for obtaining the target link identifier;
[0203] The first parsing module 1402 for parsing the first node identifier and the tracking identifier from the target link identifier;
[0204] The second parsing module 1403 for parsing the call relationship between service nodes in the call link based on the tracking identifier;
[0205] The second generation module 1404 for generating a call link starting from the service node corresponding to the first node identifier and including the call relationship between service nodes.
[0206] In a possible implementation, the first parsing module 1402 includes:
[0207] The first parsing sub-module for parsing the tracking identifier from the first target position of the target link identifier;
[0208] The second parsing sub-module for parsing the digital identifier from the second target position of the target link identifier;
[0209] The decompiling sub-module for decompiling the digital identifier to obtain the first node identifier.
[0210] In a possible implementation, the first parsing module 1402 further includes:
[0211] A third parsing sub-module, configured to parse the first part of the time information from the tracking identifier;
[0212] A fourth parsing sub-module, configured to parse the second part of the time information from the third target position of the target link identifier;
[0213] A timestamp generation sub-module, configured to generate a timestamp of the time information based on the first part of the information and the second part of the information.
[0214] In a possible implementation, the second parsing module 1403 is configured to:
[0215] Obtain a plurality of service nodes recording the tracking identifier;
[0216] For each service node, respectively obtain the second node identifier of the called service node called by the service node from the local instance of the service node;
[0217] Determine the call relationship based on each service node and the second node identifier of each called service node.
[0218] In a possible implementation, the second parsing module 1403 includes:
[0219] A first screening sub-module, configured to screen out at least one target link identifier based on the target link identifier screening condition to obtain a target link identifier set;
[0220] A first selection sub-module, configured to select a target link identifier from the target link identifier set.
[0221] In a possible implementation, the first screening sub-module is configured to:
[0222] Screen out at least one target link identifier from the specified information based on the target link identifier screening condition;
[0223] The specified information includes at least one of the following: logs, reported error events, and request headers recorded in the browser console.
[0224] In a possible implementation, the target link identifier screening condition includes at least one of the following: access layer type, geographical scope, status code, domain name, and IP address.
[0225] Based on the same technical concept, the embodiments of the present disclosure further provide a processing device for a call link, as Figure 15 shown, including:
[0226] A third acquisition module 1501, configured to acquire a to-be-processed access request;
[0227] A third generation module 1502, configured to generate a target link identifier for a call link of the to-be-processed access request; wherein, the target link identifier includes a first node identifier and a trace identifier; in the call link, when any service node calls a called service node, the trace identifier is used to be passed from any service node to the called service node;
[0228] A fourth acquisition module 1503, configured to acquire the target link identifier;
[0229] A third parsing module 1504, configured to parse out the first node identifier and the trace identifier from the target link identifier;
[0230] A fourth parsing module 1505, configured to parse the call relationship between service nodes in the call link based on the trace identifier;
[0231] A fourth generation module 1506, configured to generate a call link with the service node corresponding to the first node identifier as the starting service node and including the call relationship between service nodes.
[0232] In some embodiments, the third generation module 1502 includes:
[0233] A second partitioning sub-module, configured to partition the time information of the to-be-processed access request into first part information and second part information;
[0234] A third generation sub-module, configured to generate a trace identifier based on the first part information;
[0235] A fourth generation sub-module, configured to generate a target link identifier based on the second part information, the trace identifier, and the first node identifier.
[0236] In some embodiments, the fourth generation sub-module is configured to:
[0237] When the first node identifier contains characters, compile the first node identifier into a digital identifier;
[0238] Compile the second part information, the trace identifier, and the digital identifier into a digital string to obtain the target link identifier.
[0239] In some embodiments, the apparatus further includes:
[0240] A second saving module, configured to save the second node identifier of the called service node in a local instance when calling a service node.
[0241] In some embodiments, the third parsing module 1504 is configured to:
[0242] Parse the tracking identifier from the first target position of the target link identifier;
[0243] Parse the digital identifier from the second target position of the target link identifier;
[0244] Decompile the digital identifier to obtain the first node identifier.
[0245] In some embodiments, the fourth parsing module 1505 is configured to:
[0246] Obtain multiple service nodes that record the tracking identifier;
[0247] For each service node, respectively obtain the second node identifier of the called service node called by the service node from the local instance of the service node;
[0248] Determine the call relationship based on each service node and the second node identifier of each called service node.
[0249] In some embodiments, the fourth obtaining module 1503 includes:
[0250] The second filtering sub-module is configured to filter out at least one target link identifier based on the target link identifier filtering condition to obtain a target link identifier set;
[0251] The second selection sub-module is configured to select a target link identifier from the target link identifier set.
[0252] In some embodiments, the second filtering sub-module is configured to:
[0253] Filter out at least one target link identifier from the specified information based on the target link identifier filtering condition;
[0254] The specified information includes at least one of the following: logs, reported error events, and request headers recorded in the browser's console.
[0255] In some embodiments, the target link identifier filtering condition includes at least one of the following:
[0256] Access layer type, geographical range, status code, domain name, and IP address.
[0257] For the specific functions and examples of the modules and sub-modules of the device according to the embodiments of the present disclosure, reference may be made to the relevant descriptions of the corresponding steps in the above method embodiments, which will not be elaborated herein.
[0258] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0259] Figure 16FIG. shows a schematic block diagram of an exemplary electronic device 1600 that may be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as, personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementations of the present disclosure described and / or claimed herein.
[0260] As Figure 16 shown, the device 1600 includes a computing unit 1601 that can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1602 or a computer program loaded from a storage unit 1608 into a random access memory (RAM) 1603. In the RAM 1603, various programs and data required for the operation of the device 1600 can also be stored. The computing unit 1601, the ROM 1602, and the RAM 1603 are connected to each other via a bus 1604. An input / output (I / O) interface 1605 is also connected to the bus 1604.
[0261] A plurality of components in the device 1600 are connected to the I / O interface 1605, including: an input unit 1606, such as a keyboard, a mouse, etc.; an output unit 1607, such as various types of displays, speakers, etc.; a storage unit 1608, such as a magnetic disk, an optical disk, etc.; and a communication unit 1609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1609 allows the device 1600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0262] The computing unit 1601 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1601 executes the various methods and processes described above, such as the processing method of the call link. For example, in some embodiments, the processing method of the call link can be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as the storage unit 1608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 1600 via the ROM 1602 and / or the communication unit 1609. When the computer program is loaded into the RAM 1603 and executed by the computing unit 1601, one or more steps of the processing method of the call link described above can be executed. Alternatively, in other embodiments, the computing unit 1601 can be configured to execute the processing method of the call link in any other suitable manner (e.g., by means of firmware).
[0263] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0264] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0265] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0266] To provide for interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic, speech, or tactile input).
[0267] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of a communication network include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0268] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
[0269] It should be understood that the various forms of processes shown above can be used, with steps reordered, added or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitations are imposed herein.
[0270] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A method for processing a call chain, comprising: Obtaining a to-be-processed access request; wherein, the to-be-processed access request is any one of at least one call request generated by a gateway for a request sent by a client; Generating a target link identifier for the call chain of the to-be-processed access request; Wherein, the target link identifier is used to resolve the call chain, and the target link identifier includes a first node identifier and a trace identifier; the call chain includes multiple service nodes, and the first node identifier is used to mark the starting service node among the multiple service nodes; in the case where any service node in the call chain calls a called service node, the trace identifier is used to be passed from the any service node to the called service node, and the trace identifier is used to resolve the call relationship between the service nodes in the call chain; Further comprising: when calling a service node, saving the second node identifier of the called service node in a local instance.
2. The method according to claim 1, wherein The generating a target link identifier for the call chain of the to-be-processed access request includes: Dividing the time information of the to-be-processed access request into first part information and second part information; Generating the trace identifier based on the first part information; Generating the target link identifier based on the second part information, the trace identifier, and the first node identifier.
3. The method according to claim 2, wherein, The generating the target link identifier based on the second part information, the trace identifier, and the first node identifier includes: When the first node identifier contains characters, compiling the first node identifier into a digital identifier; Compiling the second part information, the trace identifier, and the digital identifier into a digital string to obtain the target link identifier.
4. A method for processing a call chain, comprising: Obtaining a target link identifier; the target link identifier is used to identify the call chain of a to-be-processed access request, and the to-be-processed access request is any one of at least one call request generated by a gateway for a request sent by a client; Parsing out a first node identifier and a trace identifier from the target link identifier; Based on the trace identifier, resolving the call relationship between the service nodes in the call chain, including: Obtaining multiple service nodes that record the trace identifier; For each service node, respectively obtaining the second node identifier of the called service node called by the service node from the local instance of the service node; Determining the call relationship based on each service node and the second node identifiers of each called service node; Generating a call chain with the service node corresponding to the first node identifier as the starting service node and including the call relationship between the service nodes.
5. The method according to claim 4, wherein The parsing out a first node identifier and a trace identifier from the target link identifier includes: Parsing out the trace identifier from a first target position of the target link identifier; Parsing out a digital identifier from a second target position of the target link identifier; Performing decompilation on the digital identifier to obtain the first node identifier.
6. According to the method of claim 4 or 5, further comprising: Parse the first part of the time information from the tracking identifier; Parse the second part of the time information from the third target position of the target link identifier; Generate a time stamp of the time information based on the first part of the information and the second part of the information.
7. The method according to claim 4, wherein The obtaining of the target link identifier includes: Based on the target link identifier filtering condition, filter out at least one target link identifier to obtain a target link identifier set; Select the target link identifier from the target link identifier set.
8. The method according to claim 7, wherein The filtering out of at least one target link identifier based on the target link identifier filtering condition includes: Based on the target link identifier filtering condition, filter out at least one target link identifier from the specified information; The specified information includes at least one of the following: logs, reported error events, request headers recorded in the browser's console.
9. The method according to claim 7, wherein the target link identifier filtering condition includes at least one of the following: Access layer type, geographical range, status code, domain name, and IP address.
10. A processing method for a call link, comprising: Obtain a to-be-processed access request; wherein, the to-be-processed access request is any one of at least one call request generated by a gateway for a request sent by a client; Generate a target link identifier for a call link of the to-be-processed access request; wherein, the target link identifier includes a first node identifier and a tracking identifier; in the call link, when any service node calls a called service node, the tracking identifier is used to be passed from the any service node to the called service node; Obtain the target link identifier; Parse the first node identifier and the tracking identifier from the target link identifier; Analyze the call relationship between service nodes in the call link based on the tracking identifier; Generate a call link with the service node corresponding to the first node identifier as the starting service node and including the call relationship between the service nodes; Further includes: When calling a service node, save the second node identifier of the called service node in a local instance.
11. The method according to claim 10, wherein, The generating of the target link identifier for the call link of the to-be-processed access request includes: Divide the time information of the to-be-processed access request into a first part of information and a second part of information; Generate the tracking identifier based on the first part of the information; Generate the target link identifier based on the second part of the information, the tracking identifier, and the first node identifier.
12. The method according to claim 11, wherein, The generating of the target link identifier based on the second part of the information, the tracking identifier, and the first node identifier includes: When the first node identifier contains characters, compile the first node identifier into a digital identifier; Compile the second part of the information, the tracking identifier, and the digital identifier into a digital string to obtain the target link identifier.
13. The method according to claim 10, wherein The parsing of the first node identifier and the tracking identifier from the target link identifier includes: Parse the tracking identifier from the first target position of the target link identifier; Parse the digital identifier from the second target position of the target link identifier; Decompile the digital identifier to obtain the first node identifier.
14. The method according to any one of claims 10-13 further includes: Parse the first part of the time information from the tracking identifier; Parse the second part of the time information from the third target position of the target link identifier; Generate a timestamp of the time information based on the first part of the information and the second part of the information.
15. The method according to any one of claims 10-13, wherein, The parsing of the call relationship between service nodes in the call link based on the tracking identifier includes: Obtain a plurality of service nodes recording the tracking identifier; For each service node, respectively obtain the second node identifier of the called service node called by the service node from the local instance of the service node; Determine the call relationship based on each service node and the second node identifiers of each called service node.
16. The method according to claim 10, wherein, The obtaining of the target link identifier includes: Based on the target link identifier screening condition, screen out at least one target link identifier to obtain a target link identifier set; Select the target link identifier from the target link identifier set.
17. The method according to claim 16, wherein, The screening out of at least one target link identifier based on the target link identifier screening condition includes: Based on the target link identifier screening condition, screen out at least one target link identifier from the specified information; The specified information includes at least one of the following: logs, reported error events, and request headers recorded in the browser console.
18. The method according to claim 16, wherein the target link identifier screening condition includes at least one of the following: Access layer type, geographical scope, status code, domain name, and IP address.
19. A call link processing system includes: A gateway for executing the method according to any one of claims 1-3; A link parsing server for executing the method according to any one of claims 4-9.
20. A call link processing device includes: A first acquisition module for acquiring a to-be-processed access request; wherein the to-be-processed access request is any one of at least one call request generated by the gateway for a request sent by a client; A first generation module for generating a target link identifier of a call link of the to-be-processed access request; Wherein the target link identifier is used to parse the call link, and the target link identifier includes a first node identifier and a tracking identifier; the call link includes a plurality of service nodes, and the first node identifier is used to mark the starting service node among the plurality of service nodes; when any service node in the call link calls a called service node, the tracking identifier is used to be passed from the any service node to the called service node, and the tracking identifier is used to track and parse the call relationship between service nodes in the call link; It further includes a first saving module for saving the second node identifier of the called service node in the local instance when calling a service node.
21. A call link processing device includes: A second acquisition module, configured to acquire a target link identifier; the target link identifier is used to identify a call link of a to-be-processed access request, and the to-be-processed access request is any one of at least one call request generated by a gateway for a request sent by a client; A first parsing module, configured to parse a first node identifier and a tracing identifier from the target link identifier; A second parsing module, configured to parse a call relationship between service nodes in the call link based on the tracing identifier. Specifically, the second parsing module is configured to: acquire multiple service nodes recording the tracing identifier; for each service node, respectively acquire a second node identifier of a called service node called by the service node from a local instance of the service node; Determine a call relationship based on each service node and the second node identifiers of each called service node; A second generation module, configured to generate a call link starting from a service node corresponding to the first node identifier and including the call relationship between the service nodes; 22. A processing device for a call link, comprising: A third acquisition module, configured to acquire a to-be-processed access request; wherein, the to-be-processed access request is any one of at least one call request generated by a gateway for a request sent by a client; A third generation module, configured to generate a target link identifier of a call link of the to-be-processed access request; wherein, the target link identifier includes a first node identifier and a tracing identifier; when any service node in the call link calls a called service node, the tracing identifier is used to be passed from the any service node to the called service node; A fourth acquisition module, configured to acquire the target link identifier; A third parsing module, configured to parse the first node identifier and the tracing identifier from the target link identifier; A fourth parsing module, configured to parse a call relationship between service nodes in the call link based on the tracing identifier; A fourth generation module, configured to generate a call link starting from a service node corresponding to the first node identifier and including the call relationship between the service nodes; Further comprising: A second saving module, configured to save a second node identifier of a called service node in a local instance when the service node is called; 23. An electronic device, comprising: At least one processor; And a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method according to any one of claims 1-18.
24. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-18.
25. A computer program product, comprising a computer program, where the computer program, when executed by a processor, implements the method according to any one of claims 1-18.
Citation Information
Patent Citations
Link tracking method and device, medium and computing equipment
CN113094166A
Full-link monitoring method and device, equipment, storage medium and program product
CN114490268A