CN115982234A - Method for tracking distributed architecture link based on micro-service - Google Patents

Method for tracking distributed architecture link based on micro-service Download PDF

Info

Publication number
CN115982234A
CN115982234A CN202211653262.9A CN202211653262A CN115982234A CN 115982234 A CN115982234 A CN 115982234A CN 202211653262 A CN202211653262 A CN 202211653262A CN 115982234 A CN115982234 A CN 115982234A
Authority
CN
China
Prior art keywords
service
micro
tracking
traceid1
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211653262.9A
Other languages
Chinese (zh)
Inventor
郑能欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Shuyan Jinhan Intelligent Technology Co ltd
Original Assignee
Shenzhen Shuyan Jinhan Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Shuyan Jinhan Intelligent Technology Co ltd filed Critical Shenzhen Shuyan Jinhan Intelligent Technology Co ltd
Priority to CN202211653262.9A priority Critical patent/CN115982234A/en
Publication of CN115982234A publication Critical patent/CN115982234A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a micro-service distributed architecture based link tracking method, which is used for monitoring the transaction flow direction of construction wastes. The technical scheme is that a micro-service module generates a spanID1 according to a transaction request initiated by a user; the link tracking module generates a traceID1 according to a transaction request initiated by a user; executing a micro-service module service method, and generating index information according to a server IP address, a micro-service module name, a service method name, a tracking point ID called by the span ID1 and the traceID1, the start execution time of the service method and the end execution information of the service method; after receiving the spanID1, traceID1 and the index information, the central collector constructs and generates multi-dimensional structured data, and then stores the data into a distributed storage fragment index; and executing a query instruction of the distributed storage fragment index according to a GET mode, querying and tracking multi-dimensional structured data through a visualization module, and displaying a visualization interface.

Description

Method for tracking distributed architecture link based on micro-service
Technical Field
The invention relates to a method for tracking a link based on a micro-service distributed architecture.
Background
Micro-service architecture: microservice is an architectural and organizational method of developing software that consists of small, independent services that communicate through well-defined APIs.
Distributed link tracing: a Distributed System Tracing (DST) is an application Observability (Observability) solution oriented to a Distributed architecture, a micro service (Spring Cloud, etc.) architecture, and the like.
Construction waste: the construction waste refers to the general name of dregs, waste concrete, waste bricks and stones and other wastes generated in the production activities of people in the construction industry such as demolition, construction, decoration, repair and the like.
In recent years, with the rapid development of economic society and urban construction, particularly with the continuous promotion of urban rail transit and old city reconstruction along with ecological civilization construction, the work special for provincial solid waste management requires that the treatment trend of each ton of solid waste is traceable. Therefore, the construction waste disposal management needs to be standardized by means of science and technology and informatization, a digital management mode of the whole life cycle of the construction waste is constructed, and the transaction processing tracking of the construction waste is realized.
The current waste transaction processing process link is a single-instance-based process, is not supported by a distributed processing link, has limited processing capacity, can only solve the tracking requirement of partial application scenes due to the fact that only single-scene process tracking is supported, has problems in upstream and downstream links in the waste transaction processing process, needs to query service data through a database and combine the service data with application process log data, is difficult to accurately position the problem, wastes time and labor, and has no data statistics and display capacity in the aspects of service processing link processes and service processing performance.
The technical defects of the existing waste transaction service are as follows: the service single-instantiation processing is lack of distributed multi-instance capability, so that the performance problem exists when the transaction magnitude is large; the process tracking of a single scene has defects in the link tracking among multiple services and lacks the link tracking data statistics and display capability; operation and maintenance personnel cannot quickly identify and locate the service performance bottleneck module.
Disclosure of Invention
In order to solve at least one technical defect existing in the prior art, the invention provides a method for tracking a link based on a micro-service distributed architecture.
To at least improve the above technical problem, the present invention provides a method for tracing a link based on a microservice distributed architecture, which is used for monitoring the transaction flow of construction waste,
the micro-service module generates a spanID1 according to a transaction request initiated by a user; the link tracking module generates a traceID1 according to a transaction request initiated by a user;
the method for executing the micro-service module business generates index information according to the server IP address, the name of the micro-service module, the name of the business method, the tracking point ID called by the span ID1 and the traceID1, the starting execution time of the business method and the ending execution information of the business method;
after receiving the spanID1, the traceID1 and the index information, the central collector constructs and generates multi-dimensional structured data, and then stores the data into a distributed storage fragment index;
and executing a query instruction of the distributed storage fragment index in a GET mode, querying and tracking multi-dimensional structured data through a visualization module, and displaying a visualization interface.
Further, the link tracking module calls a micro service module which enters the link for the first time to generate an identifier traceID2 by using a snowfall algorithm.
Further, when the asynchronous thread is called, the characteristic information of the data space file of the current thread section and the spanID1 is copied, then the playback is carried out in the sub-thread, and the playback snapshot is stored in the parentspaniD1 of the traceID1 and marked.
Furthermore, when the micro-service module needs to call the downstream micro-service; if the downstream micro-service is called for the first time, setting parentspanID2 corresponding to the downstream micro-service to null or 0; if the downstream micro-service is not called for the first time, the calling of the downstream micro-service is initiated after the existing parentspanID3 is set as the current traceID 3.
Furthermore, if the Key value of SW8 of the Header is required to be set in the Http protocol of the exchange downstream micro service and the upstream micro service, the information required to be transmitted comprises traceID 2/traceID 2, parentspanID 2/parentspanID 3 and request address information, and the Context information in the upstream and downstream spanIDContext deserialization Header is transmitted to the downstream micro service.
Furthermore, the central collector fails to build, data files record traceID1 tracking information Data, and the tracking information Data is written into a Buffer cache file in a cache mode.
Furthermore, a Buffer file is read through an internal thread to be constructed, traceID1 information is calculated in an Agent Streaming mode, and a calculation result is received by a central collector and stored into the distributed storage fragment index.
Advantageous technical effects
Realizing the self-registration, discovery, communication strategy among the micro service gateway and the user-defined service and the automatic detection of the performance of the micro service; the tracking of the transaction processing process of the construction waste and the storage, statistics and display of the data of the tracking chain are realized, the business processing and tracking capacity of the transaction processing system of the construction waste can be obviously improved, the development and operation and maintenance efficiency is improved, the research and development cost of enterprises is reduced, and the technical support is provided for the reliable and efficient operation of the distributed transaction processing system of the construction waste with the micro-service architecture.
Drawings
FIG. 1 is a schematic diagram of distributed link tracking of construction waste transaction processing;
figure 2 is a schematic diagram of distributed storage of construction waste transaction tracking data and data statistics.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When a component is referred to as being "connected" to another component, it can be directly connected to the other component or intervening components may also be present.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
traceID: for identifying a particular request ID. When a user request enters the system, a globally unique traceID is generated at the first layer of the RPC calling network and is continuously transmitted with the RPC calling of each layer, so that the paths called in the system by one user request can be connected in series through the traceID.
The spanID, which is used to identify the location of an RPC call in the distributed request. After the request reaches each service, the service generates a spanID for the request. When a user request enters a system, the initial value of the span ID is 0 when the user request is positioned at the first layer A of the RPC call network, the span ID is 0.1 when the user request enters the next layer B of the RPC call network, the span ID is 0.1.1 when the user request continues to enter the next layer C of the RPC call network, and the span ID of the RPC call D positioned at the same layer as the layer B is 0.2, so that the position of a certain RPC request in the system call can be positioned through the span ID.
parentspanID: for identifying the location of the upstream RPC call in the distributed request. After the request reaches each service, the span ID of the upstream service that comes upstream with the request will be recorded as the parentspanID, or pspanID. The spanID generated by the current service is recorded by the downstream service as a parentspannid along with the request when passing to the downstream service.
As shown in fig. 1 and 2, a method for distributed architecture link tracing based on microservice, which is used for building waste transaction flow direction supervision,
the micro-service module generates a spanID1 according to a transaction request initiated by a user; the link tracking module generates a traceID1 according to a transaction request initiated by a user;
when a user initiates a transaction request through an Http protocol, a micro-service module is called inside a system, after the micro-service module receives the calling request, a link tracking module is responsible for acquiring and processing link information, if the current transaction request is for entering a link for the first time, a snowfall algorithm (a Snowflake algorithm) is used for generating a local globally unique identifier traceID1, and if the current transaction request is not for entering the link for the first time, the existing traceID1 is directly called.
Generating index information according to the IP address of the server, the name of the micro-service module, the name of the service method, the span ID1, the tracking point ID called by the traceID1, the starting execution time of the service method and the ending execution information of the service method; after recording, data information is transmitted to a central collector through an internal gPC mechanism (a client application can directly call a method of a server application deployed on other machines like a method of calling a local object);
after receiving the spanID1, the traceID1 and the index information, the central collector constructs and generates multi-dimensional structured data, and then stores the data into a distributed storage fragment index; the central collector fails to establish, the Data file records traceID1 tracking information Data, and the tracking information Data is written into a Buffer cache file in a caching mode; memory is reduced, and operation efficiency is improved; reading a Buffer file through an internal thread to construct, calculating traceID1 information in an Agent Streaming mode, and receiving and storing a calculation result into a distributed storage fragment index through a central collector; even if the traceID1 tracking information data is constructed unsuccessfully, the traceID1 tracking information data can be corrected through the Buffer cache file and stored into the distributed storage fragment index;
and executing a query instruction of the distributed storage fragment index in a GET mode, querying and tracking multi-dimensional structured data through a visualization module, and displaying a visualization interface.
Adopt above-mentioned technical scheme: the method can realize self-registration, discovery, communication strategy among micro-service gateways, user-defined services and automatic detection of micro-service performance of the micro-service architecture, realize tracking of the transaction processing process of the construction waste and storage, statistics and display of traceID1, remarkably improve the service processing and tracking capacity of the transaction processing system of the construction waste, improve the development and operation and maintenance efficiency and reduce the research and development cost of enterprises; the method provides technical support for reliable and efficient operation of the distributed construction waste transaction processing system with the micro-service architecture.
As shown in fig. 1 and 2, when the asynchronous thread is called, the feature information of the data space file and the spanID1 of the current thread segment is copied and then played back in the child thread, and a playback snapshot is saved in the parentspanID1 of the traceID1 and marked.
As shown in fig. 1 and 2, when the microservice module needs to invoke a downstream microservice; if the downstream micro service is called for the first time, setting parentspanID2 corresponding to the downstream micro service as null or 0; if the downstream micro-service is not called for the first time, after the existing parentspanID3 is set as the current traceID3, initiating the calling of the downstream micro-service; the calculation amount is reduced, the same microservice which is called for many times is ensured, and the data accumulation is reliable.
As shown in fig. 1 and fig. 2, if Key values of SW8 of a Header are required to be set in Http protocols of a calling downstream micro service and an upstream micro service, information required to be transmitted includes traceID 2/traceID 2, parentspanID 2/parentspanID 3, and request address information, and is transmitted to the downstream micro service through Context information in a deserialization Header of upstream and downstream spanID1Context (global Context information carrier of traceID 1).
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (7)

1. A method based on micro-service distributed architecture link tracking is used for monitoring the transaction flow direction of construction wastes and is characterized in that:
the micro-service module generates a spanID1 according to a transaction request initiated by a user; the link tracking module generates a traceID1 according to a transaction request initiated by a user;
executing a micro-service module service method, and generating index information according to a server IP address, a micro-service module name, a service method name, a tracking point ID called by the span ID1 and the traceID1, the start execution time of the service method and the end execution information of the service method;
after receiving the spanID1, the traceID1 and the index information, the central collector constructs and generates multi-dimensional structured data, and then stores the data into a distributed storage fragment index;
and executing a query instruction of the distributed storage fragment index in a GET mode, querying and tracking multi-dimensional structured data through a visualization module, and displaying a visualization interface.
2. The method for micro-service distributed architecture link tracing based on claim 1, wherein:
the link tracking module calls a micro service module which firstly enters the link to generate an identification traceID2 by using a Snowflake algorithm.
3. The method for microservice distributed architecture link tracing based on claim 1, wherein:
when the asynchronous thread is called, the characteristic information of the data space file and the spanID1 of the current thread segment is copied, then the playback is carried out in the sub-thread, and the playback snapshot is saved in the parentsspanID 1 of the traceID1 and marked.
4. The method of claim 3, wherein the method comprises:
when the micro-service module needs to call the downstream micro-service; if the downstream micro-service is called for the first time, setting parentspanID2 corresponding to the downstream micro-service to null or 0; if the downstream micro-service is not called for the first time, the calling of the downstream micro-service is initiated after the existing parentspanID3 is set as the current traceID 3.
5. The method of microservice distributed architecture link tracing based on claim 4, wherein:
if the Key value of SW8 of the Header is required to be set in the protocol of the exchange downstream micro service and the upstream micro service Http, the information required to be transmitted comprises traceID 2/traceID 2, parentspanID 2/parentspanID 3 and request address information, and the Context information in the upstream and downstream spanIDContext deserialization Header is transmitted to the downstream micro service.
6. The method for micro-service distributed architecture link tracing based on claim 1, wherein:
and the central collector fails to establish, records traceID1 tracking information Data by the Data file, and writes the tracking information Data into the Buffer cache file in a cache mode.
7. The method of claim 6, wherein the method comprises:
reading a Buffer file through an internal thread to construct, calculating traceID1 information in an Agent Streaming mode, and receiving and storing a calculation result into a distributed storage fragment index through a central collector.
CN202211653262.9A 2022-12-22 2022-12-22 Method for tracking distributed architecture link based on micro-service Pending CN115982234A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211653262.9A CN115982234A (en) 2022-12-22 2022-12-22 Method for tracking distributed architecture link based on micro-service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211653262.9A CN115982234A (en) 2022-12-22 2022-12-22 Method for tracking distributed architecture link based on micro-service

Publications (1)

Publication Number Publication Date
CN115982234A true CN115982234A (en) 2023-04-18

Family

ID=85960830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211653262.9A Pending CN115982234A (en) 2022-12-22 2022-12-22 Method for tracking distributed architecture link based on micro-service

Country Status (1)

Country Link
CN (1) CN115982234A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756044A (en) * 2023-08-11 2023-09-15 杭州罗莱迪思科技股份有限公司 RPC remote debugging method, device and application based on data link tracking

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756044A (en) * 2023-08-11 2023-09-15 杭州罗莱迪思科技股份有限公司 RPC remote debugging method, device and application based on data link tracking
CN116756044B (en) * 2023-08-11 2023-11-21 杭州罗莱迪思科技股份有限公司 RPC remote debugging method, device and application based on data link tracking

Similar Documents

Publication Publication Date Title
CN110505312B (en) Internet of things platform management system capable of being deployed at high end
CN101105793A (en) Data processing method and system of data library
CN112035191B (en) APM full-link monitoring system and method based on micro-service
CN111752799A (en) Service link tracking method, device, equipment and storage medium
CN115982234A (en) Method for tracking distributed architecture link based on micro-service
CN111125260A (en) Data synchronization method and system based on SQL Server
CN115033646B (en) Method for constructing real-time warehouse system based on Flink and Doris
CN114610588A (en) Database performance analysis method and device, electronic equipment and storage medium
CN116842055A (en) System and method for integrated processing of internet of things data batch flow
CN110377757B (en) Real-time knowledge graph construction system
CN103684900A (en) Business polling method and system
CN113688418A (en) Engineering order settlement method and system based on block chain data storage
CN112328406A (en) Micro-service distributed transaction system based on TCC (transmission control center) and service processing method
CN116980475A (en) Data pushing system based on binlog and double annular buffer areas
CN116185298A (en) Method for distributed storage of logs
CN113111074B (en) Interactive data monitoring method and device based on block chain
CN113190519B (en) Running log compression method based on railway running scene template
CN112181927A (en) Log auditing method under micro-service architecture
CN113094398B (en) Data link tracking method based on block chain technology
CN115633051A (en) Edge computing node self-cooperation management method
CN113052700A (en) Method and device for determining micro-service call chain
CN113472566A (en) Status monitoring method of union block chain and master node status monitoring system
CN105488861A (en) Large-dam inspection system
CN112463167A (en) Bank account dynamic account notification service system
CN111541747A (en) Data check point setting method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication