Full-link anomaly tracking and collecting method, device, equipment, medium and program product
By generating and storing the span information of service call events, and using exception processors to capture exception signals, the problem of low efficiency of the full-link tracking system in asynchronous calls and multi-branch transactions in the existing technology is solved, and rapid positioning and accurate tracking are achieved. Exception handling.
Patent Information
- Application Number
- CN202410701184.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-08-23
AI Technical Summary
The existing full-link tracking system is difficult to quickly locate exceptions in asynchronous calls and multi-branch transactions, is inefficient, and cannot propagate exception markers through responses, resulting in the inability to sample branch work data without exceptions.
By generating service call events and span information of associated call events, they are stored in a centralized storage database. The exception processor is used to capture exception signals and obtain associated span information. Based on this information, exception positioning is performed to determine the service link that caused the exception.
It realizes rapid location of exceptions in asynchronous calls and multi-branch transaction scenarios, improves exception handling efficiency, can accurately obtain full-link exception information, and improves the accuracy of exception location.
Smart Images

Figure CN118540210A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of software development and financial technology, and specifically to a full-link anomaly tracking and collection method, device, equipment, medium and program product. Background Art
[0002] With the rapid development of Internet business, the software architecture has evolved from single service to distributed service and has become extremely complex. In order to adapt to the high-concurrency requests of massive users, the deployment of system applications must be distributed. A high-concurrency system with massive users often has hundreds or even thousands of servers, which also involves service calls between multiple applications, which constitutes a complex distributed service system. However, based on the above distributed service system, if the service request is abnormal, it is impossible to quickly locate which server has handled the abnormality. If the log is used to check each server one by one, the efficiency is very low. In order to solve the problem of low efficiency, the existing link tracking system is generally used for troubleshooting.
[0003] The common full-link tracking method currently is to sample and locate the abnormal information. However, the existing solutions have the following problems: First, in asynchronous calls, since the caller will not wait for the response of the callee, it is impossible to propagate the abnormal mark through the response; second, if a transaction has multiple branches, only the branches with abnormalities can be reported. For branches without abnormalities, since there is no abnormal mark in their responses, their working data may not be sampled. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a full-link exception tracking and collection method, device, equipment, medium and program product for improving the efficiency of exception capture in software development.
[0005] According to the first aspect of the present disclosure, a full-link exception tracking and collection method is provided, including: in response to a service call event, generating span information of the service call event and associated call events generated in the service call event; storing the span information in a preset centralized storage database; in response to an abnormal signal generated in the service call event, obtaining span information associated with the service call event from the centralized storage database; locating the abnormality based on the span information and the abnormal signal, and determining the service link that generates the abnormal signal.
[0006] According to an embodiment of the present disclosure, generating the span information of the service call event and the associated call event generated in the service call event in response to a service call event includes: creating the span information of the service call event in response to an instruction to start the service call event; during the execution of the service call event, in response to an associated call event formed by calling a branch service in the service call event, creating the span information of the associated call event when the branch service is called.
[0007] According to an embodiment of the present disclosure, storing the span information in a preset centralized storage database includes: associating the span information of the service call event and the associated call event with the transaction tag of the service call event and storing them in the centralized storage database.
[0008] According to an embodiment of the present disclosure, in response to an exception signal generated in the service call event, obtaining the span information associated with the service call event from the centralized storage database includes: capturing the exception signal generated in the service call event based on an exception handler integrated in the service code corresponding to the service call event; when the exception handler captures the exception signal, obtaining the span information associated with the transaction tag of the service call event from the centralized storage database.
[0009] According to an embodiment of the present disclosure, before obtaining the span information associated with the service call event from the centralized storage database, the method also includes: in response to an abnormal signal generated in the service call event, associating the abnormal signal with the span information of the service call event or the associated call event that generates the abnormal signal; reporting the abnormal signal and the associated span information to the centralized storage database, and publishing the abnormal signal and the associated span information based on a preset channel of the centralized storage database.
[0010] According to an embodiment of the present disclosure, the method also includes: before starting the service call event, starting an exception handling node, so that the exception handling node subscribes to a preset channel of the centralized storage database; when the preset channel of the centralized storage database publishes the exception signal, obtaining the exception signal and the associated span information based on the exception handling node, and obtaining all span information related to the service call event based on the transaction tag of the service call event bound to the span information.
[0011] According to an embodiment of the present disclosure, the abnormality locating based on the span information and the abnormal signal and determining the service link that generates the abnormal signal includes: acquiring a branch service associated with the service call event based on the span information and a service call link formed based on the branch service; and locating the abnormal signal in the service call link to determine the service link that generates the abnormal signal.
[0012] According to an embodiment of the present disclosure, the method further includes: when the service call event ends, deleting the span information associated with the service call event from the centralized storage database.
[0013] The second aspect of the present disclosure provides a full-link exception tracking and collection device, including: a span generation module, which is used to generate span information of the service call event and the associated call events generated in the service call event in response to a service call event; a span storage module, which is used to store the span information in a preset centralized storage database; an exception acquisition module, which is used to obtain the span information associated with the service call event from the centralized storage database in response to an exception signal generated in the service call event; and an exception locating module, which is used to locate the exception based on the span information and the exception signal, and determine the service link that generates the exception signal.
[0014] 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 full-link exception tracking and collection method.
[0015] The fourth aspect of the present disclosure also provides a computer-readable storage medium on which executable instructions are stored, and when the instructions are executed by a processor, the processor executes the above-mentioned full-link exception tracking and collection method.
[0016] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned full-link exception tracking and collection method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] 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:
[0018] Figure 1 The application scenario diagram of the full-link anomaly tracking and collection method, device, equipment, medium and program product according to the embodiment of the present disclosure is schematically shown;
[0019] Figure 2A flowchart of a full-link abnormality tracking and collection method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3 The following schematically shows an application flow diagram of the full-link abnormality tracking and collection method according to an embodiment of the present disclosure;
[0021] Figure 4 A schematic diagram of a structure of a full-link abnormality tracking and collection device according to an embodiment of the present disclosure is shown; and
[0022] Figure 5 A block diagram of an electronic device suitable for implementing a full-link anomaly tracking and collection method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, 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 known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0024] 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 existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0025] All terms (including technical and scientific terms) used herein 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.
[0026] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression 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.).
[0027] It should be noted that the full-link anomaly tracking and collection method and device disclosed in the present invention can be used in the technical process of software development in the financial field, and can also be used in the technical process of software development in any field other than the financial field. The application field of the full-link anomaly tracking and collection method and device provided by the present invention is not limited.
[0028] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0029] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present invention provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0030] Definitions of Key Terms:
[0031] A distributed system is a system composed of a group of computer nodes that communicate through a network and work in coordination to complete a common task. The emergence of distributed systems is to use cheap, ordinary machines to complete computing and storage tasks that a single computer cannot complete. Its purpose is to use more machines to process more data. Distributed systems have the advantages of reliability, high fault tolerance, scalability, flexibility, fast computing speed, and high degree of openness.
[0032] Full-link tracing (Trace) involves the communication and call links between multiple services and components. In the distributed core system of banks, it mainly refers to the communication and call links of transactions.
[0033] Span, in English, is the basic unit of work. Generally speaking, Span is a request message. Sending a remote scheduling task will generate a Span, such as an RPC request or a database query. Span is uniquely identified by a 64-bit ID, and Trace is uniquely identified by another 64-bit ID. Span also has other data information, such as summary, timestamp event, Span ID, progress ID, key value annotation (label), the ID of the span that caused them, and the process ID (usually an IP address). After creating a span, it must be stopped at some point in the future;
[0034] Redis is an open source log-based, key-value database written in ANSI C, compliant with the BSD protocol, supporting networks, and can be either memory-based or persistent. It also provides APIs in multiple languages.
[0035] Pub / Sub is a messaging model where publishers publish messages and subscribers subscribe to messages. There is no direct connection between publishers and subscribers, and messages are usually delivered through an intermediate message broker.
[0036] The exception handling node is a node that specializes in handling exceptions. It receives exception information, handles exceptions, and obtains the entire link information.
[0037] The embodiment of the present disclosure provides a full-link exception tracking and collection method, which uses centralized storage to store all spans of each transaction, and when an exception occurs, a dedicated exception handling node handles the exception and obtains the entire link information. The method includes: in response to a service call event, generating a service call event and span information of an associated call event generated in the service call event; storing the span information in a preset centralized storage database; in response to an abnormal signal generated in the service call event, obtaining the span information associated with the service call event from the centralized storage database; locating the abnormality based on the span information and the abnormal signal, and determining the service link that generates the abnormal signal.
[0038] Figure 1 The application scenario diagram of the full-link anomaly tracking and collection method and device according to an embodiment of the present disclosure is schematically shown.
[0039] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a software development scenario in the financial field. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0040] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0041] 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.
[0042] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0043] It should be noted that the full-link exception tracking and collection method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the full-link exception tracking and collection device provided in the embodiment of the present disclosure can generally be set in the server 105. The full-link exception tracking and collection method provided in the embodiment 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. Correspondingly, the full-link exception tracking and collection device provided in the embodiment 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.
[0044] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0045] The following will be based on Figure 1 The scene described by Figure 2~Figure 3 The full-link anomaly tracking and collection method of the disclosed embodiment is described in detail.
[0046] Figure 2 The flowchart of the full-link abnormality tracking and collection method according to an embodiment of the present disclosure is schematically shown.
[0047] like Figure 2 As shown, the full-link abnormality tracking and collection of this embodiment includes operations S210 to S240, and the transaction processing method can be executed sequentially.
[0048] In operation S210 , in response to a service call event, a service call event and span information of call events associated with the service call event are generated.
[0049] A service call event can be a method call event for a service in a distributed system. In a service call event, it needs to be executed through the cooperation of multiple parties such as the gateway access layer, service provider, service caller, application internal layered module, database access, message sender, message consumer, and dynamic bytecode enhanced business class. In the case of an exception in the above service call event, based on the span information of the gateway access layer, service provider, service caller, application internal layered module, database access, message sender, message consumer, and dynamic bytecode enhanced business class, the link data of the service scheduling event can be collected, so as to quickly locate the exception when it occurs.
[0050] In the disclosed embodiment, when a service call starts, a new span information is generated to record the call event. The span information may include a summary of the call event, a timestamp event, an ID of the span information, a progress ID, a key value annotation (label), an ID that caused the span, and a process ID (usually an IP address), etc., to facilitate subsequent tracking and identification.
[0051] In operation S220, the span information is stored in a preset centralized storage database.
[0052] In the disclosed embodiment, the centralized storage database may be Redis. Redis is an open source, memory-based, and optionally persistent key-value pair storage database written in ANSI C. It contains multiple data structures, supports networks, is memory-based, and has optional persistence. It runs based on memory, has high performance, supports distribution, and can be infinitely expanded in theory. It is an open source key-value storage system written in ANSI C, complies with the BSD protocol, supports networks, is a log-type, Key-Value database that can be based on memory and can also be persistent, and provides APIs in multiple languages. Redis provides a publish-subscribe function that can be used for message transmission. The span information is stored in Redis. When an exception occurs during the call process, Redis can be used to obtain the exception information and publish the exception in time so that the exception can be quickly captured. The newly created span information will be stored in a centralized storage (such as Redis). A hash table (Hash) or a list (List) can be used to store all the span information of each transaction. The ID of each transaction can be used as a key value, and the corresponding span information set can be used as a storage value.
[0053] In operation S230 , in response to an abnormal signal being generated in the service call event, span information associated with the service call event is acquired from a centralized storage database.
[0054] In an embodiment of the present disclosure, an exception handler can be integrated and deployed in the code of the service call. When an exception signal is generated in a service call event, the exception handler can capture the exception signal and integrate the exception information into the current span information. The span information with the exception signal is stored in a centralized storage database, so when a service call event generates an exception signal, the relevant span information can be obtained from the centralized storage database. Furthermore, in order to obtain comprehensive link information, when an exception occurs, all span information associated with the service call event can be obtained from the centralized storage database, which is convenient for subsequent detailed full-link exception positioning.
[0055] In operation S240 , anomaly location is performed based on the span information and the abnormal signal, and a service link generating the abnormal signal is determined.
[0056] In the disclosed embodiment, based on the span information, not only the transaction information of the abnormal branch can be obtained, but also the transaction information of other branches without abnormalities in the service call event can be obtained, and then the abnormality can be located according to the abnormal signal, and the whole link analysis of the abnormality can be performed.
[0057] The full-link exception tracking and collection method provided by the embodiment of the present disclosure does not rely on the response of the service to determine the exception. It records the information of each call event in the service call through span information and performs centralized management and storage, so that when an exception occurs, the span information associated with the exception event can be processed, and a full-link tracking is formed based on the span information to accurately locate the exception.
[0058] Figure 3 The application flow chart of the full-link abnormality tracking and collection method according to an embodiment of the present disclosure is schematically shown.
[0059] As shown in 3, in the embodiment of the present disclosure, the method involves three parties: a server, a Redis database, and an exception handling node. During the service call process, the specific method for tracking the exception is as follows.
[0060] First, according to operation S210, in response to a service call event, a service call event and span information of associated call events generated in the service call event are generated. Span information is created for each service call event in the call event to ensure that the link information is complete, so as to facilitate full-link positioning of the exception when an exception occurs.
[0061] Specifically, S210 includes S211~S212.
[0062] In operation S211 , in response to an instruction to start a service call event, span information of the service call event is created.
[0063] In operation S212 , during the execution of the service call event, in response to an associated call event formed by calling a branch service in the service call event, when the branch service is called, span information of the associated call event is created.
[0064] For example, in the process of calling service A, function B1 needs to be implemented by calling service B. In the process of implementing function B1, corresponding data needs to be obtained by calling service C. Then, when starting to call service A, service B, and service C, span information is created respectively to record the service name, method name, parameters, etc. used when calling service A, service B, and service C, and form a call summary, timestamp event, span information ID, progress ID, key value annotation, ID of the span that caused them, and process ID, etc. The call time is described and recorded through the span information.
[0065] Then, according to operation S220, the span information is stored in a preset centralized storage database. Among them, the span information of the service call event and the associated call event are associated with the transaction tag of the service call event, and the span information associated with the transaction tag is stored in the centralized storage database. In this way, in a service call event, the span information of all call events occurring in the service call event has the same transaction tag, which is convenient for obtaining all the span information at one time when an exception occurs, obtaining the transaction status of the entire link, and performing an exception analysis of the entire link. Optionally, a hash table (Hash) or a list (List) can be used to store all the span information of each transaction. The transaction tag of each transaction can be its ID value. The transaction tag can be used as a key value, and the corresponding span information set is used as a storage value.
[0066] According to the disclosed embodiment, an exception handler is integrated in the service call code. When an exception occurs during the service call, the exception handler integrated in the service code service corresponding to the service call event captures the exception signal generated in the service call event, and reports the exception signal to the centralized storage database Redis.
[0067] Specifically, the exception handler reports an exception signal to Redis, including: in response to an exception signal generated in a service call event, associating the exception signal with the span information of the service call event or the associated call event that generates the exception signal; reporting the exception signal and the associated span information to a centralized storage database, and publishing the exception signal and the associated span information based on a preset channel of the centralized storage database. By associating the current span information, based on the transaction tag associated with the span information, it can assist in obtaining all service transactions related to the transaction branch corresponding to the span information in subsequent operations, and perform full-link exception location.
[0068] In the disclosed embodiment, the exception handling node subscribes to a specified channel of Redis (e.g., "exceptions"). Before initiating a call event, the exception handling node is started so that the exception handling node subscribes to a preset channel of a centralized storage database. When the exception handler captures an exception signal, the exception handling node can obtain span information associated with the transaction tag of the service call event from the centralized storage database.
[0069] According to operation S230, in response to an exception signal generated in a service call event, the span information associated with the service call event is obtained from a centralized storage database. Specifically, when the exception handler captures the exception signal, it reports the exception to Redis; Redis publishes the exception signal through a preset channel after obtaining the exception signal; when the preset channel of the centralized storage database Redis publishes the exception signal, the exception handling node obtains the exception signal through subscription, and obtains the exception signal and the associated span information from Redis based on the exception handling node; since the span information is associated with the transaction tag of the service call event, based on the transaction tag of the service call event bound to the span information, the exception handling node can obtain all the span information related to the service call event from Redis. After receiving the exception information and span information, the exception handling node will extract all the span information related to the transaction ID from Redis. Then, these span information and exception information will be recorded in the link database.
[0070] According to operation S240, the exception processing node processes the exception, locates the exception based on the span information and the exception signal, and determines the service link that generates the exception signal.
[0071] S240 includes S241~S242.
[0072] In operation S241, a branch service associated with the service call event is acquired based on the span information, and a service call link is formed based on the branch service.
[0073] Each span information corresponds to the calling status of a branch service, and all span information associated with the service calling event records the complete service calling link.
[0074] In operation S242, based on the location of the abnormal signal in the service call link, the service link generating the abnormal signal is determined.
[0075] According to the method provided in the embodiment of the present disclosure, the full-link tracking of the service call that generates the exception is performed based on the span information, so that when positioning is performed according to the abnormal signal, the exception can be located and handled from a macro perspective on the entire link, thereby improving the efficiency of exception handling.
[0076] Finally, when the service call event ends, or after each span information is recorded in the database by the exception handling node, the span information associated with the service call event is deleted from the centralized storage database to prevent data expiration in Redis and prevent data confusion in subsequent database applications.
[0077] According to the full-link exception tracking and collection method provided by the embodiment of the present disclosure, the situations of asynchronous calls and transaction branches can be handled. The method no longer relies on the response of the service, but uses a centralized storage to store all span information, so it can handle the situations of asynchronous calls and transaction branches.
[0078] Based on the above-mentioned full-link abnormality tracking and collection method, the present disclosure also provides a full-link abnormality tracking and collection device. Figure 4 The device is described in detail.
[0079] Figure 4 The structural block diagram of the full-link abnormality tracking and collection device according to an embodiment of the present disclosure is schematically shown.
[0080] like Figure 4 As shown, the full-link anomaly tracking and collection device 400 of this embodiment includes a span generation module 410 , a span storage module 420 , an anomaly acquisition module 430 and an anomaly location module 440 .
[0081] The span generation module 410 is used to generate a service call event and span information of associated call events generated in the service call event in response to a service call event. In one embodiment, the span generation module 410 can be used to perform the operation S210 described above, which will not be described in detail here.
[0082] The span storage module 420 is used to store the span information in a preset centralized storage database. In one embodiment, the span storage module 420 can be used to perform the operation S220 described above, which will not be described in detail here.
[0083] The abnormal acquisition module 430 is used to obtain the span information associated with the service call event from the centralized storage database in response to the abnormal signal generated in the service call event. In one embodiment, the abnormal acquisition module 430 can be used to perform the operation S230 described above, which will not be repeated here.
[0084] The abnormality location module 440 is used to locate the abnormality based on the span information and the abnormal signal, and determine the service link that generates the abnormal signal. In one embodiment, the abnormality location module 440 can be used to perform the operation S240 described above, which will not be repeated here.
[0085] According to an embodiment of the present disclosure, the span generation module 410 includes an initial span creation unit and a call span creation unit.
[0086] The initial span creation unit is used to create span information of the service call event in response to an instruction to start the service call event.
[0087] The call span creation unit is used to create span information of the associated call event in response to the associated call event formed by calling the branch service in the service call event during the execution of the service call event, when the branch service is called.
[0088] The span storage module 420 associates the span information of the service call event and the associated call event with the transaction tag of the service call event, and stores the span information associated with the transaction tag in the centralized storage database. In this way, in a service call event, the span information of all call events occurring in the service call event has the same transaction tag, which facilitates obtaining all the span information at one time when an exception occurs, obtaining the transaction status of the entire link, and performing an exception analysis of the entire link.
[0089] The exception acquisition module 430 includes an exception handler and an exception handling node. After receiving the exception information and span information, the exception handling node will extract all span information related to the transaction ID from Redis. Then, these span information and exception information will be recorded in the link database. The exception handling node subscribes to the specified channel of Redis. When the exception handler captures the exception signal, the exception handling node can obtain the span information associated with the transaction tag of the service call event from the centralized storage database.
[0090] The abnormality locating module 440 includes a link restoration unit and an abnormality processing unit.
[0091] The link restoration unit is used to obtain the branch service associated with the service call event based on the span information, and the service call link formed based on the branch service.
[0092] The exception handling unit is used to locate the service call link based on the exception signal and determine the service link that generates the exception signal.
[0093] According to an embodiment of the present disclosure, any multiple modules of the span generation module 410, the span storage module 420, the anomaly acquisition module 430 and the anomaly location module 440 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the span generation module 410, the span storage module 420, the anomaly acquisition module 430 and the anomaly location module 440 can 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 can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the span generation module 410 , the span storage module 420 , the exception acquisition module 430 , and the exception location module 440 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0094] Figure 5 A block diagram of an electronic device suitable for implementing a full-link anomaly tracking and collection method according to an embodiment of the present disclosure is schematically shown.
[0095] like Figure 5 As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0096] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0097] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.
[0098] 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 without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0099] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include 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 containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0100] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes a 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 full-link abnormality tracking and collection method provided by the embodiment of the present disclosure.
[0101] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0102] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0103] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0104] 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 computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of 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 through the Internet).
[0105] The flow charts and block diagrams in the accompanying drawings illustrate the possible 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 flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order 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 flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0106] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0107] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A full-link abnormality tracking and collection method, characterized in that: The method comprises: In response to a service call event, generating span information of the service call event and associated call events generated in the service call event; Storing the span information in a preset centralized storage database; In response to an abnormal signal generated in the service call event, acquiring span information associated with the service call event from the centralized storage database; Anomaly location is performed based on the span information and the abnormal signal, and a service link generating the abnormal signal is determined.
2. The method according to claim 1, characterized in that The generating of the service call event and the span information of the associated call event generated in response to a service call event includes: In response to an instruction to start the service call event, creating span information of the service call event; During the execution of the service call event, in response to an associated call event formed by calling a branch service in the service call event, when the branch service is called, span information of the associated call event is created.
3. The method according to claim 1, characterized in that The storing the span information in a preset centralized storage database comprises: The span information of the service call event and the associated call event are associated with the transaction tag of the service call event and then stored in the centralized storage database.
4. The method according to claim 3, characterized in that In response to the abnormal signal generated in the service call event, obtaining the span information associated with the service call event from the centralized storage database includes: Capturing the abnormal signal generated in the service call event based on the abnormal processor integrated in the service code corresponding to the service call event; When the exception handler captures the exception signal, the span information associated with the transaction tag of the service call event is obtained from the centralized storage database.
5. The method according to claim 1, characterized in that: Before acquiring the span information associated with the service call event from the centralized storage database, the method further includes: In response to an abnormal signal being generated in the service call event, associating the abnormal signal with span information of the service call event or the associated call event that generates the abnormal signal; The abnormal signal and the associated span information are reported to the centralized storage database, and the abnormal signal and the associated span information are published based on a preset channel of the centralized storage database.
6. The method according to claim 5, characterized in that The method further comprises: Before starting the service call event, starting an exception handling node so that the exception handling node subscribes to a preset channel of the centralized storage database; When the preset channel of the centralized storage database publishes the abnormal signal, the abnormal signal and the associated span information are obtained based on the abnormal processing node, and all span information related to the service call event is obtained based on the transaction tag of the service call event bound to the span information.
7. The method according to claim 1, characterized in that The performing abnormality location based on the span information and the abnormal signal and determining the service link generating the abnormal signal comprises: Acquire a branch service associated with the service call event based on the span information, and form a service call link based on the branch service; Based on the location of the abnormal signal in the service calling link, the service link generating the abnormal signal is determined.
8. The method according to claim 1, characterized in that The method further comprises: When the service call event ends, the span information associated with the service call event is deleted from the centralized storage database.
9. A full-link abnormality tracking and collection device, characterized in that: The device comprises: A span generating module, configured to generate, in response to a service calling event, span information of the service calling event and associated calling events generated in the service calling event; A span storage module, used to store the span information in a preset centralized storage database; An exception acquisition module, configured to acquire span information associated with the service call event from the centralized storage database in response to an exception signal generated in the service call event; The abnormality locating module is used to locate the abnormality based on the span information and the abnormal signal, and determine the service link that generates the abnormal signal.
10. An electronic device comprising: one or more processors; a storage device for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
