Method and apparatus for generating message interception and service link diagrams

By using codec modules and message interception modules in the RPC architecture, the service request packets are encapsulated into the target communication protocol and recorded the call information, which solves the problem that traditional RPC architecture cannot intercept multi-communication protocol messages, and realizes the link tracking function of multi-protocols.

CN115913912BActive Publication Date: 2025-07-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111164814.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2025-07-25
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

In the prior art, traditional RPC architectures cannot intercept service request messages generated based on other communication protocols, resulting in poor interception and poor expansion of message interception and inability to realize service request messages link tracking of multi-communication protocols.

Method used

The relevant information of the service request message is encapsulated into the initial service call message generated by the target communication protocol through the codec module, and the call information is intercepted and recorded through the message intercept module to generate a service call relationship sub-graph to locate the faulty node.

Benefits of technology

Link tracking of service request messages of multi-communication protocols is realized, and the problem of poor scalability of traditional RPC architectures is solved, and the data content of service request messages generated by various communication protocols and computer languages can be intercepted and recorded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115913912B_ABST
    Figure CN115913912B_ABST
Patent Text Reader

Abstract

This application relates to the field of computers, and provides a method and device for intercepting messages and generating a service link diagram to solve the problem of poor scalability of message interception. The method includes: when it is determined by the encoding and decoding module that the communication protocol adopted by the service request message does not conform to the target communication protocol, encapsulate the relevant information of the service request message into the initial service call message generated based on the target communication protocol, and send the initial service call message to the message interception module according to the message transmission path set by the RPC architecture. In this way, regardless of the service request message generated based on which communication protocol, it can be intercepted by the message interception module, and the relevant data content of the service request message can be recorded, solving the problem of poor scalability of message interception, and realizing the function of link tracing for service request messages of multiple communication protocols.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the increasing volume of Internet services, each platform has started to build a microservice architecture to support the huge volume of services. As the volume of services grows, fault location has become a key technical means to optimize the platform architecture.

[0003] In the initial stage, the manual logging method is usually used to locate the fault nodes in the platform. However, the manual logging method has high implementation costs, low accuracy, and it is difficult to monitor all nodes related to business requirements. Summary of the Invention

[0004] The embodiments of the present application provide a method and device for intercepting messages and generating a service link graph to solve the problem of poor scalability of message interception.

[0005] In a first aspect, the embodiments of the present application provide a method for intercepting messages, including:

[0006] Through the encoding and decoding module, obtain the service request message triggered by the service invoker. If it is determined that the communication protocol used by the service request message does not conform to the target communication protocol, encapsulate the message content of the service request message and the service call method corresponding to the service request message into an initial service call message generated based on the target communication protocol, and send the initial service call message to the message interception module;

[0007] Intercept the initial service call message through the message interception module, and record the call information carried in the initial service call message. The call information is used to generate a service call relationship sub-graph corresponding to the service request message, and the service call relationship sub-graph is used to locate the fault node based on the call relationship between the service invoker and the service provider. The fault node is the service invoker or the service provider.

[0008] In a second aspect, the embodiments of the present application further provide a method for generating a service link graph, including:

[0009] Obtain the call information carried in each initial service call message sent by the client, where each call information is obtained based on any of the above message interception methods;

[0010] Generate a service link graph based on the respective call information. The service link graph is used to locate the fault node based on the call relationship between the nodes corresponding to each initial service call message. The fault node is the service invoker or the service provider.

[0011] In a third aspect, the embodiments of the present application further provide a device for intercepting messages, including:

[0012] A codec unit, configured to obtain a service request message triggered by a service invoker through a codec module. If it is determined that the communication protocol adopted by the service request message does not conform to the target communication protocol, the message content of the service request message and the service invocation method corresponding to the service request message are encapsulated into an initial service invocation message generated based on the target communication protocol, and the initial service invocation message is sent to a message interception module.

[0013] A message interception unit, configured to intercept the initial service invocation message through the message interception module, and record the invocation information carried in the initial service invocation message. The invocation information is used to generate a service invocation relationship sub-graph corresponding to the service request message, and the service invocation relationship sub-graph is used to locate a fault node based on the invocation relationship between the service invoker and the service provider. The fault node is the service invoker or the service provider.

[0014] Optionally, after recording the invocation information and the service response result carried in the target service response decoding message, the message interception unit is further configured to:

[0015] Generate message delay information based on the sending time of the initial service invocation message and the receiving time of the target service response decoding message through the message interception module.

[0016] Through the message interception module, the message delay information and the response status identifier carried in the service response result are used as the running information of the service provider, where the response status identifier indicates whether the service provider has successfully provided corresponding service to the service invoker.

[0017] Optionally, before obtaining the service request message triggered by the service invoker through the codec module, the apparatus further includes a collection unit, and the collection unit is configured to:

[0018] Call an information collection process through the message interception module, and the information collection process is used to periodically collect the running information of each node in the platform.

[0019] Optionally, the codec unit performs the following operations through the codec module to determine that the communication protocol adopted by the service request message does not conform to the target communication protocol:

[0020] Based on the communication protocol identifier carried in the service request message, it is determined through the codec module that the communication protocol adopted by the service request message does not conform to the target communication protocol.

[0021] Fourthly, an apparatus for generating a service link graph provided in an embodiment of the present application further includes:

[0022] An acquisition unit, configured to acquire the call information carried in each initial service call message sent by a client, where each piece of call information is obtained based on any one of the above-mentioned message interception methods;

