CN113051043A - Micro-service anomaly compensation method and device - Google Patents

Micro-service anomaly compensation method and device Download PDF

Info

Publication number
CN113051043A
CN113051043A CN202110260346.5A CN202110260346A CN113051043A CN 113051043 A CN113051043 A CN 113051043A CN 202110260346 A CN202110260346 A CN 202110260346A CN 113051043 A CN113051043 A CN 113051043A
Authority
CN
China
Prior art keywords
abnormal
node
call chain
chain
compensation
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
CN202110260346.5A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110260346.5A priority Critical patent/CN113051043A/en
Publication of CN113051043A publication Critical patent/CN113051043A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The application discloses a micro-service abnormity compensation method and device, and relates to the technical field of micro-services. One embodiment of the method comprises: responding to the received abnormal service alarm information, performing distributed link tracking according to the abnormal service identifier to acquire an abnormal call chain, wherein the abnormal event alarm information comprises: an abnormal service identifier; acquiring context parameters corresponding to the abnormal call chain; based on the context parameters and the chain of exception calls, a compensation operation is performed on each node in the chain of exception calls prior to the exception node. The implementation method effectively guarantees the consistency of the distributed data and improves the performance of service execution.

Description

Micro-service anomaly compensation method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of micro service technologies, and in particular, to a micro service anomaly compensation method and apparatus.
Background
In the prior art, a scheme for maintaining distributed data consistency when a system is abnormal is generally implemented by distributed transactions.
The distributed transaction means that a participant of the transaction, a server, a resource server and a transaction manager are respectively located on different nodes of different distributed systems. Distributed transactions often require database locking to ensure data consistency, which severely affects the performance of service execution.
Disclosure of Invention
The embodiment of the application provides a micro-service abnormity compensation method, a device, equipment and a storage medium.
According to a first aspect, an embodiment of the present application provides a micro-service anomaly compensation method, including: responding to the received abnormal service alarm information, performing distributed link tracking according to the abnormal service identifier to acquire an abnormal call chain, wherein the abnormal event alarm information comprises: an abnormal service identifier; acquiring context parameters corresponding to the abnormal call chain; and performing compensation operation on each node in the abnormal calling chain before the abnormal node based on the context parameters and the abnormal calling chain.
In some embodiments, based on the context parameters and the chain of exception calls, performing a compensation operation on nodes preceding the exception node in the chain of exception calls, comprises: converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relation of each node in the abnormal call chain; and according to the context parameters and the tree-shaped flow chart, performing compensation operation on each node in the abnormal call chain before the abnormal node.
In some embodiments, converting the chain of abnormal calls into a tree-shaped flow chart based on the parent-child call relationship of each node in the chain of abnormal calls includes: and converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relationship of each node in the abnormal call chain and the execution sequence relationship of the brother nodes.
In some embodiments, performing a compensation operation on nodes in the exception call chain prior to the exception node comprises: and executing compensation operation on each node before the abnormal node in the abnormal call chain according to a subsequent traversal method.
In some embodiments, the method further comprises: and outputting indication information requesting manual processing in response to the situation that the execution of the compensation operation on each node before the abnormal node in the abnormal call chain fails and the retry number is greater than or equal to a preset retry number threshold.
According to a second aspect, an embodiment of the present application provides a micro-service anomaly compensation apparatus, including: a tracing module configured to, in response to receiving the abnormal service alarm information, perform distributed link tracing according to the abnormal service identifier to obtain an abnormal call chain, where the abnormal event alarm information includes: an abnormal service identifier; the obtaining module is configured to obtain context parameters corresponding to the abnormal call chain; a compensation module configured to perform a compensation operation on each node preceding an abnormal node in an abnormal call chain based on a context parameter and the abnormal call chain.
In some embodiments, the compensation module further comprises: the conversion unit is configured to convert the abnormal call chain into the tree-shaped flow chart based on the parent-child call relation of each node in the abnormal call chain; and the execution unit is configured to execute compensation operation on each node before the abnormal node in the abnormal call chain according to the context parameters and the tree-shaped flow chart.
In some embodiments, the conversion unit is further configured to: and converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relationship of each node in the abnormal call chain and the execution sequence relationship of the brother nodes.
In some embodiments, the compensation module is further configured to: and executing compensation operation on each node before the abnormal node in the abnormal call chain according to a subsequent traversal method.
In some embodiments, the apparatus further comprises: and the retry module is configured to respond to the failure of executing the compensation operation on each node before the abnormal node in the abnormal call chain, and the retry number is greater than or equal to a preset retry number threshold value, and output indication information requesting manual processing.
According to a third aspect, embodiments of the present application provide an electronic device, which includes one or more processors; a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement the microservice anomaly compensation method of any embodiment of the first aspect.
According to a fourth aspect, embodiments of the present application provide a computer-readable medium, on which a computer program is stored, which when executed by a processor implements the microservice anomaly compensation method according to any one of the embodiments of the first aspect.
The method and the device perform distributed link tracking according to the abnormal service identifier to acquire the abnormal call chain by responding to the received abnormal service alarm information, wherein the abnormal event alarm information comprises the following steps: an abnormal service identifier; acquiring context parameters corresponding to the abnormal call chain; based on the context parameters and the abnormal calling chain, compensation operation is performed on each node in the abnormal calling chain before the abnormal node, namely step occupation of the database is realized, long-term occupation of data in distributed transactions is avoided, and the performance of service execution is improved while the consistency of distributed data is guaranteed.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a microservice anomaly compensation method according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a microservice anomaly compensation method according to the present application;
FIG. 4 is a flow diagram of another embodiment of a microservice anomaly compensation method according to the present application;
FIG. 5 is a flow chart of yet another embodiment of a microservice anomaly compensation method according to the present application;
FIG. 6 is a schematic diagram of one embodiment of a microservice anomaly compensation apparatus according to the present application;
FIG. 7 is a block diagram of a computer system suitable for use in implementing a server according to embodiments of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the microservice anomaly compensation method of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. Various communication client applications, such as communication-type applications, may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen, including but not limited to a mobile phone and a notebook computer. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple software or software modules (e.g., to provide microservice anomaly compensation services) or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, for example, in response to receiving the abnormal service warning information, performing distributed link tracking according to the abnormal service identifier to obtain an abnormal call chain; acquiring context parameters corresponding to the abnormal call chain; and performing compensation operation on each node in the abnormal calling chain before the abnormal node based on the context parameters and the abnormal calling chain.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (for example, to provide the micro-service anomaly compensation service), or may be implemented as a single software or software module. And is not particularly limited herein.
It should be noted that the micro-service anomaly compensation method provided by the embodiment of the present disclosure may be executed by the server 105, or may be executed by the terminal devices 101, 102, and 103, or may be executed by the server 105 and the terminal devices 101, 102, and 103 in cooperation with each other. Accordingly, each part (for example, each unit, sub-unit, module, sub-module) included in the micro-service abnormality compensation apparatus may be entirely provided in the server 105, may be entirely provided in the terminal devices 101, 102, and 103, and may be provided in the server 105 and the terminal devices 101, 102, and 103, respectively.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 shows a flow diagram 200 of an embodiment of a microservice anomaly compensation method that can be applied to the present application. In this embodiment, the micro-service anomaly compensation method includes the following steps:
step 201, in response to receiving the abnormal service alarm information, performing distributed link tracking according to the abnormal service identifier to obtain an abnormal call chain.
In this embodiment, the execution main body (for example, the server 105 or the terminal devices 101, 102, 103 shown in fig. 1) may monitor the calling condition of each service through the abnormal service monitoring and warning system, analyze the abnormal service warning information to obtain an abnormal service identifier in response to receiving the abnormal service warning information, further determine an abnormal calling link identifier to which the abnormal service belongs according to the abnormal service identifier, and further perform distributed link tracking according to the abnormal calling link identifier and the link tracking system to obtain the abnormal calling chain.
The services described above are typically used to indicate microservices, indicating many loosely coupled and independently deployable smaller components or services that are broken down by a single application.
Here, the distributed link tracing refers to restoring a distributed request to a call link, and collectively displaying the call condition of the distributed request. The calling situation may include time consumption on each service node, specific arrival of the request on which machine, request status of each service node, and the like.
The link tracking system may be any tracking system known in the art or developed in the future, such as a Zipkin system, a Jaeger system, a Dapper system, etc., and is not limited in this application.
The Dapper system provides the concepts of trace and span, wherein the trace is used for indicating a calling link and a path for requesting all services passing through a back end, and each link is identified by a globally unique trace id. The span is used for indicating a basic working unit of the tracking service and represents a cross-service call, and comprises information such as a summary, a timestamp event, a key value annotation, and a span. Each span has a parent span id and its own span id, the span without the parent span id is a root span, the parent span id of the current span is the span id of the calling link upstream, and all the spans are associated to a specific trace and share the trace id of the trace.
Step 202, obtaining context parameters corresponding to the abnormal call chain.
In this embodiment, after the execution main body obtains the abnormal call chain, the execution main body may further obtain a context parameter corresponding to the abnormal call chain in a service log corresponding to the abnormal call chain.
Step 203, based on the context parameter and the abnormal call chain, performing a compensation operation on each node before the abnormal node in the abnormal call chain.
In this embodiment, the execution main body may directly execute the compensation operation on the node before the abnormal node corresponding to the abnormal service in the abnormal call chain according to the context parameter and the abnormal call chain, that is, perform data recovery, or may convert the abnormal call chain into the tree-shaped flowchart at first, and further perform data recovery on each node before the abnormal node in the abnormal call chain according to the tree-shaped flowchart and the context parameter, which is not limited in this application.
In the process of directly performing data recovery on each node before the abnormal node in the abnormal call chain according to the context parameter and the abnormal call chain, because the call chain is complicated, the execution main body needs to synchronously acquire information of a father node, a brother node and the like of each node in the call chain according to the corresponding service log so as to perform data recovery.
In addition, the execution main body may perform data recovery on each node before the abnormal node according to the context parameter in a subsequent traversal manner, that is, sequentially perform data recovery according to a reverse order of a calling order of each node in the abnormal calling chain, perform data recovery preferentially according to a reuse degree of each node, perform data recovery concurrently by multiple nodes, and the like, which is not limited in the present application.
It should be noted that the execution subject may perform data recovery on each node before the abnormal node according to a preset compensation logic, that is, a data recovery logic. Here, the preset compensation logic may restore the state of the data of each node to guarantee the consistency of the data for performing a compensation service or transmitting a compensation message.
The compensation logic is separated from the execution logic of the service, and is realized by the developer according to the preset design of the service.
Further, in the process of performing data recovery on a node before the abnormal node in the abnormal call chain, if data recovery of a certain node fails, the execution subject may attempt to perform data recovery again on the node.
It should be noted that, the execution subject may determine the exception type of the exception node before performing the compensation operation on each node before the exception node in the exception call chain. Here, the exception type is mainly used to determine whether a compensation operation needs to be performed on the current exception node.
Specifically, the exception type may include a first type and a second type, and if the exception type of the exception node is the first type, a compensation operation is performed on the exception node; and if the abnormal type of the abnormal node is the second type, not executing compensation operation on the abnormal node.
In some optional ways, the method further comprises: and outputting indication information requesting manual processing in response to the situation that the execution of the compensation operation on each node before the abnormal node in the abnormal call chain fails and the retry number is greater than or equal to a preset retry number threshold.
In this implementation, in the process of performing data recovery on each node before the abnormal node in the abnormal call chain, if the compensation operation performed on a certain node fails, that is, if the data recovery fails, retry may be performed, and if the retry number is greater than or equal to the preset retry number threshold, retry is not performed, and instruction information requesting manual processing is output.
The retry threshold may be determined according to experience, actual requirements, and specific application scenarios, for example, 3 times, 5 times, and the like, which is not limited in this application.
According to the implementation mode, the compensation operation failure is executed on each node in the abnormal call chain before the abnormal node, the retry times are larger than or equal to the preset retry time threshold, and the instruction information of requesting manual processing is output, so that the problems that the data recovery cannot be completed due to the failure of one-time compensation operation and the system pressure is increased due to a large number of retry operations can be effectively solved, the effectiveness of abnormal compensation is effectively improved, and the consistency of distributed data is better guaranteed.
In some optional modes, the compensation operation is performed on each node before the abnormal node in the abnormal call chain, and the compensation operation comprises the following steps: and executing compensation operation on each node before the abnormal node in the abnormal call chain according to a subsequent traversal method.
In this implementation, the execution subject may perform the compensation operation on the nodes before the abnormal node in the abnormal call chain according to a subsequent traversal method, that is, sequentially perform data recovery on the nodes before the abnormal node according to a reverse order of the call order of the nodes in the abnormal call chain.
The implementation mode can effectively guarantee the reliability of executing the compensation operation on the nodes before the abnormal node in the abnormal call chain, and further is more beneficial to guaranteeing the consistency of the distributed data.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the micro-service anomaly compensation method according to the present embodiment.
In the application scenario of fig. 3, the calling relationship between the micro services corresponding to one distributed request is micro service 301-micro service 302-micro service 303, the execution main body 304, in response to receiving the abnormal service alarm information, parses the abnormal service alarm information to obtain an abnormal service identifier, for example, micro service 303, further determines an abnormal calling link identifier to which the abnormal service belongs according to the abnormal service identifier, and further performs distributed link tracking according to the abnormal calling link identifier and the link tracking system to obtain an abnormal calling chain 305. Further, the execution subject obtains context parameters 306 corresponding to the abnormal call chain, and performs compensation operation 307 on each node before the abnormal node in the abnormal call chain according to the context parameters and the abnormal call chain, that is, performs data recovery on distributed data corresponding to the micro service 301 and the micro service 302 in sequence.
The micro-service abnormity compensation method disclosed by the invention has the advantages that by responding to the received abnormity service alarm information, the distributed link tracking is carried out according to the abnormity service identifier to obtain an abnormity call chain, and the abnormity event alarm information comprises the following steps: an abnormal service identifier; acquiring context parameters corresponding to the abnormal call chain; and executing compensation operation on each node in the abnormal call chain before the abnormal node based on the context parameter and the abnormal call chain, thereby improving the performance of service execution while effectively ensuring the consistency of distributed data.
With further reference to fig. 4, a flow 400 of yet another embodiment of a microservice anomaly compensation method is illustrated. The process 400 of the micro-service anomaly compensation method of the present embodiment may include the following steps:
step 401, in response to receiving the abnormal service alarm information, performing distributed link tracking according to the abnormal service identifier to obtain an abnormal call chain.
In this embodiment, details of implementation and technical effects of step 401 may refer to the description of step 201, and are not described herein again.
Step 402, obtaining context parameters corresponding to the abnormal call chain.
In this embodiment, reference may be made to the description of step 202 for details of implementation and technical effects of step 402, which are not described herein again.
Step 403, converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relation of each node in the abnormal call chain.
In this embodiment, the execution subject may convert the abnormal call chain into the tree-shaped flowchart in advance according to the parent-child call relationship of each node in the service log corresponding to the abnormal call chain.
The execution sequence relation of the brother nodes in the abnormal call chain is not required in the transfer process, namely, only the brother nodes in the abnormal call chain are required to be ensured to correspond to the branches of the same level in the tree-shaped flow chart.
In some optional manners, converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relationship of each node in the abnormal call chain, including: and converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relationship of each node in the abnormal call chain and the execution sequence relationship of the brother nodes.
In this implementation manner, the execution subject may convert the exception call chain into the tree-shaped flowchart in advance according to the parent-child call relationship and the execution sequence relationship of the sibling node of each node in the service log corresponding to the exception call chain. Further based on the context parameters and the tree-shaped flow chart, compensation operation is executed on each node in the abnormal call chain before the abnormal node
Specifically, the tree flow diagram is shown in fig. 5, where node a501 is a parent node of node B502, node B502 is a parent node of node C503, node C503 is a parent node of node D504 and node F505, node D504 is a parent node of node E506, node F505 is a parent node of node G507, and nodes D504 and E506 are siblings with node F505 and node G507. The calling order of the sibling nodes is from right to left, i.e. the calling order of node D504 and node E506 precedes that of node F505 and node G507.
The order in which the execution subject performs the compensation operation on the nodes before the abnormal node (e.g., node G507) in the abnormal call chain based on the context parameters and the tree flow diagram (as shown in fig. 5) may be the reverse order of the call order indicated by the tree flow diagram, i.e., node F505-node E506-node D504-node C503-node B502-node a 501.
And step 404, based on the context parameters and the tree-shaped flow chart, performing compensation operation on nodes before the abnormal node in the abnormal call chain.
In this embodiment, the execution main body may execute, according to the context parameter, a compensation operation on each node before the abnormal node in the abnormal call chain, that is, perform data recovery, in a reverse order of the call order of each node indicated by the tree-shaped flowchart.
Compared with the embodiment corresponding to fig. 2, in the above embodiment of the present application, the flow 400 of the microservice anomaly compensation method in the present embodiment embodies that the exception call chain is converted into a tree-shaped flow chart based on the parent-child call relationship of each node in the exception call chain; according to the context parameters and the tree-shaped flow chart, compensation operation is performed on each node in the abnormal call chain before the abnormal node, the abnormal call chain is clearly and definitely represented, the execution main body can directly perform compensation operation on each node in the abnormal call chain before the abnormal node according to the tree-shaped flow chart, and the efficiency of abnormal compensation is improved.
With further reference to fig. 6, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of a microservice anomaly compensation apparatus, which corresponds to the method embodiment shown in fig. 1, and which can be applied to various electronic devices.
As shown in fig. 6, the microservice abnormality compensation apparatus 600 of the present embodiment includes: a tracking module 601, an acquisition module 602, and a compensation module 603.
Wherein, the tracking module 601 may be configured to, in response to receiving the abnormal service alarm information, perform distributed link tracking according to the abnormal service identifier to obtain the abnormal call chain.
The obtaining module 602 may be configured to obtain a context parameter corresponding to the abnormal call chain.
The compensation module 603 may be configured to perform a compensation operation on each node preceding the abnormal node in the abnormal call chain based on the context parameter and the abnormal call chain.
In some optional manners of this embodiment, the compensation module further includes: the conversion unit is configured to convert the abnormal call chain into the tree-shaped flow chart based on the parent-child call relation of each node in the abnormal call chain; and the execution unit is configured to execute compensation operation on each node before the abnormal node in the abnormal call chain according to the context parameters and the tree-shaped flow chart.
In some alternatives of this embodiment, the conversion unit is further configured to: and converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relationship of each node in the abnormal call chain and the execution sequence relationship of the brother nodes.
In some alternatives of this embodiment, the compensation module is further configured to: and executing compensation operation on each node before the abnormal node in the abnormal call chain according to a subsequent traversal method.
In some optional manners of this embodiment, the apparatus further includes: and the retry module is configured to respond to the failure of executing the compensation operation on each node before the abnormal node in the abnormal call chain, and the retry number is greater than or equal to a preset retry number threshold value, and output indication information requesting manual processing.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
700 is a block diagram of an electronic device for a microservice anomaly compensation method according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 7, the electronic apparatus includes: one or more processors 701, a memory 702, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 7, one processor 701 is taken as an example.
The memory 702 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the micro-service anomaly compensation method provided by the application. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to perform the microservice anomaly compensation method provided by the present application.
The memory 702, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules (e.g., the tracking module 601, the obtaining module 602, and the compensation module 603 shown in fig. 6) corresponding to the micro-service anomaly compensation method in the embodiments of the present application. The processor 701 executes various functional applications of the server and data processing by running non-transitory software programs, instructions, and modules stored in the memory 702, that is, implements the micro-service anomaly compensation method in the above-described method embodiment.
The memory 702 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of the electronic device for microservice anomaly compensation, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 702 may optionally include memory located remotely from processor 701, which may be connected to microservice anomaly compensated electronics over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the microservice anomaly compensation method may further include: an input device 703 and an output device 704. The processor 701, the memory 702, the input device 703 and the output device 704 may be connected by a bus or other means, and fig. 7 illustrates an example of a connection by a bus.
The input device 703 may receive input numeric or character information, such as a touch screen, keypad, mouse, track pad, touch pad, pointer, one or more mouse buttons, track ball, joystick, or other input device. The output devices 704 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, the consistency of the distributed data is effectively guaranteed, and meanwhile the performance of service execution is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A microservice anomaly compensation method, the method comprising:
responding to the received abnormal service alarm information, performing distributed link tracking according to the abnormal service identifier to acquire an abnormal call chain, wherein the abnormal event alarm information comprises: an abnormal service identifier;
acquiring context parameters corresponding to the abnormal call chain;
based on the context parameters and the exception call chain, performing a compensation operation on each node in the exception call chain before the exception node.
2. The method of claim 1, wherein said performing a compensation operation on each node in the chain of abnormal calls prior to an abnormal node based on the context parameter and the chain of abnormal calls comprises:
converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relation of each node in the abnormal call chain;
and executing compensation operation on each node in the abnormal call chain before the abnormal node according to the context parameters and the tree-shaped flow chart.
3. The method of claim 1, wherein the converting the chain of abnormal calls into a tree-shaped flow chart based on the parent-child call relationship of each node in the chain of abnormal calls comprises:
and converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relationship of each node in the abnormal call chain and the execution sequence relationship of the brother nodes.
4. The method of any of claims 1-3, wherein said performing a compensation operation on each node in the chain of exceptional calls prior to the exceptional node comprises:
and executing compensation operation on each node before the abnormal node in the abnormal call chain according to a subsequent traversal method.
5. The method according to any one of claims 1-3, further comprising:
and outputting indication information requesting manual processing in response to that the execution of the compensation operation on each node before the abnormal node in the abnormal call chain fails and the retry number is greater than or equal to a preset retry number threshold.
6. A microservice anomaly compensation apparatus, the apparatus comprising:
a tracing module configured to, in response to receiving the abnormal service alarm information, perform distributed link tracing according to the abnormal service identifier to obtain an abnormal call chain, where the abnormal event alarm information includes: an abnormal service identifier;
an obtaining module configured to obtain a context parameter corresponding to the abnormal call chain;
a compensation module configured to perform a compensation operation on nodes preceding an abnormal node in the abnormal call chain based on the context parameter and the abnormal call chain.
7. The apparatus of claim 6, wherein the compensation module further comprises:
the conversion unit is configured to convert the abnormal call chain into a tree-shaped flow chart based on the parent-child call relation of each node in the abnormal call chain;
and the execution unit is configured to execute compensation operation on each node before the abnormal node in the abnormal call chain according to the context parameter and the tree-shaped flow chart.
8. The apparatus of claim 7, wherein the conversion unit is further configured to:
and converting the abnormal call chain into a tree-shaped flow chart based on the parent-child call relationship of each node in the abnormal call chain and the execution sequence relationship of the brother nodes.
9. The apparatus of any of claims 6-8, wherein the compensation module is further configured to:
and executing compensation operation on each node before the abnormal node in the abnormal call chain according to a subsequent traversal method.
10. The apparatus of any of claims 6-8, further comprising:
and the retry module is configured to respond to the failure of executing the compensation operation on each node before the abnormal node in the abnormal call chain, and the retry number is greater than or equal to a preset retry number threshold value, and output indication information requesting manual processing.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory is stored with instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202110260346.5A 2021-03-10 2021-03-10 Micro-service anomaly compensation method and device Pending CN113051043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110260346.5A CN113051043A (en) 2021-03-10 2021-03-10 Micro-service anomaly compensation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110260346.5A CN113051043A (en) 2021-03-10 2021-03-10 Micro-service anomaly compensation method and device

Publications (1)

Publication Number Publication Date
CN113051043A true CN113051043A (en) 2021-06-29

Family

ID=76510944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110260346.5A Pending CN113051043A (en) 2021-03-10 2021-03-10 Micro-service anomaly compensation method and device

Country Status (1)

Country Link
CN (1) CN113051043A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113486033A (en) * 2021-07-02 2021-10-08 中国建设银行股份有限公司 Method, apparatus, device and computer readable medium for controlling transaction consistency
CN114024901A (en) * 2022-01-05 2022-02-08 中邮消费金融有限公司 Message isolation forwarding method and system
CN114844957A (en) * 2022-04-27 2022-08-02 工银科技有限公司 Link message conversion method, device, equipment, storage medium and program product
CN115509770A (en) * 2022-09-22 2022-12-23 北京车欢欢信息技术有限公司 Micro-service calling method and device, electronic equipment and readable storage medium
CN117370064A (en) * 2023-10-31 2024-01-09 河北东软软件有限公司 Micro-service system based on container technology

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140215443A1 (en) * 2013-01-28 2014-07-31 Rackspace Us, Inc. Methods and Systems of Distributed Tracing
CN105224445A (en) * 2015-10-28 2016-01-06 北京汇商融通信息技术有限公司 Distributed tracking system
CN106487596A (en) * 2016-10-26 2017-03-08 宜人恒业科技发展(北京)有限公司 Distributed Services follow the tracks of implementation method
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system
CN107135276A (en) * 2017-06-28 2017-09-05 北京中电普华信息技术有限公司 A kind of full link monitoring methods, devices and systems under micro services framework
CN107306196A (en) * 2016-04-20 2017-10-31 中兴通讯股份有限公司 Virtualization services monitoring method and device
CN107766205A (en) * 2017-10-10 2018-03-06 武汉大学 A kind of monitoring system and method towards the tracking of micro services invoked procedure
CN107870845A (en) * 2017-10-19 2018-04-03 北京工业大数据创新中心有限公司 Towards the management method and system of micro services framework applications
CN108304271A (en) * 2018-01-16 2018-07-20 深圳市康拓普信息技术有限公司 A kind of distributed transaction management device under micro services framework and management method
CN108900640A (en) * 2018-08-13 2018-11-27 平安普惠企业管理有限公司 Node calls link generation method, device, computer equipment and storage medium
US20190089809A1 (en) * 2017-09-15 2019-03-21 Oracle International Corporation Dynamic message queues for a microservice based cloud service
CN109542639A (en) * 2018-11-06 2019-03-29 用友网络科技股份有限公司 A kind of processing method, processing unit for ensureing micro services and calling data consistency
CN109739550A (en) * 2018-12-28 2019-05-10 四川新网银行股份有限公司 A kind of micro services traffic scheduling engine based under Internet advertising distribution
CN109873717A (en) * 2019-01-18 2019-06-11 深圳壹账通智能科技有限公司 Monitoring method, device, computer equipment and storage medium
CN112328406A (en) * 2020-10-10 2021-02-05 南方电网深圳数字电网研究院有限公司 Micro-service distributed transaction system based on TCC (transmission control center) and service processing method
CN112417042A (en) * 2020-11-19 2021-02-26 中国建设银行股份有限公司 Method and device for processing service request

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140215443A1 (en) * 2013-01-28 2014-07-31 Rackspace Us, Inc. Methods and Systems of Distributed Tracing
CN105224445A (en) * 2015-10-28 2016-01-06 北京汇商融通信息技术有限公司 Distributed tracking system
CN107306196A (en) * 2016-04-20 2017-10-31 中兴通讯股份有限公司 Virtualization services monitoring method and device
CN106487596A (en) * 2016-10-26 2017-03-08 宜人恒业科技发展(北京)有限公司 Distributed Services follow the tracks of implementation method
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system
CN107135276A (en) * 2017-06-28 2017-09-05 北京中电普华信息技术有限公司 A kind of full link monitoring methods, devices and systems under micro services framework
US20190089809A1 (en) * 2017-09-15 2019-03-21 Oracle International Corporation Dynamic message queues for a microservice based cloud service
CN107766205A (en) * 2017-10-10 2018-03-06 武汉大学 A kind of monitoring system and method towards the tracking of micro services invoked procedure
CN107870845A (en) * 2017-10-19 2018-04-03 北京工业大数据创新中心有限公司 Towards the management method and system of micro services framework applications
CN108304271A (en) * 2018-01-16 2018-07-20 深圳市康拓普信息技术有限公司 A kind of distributed transaction management device under micro services framework and management method
CN108900640A (en) * 2018-08-13 2018-11-27 平安普惠企业管理有限公司 Node calls link generation method, device, computer equipment and storage medium
CN109542639A (en) * 2018-11-06 2019-03-29 用友网络科技股份有限公司 A kind of processing method, processing unit for ensureing micro services and calling data consistency
CN109739550A (en) * 2018-12-28 2019-05-10 四川新网银行股份有限公司 A kind of micro services traffic scheduling engine based under Internet advertising distribution
CN109873717A (en) * 2019-01-18 2019-06-11 深圳壹账通智能科技有限公司 Monitoring method, device, computer equipment and storage medium
CN112328406A (en) * 2020-10-10 2021-02-05 南方电网深圳数字电网研究院有限公司 Micro-service distributed transaction system based on TCC (transmission control center) and service processing method
CN112417042A (en) * 2020-11-19 2021-02-26 中国建设银行股份有限公司 Method and device for processing service request

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113486033A (en) * 2021-07-02 2021-10-08 中国建设银行股份有限公司 Method, apparatus, device and computer readable medium for controlling transaction consistency
CN114024901A (en) * 2022-01-05 2022-02-08 中邮消费金融有限公司 Message isolation forwarding method and system
CN114024901B (en) * 2022-01-05 2022-04-19 中邮消费金融有限公司 Message isolation forwarding method and system
CN114844957A (en) * 2022-04-27 2022-08-02 工银科技有限公司 Link message conversion method, device, equipment, storage medium and program product
CN114844957B (en) * 2022-04-27 2024-03-08 工银科技有限公司 Link message conversion method, device, equipment, storage medium and program product
CN115509770A (en) * 2022-09-22 2022-12-23 北京车欢欢信息技术有限公司 Micro-service calling method and device, electronic equipment and readable storage medium
CN115509770B (en) * 2022-09-22 2023-12-05 北京车欢欢信息技术有限公司 Micro-service calling method and device, electronic equipment and readable storage medium
CN117370064A (en) * 2023-10-31 2024-01-09 河北东软软件有限公司 Micro-service system based on container technology

