Link data processing method, device, equipment, storage medium and program product
By determining the source system information and link identification mapping information in the distributed system and generating target link data, the problem of inconsistent link identification between distributed systems is solved, and cross-system link monitoring integration is achieved.
Patent Information
- Application Number
- CN202210457315.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-04-27
AI Technical Summary
In distributed systems, due to inconsistent link identification formats, complete end-to-end link monitoring and integrated link monitoring cannot be achieved when calling cross-system services.
By determining the source system information and link identifier mapping information, generating the target system identifier and link identifier, calling the preset interface to process the second distributed system link data, converting it into hierarchical triple data, and realizing the generation of link triple data.
It solves the problem of inconsistent link identification uniqueness requirements, realizes the unification of link identification between independent distributed systems, and supports link query between multiple distributed systems.
Smart Images

Figure CN114840718B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, specifically to the field of distributed technology, and more specifically to a link data processing method, apparatus, device, storage medium, and program product. Background Art
[0002] With the continuous development of distributed technology, the requirements for operations and maintenance (O&M) within distributed architectures are becoming increasingly stringent. Enterprises typically integrate services in different distributed systems into the APMS (Application Performance Management & Monitoring System) to support application-level monitoring and alerting within the enterprise's distributed systems. When an enterprise needs to introduce a new, independent distributed system, distributed O&M challenges arise. When a user initiates a cross-system service call request, the link identifier format specifications generated in the two independent distributed systems differ, and the link data formats also differ. This makes it impossible to connect to a complete end-to-end link, making integrated link monitoring impossible.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the Invention
[0004] In view of the above problems, the present disclosure provides a link data processing method, apparatus, device, storage medium and program product.
[0005] According to a first aspect of the present disclosure, a link data processing method is provided, which is applied to a distributed system, the distributed system comprising a first distributed system and a second distributed system, comprising: determining source system information and link identifier mapping information in response to a link message conversion instruction, wherein the source system information comprises a source system identifier and a source system link identifier;
[0006] Determine a target system identifier and a target system link identifier according to the source system identifier, the source system link identifier, and the link identifier mapping information; and
[0007] When it is determined that the target system identifier is the first distributed system, a preset interface is called to process the second distributed system link data to generate target link data, where the second distributed system link data is hierarchical triple data and the target link data is link triple data.
[0008] According to an embodiment of the present disclosure, when it is determined that the target system identifier is the first distributed system, calling a preset interface to process the second distributed system link data to generate target link data includes:
[0009] Acquire hierarchical triplet data according to the second distributed system link identifier, wherein the hierarchical triplet data includes a current node identifier, a node hierarchy, and a parent node identifier;
[0010] The preset interface is called to convert the hierarchical triple data to generate link triple data, where the link triple data includes a current span identifier, a parent span identifier, and a first distributed system link identifier.
[0011] According to an embodiment of the present disclosure, calling a preset interface to convert the hierarchical triplet data to generate link triplet data includes:
[0012] Traversing the current node identifiers in all level triplet data to generate a current span identifier corresponding to the current node identifier;
[0013] Determining a parent span identifier corresponding to the current span identifier according to the current node identifier, the node level, and the parent node identifier; and
[0014] Link triplet data is generated according to the current span identifier, the parent span identifier, and the first distributed system link identifier.
[0015] According to an embodiment of the present disclosure, the link identifier mapping information is used to characterize a mapping relationship between a source system link identifier and a target system link identifier, and determining the target system identifier and the target system link identifier based on the source system identifier, the source system link identifier, and the link identifier mapping information includes:
[0016] When it is determined that the source system identifier is the second distributed system, the target system identifier is determined to be the first distributed system;
[0017] The first distributed system link identifier is determined according to the second distributed system link identifier and the mapping relationship.
[0018] According to an embodiment of the present disclosure, determining the target system identifier and the target system link identifier according to the source system identifier, the source system link identifier, and the link identifier mapping information further includes:
[0019] When it is determined that the source system identifier is the first distributed system, the target system identifier is determined to be the second distributed system;
[0020] The second distributed system link identifier is determined according to the first distributed system link identifier and the mapping relationship.
[0021] According to an embodiment of the present disclosure, it further includes:
[0022] When it is determined that the target system identifier is the second distributed system, the first distributed system link data is determined as the target link data.
[0023] A second aspect of the present disclosure provides a link data processing device, which is applied to a distributed system. The distributed system includes a first distributed system and a second distributed system, including:
[0024] A first determining module, configured to determine source system information and link identifier mapping information in response to a link message conversion instruction, wherein the source system information includes a source system identifier and a source system link identifier;
[0025] A second determining module is configured to determine a target system identifier and a target system link identifier according to the source system identifier, the source system link identifier, and the link identifier mapping information;
[0026] A generation module is used to call a preset interface to process the second distributed system link data to generate target link data when it is determined that the target system identifier is the first distributed system, wherein the second distributed system link data is hierarchical triple data, and the target link data is link triple data.
[0027] According to an embodiment of the present disclosure, it further includes:
[0028] The third determining module is configured to determine the first distributed system link data as target link data when it is determined that the target system identifier is the second distributed system.
[0029] According to an embodiment of the present disclosure, the generating module includes:
[0030] An acquisition submodule, configured to acquire hierarchical triplet data according to the second distributed system link identifier, wherein the hierarchical triplet data includes a current node identifier, a node level, and a parent node identifier;
[0031] The generating submodule is used to call a preset interface to convert the hierarchical triple data to generate link triple data, wherein the link triple data includes a current span identifier, a parent span identifier and a first distributed system link identifier.
[0032] According to an embodiment of the present disclosure, the generating submodule includes:
[0033] A traversal unit, configured to traverse the current node identifiers in all level triple data to generate a current span identifier corresponding to the current node identifier;
[0034] a determining unit, configured to determine a parent span identifier corresponding to the current span identifier according to the current node identifier, the node level, and the parent node identifier;
[0035] A generating unit is configured to generate link triplet data according to the current span identifier, the parent span identifier, and the first distributed system link identifier.
[0036] According to an embodiment of the present disclosure, the second determining module includes:
[0037] A first determining submodule, configured to, when determining that the source system identifier is the second distributed system, determine that the target system identifier is the first distributed system;
[0038] The second determining submodule is configured to determine the first distributed system link identifier according to the second distributed system link identifier and the mapping relationship.
[0039] According to an embodiment of the present disclosure, the second determining module further includes:
[0040] a third determining submodule, configured to, when determining that the source system identifier is the first distributed system, determine that the target system identifier is the second distributed system;
[0041] The fourth determining submodule is configured to determine the second distributed system link identifier according to the first distributed system link identifier and the mapping relationship.
[0042] The third aspect of the present 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 execute the above-mentioned link data processing method.
[0043] A fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned link data processing method.
[0044] The fifth aspect of the present disclosure further provides a computer program product, including a computer program, which implements the above-mentioned link data processing method when executed by a processor.
[0045] Through the link data processing method of the embodiment of the present invention, by determining the source system information and the link identifier mapping information, wherein the source system information includes the source system identifier and the source system link identifier; determining the target system identifier and the target system link identifier according to the source system identifier, the source system link identifier and the link identifier mapping information; when it is determined that the target system identifier is the first distributed system, calling the preset interface to process the second distributed system link data to generate target link data, the second distributed system link data is hierarchical triple data, and the target link data is link triple data, which solves the problem of inconsistent requirements for link identifier uniqueness in the two distributed systems, realizes the unification of link identifiers between independent distributed systems, and is conducive to link query between multiple distributed systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0047] Figure 1 A schematic diagram schematically illustrates the link monitoring process for cross-system service calls;
[0048] Figure 2 Schematically illustrates an application scenario diagram of the link data processing method, apparatus, device, storage medium, and program product according to an embodiment of the present disclosure;
[0049] Figure 3 The following schematically shows a flow chart of a link data processing method according to an embodiment of the present disclosure;
[0050] Figure 4a Schematically shows one of the flow charts of the method for generating target link data according to an embodiment of the present disclosure;
[0051] Figure 4b Schematically shows a structural diagram of a hierarchical triplet according to an embodiment of the present disclosure;
[0052] Figure 4c The second flowchart of the method for generating target link data according to an embodiment of the present disclosure is schematically shown;
[0053] Figure 5a Schematically illustrates one of the flow charts of a method for determining a target link identifier according to an embodiment of the present disclosure;
[0054] Figure 5b The second flowchart of the method for determining the target link identifier according to an embodiment of the present disclosure is schematically shown;
[0055] Figure 6 Schematically shows a structural block diagram of a link data processing device according to an embodiment of the present disclosure; and
[0056] Figure 7 The block diagram schematically shows an electronic device suitable for implementing the link data processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0057] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0058] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0059] 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 should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0060] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0061] First, the terms that appear in the embodiments of the present disclosure are explained:
[0062] First distributed system: an independent distributed system, including but not limited to distributed services, distributed messages, distributed transactions, soft load, distributed database and distributed cache.
[0063] Second distributed system: A third-party distributed system, similar to the first distributed system, is also an independent distributed system;
[0064] First distributed system link identifier: This is the link identifier of the first distributed system, generated by the Zipkin component, depends on specific machine address, timestamp and other information, and is globally unique.
[0065] Second distributed system link identifier: the link identifier of the second distributed system, usually the transaction ID is used as the second distributed system link identifier.
[0066] HMP: Holographic Monitoring Platform, which is the operational component of the first distributed system and can be used to monitor the call link data of services in the first distributed system;
[0067] APMS: Application Performance Management & Monitoring System, distributed link tracking, is the operation and maintenance component of the second distributed system, which can be used to monitor the call link data of the services in the second distributed system.
[0068] Opentracing: A specification and industry standard for distributed link tracing. It consists of a complete API specification, a framework and library for implementing it, and project documentation.
[0069] Trace: A link, similar to a tree-structured span set, represents a link and has a unique trace ID.
[0070] Span: Span is the basic unit of work. A span is created for each link call. The span also contains description information, timestamp, etc. In layman's terms, a span is a request information.
[0071] Trace Id: The unique global ID of a link;
[0072] Span Id: identifies the span ID. Each span in a link has a unique span Id.
[0073] In order to better understand the technical solutions of the embodiments of the present disclosure, a brief introduction to the link monitoring process in the prior art is first given. Figure 1 The schematic diagram of the link monitoring process of cross-system service calls is shown schematically. Figure 1As shown, service node A, service node B, and Adapter node are connected to the first distributed system, and service node C and service node D are connected to the second distributed system. Assume that there is a service call request, and service node A calls service node D via service node B, Adapter node, and service node C. The starting node A creates a new traceId: a01. In the call link of A-B-Adapter, the link identifier is unified as a01. However, in the second distributed system, the format specifications for traceId are inconsistent between the two distributed systems. The traceId of the first distributed system is generated by the zipkin component and includes specific machine address information and timestamp information, and is globally unique. The traceId in the second distributed system only needs to be globally unique. Any string, transaction number, etc. can be used as the traceId. Generally speaking, the traceId of the second distributed system uses transactionId (transaction transaction id, generated by a specific component) as the link id. Because transactionId itself is unique, it is suitable for identifying links in the APMS system. To distinguish the two distributed system link IDs, assume that the first distributed system link identifier is traceId, while the second distributed system link identifier is transactionId. This will not be further explained. From this, it can be inferred that the traceId generated by services A, B, and the Adapter node can be accepted by services C and D connected to the APMS system and used as the link traceId, but the reverse is not true. During link message conversion, due to the inconsistent link identifiers in the two systems, the link identifiers of the two systems cannot communicate with each other.
[0074] Based on the above technical problems, an embodiment of the present disclosure provides a link data processing method, which is applied to a distributed system, wherein the distributed system includes a first distributed system and a second distributed system, including:
[0075] In response to a link message conversion instruction, source system information and link identifier mapping information are determined, wherein the source system information includes a source system identifier and a source system link identifier; a target system identifier and a target system link identifier are determined based on the source system identifier, the source system link identifier, and the link identifier mapping information; when it is determined that the target system identifier is the first distributed system, a preset interface is called to process the second distributed system link data to generate target link data, wherein the second distributed system link data is hierarchical triplet data, and the target link data is link triplet data.
[0076] Figure 2 The application scenario diagram of the link data processing method, apparatus, device, storage medium and program product according to the embodiments of the present disclosure is schematically shown.
[0077] like Figure 2 As shown, the application scenario 100 according to this embodiment may include an application scenario of link data processing. A network 104 is used to provide a medium for a communication link between terminal devices 101, 102, 103 and a server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0078] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0079] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0080] Server 105 may be a server that provides various services, such as a message conversion server (for example only) that supports service requests initiated by users using terminal devices 101, 102, and 103. The backend management server may analyze and process received user request data, and generate service call link data.
[0081] It should be noted that the link data processing method provided in the embodiments of the present disclosure can generally be executed by the server 105. Accordingly, the link data processing device provided in the embodiments of the present disclosure can generally be set in the server 105. The link data processing method provided in the embodiments of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the link data processing device provided in the embodiments of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0082] It should be understood that Figure 2 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0083] It should be noted that the methods and devices determined in the present disclosure can be used in the distributed operation and maintenance field of the financial field, and can also be used in any field other than the financial field. The application field of the link data processing method and device determined in the present disclosure is not limited.
[0084] The following will be based on Figure 2 The scene described by Figures 3 to 6 The link data processing method of the disclosed embodiment is described in detail.
[0085] Figure 3 The flowchart of the link data processing method according to the embodiment of the present disclosure is schematically shown. Figure 3 As shown, the link data processing method of this embodiment includes operations S210 to S230.
[0086] In operation S210 , in response to a link message conversion instruction, source system information and link identifier mapping information are determined.
[0087] According to an embodiment of the present disclosure, the source system information includes a source system identifier and a source system link identifier.
[0088] In one example, the source system is the system to which the message to be converted belongs, which can be the first distributed system or the second distributed system. Correspondingly, the target system is the system to which the message after conversion belongs. When the source system is the first distributed system, the target system is the second distributed system. When the source system is the second distributed system, the target system is the first distributed system. Regardless of whether the service call direction is service node A calling service node D or service node D calling service node A, the two distributed systems generate two types of link messages for the same service call request, and at the same time generate two types of link identifiers. As can be seen from the above, the traceId generated by services A, B and the Adapter node can be accepted by services C and D connected to the APMS system and used as the traceId of the link. The transactionId generated by service nodes C and D cannot be directly used as the link identifier of the first distributed system. Therefore, the link identifier needs to be converted before the message conversion is performed. In the embodiment of the present disclosure, after receiving the link message conversion instruction, the link identifier mapping information is obtained from the message middleware. The link identifier mapping information is generated by the Adapter and sent to the corresponding message middleware.
[0089] In operation S220, a target system identifier and a target system link identifier are determined according to the source system identifier, the source system link identifier, and the link identifier mapping information.
[0090] In one example, the link identifier mapping information represents the mapping relationship between the source system link identifier and the target system link identifier. When the service call passes through the Adapter node, the Adapter will collect information to construct traceMapping, that is, the link mapping structure information. The Adapter node is actually composed of two types of nodes, one is InboundAdapter (the second distributed system calls the first distributed system), and the other is OutboundAdapter (the first distributed system calls the second distributed system). When the first distributed system calls the second distributed system, the first distributed system link identifier can be used as the second distributed system link identifier; when the second distributed system calls the first distributed system, the InboundAdapter node generates a new link identifier as the first distributed system link identifier based on the second distributed system link identifier. According to traceMapping, the link identifier mapping information can be determined, and then the target system identifier and the target system link identifier are determined based on the source system identifier and the original system link identifier. The specific process can be seen in operations S221 to S222 shown in Figure 5, and will not be repeated here.
[0091] In operation S230, when it is determined that the target system identifier is the first distributed system, a preset interface is called to process the second distributed system link data to generate target link data.
[0092] According to an embodiment of the present disclosure, the second distributed system link data is hierarchical triplet data, and the target link data is link triplet data.
[0093] According to an embodiment of the present disclosure, when it is determined that the target system identifier is the second distributed system, the first distributed system link data is determined as the target link data.
[0094] In one example, due to the inconsistency in the link message format, structure, field, etc. between the first distributed system and the second distributed system, the link data format that constitutes the link message is also different. In order to display the complete link, it is necessary to convert different types of link messages in the same link to each other, such as converting the APMS link message into the HMP link message, and converting the HMP link message into the APMS link message, so that the management pages of the first distributed system and the second distributed system can display the complete link message. The first message link data is the link triplet [traceId, id, parentId], and the second message link data is the level triplet [level, nid, pid]. When the target system is identified as the first distributed system, it is necessary to call the interface to process the link data of the second distributed system, that is, to map the level triplet to the link triplet. For the specific processing process, please refer to Figure 4a and Figure 4bOperations S231 to S232 are shown. When the target system is identified as the second distributed system, the link data does not need to be processed as described above. In this case, the second message link data is the target link data, and the message conversion logic can be directly executed.
[0095] Through the link data processing method of the embodiment of the present invention, by determining the source system information and the link identifier mapping information, wherein the source system information includes the source system identifier and the source system link identifier; determining the target system identifier and the target system link identifier according to the source system identifier, the source system link identifier and the link identifier mapping information; when it is determined that the target system identifier is the first distributed system, calling the preset interface to process the second distributed system link data to generate target link data, the second distributed system link data is hierarchical triple data, and the target link data is link triple data, which solves the problem of inconsistent requirements for link identifier uniqueness in the two distributed systems, realizes the unification of link identifiers between independent distributed systems, and is conducive to link query between multiple distributed systems.
[0096] Figure 4a Schematically shows one of the flow charts of the method for generating target link data according to an embodiment of the present disclosure, Figure 4b The following schematically shows a structural diagram of a hierarchical triplet according to an embodiment of the present disclosure. Figure 4c The second flow chart of the method for generating target link data according to an embodiment of the present disclosure is schematically shown. Figure 4a As shown, operation S230 includes operations S231 to S232.
[0097] In operation S231 , hierarchical triplet data is acquired according to the second distributed system link identifier.
[0098] According to an embodiment of the present disclosure, the hierarchical triplet data includes a current node identifier, a node hierarchy, and a parent node identifier.
[0099] First combine Figure 4b Introducing the hierarchical triples, the link message of the second distributed system (APMS system) is based on the node level. The node message has only one entry method and the internal private method call is described by the hierarchical triple [nid, pid, level].
[0100] like Figure 4bAs shown, APM message A is a node message, and message B is also an independent node message. Its internal private method call consists of [nid, pid, level]. / test is at the first level, with a level of 1; callDemoServiceA, / test4, and / test8 are at the second level, with a level of 2; and / test45 and / test47 are at the third level, with a level of 3. The nid of the calling method is the pid of the called method. For example, if the nid of / test is 1, the pid of the called methods callDemoServiceA, / test4, and / test8 is also 1. The nid of the calling method / test4 is 3, and the pid of the called methods / test45 and / test47 is also 3. Therefore, the node-level nid of the level triple is unique and is identified by a number starting from 1. The method level starts at 1 and increases by 1 with each method call. The nid of the calling method is the pid of the called method.
[0101] The hierarchical triplet data is searched in the database according to the second distributed system link identifier, and then the hierarchical triplet is converted into a link triplet.
[0102] In operation S232 , a preset interface is called to convert the layer triplet data to generate link triplet data.
[0103] According to an embodiment of the present disclosure, the link triplet data includes a current span identifier, a parent span identifier, and a first distributed system link identifier.
[0104] like Figure 4c As shown, the specific conversion process includes operations S2321 to S2323.
[0105] In operation S2321 , current node identifiers in all level triple data are traversed to generate a current span identifier corresponding to the current node identifier.
[0106] In operation S2322 , a parent span identifier corresponding to the current span identifier is determined according to the current node identifier, the node level, and the parent node identifier.
[0107] In operation S2323 , link triplet data is generated according to the current span identifier, the parent span identifier, and the first distributed system link identifier.
[0108] In an example, the basic idea of converting the hierarchical triplet [nid, pid, level] to the link triplet [id, parentId, traceId] is to build a hierarchical relationship between ApmsMessage and ApmsMethod through recursive traversal, and map it to the corresponding traceId, id, and parentId. Since Id and parentId do not exist, they need to be generated by tools, specifically by calling the SpanIdCreator interface. ApmsMessage and ApmsMethod are the object organization forms after the commercial version of APMS message json is deserialized. The outermost layer is the ApmsMessage object, and maps is an array. Each element in it will generate an ApmsMethod. Each ApmsMethod will have a hierarchical triplet [nid, pid, level].
[0109] This is achieved by traversing each element of maps and synchronously constructing a spanIdMapping structure (using an idea similar to an inverted index). Specifically, the map array is traversed to obtain all current node identifiers; the interface function is called to generate the current span identifier from the current node identifier in the hierarchical triplet, and the link call relationship is determined based on the parent node identifier and the current node identifier in the hierarchical triplet and the node hierarchy, that is, the corresponding mapping relationship between the parent node identifier and the current node identifier, and the mapping relationship between the newly generated current span identifier and the parent span identifier is further determined based on the mapping relationship, and then the link triplet is generated in combination with the first distributed system link identifier.
[0110] Figure 5a One of the flow charts of the method for determining the target link identifier according to an embodiment of the present disclosure is schematically shown. Figure 5b The second flowchart of the method for determining the target link identifier according to an embodiment of the present disclosure is schematically shown.
[0111] like Figure 5a and Figure 5b As shown, there are two feasible implementations of operation S220.
[0112] In a feasible implementation manner, it includes operations S221 to S222.
[0113] In operation S221 , when it is determined that the source system identifier is the second distributed system, the target system identifier is determined to be the first distributed system.
[0114] In operation S222, the first distributed system link identifier is determined according to the second distributed system link identifier and the mapping relationship.
[0115] According to an embodiment of the present disclosure, the link identifier mapping information is used to characterize a mapping relationship between a source system link identifier and a target system link identifier.
[0116] In one example, when the source system identifier is determined to be the second distributed system, the target system identifier is characterized as the first distributed system. At this time, the APMS message is converted to the HMP message, and the link mapping relationship is determined according to the link identifier mapping information, and then the link identifier of the first distributed system is determined. There are two cases here: 1. When the service call direction is the first distributed system calling the second distributed system, the first distributed link identifier is the same as the second distributed link identifier, for example, the second distributed link identifier is a01, and the first distributed link identifier is also a01. 2. When the service call direction is the second distributed system calling the first distributed system, the mapping relationship is traceId: c01, transactionId: b01, that is, the second distributed system link identifier is b01, and the first distributed system link identifier is determined to be c01.
[0117] In another feasible implementation manner, operations S223 and S224 are included.
[0118] In operation S223 , when it is determined that the source system identifier is the first distributed system, the target system identifier is determined to be the second distributed system.
[0119] In operation S224, a second distributed system link identifier is determined according to the first distributed system link identifier and the mapping relationship.
[0120] In one example, when the source system identifier is determined to be the first distributed system, the target system identifier is determined to be the second distributed system, that is, the HMP message is converted to the APMS message. There are also two situations here according to the service call direction. 1. When the service call direction is the first distributed system calling the second distributed system, the first distributed link identifier is the same as the second distributed link identifier. For example, if the first distributed link identifier is a01, the second distributed link identifier is also a01. 2. When the service call direction is the second distributed system calling the first distributed system, the mapping relationship is traceId: c01, transactionId: b01, that is, the first distributed system link identifier is c01, and the second distributed system link identifier is determined to be b01.
[0121] Based on the above link data processing method, the present disclosure also provides a link data processing device. Figure 6 The device is described in detail.
[0122] Figure 6 The structure block diagram of the link data processing device according to an embodiment of the present disclosure is schematically shown.
[0123] like Figure 6 As shown, the link data processing device 800 of this embodiment is applied to a distributed system, which includes a first distributed system and a second distributed system, and includes a first determining module 810 , a second determining module 820 and a generating module 830 .
[0124] The first determination module 810 is used to determine the source system information and link identifier mapping information in response to the link message conversion instruction, wherein the source system information includes the source system identifier and the source system link identifier. In one embodiment, the first determination module 810 can be used to perform the operation S210 described above, which will not be repeated here.
[0125] The second determining module 820 is used to determine the target system identifier and the target system link identifier according to the source system identifier, the source system link identifier and the link identifier mapping information. In one embodiment, the second determining module 820 can be used to perform the operation S220 described above, which will not be repeated here.
[0126] When the target system identifier is determined to be the first distributed system, generation module 830 is configured to call a preset interface to process the second distributed system link data to generate target link data, where the second distributed system link data is layer triplet data, and the target link data is link triplet data. In one embodiment, generation module 830 can be configured to perform operation S230 described above, which will not be further described here.
[0127] According to an embodiment of the present disclosure, it further includes:
[0128] The third determining module is configured to determine the first distributed system link data as the target link data when the target system identifier is determined to be the second distributed system. In one embodiment, the third determining module may be configured to execute the operation S230 described above, which will not be described in detail herein.
[0129] According to an embodiment of the present disclosure, the generation module 830 includes an acquisition submodule and a generation submodule.
[0130] The acquisition submodule is configured to acquire hierarchical triplet data according to the second distributed system link identifier, wherein the hierarchical triplet data includes the current node identifier, the node hierarchy, and the parent node identifier. In one embodiment, the acquisition submodule may be configured to execute operation S231 described above, which will not be described in detail herein.
[0131] A generation submodule is configured to call a preset interface to convert the hierarchical triple data to generate link triple data, wherein the link triple data includes a current span identifier, a parent span identifier, and a first distributed system link identifier. In one embodiment, the generation submodule can be configured to perform operation S232 described above and will not be further described herein.
[0132] According to an embodiment of the present disclosure, the generation submodule includes a traversal unit, a determination unit, and a generation unit.
[0133] The traversal unit is configured to traverse the current node identifiers in all level triple data to generate a current span identifier corresponding to the current node identifier. In one embodiment, the traversal unit may be configured to execute the operation S2321 described above, which will not be described in detail herein.
[0134] The determining unit is configured to determine a parent span identifier corresponding to the current span identifier based on the current node identifier, the node level, and the parent node identifier. In one embodiment, the determining unit may be configured to perform operation S2322 described above, which will not be described in detail herein.
[0135] The generating unit is configured to generate link triplet data according to the current span identifier, the parent span identifier, and the first distributed system link identifier. In one embodiment, the generating unit may be configured to perform the operation S2323 described above, which will not be described in detail here.
[0136] According to an embodiment of the present disclosure, the second determining module 820 includes a first determining submodule, a second determining submodule, a third determining submodule, and a fourth generating submodule.
[0137] The first determining submodule is configured to determine that the target system identifier is the first distributed system when the source system identifier is determined to be the second distributed system. In one embodiment, the first determining submodule may be configured to execute the operation S221 described above, which will not be described in detail herein.
[0138] The second determining submodule is configured to determine the first distributed system link identifier according to the second distributed system link identifier and the mapping relationship. In one embodiment, the second determining submodule may be configured to execute the operation S222 described above, which will not be described in detail here.
[0139] The third determining submodule is configured to determine that the target system identifier is the second distributed system when the source system identifier is determined to be the first distributed system. In one embodiment, the third determining submodule may be configured to execute the operation S223 described above, which will not be described in detail here.
[0140] The fourth determining submodule is configured to determine the second distributed system link identifier according to the first distributed system link identifier and the mapping relationship. In one embodiment, the fourth determining submodule may be configured to execute the operation S224 described above, which will not be described in detail here.
[0141] According to embodiments of the present disclosure, any multiple modules among the first determination module 810, the second determination module 820, and the generation module 830 may be combined into a single 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 a single module. According to embodiments of the present disclosure, at least one of the first determination module 810, the second determination module 820, and the generation module 830 may be at least partially implemented as a hardware circuit, 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 a package, an application-specific integrated circuit (ASIC), or may be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or may be implemented in any one of the three implementation methods of software, hardware, and firmware, or any appropriate combination of these. Alternatively, at least one of the first determination module 810, the second determination module 820, and the generation module 830 may be at least partially implemented as a computer program module that, when executed, performs the corresponding functionality.
[0142] Figure 7 The block diagram schematically shows an electronic device suitable for implementing the link data processing method according to an embodiment of the present disclosure.
[0143] like Figure 7 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage unit 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0144] Various programs and data required for the operation of the electronic device 900 are stored in the RAM 903. The processor 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. The processor 901 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 902 and / or the RAM 903. It should be noted that the programs may also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.
[0145] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 908 including a hard disk; and a communication section 909 including a network interface card such as a LAN card or a modem. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. Removable media 911, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 910 as needed, so that computer programs read from the removable media can be installed in the storage section 908 as needed.
[0146] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.
[0147] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a 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 an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above, and / or one or more memories other than ROM 902 and RAM 903.
[0148] The embodiments of the present disclosure also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the link data processing method provided by the embodiments of the present disclosure.
[0149] The computer program executes the above functions defined in the system / device of the embodiment of the present disclosure when the processor 901 executes the computer program. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0150] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0151] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from a removable medium 911. When the computer program is executed by the processor 901, the above-described functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.
[0152] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer 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 be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0154] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways, even if such combinations and / or couplings are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or couplings are intended to fall within the scope of this disclosure.
[0155] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A link data processing method, applied to a distributed system, wherein the distributed system includes a first distributed system and a second distributed system, characterized in that: include: In response to the link message conversion instruction, determining source system information and link identifier mapping information, wherein the source system information includes a source system identifier and a source system link identifier; Determine a target system identifier and a target system link identifier according to the source system identifier, the source system link identifier, and the link identifier mapping information; and When it is determined that the target system identifier is the first distributed system, a preset interface is called to process the second distributed system link data to generate target link data, where the second distributed system link data is hierarchical triple data, and the target link data is link triple data. When it is determined that the target system identifier is the first distributed system, calling a preset interface to process the second distributed system link data to generate target link data includes: Acquire hierarchical triplet data according to the second distributed system link identifier, wherein the hierarchical triplet data includes a current node identifier, a node hierarchy, and a parent node identifier; The preset interface is called to convert the hierarchical triple data to generate link triple data, where the link triple data includes a current span identifier, a parent span identifier, and a first distributed system link identifier.
2. The method according to claim 1, characterized in that The calling of a preset interface to convert the hierarchical triplet data to generate link triplet data includes: Traversing the current node identifiers in all level triplet data to generate a current span identifier corresponding to the current node identifier; Determining a parent span identifier corresponding to the current span identifier according to the current node identifier, the node level, and the parent node identifier; and Link triplet data is generated according to the current span identifier, the parent span identifier, and the first distributed system link identifier.
3. The method according to claim 2, characterized in that The link identifier mapping information is used to characterize a mapping relationship between a source system link identifier and a target system link identifier, and determining the target system identifier and the target system link identifier according to the source system identifier, the source system link identifier, and the link identifier mapping information includes: When it is determined that the source system identifier is the second distributed system, the target system identifier is determined to be the first distributed system; The first distributed system link identifier is determined according to the second distributed system link identifier and the mapping relationship.
4. The method according to claim 2, characterized in that The determining of the target system identifier and the target system link identifier according to the source system identifier, the source system link identifier and the link identifier mapping information further comprises: When it is determined that the source system identifier is the first distributed system, the target system identifier is determined to be the second distributed system; The second distributed system link identifier is determined according to the first distributed system link identifier and the mapping relationship.
5. The method according to any one of claims 1 to 4, characterized in that Also includes: When it is determined that the target system identifier is the second distributed system, the first distributed system link data is determined as the target link data.
6. A link data processing device, applied to a distributed system, the distributed system comprising a first distributed system and a second distributed system, comprising: A first determining module, configured to determine source system information and link identifier mapping information in response to a link message conversion instruction, wherein the source system information includes a source system identifier and a source system link identifier; A second determining module is configured to determine a target system identifier and a target system link identifier according to the source system identifier, the source system link identifier, and the link identifier mapping information; a generation module for, when determining that the target system identifier is the first distributed system, calling a preset interface to process the second distributed system link data to generate target link data, wherein the second distributed system link data is hierarchical triple data, and the target link data is link triple data; Among them, the generation module is also used to obtain hierarchical triplet data according to the second distributed system link identifier, wherein the hierarchical triplet data includes the current node identifier, the node level and the parent node identifier; calling the preset interface to convert the hierarchical triplet data to generate link triplet data, wherein the link triplet data includes the current span identifier, the parent span identifier and the first distributed system link identifier.
7. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to perform the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Message conversion method and device, computer equipment and computer readable storage medium
CN109617646A