[0023] A first generation unit, configured to generate a service link diagram based on the respective pieces of call information, where the service link diagram is used to locate a faulty node based on the call relationship between the nodes corresponding to the respective initial service call messages, and the faulty node is a service call party or a service provider.

[0024] Optionally, after generating a service link diagram based on the call information of the respective initial service call messages, the apparatus further includes a second generation unit, and the second generation unit is configured to:

[0025] Acquire the operation information of each service provider sent by the client, and the operation information of each node in the platform;

[0026] Based on the operation information of each service provider and the operation information of each node in the platform, add corresponding operation information to each node in the service link diagram.

[0027] Optionally, the first generation unit is configured to:

[0028] Based on the service request message identifier, link identifier, service call party identifier, and service provider identifier carried in the call information, connect the nodes corresponding to the respective service request messages to generate the service link diagram.

[0029] In a fifth aspect, an embodiment of the present application further provides a computer device, including a processor and a memory, where the memory stores program code, and when the program code is executed by the processor, the processor is caused to execute the steps of any one of the above-mentioned message interception methods or the steps of the service link diagram generation method.

[0030] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, which includes program code, and when the program product runs on a computer device, the program code is used to cause the computer device to execute the steps of any one of the above-mentioned message interception methods or the steps of the service link diagram generation method.

[0031] The beneficial effects of the present application are as follows:

[0032] The embodiments of the present application provide a method and apparatus for generating a message interception and service link diagram. The method includes: when it is determined by the encoding and decoding module that the communication protocol adopted by the service request message does not conform to the target communication protocol, encapsulate the relevant information of the service request message into an initial service call message generated based on the target communication protocol, and send the initial service call message to the message interception module according to the message transmission path set by the RPC architecture.

[0033] If a service request message generated based on the target communication protocol is obtained, transmit the service request message according to the message transmission path specified by the pluggable RPC architecture, and intercept and record the relevant data content of the service request message through the message interception module; if a service request message generated based on other communication protocols is obtained, encapsulate the message content of the service request message and the service call method corresponding to the service request message into an initial service call message generated based on the target communication protocol, and send the initial service call message to the message interception module. In this way, regardless of which communication protocol the service request message is generated based on, the relevant data content of the service request message can be intercepted and recorded by the message interception module, solving the problem that the traditional RPC architecture cannot intercept service request messages generated based on other communication protocols and the poor scalability of message interception, and realizing the function of link tracking for service request messages of multiple communication protocols.

[0034] Other features and advantages of the present application will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present application. The objectives and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The schematic embodiments and descriptions thereof of the present application are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:

[0036] Figure 1a is an optional schematic diagram of an application scenario in the embodiments of the present application;

[0037] Figure 1b is a schematic diagram of the service request logic based on the pluggable RPC architecture provided by the embodiments of the present application;

[0038] Figure 1c is a schematic diagram of the service link diagram provided by the embodiments of the present application;

[0039] Figure 2a is a schematic diagram of the logic for the upstream gateway to call the downstream service 1;

[0040] Figure 2bSchematic diagram of the process for the client in the embodiment of the present application to intercept any business request message;

[0041] Figure 2c Schematic diagram of a sub - graph of business call relationships provided by the embodiment of the present application;

[0042] Figure 2d Schematic diagram of another sub - graph of business call relationships provided by the embodiment of the present application;

[0043] Figure 2e Schematic diagram of the business link graph generated based on call information provided by the embodiment of the present application;

[0044] Figure 2f Logical schematic diagram of the business link graph that generates the operation information of nodes provided by the embodiment of the present application;

[0045] Figure 2g Schematic diagram of the details of the operation information of a node provided by the embodiment of the present application;

[0046] Figure 3 Schematic diagram of the process for generating the business link graph that includes the operation information of nodes provided by the embodiment of the present application;

[0047] Figure 4 Schematic diagram of the structure of a message interception device provided by the embodiment of the present application;

[0048] Figure 5 Schematic diagram of the structure of a business link graph generation device provided by the embodiment of the present application;

[0049] Figure 6 Schematic diagram of the composition structure of a computer device provided in the embodiment of the present application;

[0050] Figure 7 Schematic diagram of the structure of a computing device in the embodiment of the present application. Detailed implementation manners

[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solutions of the present application, rather than all of them. Based on the embodiments described in this application document, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope protected by the technical solutions of the present application.

[0052] The following explains some terms in the embodiments of the present application to facilitate understanding by those skilled in the art.

[0053] 1. Cloud Computing:

[0054] Narrow - sense cloud computing refers to the delivery and usage model of Internet Technology (IT) infrastructure, which obtains the required resources in a on - demand and easily - scalable manner through the network; while broad - sense cloud computing refers to the delivery and usage model of services, which obtains the required services in a on - demand and easily - scalable manner through the network. Among them, it can be IT and software, Internet - related services, or other services.

[0055] Cloud computing is the product of the development and integration of traditional computer and network technologies such as Grid Computing, Distributed Computing, Parallel Computing, Utility Computing, Network Storage Technologies, Virtualization, and Load Balance.

[0056] With the development of the Internet, real - time data streams, diverse connected devices, and the promotion of demands such as search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from traditional parallel and distributed computing, cloud computing will revolutionize the entire Internet model and enterprise management model conceptually.

[0057] 2. RPC Architecture: An architecture for calling remote services is constructed with the help of the RPC protocol. Users can call remote services through the RPC framework, making it unnecessary for users to clearly distinguish between local calls and remote calls.

[0058] A complete RPC architecture mainly consists of the following four core components, namely:

[0059] Client (referring to the business invoker), Client Stub (used to encode the request parameters of the client into a business call message and then remotely send it to the server through the network), Server (referring to the business provider, the real business provider), Server Stub (used to receive and decode the business call message sent by the client and locally call the corresponding business call method to provide corresponding business services for the business invoker).

[0060] The RPC architecture also includes an interceptor component, which is used to intercept each message transmitted in the RPC architecture and record the call information and service response results carried by each message, so that the full-link telemetry system can generate a service link diagram for locating faulty nodes based on the call information and service response results carried by each message uploaded by the interceptor.

[0061] 3. Full-link telemetry system based on OpenTelemetry: OpenTelemetry is a standard specification for an observability ecosystem that combines OpenCensus and OpenTracing. The full-link telemetry system has the capabilities of data collection, data processing, and data export, enabling functions such as data observation, performance analysis, system monitoring, and service alerting.

[0062] The full-link telemetry system usually monitors the following three types of data, namely:

[0063] Metrics data, including the metric information of each node in the platform during runtime (such as the usage rate of the Central Processing Unit (CPU), memory usage, website traffic, etc.), and the runtime information of the nodes used by the service provider during the process of providing corresponding business services to the business caller (such as the time consumption of business request messages, etc.);

[0064] Logging data, which is used to monitor the logs of program processes, such as events or notifications that occur during program operation;

[0065] Tracing data, also known as distributed tracing data, contains various information such as the start time and end time of each node on a link, the transmitted parameters, and the call relationships between nodes. Tracing data includes various information such as message sending and receiving, database access, and load balancing, which facilitates developers to deeply understand the execution of each business request message. In case of an exception, the faulty node can be quickly located.

[0066] 4. Graph database: It is a branch system of the non-relational database NoSQL. By applying graph storage for entities and the relationship information between entities, it provides a good database storage and data processing solution for a certain graph model problem.

[0067] If there are multiple relationships between two entities, usually multiple association tables will be created in a relational database to record each relationship between the two entities. However, in a graph database, relationships are realized through the feature that a relationship can contain attributes. Compared with various association tables in a relational database, a graph database provides a richer way of presenting relationships.

[0068] A brief introduction to the design concept of the embodiments of the present application is as follows:

[0069] As the business volume of Internet services grows day by day, each platform has started to build a microservice architecture to support the huge business volume. With the growth of the business volume, fault location has also become a key technical means to optimize the platform architecture.

[0070] In the initial stage, the manual instrumentation method is usually used to locate the faulty nodes in the platform. However, the manual instrumentation method has high implementation costs, low accuracy, and it is difficult to monitor all nodes related to business requirements.

[0071] To solve the above problems, the following two instrumentation methods for locating faulty nodes have been proposed in the related technologies.

[0072] The first method is: the instrumentation method based on the traditional RPC architecture.

[0073] However, the interceptor of the traditional RPC architecture can only intercept the service request messages generated based on a specific communication protocol, and cannot intercept the service request messages generated based on other communication protocols, and cannot perform link tracing on the service request messages generated based on other communication protocols.

[0074] The second method is: the instrumentation method based on bytecode enhancement.

[0075] However, using this method can only intercept the service request messages generated based on a specific computer language, and cannot intercept the service request messages generated based on other computer languages, and cannot perform link tracing on the service request messages generated based on other computer languages.

[0076] To solve the problem of poor scalability of message interception, the embodiments of the present application propose a method for message interception. The method includes:

[0077] Through the encoding and decoding module, obtain the service request message triggered by the service invoker. If it is determined that the communication protocol used by the service request message does not conform to the target communication protocol, then encapsulate the message content of the service request message and the invocation method corresponding to the service request message into the initial service invocation message generated by the target communication protocol, and send the initial service invocation message to the message interception module;

[0078] Intercept the initial service invocation message through the message interception module, record the invocation information carried in the initial service invocation message, the invocation information is used to generate a service invocation relationship sub-graph corresponding to the service request message, and the service invocation relationship sub-graph is used to locate the faulty node based on the invocation relationship between the service invoker and the service provider, and the faulty node is the service invoker or the service provider.

[0079] If the communication protocol adopted by the service request message does not conform to the target communication protocol, the relevant information of the service request message is encapsulated into the initial service invocation message generated based on the target communication protocol, and the initial service invocation message is sent to the message interception module according to the message transmission path set by the RPC architecture. In this way, regardless of the service request message generated based on which communication protocol, it can be intercepted by the message interception module, and the relevant data content of the service request message can be recorded, solving the problem of poor scalability of message interception and realizing the function of link tracking for service request messages of multiple communication protocols.

[0080] The preferred embodiments of the present application will be described below in conjunction with the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. And without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0081] The embodiments of the present application can be applied to various scenarios such as cloud technology, artificial intelligence, intelligent transportation, and assisted driving. Figure 1a An optional schematic diagram of an application scenario is shown. In this application scenario, it includes server 110 as a client, server 130 as a server, and physical terminal device 120 connected to the two servers. The two servers communicate through a wired network or a wireless network, and the physical terminal device 120 also communicates with the two servers through a wired network or a wireless network.

[0082] Refer to Figure 1b The schematic diagram of the service request logic based on the pluggable RPC architecture is shown. The RPC architecture is deployed on server 110. Through the encoding and decoding module, the service request message triggered by the service invoker is obtained. When the communication protocol adopted by the service request message does not conform to the target communication protocol, the relevant information of the service request message is encapsulated into the initial service invocation message generated based on the target communication protocol, and the initial service invocation message is sent to the message interception module according to the message transmission path set by the RPC architecture; then the initial service invocation message is intercepted by the message interception module, the invocation information carried in the initial service invocation message is recorded, and the initial service invocation message is sent to the transmission module; through the transmission module, based on the message content carried in the initial service invocation message, the third-party codec is called to process the initial service invocation message to generate the target service invocation encoded message, and the target service invocation encoded message is sent to server 130 as the server, so that server 130 provides the corresponding service for the service invoker based on the target service invocation encoded message.

[0083] The RPC architecture is also deployed on server 130. Through the transmission module, based on the message content carried in the target service call encoded message sent by the client, it calls a third-party codec to process the target service call encoded message, generates a target service call decoded message, and sends the target service call decoded message to the message interception module; then, the message interception module intercepts the target service call decoded message, records the call information carried in the target service call decoded message, and sends the target service call decoded message to the codec module; through the codec module, based on the message content and service call method carried in the target service call decoded message, it provides corresponding service to the service caller, and then sends the service response result back to server 110 acting as the client.

[0084] A full-link telemetry system based on OpenTelemetry is deployed on the physical terminal device 120 to receive the call information of each message uploaded by the two servers and the running information of the service provider. Since the two servers upload the same data content, the full-link telemetry system eliminates the data content uploaded by one of them and generates a service link graph containing the running information of each node only based on the data content uploaded by the other party, and displays it on the display screen of the physical terminal device 120 as Figure 1c shown in the service link graph.

[0085] As Figure 1c shown, the service link graph shows the name, Query Per Second (QPS), elapsed time, node health status and other metric information of each node and third-party libraries (MySQL, kafka, Remote Dictionary Server (Redis)). Among them, the red and green border colors are used to distinguish whether the node is in an abnormal state. For example, when the elapsed time exceeds the set threshold, the border color of the node will be displayed in red, which is convenient for developers to perform link tracing and quickly locate the faulty node causing the abnormal situation. In addition, by clicking on each node, the currently displayed service link graph will jump to the associated detailed monitoring page, which is convenient for developers to view the detailed running information of the node.

[0086] In the embodiment of the present application, the physical terminal device 120 is an electronic device used by the user, and the electronic device can be a personal computer, mobile phone, tablet computer, laptop computer, e-book reader, intelligent voice interaction device, smart home appliance, vehicle terminal and other electronic devices.

[0087] Either the server 110 as the client or the server 130 as the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), big data, and artificial intelligence platforms. This application does not limit it here.

[0088] As Figure 2a shown, the upstream gateway calls the downstream service 1 through the Common Gateway Interface (CGI) of the access layer. During the process of the server calling service 1, in order to obtain the service response result of service 1, service 1 calls service 2 and service 3 successively, and finally sends the service response result to the upstream gateway through CGI.

[0089] Therefore, in order to provide corresponding service to the upstream gateway, three service requests as shown in Table 1 occurred.

[0090] Table 1

[0091] Number of business requests Business invoker Business provider The first time Upstream gateway Service 1 The second time Service 1 Service 2 The third time Service 1 Service 3

[0092] Using the pluggable RPC architecture, report the relevant data content of the service caller and service provider for each service request. The full-link telemetry system based on OpenTelemetry analyzes the relevant data content uploaded by the RPC architecture, generates a service link diagram, and visually displays the service link diagram to achieve the purpose of link tracing.

[0093] Since the client and the server upload the same data content, for the convenience of description, refer to Figure 2b the process schematic diagram shown to introduce the process of the pluggable RPC architecture reporting the relevant data content of the service caller for any service request.

[0094] S201: The client obtains the service request message triggered by the service caller through the encoding and decoding module. If it is determined that the communication protocol adopted by the service request message does not conform to the target communication protocol, the message content of the service request message and the service call method corresponding to the service request message are encapsulated into the initial service call message generated based on the target communication protocol, and the initial service call message is sent to the message interception module.

[0095] Before executing step 201, in order to improve processing efficiency and avoid occupying the message transmission process of the pluggable RPC architecture, the client calls the information collection process through the message interception module. The information collection process is an asynchronous process of the message transmission process of the pluggable RPC architecture and is used to periodically collect the running information of each node in the platform.

[0096] Among them, the nodes include service nodes for providing business services to business callers and interface nodes for transmitting messages. The running information of each node includes, but is not limited to, CPU usage, memory usage, website traffic, input / output (I / O) interface information, etc.

[0097] The specific execution process of step 201 is that the client obtains the business request message triggered by the business caller through the business request module and then sends the business request message to the encoding and decoding module; through the encoding and decoding module, it obtains the business call method corresponding to the business request message from the container, and then through the encoding and decoding module, when it is determined that the communication protocol adopted by the business request message does not conform to the target communication protocol based on the communication protocol identifier carried in the business request message, it encapsulates the message content of the business request message and the business call method corresponding to the business request message into the initial business call message generated based on the target communication protocol and sends the initial business call message to the message interception module.

[0098] The target communication protocols include private RPC and Hyper Text Transfer Protocol (HTTP). Other communication protocols include, but are not limited to, kafka protocol, MySQL protocol, and Redis protocol.

[0099] For example, if the client determines through the encoding and decoding module that the communication protocol adopted by the business request message is the kafka protocol rather than private RPC or HTTP based on the communication protocol identifier carried in the business request message, it encapsulates the message content of the business request message and the business call method corresponding to the business request message into the initial business call message generated based on the target communication protocol and sends the initial business call message to the message interception module.

[0100] If it is the first business request message on the entire link, the message content includes the business request message identifier, business caller identifier, business provider identifier, business request content, communication protocol identifier, and structure code of the communication protocol;

[0101] If it is a non-first business request message on the entire link, in addition to including the above content, the message content also includes a link identifier representing the call relationship between the business caller and the business provider.

[0102] To facilitate the generation of service link diagrams by the full-link telemetry system, it is stipulated that the messages transmitted on the same link carry the same service request message identifier.

[0103] S202: The client intercepts the initial service call message through the message interception module, records the call information carried in the initial service call message. The call information is used to generate a service call relationship sub-diagram corresponding to the service request message, and the service call relationship sub-diagram is used to locate the fault node based on the call relationship between the service caller and the service provider. The fault node is either the service caller or the service provider.

[0104] If it is the first service request message on the entire link, the call information includes the service request message identifier, the service caller identifier, and the service provider identifier; if it is a non-first service request message on the entire link, the call information includes the service request message identifier, the service caller identifier, the service provider identifier, and the link identifier.

[0105] For example, the message interception module of the client records the service request message identifier Trace_ID1, the service caller identifier CGI_ID, and the service provider identifier Svr1_ID of the initial service call message, and generates a service call relationship sub-diagram as Figure 2c shown.

[0106] The message interception module of the traditional RPC architecture can only intercept service request messages generated based on private RPC or HTTP. Once a service request message generated based on other communication protocols is obtained, it is necessary to use a codec to call a third-party codec to process the service request message based on the message content carried in the service request message. However, the processed message is directly sent to the server for subsequent processing without passing through the message interception module, resulting in the message interception module being unable to intercept and record the relevant data content of this message, and thus unable to implement the function of link tracing for service request messages generated based on other communication protocols.

[0107] In the pluggable RPC architecture proposed by the embodiments of the present application, if a service request message generated based on a target communication protocol is obtained, the service request message is transmitted according to the message transmission path specified by the pluggable RPC architecture, and the relevant data content of the service request message is intercepted and recorded by the message interception module; if a service request message generated based on other communication protocols is obtained, the message content of the service request message and the service call method corresponding to the service request message are encapsulated into an initial service call message generated based on the target communication protocol, and the initial service call message is sent to the message interception module. In this way, regardless of the service request message generated based on which communication protocol, the relevant data content of the service request message can be intercepted and recorded by the message interception module, solving the problem of poor expandability of message interception and realizing the function of link tracing for service request messages of multiple communication protocols.

[0108] Whether it is a traditional RPC architecture or the pluggable RPC architecture proposed by the embodiments of the present application, the message interception module can intercept service request messages generated based on different computer languages and record the relevant data content of the intercepted messages.

[0109] Therefore, the message interception method provided by the embodiments of the present application can intercept service request messages generated based on various communication protocols or various computer languages, so as to achieve the purpose of link tracing for service request messages of multiple communication protocols or service request messages of multiple computer languages.

[0110] In the pluggable RPC architecture provided by the embodiments of the present application, the transmission module is also designed in a pluggable manner, so that the pluggable transmission module has the ability to call a third-party codec to achieve the purpose of sending the message content and service call method carried in the service request message generated based on other communication protocols to the server.

[0111] Specifically, first, the initial service call message is sent to the transmission module through the message interception module; then, based on the message content carried in the initial service call message, the transmission module calls a third-party codec to process the initial service call message, generates a target service call encoded message, and sends the target service call encoded message to the server, so that the server provides corresponding service for the service caller based on the target service call encoded message.

[0112] Refer to Figure 1bThe shown logical schematic diagram is as follows. The server, through the transmission module, based on the message content carried in the target service call encoded message sent by the client, calls a third-party codec to process the target service call encoded message, generates a target service call decoded message, and sends the target service call decoded message to the message interception module; then, through the message interception module, intercepts the target service call decoded message, records the call information carried in the target service call decoded message, and sends the target service call decoded message to the codec module; through the codec module, based on the message content and service call method carried in the target service call decoded message, provides corresponding service to the service caller, and then returns the service response result to the client as the client.

[0113] The client, through the transmission module, obtains the target service response encoded message returned by the server. If it is determined that the communication protocol adopted by the target service response encoded message does not conform to the target communication protocol, it calls a third-party codec to process the target service response encoded message, generates a target service response decoded message, and sends the target service response decoded message to the message interception module; then, through the message interception module, intercepts the target service response decoded message, records the call information and service response result carried in the target service response decoded message. The call information is used to generate a sub-graph of the service call relationship corresponding to the service request message, and the service response result is used to generate the running information of the service provider during the process of providing corresponding service to the service caller.

[0114] The client generates the running information of the service provider based on the call information and service response result recorded by the message interception module.

[0115] Specifically, the client, through the message interception module, generates message delay information based on the sending time of the initial service call message and the receiving time of the target service response decoded message; then, through the message interception module, takes the message delay information and the response status flag carried in the service response result as the running information of the service provider. Among them, the response status flag indicates whether the service provider has successfully provided corresponding service to the service caller.

[0116] For example, the message interception module of the client records the service request message identifier Trace_ID1, service caller identifier CGI_ID, service provider identifier Svr1_ID, link identifier Span_ID6 and service response result of the target service response decoded message, and generates a sub-graph of the service call relationship as shown in Figure 2d shown.

[0117] Refer to Figure 2aThe shown logical schematic diagram. After the upstream gateway receives the service response result of Service 1, the message interception modules of the client and the server respectively report the call information carried in each initial service call message to the full-link telemetry system, so that the full-link telemetry system generates, based on the call information recorded by the message interception modules, such as Figure 2e the shown service link diagram. Among them, the service link diagram is used to locate the faulty node based on the call relationship between the nodes corresponding to each initial service call message. The faulty node is either the service caller or the service provider.

[0118] The two message interception modules uploaded the same call information. Therefore, the full-link telemetry system will eliminate the call information uploaded by one party and input the call information uploaded by the other party into the internal graph database. The graph database connects the nodes corresponding to each service request message based on the service request message identifier, link identifier, service caller identifier, and service provider identifier carried in the call information to generate the service link diagram.

[0119] The embodiment of the present application also provides an implementation method. Refer to Figure 2f the shown logical schematic diagram. The full-link telemetry system executes the following two operations in parallel:

[0120] Operation 1: Input the call information uploaded by one of the message interception modules into the internal graph database to generate a service link diagram;

[0121] Operation 2: Import the running information of each service provider uploaded by one of the message interception modules and the running information of each node in the platform uploaded by the information collection process into the internal Promethus system for monitoring configuration. In addition to storing the running information of each service provider and the running information of each node in the platform, the Promethus system can also count the number of messages intercepted by the message interception module within a set time period to obtain the message concurrency of the message interception module.

[0122] Finally, through the Grafanna visualization solution inside the full-link telemetry system, based on the running information of each service provider and the running information of each node in the platform, corresponding running information is added to each node of the service link diagram, and the service link diagram is combined with the running information of each service provider, the running information of each node in the platform, and the message concurrency of the message interception module to generate such as Figure 1c the shown service link diagram containing the running information of the nodes, and the detailed running information as shown in Figure 2g can also be viewed by clicking on each node.

[0123] Taking a specific embodiment shown in Figure a as an example, the process of generating a service link diagram containing the running information of the nodes is described, and such asFigure 3 The process schematic diagram shown

[0124] S301: The message interception modules of the client and the server respectively trigger the information collection process for periodically collecting the operation information of each node in the platform;

[0125] S302: The upstream gateway triggers the service request message 1 for invoking Service 1 downstream and sends the service request message 1 to the client through the CGI of the access layer;

[0126] S303: During the process of processing the service request message 1, the message interception modules of the client and the server respectively record the call information of the service request message 1;

[0127] S304: During the process of the server executing the service call method 1 corresponding to the service request message 1, Service 1 triggers the service request message 2 for invoking Service 2, and Service 1 sends the service request message 2 to the client;

[0128] S305: During the process of processing the service request message 2, the message interception modules of the client and the server respectively record the call information of the service request message 2 and the service response result;

[0129] S306: Based on the service response result of the service request message 2, Service 1 triggers the service request message 3 for invoking Service 3, and Service 1 sends the service request message 3 to the client;

[0130] S307: During the process of processing the service request message 3, the message interception modules of the client and the server respectively record the call information of the service request message 3 and the service response result;

[0131] S308: During the process of processing the service request message 1 based on the service response result of the service request message 3, the message interception modules of the client and the server respectively record the call information of the service request message 1 and the service response result;

[0132] S309: The message interception modules of the client and the server respectively generate the operation information of each service provider based on the recorded service response results of each service request message;

[0133] S310: The full-link telemetry system generates a service link diagram containing the operation information of the nodes based on the call information of each service request message, the operation information of each provider, and the operation information of each node in the platform uploaded by the message interception modules of the client and the server.

[0134] Based on the same inventive concept as the above method embodiments, refer to Figure 4 the structural schematic diagram shown. An embodiment of the present application further provides a message interception device. The device 400 may include:

[0135] An encoding and decoding unit 401, configured to obtain a service request message triggered by a service caller through an encoding and decoding module. If it is determined that the communication protocol adopted by the service request message does not conform to the target communication protocol, the message content of the service request message and the service call method corresponding to the service request message are encapsulated into an initial service call message generated based on the target communication protocol, and the initial service call message is sent to the message interception module;

[0136] A message interception unit 402, configured to intercept the initial service call message through the message interception module, record the call information carried in the initial service call message. The call information is used to generate a service call relationship sub-graph corresponding to the service request message, and the service call relationship sub-graph is used to locate a fault node based on the call relationship between the service caller and the service provider. The fault node is either the service caller or the service provider.

[0137] Optionally, after intercepting the initial service call message through the message interception module and recording the call information carried in the initial service call message, the device 400 further includes a transmission unit 403. The transmission unit 403 is configured to:

[0138] Send the initial service call message to the transmission module through the message interception module;

[0139] Through the transmission module, based on the message content carried in the initial service call message, call a third-party codec to process the initial service call message, generate a target service call encoded message, and send the target service call encoded message to the server, so that the server provides corresponding service for the service caller based on the target service call encoded message.

[0140] Optionally, after sending the target service call message to the server, the transmission unit 403 is further configured to:

[0141] Obtain a target service response encoded message returned by the server through the transmission module. If it is determined that the communication protocol adopted by the target service response encoded message does not conform to the target communication protocol, call a third-party codec to process the target service response encoded message, generate a target service response decoded message, and send the target service response decoded message to the message interception module;

[0142] Intercept the target service response decoded message through the message interception module, record the call information and service response result carried in the target service response decoded message, where the call information is used to generate a sub-graph of the service call relationship corresponding to the service request message, and the service response result is used to generate the running information of the service provider during the process of providing corresponding service to the service caller.

[0143] Optionally, after recording the call information and service response result carried in the target service response decoded message, the message interception unit 402 is further configured to:

[0144] Generate message delay information through the message interception module based on the sending time of the initial service call message and the receiving time of the target service response decoded message;

[0145] Use the message delay information and the response status flag carried in the service response result as the running information of the service provider through the message interception module, where the response status flag indicates whether the service provider has successfully provided corresponding service to the service caller.

[0146] Optionally, before obtaining the service request message triggered by the service caller through the encoding and decoding module, the device 400 further includes an acquisition unit 404, and the acquisition unit 404 is configured to:

[0147] Call an information acquisition process through the message interception module, and the information acquisition process is used to periodically acquire the running information of each node in the platform.

[0148] Optionally, the encoding and decoding unit 401 performs the following operations through the encoding and decoding module to determine that the communication protocol adopted by the service request message does not conform to the target communication protocol:

[0149] Based on the communication protocol identifier carried in the service request message, determine through the encoding and decoding module that the communication protocol adopted by the service request message does not conform to the target communication protocol.

[0150] Based on the same inventive concept as the above method embodiment, referring to Figure 5 the structural schematic diagram shown, the embodiment of the present application further provides a device for generating a service link graph. The device 500 may include:

[0151] An acquisition unit 501, configured to acquire the call information carried in each initial service call message sent by the client, where each call information is obtained based on the method according to any one of claims 1-6;

[0152] A first generation unit 502, configured to generate a service link graph based on each call information, where the service link graph is used to locate a faulty node based on the call relationship between the nodes corresponding to each initial service call message, and the faulty node is a service caller or a service provider.

[0153] Optionally, after generating the service link diagram based on the call information of each initial service call message, the apparatus 500 further includes a second generation unit 502, and the second generation unit 502 is configured to:

[0154] Obtain the running information of each service provider sent by the client, as well as the running information of each node in the platform;

[0155] Based on the running information of each service provider and the running information of each node in the platform, add corresponding running information to each node in the service link diagram.

[0156] Optionally, the first generation unit 501 is configured to:

[0157] Based on the service request message identifier, link identifier, service caller identifier, and service provider identifier carried in the call information, connect the nodes corresponding to each service request message to generate a service link diagram.

[0158] For convenience of description, the above parts are divided into respective modules (or units) according to functions and described separately. Of course, when implementing this application, the functions of the respective modules (or units) can be implemented in the same or multiple software or hardware.

[0159] After introducing the access method and apparatus of the service platform according to the exemplary embodiments of the present application, next, a computer device according to another exemplary embodiment of the present application is introduced.

[0160] Those skilled in the art to which the present application pertains can understand that various aspects of the present application can be implemented as a system, method, or program product. Therefore, various aspects of the present application can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to herein as "circuitry", "module", or "system".

[0161] Based on the same inventive concept as the above method embodiment, an embodiment of the present application also provides a computer device. Refer to Figure 6 As shown, the computer device 600 may at least include a processor 601 and a memory 602. Among them, the memory 602 stores program code, and when the program code is executed by the processor 601, the processor 601 is caused to execute the steps of any of the above message interception methods or service link diagram generation methods.

[0162] In some possible embodiments, a computing device according to the present application may at least include at least one processor and at least one memory. Among them, the memory stores program code, and when the program code is executed by the processor, the processor executes the steps in the method of packet interception according to various exemplary embodiments of the present application described above in this specification. For example, the processor may execute steps as shown in Figure 2b as shown.

[0163] The following will refer to Figure 7 to describe the computing device 700 according to this embodiment of the present application. Figure 7 The computing device 700 is only an example and should not impose any restrictions on the functions and usage scope of the embodiments of the present application.

[0164] As Figure 7 shown, the computing device 700 is presented in the form of a general-purpose computing device. The components of the computing device 700 may include but are not limited to: the above-mentioned at least one processing unit 701, the above-mentioned at least one storage unit 702, and a bus 703 connecting different system components (including the storage unit 702 and the processing unit 701).

[0165] The bus 703 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a processor, or a local bus using any bus structure in a variety of bus structures.

[0166] The storage unit 702 may include a readable medium in the form of volatile memory, such as a random access memory (RAM) 7021 and / or a cache storage unit 7022, and may further include a read-only memory (ROM) 7023.

[0167] The storage unit 702 may further include a program / utility 7025 having a set (at least one) of program modules 7024. Such program modules 7024 include but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.

[0168] The computing device 700 may also communicate with one or more external devices 704 (such as a keyboard, a pointing device, etc.), and may also communicate with one or more devices that enable a user to interact with the computing device 700, and / or communicate with any device that enables the computing device 700 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication may be carried out through the input / output (I / O) interface 705. Moreover, the computing device 700 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 706. As shown in the figure, the network adapter 706 communicates with other modules for the computing device 700 through the bus 703. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computing device 700, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0169] Based on the same inventive concept as the above method embodiments, various aspects of the message interception method provided in this application can also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code is used to cause the computer device to execute the steps in the message interception method according to various exemplary embodiments of this application described above in this specification. For example, an electronic device can execute the steps as shown in Figure 2b the figure.

[0170] The program product may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0171] Although the preferred embodiments of this application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0172] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims

1. A message interception method, characterized in that, Applied to the client for deploying a pluggable RPC architecture, the method includes: Through the codec module, obtain the service request message triggered by the service invoker. If it is determined that the communication protocol adopted by the service request message does not conform to the target communication protocol, encapsulate the message content of the service request message and the service invocation method corresponding to the service request message into the initial service invocation message generated based on the target communication protocol, and send the initial service invocation message to the message interception module; Intercept the initial service invocation message through the message interception module, and record the invocation information carried in the initial service invocation message. The invocation information is used to generate the service invocation relationship sub-graph corresponding to the service request message, and the service invocation relationship sub-graph is used to locate the fault node based on the invocation relationship between the service invoker and the service provider. The fault node is the service invoker or the service provider; Through the message interception module, send the initial service invocation message to the transmission module; through the transmission module, based on the message content carried in the initial service invocation message, call the third-party codec to process the initial service invocation message, generate the target service invocation encoded message, and send the target service invocation encoded message to the server that also deploys the pluggable RPC architecture, so that the server, through the transmission module, based on the message content carried in the target service invocation encoded message, calls the third-party codec to process the target service invocation encoded message, generate the target service invocation decoded message, and send the target service invocation decoded message to the message interception module; then intercept the target service invocation decoded message through the message interception module, record the invocation information carried in the target service invocation decoded message, and send the target service invocation decoded message to the codec module; through the codec module, based on the message content and service invocation method carried in the target service invocation decoded message, provide the corresponding service for the service invoker.

2. The method according to claim 1, wherein After sending the target service invocation encoded message to the server, it further includes: Through the transmission module, obtain the target service response encoded message returned by the server. If it is determined that the communication protocol adopted by the target service response encoded message does not conform to the target communication protocol, call the third-party codec to process the target service response encoded message, generate the target service response decoded message, and send the target service response decoded message to the message interception module; Intercept the target service response decoded message through the message interception module, record the invocation information and service response result carried in the target service response decoded message. The invocation information is used to generate the service invocation relationship sub-graph corresponding to the service request message, and the service response result is used to generate the running information of the service provider during the process of providing the corresponding service for the service invoker.

3. The method according to claim 2, characterized in that After recording the invocation information and service response result carried in the target service response decoded message, it further includes: Through the message interception module, message delay information is generated based on the sending time of the initial service call message and the receiving time of the target service response decoded message; Through the message interception module, the message delay information and the response status identifier carried by the service response result are used as the operation information of the service provider, where the response status identifier indicates whether the service provider has successfully provided the corresponding service to the service caller.

4. The method according to claim 1, wherein Before obtaining the service request message triggered by the service caller through the encoding and decoding module, it further includes: The message interception module is used to call an information collection process, and the information collection process is used to regularly collect the operation information of each node in the platform.

5. The method according to claim 1, wherein The following operations are performed through the encoding and decoding module to determine that the communication protocol adopted by the service request message does not conform to the target communication protocol: Through the encoding and decoding module, based on the communication protocol identifier carried by the service request message, it is determined that the communication protocol adopted by the service request message does not conform to the target communication protocol.

6. A method for generating a service link diagram, characterized in that It includes: Obtain the call information carried in each initial service call message sent by the client, where each call information is obtained based on the method described in any one of claims 1-5; Based on the respective call information, a service link diagram is generated, and the service link diagram is used to locate a faulty node based on the call relationship between the nodes corresponding to the respective initial service call messages, and the faulty node is a service caller or a service provider.

7. The method according to claim 6, characterized in that, After generating the service link diagram based on the call information of the respective initial service call messages, it further includes: Obtain the operation information of each service provider sent by the client and the operation information of each node in the platform; Based on the operation information of each service provider and the operation information of each node in the platform, corresponding operation information is added to each node in the service link diagram.

8. The method according to claim 6, wherein The generating the service link diagram based on the respective call information includes: Based on the service request message identifier, link identifier, service caller identifier, and service provider identifier carried in the call information, the nodes corresponding to each service request message are connected to generate the service link diagram.

9. A message interception device, characterized in that, Applied to a client deploying a pluggable RPC architecture, the device includes: An encoding and decoding unit, configured to obtain a service request message triggered by a service caller through an encoding and decoding module. If it is determined that the communication protocol adopted by the service request message does not conform to the target communication protocol, the message content of the service request message and the service call method corresponding to the service request message are encapsulated into an initial service call message generated based on the target communication protocol, and the initial service call message is sent to the message interception module; A message interception unit, configured to intercept the initial service call message through the message interception module, and record the call information carried in the initial service call message. The call information is used to generate a service call relationship sub-graph corresponding to the service request message, and the service call relationship sub-graph is used to locate a fault node based on the call relationship between the service call party and the service provider. The fault node is the service call party or the service provider; A transmission unit, configured to send the initial service call message into the transmission module through the message interception module; through the transmission module, based on the message content carried in the initial service call message, call a third-party codec to process the initial service call message, generate a target service call encoded message, and send the target service call encoded message to the server with the pluggable RPC architecture deployed as well, so that the server, through the transmission module, based on the message content carried in the target service call encoded message, calls a third-party codec to process the target service call encoded message, generate a target service call decoded message, and send the target service call decoded message to the message interception module; then intercept the target service call decoded message through the message interception module, record the call information carried in the target service call decoded message, and send the target service call decoded message to the codec module; through the codec module, based on the message content and service call method carried in the target service call decoded message, provide corresponding service for the service call party.

10. An apparatus for generating a service link diagram, characterized in that, Comprising: An acquisition unit, configured to acquire the call information carried in each initial service call message sent by the client, wherein each call information is obtained based on the method according to any one of claims 1-5; A first generation unit, configured to generate a service link graph based on the respective call information. The service link graph is used to locate a fault node based on the call relationship between the nodes corresponding to the respective initial service call messages. The fault node is the service call party or the service provider.

Citation Information

Patent Citations

  • Fault locating method, fault locating device and fault locating system

    CN108768752A

  • Service tracking method and device and computer readable storage medium

    CN109992465A

  • Service calling method and device and electronic equipment

    CN112532564A