Similar Documents

Publication Publication Date Title
CN113051043A (en) Micro-service anomaly compensation method and device
CN111831420B (en) Method for task scheduling, related device and computer program product
CN109145023B (en) Method and apparatus for processing data
CN109245908B (en) Method and device for switching master cluster and slave cluster
JP7289334B2 (en) Methods and apparatus, electronic devices, storage media and computer programs for testing code
CN112527748B (en) Method, device, equipment and storage medium for analyzing user operation behavior
US10185644B2 (en) Service implementation based debugger for service oriented architecture projects
CN110806931B (en) Method and device for realizing call link tracking of distributed service and electronic equipment
CN112491617B (en) Link tracking method, device, electronic equipment and medium
CN111813623B (en) Page monitoring method and device, electronic equipment and storage medium
CN112506854A (en) Method, device, equipment and medium for storing page template file and generating page
KR102451678B1 (en) Method and apparatus for data processing based on smart contract, device and storage medium
CN111782341B (en) Method and device for managing clusters
CN112860356A (en) API call control method and device, electronic equipment and storage medium
CN111782357A (en) Label control method and device, electronic equipment and readable storage medium
CN111832070A (en) Data mask method and device, electronic equipment and storage medium
CN111694686B (en) Processing method and device for abnormal service, electronic equipment and storage medium
CN111581049B (en) Distributed system running state monitoring method, device, equipment and storage medium
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN114661274A (en) Method and device for generating intelligent contract
CN111597026B (en) Method and device for acquiring information
CN114417070A (en) Method, device and equipment for converging data authority and storage medium
CN111930748B (en) Method, device, equipment and storage medium for tracking data of streaming computing system
EP3828721A2 (en) Method and apparatus for converting undirected relationship to directed relationship, device, storage medium, and computer program product
CN111258954B (en) Data migration method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination