Debugging method, device and equipment of micro-service node and storage medium
Patent Information
- Application Number
- CN202310071826.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-13
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-01-13
AI Technical Summary
[0003]在实现本公开发明构思的过程中,发明人发现,在某个微服务报错的情况下,需要调用全链路信息对该微服务进行调试排错,效率较低
[0016]根据本公开提供的微服务节点的调试方法、装置、设备、介质和程序产品,在检测到测试环境下某个节点的微服务错误信息的情况下,获取引起该节点报错的其他节点的标识和该节点的调试信息,再根据节点标识,从微服务的路由关联谱图查询得到引起该节点报错的其他节点的节点地址信息,再根据节点地址信息,从跟踪栈中获取对应的调试信息,再根据两个节点的调试信息,对上述报错的节点进行调试,由于仅调用与错误信息相关联的节点的调试信息对报错节点进行调试,因此,避免了调用微服务中全链路信息进行调试排错,提高了对报错节点的调试效率。
Smart Images

Figure CN116455794B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of microservice technology and financial technology, and in particular to a method, apparatus, device, medium and program product for debugging microservice nodes. Background Technology
[0002] In related technologies, end-to-end distributed transaction tracing relies on a chain-like tracing stack generated jointly by different subsystems. Currently, the typical approach is to collect all tracing stack information and then process and handle it.
[0003] In the process of realizing the inventive concept disclosed herein, the inventors discovered that when a microservice reports an error, it is necessary to call the full-link information to debug and troubleshoot the microservice, which is inefficient. Summary of the Invention
[0004] In view of the above problems, this disclosure provides debugging methods, apparatus, devices, media and program products for microservice nodes.
[0005] According to a first aspect of this disclosure, a method for debugging a microservice node is provided, comprising: in response to detecting microservice error information of a first node in a test environment, obtaining identification information of a second node, identification information of the first node, and debugging information of the first node, wherein the second node represents a microservice node used to trigger the first node to generate the microservice error information; querying the node address information of the second node from a routing association spectrum of the microservice based on the identification information of the first node and the identification information of the second node, wherein the routing association spectrum of the microservice is constructed based on the microservice call relationships between different nodes; obtaining the debugging information of the second node from the trace stack of the second node based on the node address information; and performing debugging operations on the first node based on the debugging information of the first node and the debugging information of the second node.
[0006] According to an embodiment of this disclosure, the routing association spectrum of the microservice includes I nodes, where I is a positive integer. The step of querying the node address information of the second node from the routing association spectrum of the microservice based on the identification information of the first node and the identification information of the second node includes: for the i-th node, obtaining the routing distance information between the first node and the i-th node based on the identification information of the first node and the identification information of the i-th node, where 1 ≤ i ≤ I, and i is a positive integer; querying the target level information from the routing association spectrum of the microservice based on the routing distance information; and determining that the routing distance information is greater than the specified value. If the distance information between the last node in the target hierarchy information and the first node is obtained, then based on the target hierarchy information, the target node that is furthest from the first node at the target hierarchy is retrieved from the routing association spectrum of the microservice. Based on the target node, the operation of determining the routing distance information between the target node and the first node is performed, and i is incremented. If the routing distance information is determined to be less than the distance information between the last node in the target hierarchy information and the first node, then based on the target hierarchy information, the node address information of the second node is retrieved from the routing association spectrum of the microservice.
[0007] According to an embodiment of this disclosure, the routing association spectrum of the microservice includes M layers of nodes, where M is a positive integer. The above-mentioned querying of the target level information from the routing association spectrum of the microservice based on the routing distance information includes: for the m-th layer node, obtaining the distance range between the m-th layer node and the first node based on the level information of the m-th layer node, where 1≤m≤M, and m is a positive integer; if it is determined that the routing distance information exceeds the distance range, returning to the operation of determining the distance range information and incrementing m; and if it is determined that the routing distance information is within the distance range, obtaining the target level information.
[0008] According to embodiments of this disclosure, obtaining the debugging information of the second node from the trace stack of the second node based on the node address information includes: querying the trace stack of the second node based on the node address information; and obtaining the debugging information of the second node from the trace stack of the second node based on the User Datagram Protocol.
[0009] According to an embodiment of this disclosure, the above-mentioned debugging operation on the first node based on the debugging information of the first node and the debugging information of the second node includes: concatenating the debugging information of the first node and the debugging information of the second node to obtain target debugging information; and performing debugging operation on the first node based on the target debugging information.
[0010] According to an embodiment of this disclosure, the above-mentioned concatenation of the debugging information of the first node and the debugging information of the second node to obtain target debugging information includes: based on a filtering strategy, filtering to obtain first debugging information from the debugging information of the first node, filtering to obtain second debugging information from the debugging information of the second node; and concatenating the first debugging information and the second debugging information to obtain the target debugging information.
[0011] According to embodiments of this disclosure, the method for constructing the routing association spectrum of the microservice includes: obtaining node quantity information, node call relationship information, and node address information; constructing a microservice call topology graph based on the call relationships; processing the microservice call topology graph using a target algorithm to obtain a linear sequence of microservice call relationships; binary encoding the nodes based on the linear sequence of microservice call relationships and the node quantity information to obtain node hierarchy information; and constructing the routing association spectrum of the microservice based on the node hierarchy information and the node address information. The routing association spectrum of the microservice includes multiple levels, and the nodes at each level store the node address information of multiple target nodes. The hierarchical distance between the multiple target nodes and the nodes is determined based on the hierarchical information of the nodes in the routing association spectrum of the microservice.
[0012] A second aspect of this disclosure provides a debugging apparatus for a microservice node, comprising: a first acquisition module, configured to acquire, in response to detecting microservice error information of a first node in a test environment, identification information of a second node, identification information of the first node, and debugging information of the first node, wherein the second node represents a microservice node used to trigger the first node to generate the microservice error information; a query module, configured to query, based on the identification information of the first node and the identification information of the second node, node address information of the second node from a routing association graph of the microservice, wherein the routing association graph of the microservice is constructed based on the microservice call relationships between different nodes; a second acquisition module, configured to acquire the debugging information of the second node from the trace stack of the second node based on the node address information; and an execution module, configured to perform debugging operations on the first node based on the debugging information of the first node and the debugging information of the second node.
[0013] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the methods described above.
[0014] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods described above.
[0015] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0016] According to the microservice node debugging method, apparatus, device, medium, and program product provided in this disclosure, when a microservice error is detected in a test environment, the identifiers of other nodes that caused the error and the debugging information of the node are obtained. Then, based on the node identifiers, the node address information of other nodes that caused the error is obtained from the routing association spectrum of the microservice. Based on the node address information, the corresponding debugging information is obtained from the trace stack. Based on the debugging information of the two nodes, the aforementioned error-causing node is debugged. Since the debugging information of the node associated with the error information is only called to debug the error-causing node, the calling of the full-link information in the microservice for debugging and troubleshooting is avoided, thus improving the debugging efficiency of the error-causing node. Attached Figure Description
[0017] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 This diagram illustrates an application scenario of a microservice node debugging method according to an embodiment of the present disclosure.
[0019] Figure 2 A flowchart illustrating a debugging method for a microservice node according to an embodiment of the present disclosure is shown schematically.
[0020] Figure 3 A schematic diagram illustrating a microservice call topology according to an embodiment of the present disclosure is shown.
[0021] Figure 4 The diagram illustrates a linear sequence of microservice call relationships according to an embodiment of the present disclosure.
[0022] Figure 5 A schematic diagram of a microservice node structure according to an embodiment of the present disclosure is shown.
[0023] Figure 6 A flowchart illustrating a method for querying node address information according to an embodiment of the present disclosure is shown schematically.
[0024] Figure 7 A schematic diagram of a routing association spectrum according to an embodiment of the present disclosure is shown.
[0025] Figure 8 A schematic diagram illustrating an example of routing information according to an embodiment of this disclosure is shown.
[0026] Figure 9 A schematic block diagram illustrating a debugging apparatus for a microservice node according to an embodiment of the present disclosure is shown; and
[0027] Figure 10 A block diagram of an electronic device suitable for implementing a debugging method for microservice nodes according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0028] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0029] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0030] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0031] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).
[0032] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.
[0033] In related technologies, end-to-end distributed transaction tracing relies on a chain-like tracing stack generated jointly by different subsystems. Currently, the typical approach is to collect all tracing stack information and then process and handle it.
[0034] However, for microservice testing environments, version updates are usually for a specific application, node, or services within the microservice. When debugging test cases, it is not necessary to obtain the entire trace stack; only the links associated with the services involved in the version update need to be recorded and traced.
[0035] Furthermore, when issues arise with components such as log4j (a Java logging tool), it is necessary to call the full-link information to debug and troubleshoot the microservice, making it difficult to quickly analyze the link and locate the problematic micro-link, resulting in low efficiency.
[0036] In view of this, embodiments of this disclosure provide a method for debugging microservice nodes, including:
[0037] In response to the detection of microservice error information of the first node in the test environment, the identification information of the second node, the identification information of the first node, and the debugging information of the first node are obtained. The second node represents the microservice node used to trigger the first node to generate microservice error information.
[0038] Based on the identification information of the first node and the identification information of the second node, the node address information of the second node is obtained from the routing association spectrum of the microservice. The routing association spectrum of the microservice is constructed based on the microservice call relationship between different nodes.
[0039] Based on the node address information, obtain the debugging information of the second node from the trace stack of the second node; and
[0040] Based on the debugging information of the first node and the debugging information of the second node, perform debugging operations on the first node.
[0041] Figure 1 The diagram illustrates an application scenario of a debugging method for a microservice node according to an embodiment of the present disclosure.
[0042] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0043] Users can interact with server 105 via network 104 using at least one of the first terminal device 101, second terminal device 102, and third terminal device 103 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, second terminal device 102, and third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0044] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0045] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0046] It should be noted that the microservice node debugging method provided in this embodiment can generally be executed by server 105. Correspondingly, the microservice node debugging device provided in this embodiment can generally be located in server 105. The microservice node debugging method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the microservice node debugging device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0047] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0048] The following will be based on Figure 1 The described scene, through Figures 2-6 The debugging method for microservice nodes in the disclosed embodiments is described in detail.
[0049] Figure 2 A flowchart illustrating a debugging method for a microservice node according to an embodiment of the present disclosure is shown.
[0050] like Figure 2 As shown, the debugging method for microservice nodes in this embodiment includes operations S210 to S240.
[0051] In operation S210, in response to detecting microservice error information of the first node in the test environment, the identification information of the second node, the identification information of the first node, and the debugging information of the first node are obtained, wherein the second node represents the microservice node used to trigger the first node to generate microservice error information.
[0052] According to embodiments of this disclosure, the first node may be a microservice node that has encountered an error, and the microservice error information may include the identification information of the second node. For example, based on the microservice error information generated by the first node, the microservice node that triggered the first node to generate the microservice error information can be determined.
[0053] According to embodiments of this disclosure, the debugging information of the first node can be information used to debug the first node, and the first node can be debugged by means of the debugging information of the first node when the first node generates microservice error information.
[0054] In operation S220, based on the identification information of the first node and the identification information of the second node, the node address information of the second node is obtained from the routing association spectrum of the microservice. The routing association spectrum of the microservice is constructed based on the microservice call relationship between different nodes.
[0055] According to embodiments of this disclosure, the node address information of the second node can be the address information of the second node in the routing association spectrum, and the node address of the second node can be obtained by querying the routing association spectrum through the address information.
[0056] According to embodiments of this disclosure, a call operation can be performed on the second node once the node address information of the second node is determined.
[0057] According to embodiments of this disclosure, the routing association spectrum can include multiple nodes and the calling relationships between them. For example, when querying node B through node A, the routing distance between node A and node B can be determined using the identification information of node A and node B. Then, based on the routing distance, the node address of node B can be determined, and a calling operation can be performed on node B using its node address.
[0058] When operating S230, based on the node address information, the debugging information of the second node is obtained from the trace stack of the second node.
[0059] According to embodiments of this disclosure, the debugging information of the second node may include debugging information that can be used to debug the first node, and debugging information that can be used to debug the second node. Since the node address information is obtained by querying the identification information of the first and second nodes, the debugging information of the second node obtained based on the node address information can be used to debug the first node.
[0060] According to embodiments of this disclosure, a trace stack can be configured on a node. The trace stack of a node can store debugging information relevant to that node, as well as debugging information relevant to other nodes. For example, the amount of debugging information about other nodes contained in a node can be determined based on the routing distance between nodes. For instance, if the routing distance between node A and node B is less than the routing distance between node A and node C, then the amount of debugging information about node B contained in node A's trace stack can be greater than the amount of debugging information about node C contained in node A's trace stack.
[0061] In operation S240, based on the debugging information of the first node and the debugging information of the second node, a debugging operation is performed on the first node.
[0062] According to embodiments of this disclosure, for example, when debugging information of a first node and debugging information from a second node that allows debugging of the first node are obtained, the debugging information of the first node and the debugging information of the second node can be integrated to perform debugging operations on the first node.
[0063] According to embodiments of this disclosure, when a microservice error is detected on a node in a test environment, the identifiers of other nodes that caused the error and the debugging information of the node are obtained. Then, based on the node identifiers, the node address information of other nodes that caused the error is obtained from the routing association graph of the microservice. Based on the node address information, the corresponding debugging information is obtained from the trace stack. Based on the debugging information of the two nodes, the node that caused the error is debugged. Since the debugging information of the node associated with the error is only called to debug the node that caused the error, the need to call the full-link information in the microservice for debugging and troubleshooting is avoided, thus improving the debugging efficiency of the node that caused the error.
[0064] According to embodiments of this disclosure, for example, debugging information for debugging the error can be determined based on the error represented by the microservice error information generated by the first node. The node identifier corresponding to the debugging information can be retrieved from the database, and then the node address information corresponding to the node identifier can be retrieved from the routing association spectrum of the microservice based on the node identifier. Based on the debugging information of the node corresponding to the node address information and the debugging information of the first node, debugging operations can be performed on the first node.
[0065] According to embodiments of this disclosure, for example, node call relationship information, node quantity information, and node address information can be stored in the service registry. For instance, the node quantity information, node call relationship information, and node address information can be obtained based on all microservice nodes within a microservice.
[0066] According to embodiments of this disclosure, the method for constructing a routing association spectrum for microservices includes:
[0067] Obtain information on the number of nodes, node call relationships, and node addresses;
[0068] Construct a microservice call topology diagram based on the call relationships;
[0069] Using the target algorithm, the microservice call topology graph is processed to obtain a linear sequence of microservice call relationships;
[0070] Based on the linear sequence of microservice call relationships and the number of nodes, the nodes are binary-encoded to obtain node hierarchy information; and
[0071] Based on node hierarchy information and node address information, a routing association spectrum of the microservice is constructed. The routing association spectrum of the microservice includes multiple levels. Each node in each level stores the node address information of multiple target nodes. The hierarchical distance between multiple target nodes and nodes is determined based on the hierarchical information of the nodes in the routing association spectrum of the microservice.
[0072] According to embodiments of this disclosure, for example, the topology of a microservice call topology graph can represent the call relationships between nodes. For instance, a microservice call topology graph may include multiple microservice nodes and the call relationships between these nodes.
[0073] According to embodiments of this disclosure, for example, call relationships can be converted into sparse matrices for storage and processing. Since there are a large number of empty array elements, converting call relationships into sparse matrices can improve storage and processing efficiency.
[0074] According to embodiments of this disclosure, for example, since the calling relationship mainly exists between the upper and lower layers of the topology graph in the context of the common layered design of microservice architecture, the calling relationship between microservices can be represented by a DAG graph (directed acyclic graph), and the microservice calling topology graph can be a DAG graph.
[0075] Figure 3 A schematic diagram of a microservice call topology according to an embodiment of the present disclosure is shown.
[0076] like Figure 3As shown, nodes can include C1, C2, C3, C4, C5, C6, C7, C8, and C9. C1 can call C8 and C3, and C2 can call C3 and C5. C1 and C2 can be classified as the first layer of services. C8 can call C9, and C3 and C5 can call C4. C8, C3, and C5 can be classified as the second layer of services. C9 and C4 can call C7, and C4 and C5 can call C6. C4 and C9 can be classified as the third layer of services. C7 and C6 can be classified as the fourth layer of services.
[0077] According to embodiments of this disclosure, for example, the calling relationship between nodes can be represented by a two-dimensional array of "caller + callee". For example, C1 calling C8 can be represented as array(C1, C8), C1 calling C3 can be represented as array(C1, C3), C8 calling C9 can be represented as array(C8, C9), C3 calling C4 can be represented as array(C3, C4), and C9 calling C7 can be represented as array(C9, C7). The element value of the array can be 1, indicating the existence of a calling relationship.
[0078] According to embodiments of this disclosure, for example, the target algorithm may include a greedy algorithm and a depth-first algorithm, which can process the microservice call topology graph into a linear sequence of microservice call relationships.
[0079] According to embodiments of this disclosure, for example, a linear sequence of microservice call relationships may include multiple microservice nodes and linear call relationships between the multiple microservice nodes.
[0080] Figure 4 The diagram illustrates a linear sequence of microservice call relationships according to an embodiment of the present disclosure.
[0081] like Figure 4 As shown, the linear sequence of microservice call relationships can include nodes C1, C2, C3, C4, C5, C6, C7, C8, and C9. The order of the nodes can be C1, C2, C3, C5, C8, C4, C9, C6, and C7.
[0082] According to embodiments of this disclosure, for example, the number of bits in the binary encoding can be determined based on the total number of nodes in the node quantity information, and the nodes can be binary encoded. Furthermore, based on the linear node call relationship reflected by the linear sequence of microservice call relationships, the binary-encoded nodes can be divided into levels to obtain node level information. For example, nodes may include 1111, 1101, 1100, 1011, 1010, 1001, and 1000, etc., where 1111 can be classified as level 1, 1101 and 1100 can be classified as level 2, and 1011, 1010, 1001, and 1000 can be classified as level 3.
[0083] According to embodiments of this disclosure, as shown in Table 1, taking node C3 as an example, in Figure 4 If a microservice is ranked 3rd and its binary value is 1101, then its corresponding binary encoding is xxxx1101. The number of bits in xxxx depends on the number of microservices. For example, if the number of microservices is 65356 or less, the binary encoding is 16 bits, which can record information for 2^16 microservices. For instance, the mapping between all microservice names and their binary encodings can be stored in a service registry or server for all nodes to read.
[0084] Table 1
[0085] MicroService Num (the code name for a microservice in a DAG) C3 Key (microservice binary code) xxxx1101 IP Address, Port (Node Address Information) XXX.XXX.XXX.XXX:X Value (stack trace information) XXXXXX Route Info (Route Distance Information) XXXXXX
[0086] According to embodiments of this disclosure, a microservice call topology diagram is constructed based on the call relationship. The microservice call topology diagram is then processed into a linear sequence. Based on the linear sequence and node quantity information, the nodes are binary encoded to obtain node hierarchy information. Based on the node hierarchy information and node address information, a routing association spectrum that can represent the routing relationship between nodes is constructed, thereby achieving an accurate representation of the routing relationship between nodes.
[0087] According to embodiments of this disclosure, for example, a microservice sidecar, microservice modules, and a network protocol stack can be set up in a microservice node. A debugging information interceptor and a routing information area based on a JVM (Java Virtual Machine) agent can be set up in the microservice sidecar, and a trace stack can be set up in the node's network protocol stack. When a microservice is invoked and executed, the interceptor can obtain the microservice's debugging information and store it in the trace stack. The routing information area can be used to record information such as the microservice's name and encoding; the encoding can be the microservice node's encoding in the routing association spectrum.
[0088] According to embodiments of this disclosure, for example, a node can contain multiple microservices. Each microservice node can implement functions such as service discovery, traffic management, load balancing, health checks, circuit breakers and failover, and authentication methods by deploying a service mesh proxy, i.e., the microservice sidecar mode described above.
[0089] According to embodiments of this disclosure, a data stack area can be set up as a trace stack in the data structure area of the network protocol stack, and debugging information related to all microservices in the corresponding node can be stored in the trace stack.
[0090] Figure 5 A schematic diagram of a microservice node structure according to an embodiment of the present disclosure is shown.
[0091] like Figure 5 As shown, the microservice node 510 may include a microservice module 520, a microservice sidecar 530, and a network protocol stack 540. The microservice module 520 may include a business logic module 521; the microservice sidecar 530 may include a service discovery module 531, a routing information area 532, and a debugging information interceptor 533; the network protocol stack 540 may include a flow control module 541 and a tracing stack 542. The microservice module 520, the microservice sidecar 530, and the network protocol stack 540 can communicate with each other.
[0092] Microservice node 510 can communicate and connect with other nodes, and each microservice node 510 can contain multiple microservice sidecars 530.
[0093] It should be noted that each microservice node 510 may include multiple microservice modules 520 and multiple microservice sidecars 530, and the microservice modules 520 and the microservice sidecars 530 can communicate with each other. Those skilled in the art can adjust the internal structure of the microservice node 510 according to actual needs.
[0094] According to embodiments of this disclosure, the routing association spectrum of a microservice includes I nodes, where I is a positive integer.
[0095] Figure 6 A flowchart illustrating a method for querying node address information according to an embodiment of the present disclosure is shown.
[0096] like Figure 6 As shown, the method for querying node address information in this embodiment includes operations S610 to S650.
[0097] In operation S610, for the i-th node, based on the identification information of the first node and the identification information of the i-th node, the routing distance information between the first node and the i-th node is obtained, where 1≤i≤1 and i is a positive integer.
[0098] According to embodiments of this disclosure, the routing distance between the first node and the i-th node can be determined from the routing association spectrum of the microservice based on the identification information of the first node and the identification information of the i-th node. The node address of the i-th node can then be queried based on the routing distance.
[0099] According to embodiments of this disclosure, for example, the routing distance information can be calculated through an XOR operation. For example, the result of an XOR operation between node 1110 and node 1001 can be 0111 = 7, so the routing distance information between node 1110 and node 1001 can be 7.
[0100] When operating S620, the target level information is obtained by querying the routing association spectrum of the microservice based on the routing distance information.
[0101] According to embodiments of this disclosure, the target level can be the level where the i-th node resides. By determining the target level information, the node address of the i-th node can be determined from the target level.
[0102] When operating S630, if the routing distance information is determined to be greater than the distance between the last node and the first node in the target hierarchy information, the target node that is farthest from the first node in the microservice routing association spectrum is retrieved based on the target hierarchy information.
[0103] According to embodiments of this disclosure, for example, the distance information between the last node and the first node in the target hierarchy information can be [2]. m-1 ,2 m ), m can be a level, m is a positive integer, for example, when the target level is level 3, the routing distance information between the last node and the first node in the level can be [2 2 ,2 3 If the distance between the last node and the first node in the hierarchy is [4, 8), then the routing distance between them can be [4, 8). Therefore, the target node furthest from the first node in the target hierarchy can be the node with a routing distance of 7 from the first node.
[0104] According to embodiments of this disclosure, for example, when the binary encoding is 32 bits, the routing information area of a node in a microservice can contain routing information from layer 1 to layer 32. That is, the routing information area in the microservice sidecar of each node can store routing information within a distance range of [2]. m-1 ,2m This contains the node address information of k microservice nodes within a given level, where k is a positive integer. The value of k can be related to the balance between space and time complexity of the routing hierarchy. A larger k allows for a higher space complexity and a lower time complexity. For each microservice node, only the call information of the k nearest microservice nodes to that node can be stored. For example, the value of k can be less than the number of nodes contained in a certain level.
[0105] According to embodiments of this disclosure, for example, it can be determined whether the routing distance is greater than 2 corresponding to the node route at layer m. m-1 +k, which is the sum of the lower bound of the routing distance of the m-th layer node and k; if so, the tail pointer method can be used to iteratively find the target node; if not, the node address information of the target node can be determined from the k microservice nodes associated with the target node found in this layer.
[0106] In operation S640, based on the target node, return to perform the operation of determining the routing distance information between the target node and the first node, and increment i.
[0107] According to embodiments of this disclosure, since the routing distance information is greater than the number of nodes corresponding to the target level information, the operation of determining the routing distance information between the target node and the first node can be performed based on the target node, and i can be incremented to reduce the routing distance between the target node and the first node, so that the found target node gets closer and closer to the second node, and then the node address of the second node can be obtained.
[0108] Figure 7 A schematic diagram of a routing association spectrum according to an embodiment of the present disclosure is shown.
[0109] like Figure 7 As shown, the routing relationship spectrum can be displayed in the form of a binary tree, and the microservice nodes can be displayed as leaf nodes of the binary tree. Node address information may not be displayed in the binary tree. The routing relationship spectrum can include nodes 1111, 1110, 1101, 1100, 1011, 1010, 1001, and 1000. Among them, the hierarchical information of node 1111 can represent layer 1; the hierarchical information of nodes 1101 and 1100 can represent layer 2; and nodes 1011, 1010, 1001, and 1000 can represent layer 3. The nth bit of the binary number corresponds to the nth level of the binary tree. For example, if the first bit is 0 and the second bit is 0, node 1100 can be determined from the second level of the binary tree; if the first bit, the second bit, and the third bit are all 0, node 1000 can be determined from the third level of the binary tree. The routing distance information can be determined according to [2].i-1 ,2 i It is determined that the routing distance range of Layer 1 can be [2]. 0 ,2 1 The routing distance range of the second layer can be [1, 2); 1 ,2 2 ), that is, [2, 4); the routing distance range of the third layer can be [2, 4). 2 ,2 3 ), that is, [4, 8).
[0110] According to an embodiment of this disclosure, for example, the node address corresponding to node 1001 is found from node 1110, and the k parameter is set to 2. The result of the XOR operation between node 1110 and node 1001 is 0111 = 7, so the Layer 3 routing distance range is within [4, 8) and greater than 2. 3 If -1+k=6, then we can continue to search for 1001 through 1011 pointed to by the tail pointer of the routing information of this layer. That is, we recalculate the XOR distance between 1011 and 1001, and repeat the above search process through the routing information of 1011.
[0111] Figure 8 A schematic diagram illustrating an example of routing information according to an embodiment of this disclosure is shown.
[0112] like Figure 8 As shown, the routing information can include the binary code of the node and the address corresponding to the node. The first-level routing information can include node 1111 and the address of node 1111, with a routing distance range of [1, 2); the second-level routing information can include node 1101 and the address of node 1101, as well as node 1100 and the address of node 1100, with a routing distance range of [2, 4); the third-level routing information can include node 1010 and the address of node 1010, node 1011 and the address of node 1011, node 1000 and the address of node 1000, as well as node 1001 and the address of node 1001, with a routing distance range of [4, 8).
[0113] According to an embodiment of this disclosure, for example, the k parameter can be set to 4, then 1001 can be found directly from the head pointer to the tail of the routing layer.
[0114] According to embodiments of this disclosure, for example, by using the tail pointer method to find the target node each time, the target node can be approached more and more closely, and the probability of the target node appearing in the m-th layer routing information used in each iteration will increase. For a debugging and testing environment with any n microservice nodes, only log2(n) queries are needed, where n is a positive integer, to find the target node.
[0115] It should be noted that the above Figure 7 and Figure 8 This is for illustrative purposes only and does not represent the actual number of microservice nodes, distance range, or number of levels.
[0116] When operating S650, if the routing distance information is determined to be less than the distance between the last node and the first node in the target hierarchy information, the node address information of the second node is obtained from the routing association spectrum of the microservice based on the target hierarchy information.
[0117] According to embodiments of this disclosure, if the routing distance information is determined to be less than the number of nodes corresponding to the target level information, it can be determined that the second node is among the nodes corresponding to the target level information. The second node can be found in the target level and can be found in the routing association spectrum of the microservice.
[0118] According to embodiments of this disclosure, for example, when determining that the routing distance is less than that of a node route corresponding to the m-th layer, 2 m-1 In the case of +k, the node address information of the target node can be determined from the k microservice nodes associated with the target node as queried from this layer.
[0119] According to embodiments of this disclosure, since the routing distance between the target node and the first node is determined by returning to the execution iteration to determine the second node, the method of determining the second node by calling the full-link information is avoided, thereby reducing the computer resources required to determine the second node and improving the efficiency of determining the second node.
[0120] According to embodiments of this disclosure, the routing association spectrum of a microservice includes M-layer nodes, where M is a positive integer. Based on routing distance information, target layer information is queried from the routing association spectrum of the microservice, including:
[0121] For a node at level m, based on the level information of the node at level m, the distance range between the node at level m and the first node is obtained, where 1 ≤ m ≤ M, and m is a positive integer;
[0122] If the route distance information is determined to exceed the distance range, return to perform the operation to determine the distance range information, and increment m; and
[0123] Once the routing distance information is determined to be within the specified range, the target hierarchy information is obtained.
[0124] According to an embodiment of this disclosure, for a node at level m, the distance range between the node at level m and the first node is obtained based on the level information of the node at level m. For example, the distance range can characterize the distance between levels. The level distance between the node at level m and the first node can be determined based on the level information of the node at level m and the level information of the first node, thus obtaining the distance range between levels.
[0125] According to embodiments of this disclosure, since the operation of determining the distance range is re-executed when the routing distance information is determined to exceed the distance range, and m is incremented, the hierarchical range between the first node and the m-th layer node can be narrowed. When the routing distance information is determined to be within the distance range, the hierarchical level of the second node can be determined, and thus the hierarchical level of the second node can be determined as the target hierarchical level.
[0126] According to embodiments of this disclosure, since the hierarchical distance range between nodes is determined by returning to perform iterative operations, the method of determining the hierarchical level of the target node by calling full-link information is avoided, thereby reducing the computer resources required to determine the hierarchical level of the target node and improving the efficiency of determining the target hierarchical level.
[0127] According to embodiments of this disclosure, based on node address information, debugging information of the second node is obtained from the trace stack of the second node, including:
[0128] Based on the node address information, the trace stack of the second node can be retrieved; and
[0129] Based on the User Datagram Protocol (UDP), debugging information for the second node is obtained from the trace stack of the second node.
[0130] According to embodiments of this disclosure, the second node can be obtained by querying the node address information, and then the trace stack configured on the second node can be obtained.
[0131] According to embodiments of this disclosure, obtaining debugging information of the second node from the trace stack of the second node based on the User Datagram Protocol (UDP) can be based on the UDP and obtain partial debugging information from the trace stack of the second node that can be used to debug the first node.
[0132] According to embodiments of this disclosure, for example, by using the User Datagram Protocol (UDP) to record relevant information, the transmission of UDP packets is facilitated, and a P2P platform protocol framework can be adopted, thereby improving the adaptability of microservices.
[0133] According to embodiments of this disclosure, by querying the trace stack of the second node based on the node address information, and then obtaining the debugging information of the second node from the trace stack based on the User Datagram Protocol, the efficiency of obtaining the debugging information of the second node is improved.
[0134] According to embodiments of this disclosure, based on debugging information of the first node and debugging information of the second node, debugging operations are performed on the first node, including:
[0135] The debugging information from the first node and the debugging information from the second node are concatenated to obtain the target debugging information; and
[0136] Based on the target debugging information, perform debugging operations on the first node.
[0137] According to embodiments of this disclosure, the debugging information of the first node and the debugging information of the second node are spliced together to obtain target debugging information. For example, partial debugging information that can be used to debug the first node can be obtained from the first node, and partial debugging information that can be used to debug the first node can be obtained from the second node. The two parts of debugging information are spliced together to obtain target debugging information. The first node can be fully debugged using the spliced target debugging information so that the first node can solve the problems that have occurred.
[0138] According to embodiments of this disclosure, by concatenating the debugging information of the first node and the debugging information of the second node, target debugging information capable of debugging the first node is obtained. Then, based on the target debugging information, debugging operations are performed on the first node, reducing reliance on server-related functions and alleviating server execution pressure. Furthermore, since the debugging information is set on different nodes, and the modulation information is searched and concatenated as needed, the flexibility of microservice deployment is improved, global risks due to information leakage are avoided, and the security of debugging information stored on the nodes is enhanced.
[0139] According to embodiments of this disclosure, the debugging information of the first node and the debugging information of the second node are concatenated to obtain target debugging information, including:
[0140] Based on the filtering strategy, first debugging information is obtained from the debugging information of the first node, and second debugging information is obtained from the debugging information of the second node; and
[0141] The first and second debugging information are spliced together to obtain the target debugging information.
[0142] According to embodiments of this disclosure, for example, the filtering strategy can be a resolution strategy corresponding to microservice error information, which can be used to resolve the problem of generating microservice error information. Based on this resolution strategy, first debugging information corresponding to the error can be filtered from the debugging information of the first node, and second debugging information corresponding to the error can be filtered from the debugging information of the second node.
[0143] According to embodiments of this disclosure, for example, the filtering strategy may be determined based on the error reporting time period or the error event number. The call information can be filtered using the filtering strategy. Information related to the filtering strategy, such as the error reporting time period, can be combined and integrated with the call information for debuggers to reference.
[0144] According to embodiments of this disclosure, for example, the first debugging information may be partial debugging information obtained from the first node for handling errors, and the second debugging information may be partial debugging information obtained from the second node for handling errors.
[0145] According to embodiments of this disclosure, for example, by splicing the first debugging information and the second debugging information, complete target debugging information for handling errors can be obtained. The first node can be debugged using the target debugging information to resolve the errors that occur in the first node.
[0146] According to embodiments of this disclosure, by using a filtering strategy, first debugging information is obtained from the debugging information of the first node, and second debugging information is obtained from the debugging information of the second node. The first and second debugging information are then concatenated to obtain the target debugging information, thereby improving the efficiency of debugging information filtering and thus improving the efficiency of obtaining the target debugging information.
[0147] Based on the above-described microservice node debugging method, this disclosure also provides a microservice node debugging device. The following will combine... Figure 9 The device is described in detail.
[0148] Figure 9 A schematic block diagram of a debugging apparatus for a microservice node according to an embodiment of the present disclosure is shown.
[0149] like Figure 9 As shown, the microservice node debugging device 900 of this embodiment includes a first acquisition module 910, a query module 920, a second acquisition module 930, and an execution module 940.
[0150] The first acquisition module 910 is used to acquire the identification information of the second node, the identification information of the first node, and the debugging information of the first node in response to the detection of microservice error information of the first node in the test environment. The second node represents the microservice node that triggered the first node to generate the microservice error information. In one embodiment, the first acquisition module 910 can be used to perform the operation S210 described above, which will not be repeated here.
[0151] The query module 920 is used to query the node address information of the second node from the routing association spectrum of the microservice based on the identification information of the first node and the identification information of the second node. The routing association spectrum of the microservice is constructed based on the microservice call relationships between different nodes. In one embodiment, the query module 920 can be used to perform the operation S220 described above, which will not be repeated here.
[0152] The second acquisition module 930 is used to acquire debugging information of the second node from the trace stack of the second node based on the node address information. In one embodiment, the second acquisition module 930 can be used to perform the operation S230 described above, which will not be repeated here.
[0153] The execution module 940 is used to perform debugging operations on the first node based on the debugging information of the first node and the debugging information of the second node. In one embodiment, the execution module 940 can be used to perform the operation S240 described above, which will not be repeated here.
[0154] According to embodiments of this disclosure, the query module 920 includes a first acquisition submodule, a first query submodule, a second query submodule, an execution submodule, and a third query submodule. Specifically, the first acquisition submodule is used to obtain the routing distance information between the first node and the i-th node based on the identification information of the first node and the i-th node, where 1 ≤ i ≤ 1, and i is a positive integer; the first query submodule is used to query the target level information from the routing association spectrum of the microservice based on the routing distance information; the second query submodule is used to, when the routing distance information is determined to be greater than the distance information between the last node and the first node in the target level information, query the target node farthest from the first node at the target level from the routing association spectrum of the microservice based on the target level information; the execution submodule is used to, based on the target node, return to execute the operation of determining the routing distance information between the target node and the first node, and increment i; the third query submodule is used to, when the routing distance information is determined to be less than the distance information between the last node and the first node in the target level information, query the node address information of the second node from the routing association spectrum of the microservice based on the target level information.
[0155] According to embodiments of this disclosure, the first query submodule includes a first acquisition unit, an execution unit, and a second acquisition unit. The first acquisition unit is used to, for a node at layer m, obtain the distance range between the node at layer m and the first node based on the layer information of the node at layer m, where 1 ≤ m ≤ M, and m is a positive integer. The execution unit is used to, if it is determined that the routing distance information exceeds the distance range, return to the operation of determining the distance range information and increment m. The second acquisition unit is used to, if it is determined that the routing distance information is within the distance range, obtain the target layer information.
[0156] According to embodiments of this disclosure, the second acquisition module 930 includes a fourth query submodule and a second acquisition submodule. The fourth query submodule is used to query the trace stack of the second node based on node address information; the second acquisition submodule is used to obtain the debugging information of the second node from the trace stack of the second node based on the User Datagram Protocol (UDP).
[0157] According to an embodiment of this disclosure, the execution module 940 includes a splicing submodule and a debugging submodule. The splicing submodule is used to splice the debugging information of the first node and the debugging information of the second node to obtain target debugging information; the debugging submodule is used to perform debugging operations on the first node based on the target debugging information.
[0158] According to embodiments of this disclosure, the splicing submodule includes a filtering unit and a splicing unit. The filtering unit is used to filter first debugging information from the debugging information of a first node and second debugging information from the debugging information of a second node based on a filtering strategy. The splicing unit is used to splice the first and second debugging information to obtain the target debugging information.
[0159] According to embodiments of this disclosure, the query module 920 further includes a third acquisition submodule, a first construction submodule, a utilization submodule, an encoding submodule, and a second construction submodule. The third acquisition submodule is used to acquire node quantity information, node call relationship information, and node address information. The first construction submodule is used to construct a microservice call topology diagram based on the call relationships. The utilization submodule is used to process the microservice call topology diagram using a target algorithm to obtain a linear sequence of microservice call relationships. The encoding submodule is used to perform binary encoding on the nodes based on the linear sequence of microservice call relationships and the node quantity information to obtain node hierarchy information. The utilization submodule is used to construct a microservice routing association spectrum based on the node hierarchy information and node address information. The microservice routing association spectrum includes multiple levels, and each level stores the node address information of multiple target nodes. The hierarchical distance between multiple target nodes and nodes is determined based on the hierarchical information of the nodes in the microservice routing association spectrum.
[0160] According to embodiments of this disclosure, any plurality of modules among the first acquisition module 910, query module 920, second acquisition module 930, and execution module 940 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the first acquisition module 910, query module 920, second acquisition module 930, and execution module 940 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of software, hardware, and firmware methods, or in a suitable combination of any of these methods. Alternatively, at least one of the first acquisition module 910, the query module 920, the second acquisition module 930, and the execution module 940 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0161] Figure 10 A block diagram of an electronic device suitable for implementing a debugging method for microservice nodes according to an embodiment of the present disclosure is shown schematically.
[0162] like Figure 10 As shown, an electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage portion 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0163] RAM 1003 stores various programs and data required for the operation of electronic device 1000. Processor 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Processor 1001 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1002 and / or RAM 1003. It should be noted that the programs may also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0164] According to embodiments of this disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to a bus 1004. The electronic device 1000 may also include one or more of the following components connected to the I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.
[0165] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0166] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1002 and / or RAM 1003 and / or one or more memories other than ROM 1002 and RAM 1003 described above.
[0167] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the microservice node debugging method provided in the embodiments of this disclosure.
[0168] When the computer program is executed by the processor 1001, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0169] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1009, and / or installed from a removable medium 1011. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0170] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by processor 1001, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0171] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0172] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0173] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0174] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A method for debugging microservice nodes, comprising: In response to detecting microservice error information of the first node in the test environment, the identification information of the second node, the identification information of the first node, and the debugging information of the first node are obtained, wherein the second node represents the microservice node used to trigger the first node to generate the microservice error information; For the i-th node, based on the identification information of the first node and the identification information of the i-th node, the routing distance information between the first node and the i-th node is obtained, where 1 ≤ i ≤ 1. i is a positive integer; based on the routing distance information, the target level information is retrieved from the routing association spectrum of the microservice; if the routing distance information is determined to be greater than the distance between the last node and the first node in the target level information, the target node furthest from the first node at the target level is retrieved from the routing association spectrum of the microservice based on the target level information; based on the target node, the operation of determining the routing distance information between the target node and the first node is returned, and i is incremented; and if the routing distance information is determined to be less than the distance between the last node and the first node in the target level information, the node address information of the second node is retrieved from the routing association spectrum of the microservice based on the target level information; wherein, the routing association spectrum of the microservice is constructed based on the microservice call relationship between different nodes; the routing association spectrum of the microservice includes multiple levels, and the node address information of multiple target nodes is stored in the nodes of each level, and the level distance between the multiple target nodes and the node is determined based on the level information of the node in the routing association spectrum of the microservice; the routing association spectrum of the microservice includes I nodes. I is a positive integer; Based on the node address information, the debugging information of the second node is obtained from the trace stack of the second node; and Based on the debugging information of the first node and the debugging information of the second node, a debugging operation is performed on the first node.
2. The method according to claim 1, wherein, The routing association spectrum of a microservice includes M layers of nodes, where M is a positive integer. The step of retrieving target level information from the routing association spectrum of the microservice based on the routing distance information includes: For a node at level m, the distance range between the node at level m and the first node is obtained based on the level information of the node at level m, where 1 ≤ m ≤ M, and m is a positive integer; If it is determined that the routing distance information exceeds the distance range, return to the operation of determining the distance range information and increment m; and If the routing distance information is determined to be within the specified distance range, the target level information is obtained.
3. The method according to claim 1, wherein, The step of obtaining the debugging information of the second node from the trace stack of the second node based on the node address information includes: Based on the node address information, the tracking stack of the second node is retrieved; and Based on the User Datagram Protocol (UDP), the debugging information of the second node is obtained from the trace stack of the second node.
4. The method according to claim 1, wherein, The step of performing debugging operations on the first node based on the debugging information of the first node and the debugging information of the second node includes: The debugging information of the first node and the debugging information of the second node are concatenated to obtain the target debugging information; and Based on the target debugging information, a debugging operation is performed on the first node.
5. The method according to claim 4, wherein, The step of concatenating the debugging information of the first node and the debugging information of the second node to obtain the target debugging information includes: Based on the filtering strategy, first debugging information is obtained from the debugging information of the first node, and second debugging information is obtained from the debugging information of the second node; and The first debugging information and the second debugging information are concatenated to obtain the target debugging information.
6. The method according to claim 1, wherein, The method for constructing the routing association spectrum of the microservices includes: Obtain information on the number of nodes, node call relationships, and node addresses; Based on the aforementioned call relationships, construct a microservice call topology diagram; The target algorithm is used to process the microservice call topology graph to obtain a linear sequence of microservice call relationships; Based on the linear sequence of the microservice call relationships and the node quantity information, the nodes are binary encoded to obtain node hierarchy information; and Based on the node hierarchy information and the node address information, construct the routing association spectrum of the microservice.
7. A debugging method apparatus for microservice nodes, comprising: The first acquisition module is used to acquire the identification information of the second node, the identification information of the first node, and the debugging information of the first node in response to the detection of microservice error information of the first node in the test environment, wherein the second node represents the microservice node used to trigger the first node to generate the microservice error information. The query module is used to, for the i-th node, obtain the routing distance information between the first node and the i-th node based on the identification information of the first node and the identification information of the i-th node, where 1 ≤ i ≤ 1. i is a positive integer; based on the routing distance information, the target level information is retrieved from the routing association spectrum of the microservice; if the routing distance information is determined to be greater than the distance between the last node and the first node in the target level information, the target node furthest from the first node at the target level is retrieved from the routing association spectrum of the microservice based on the target level information; based on the target node, the operation of determining the routing distance information between the target node and the first node is returned, and i is incremented; and if the routing distance information is determined to be less than the distance between the last node and the first node in the target level information, the node address information of the second node is retrieved from the routing association spectrum of the microservice based on the target level information; wherein, the routing association spectrum of the microservice is constructed based on the microservice call relationship between different nodes; the routing association spectrum of the microservice includes multiple levels, and the node address information of multiple target nodes is stored in the nodes of each level, and the level distance between the multiple target nodes and the node is determined based on the level information of the node in the routing association spectrum of the microservice; the routing association spectrum of the microservice includes I nodes. I is a positive integer; The second acquisition module is used to acquire debugging information of the second node from the trace stack of the second node based on the node address information; and The execution module is used to perform debugging operations on the first node based on the debugging information of the first node and the debugging information of the second node.
8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
System alarm processing method and device
CN108494591A
Development and debugging method and device for micro-service application
CN114385504A