CN118264719A - Service management method and device, intelligent equipment, storage medium and program product - Google Patents
Service management method and device, intelligent equipment, storage medium and program product Download PDFInfo
- Publication number
- CN118264719A CN118264719A CN202211690178.4A CN202211690178A CN118264719A CN 118264719 A CN118264719 A CN 118264719A CN 202211690178 A CN202211690178 A CN 202211690178A CN 118264719 A CN118264719 A CN 118264719A
- Authority
- CN
- China
- Prior art keywords
- service
- governance
- interceptor
- information
- target
- 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
Links
- 238000003860 storage Methods 0.000 title claims abstract description 37
- 238000007726 management method Methods 0.000 title abstract description 169
- 238000011282 treatment Methods 0.000 claims abstract description 106
- 238000000034 method Methods 0.000 claims abstract description 95
- 238000012545 processing Methods 0.000 claims description 147
- 230000004044 response Effects 0.000 claims description 65
- 230000000670 limiting effect Effects 0.000 claims description 47
- 230000008569 process Effects 0.000 claims description 40
- 238000005067 remediation Methods 0.000 claims description 30
- 230000005540 biological transmission Effects 0.000 claims description 23
- 238000004891 communication Methods 0.000 claims description 16
- 230000003993 interaction Effects 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 12
- 230000000977 initiatory effect Effects 0.000 claims description 12
- 230000001105 regulatory effect Effects 0.000 claims description 12
- 238000011423 initialization method Methods 0.000 claims description 10
- 230000003068 static effect Effects 0.000 claims description 10
- 238000003780 insertion Methods 0.000 claims description 9
- 230000037431 insertion Effects 0.000 claims description 9
- 230000002159 abnormal effect Effects 0.000 claims description 7
- 238000011144 upstream manufacturing Methods 0.000 claims description 7
- 238000004806 packaging method and process Methods 0.000 claims description 4
- 230000006870 function Effects 0.000 description 20
- 230000018109 developmental process Effects 0.000 description 16
- 238000010586 diagram Methods 0.000 description 16
- 238000005516 engineering process Methods 0.000 description 15
- 238000011161 development Methods 0.000 description 14
- 230000015654 memory Effects 0.000 description 13
- 230000001960 triggered effect Effects 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 5
- 229940004975 interceptor Drugs 0.000 description 5
- 238000013507 mapping Methods 0.000 description 5
- 238000003032 molecular docking Methods 0.000 description 5
- 238000007781 pre-processing Methods 0.000 description 5
- 238000002203 pretreatment Methods 0.000 description 5
- 230000000903 blocking effect Effects 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 230000008676 import Effects 0.000 description 3
- 238000012805 post-processing Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 241000234282 Allium Species 0.000 description 1
- 235000002732 Allium cepa var. cepa Nutrition 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000006378 damage Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000009545 invasion Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007639 printing Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The application discloses a service management method, a device, intelligent equipment, a storage medium and a program product, wherein the method comprises the following steps: determining a treatment interceptor set from the interceptor set, wherein each treatment interceptor included in the treatment interceptor set is used for intercepting a target application at a service end according to an interception rule; loading a service governance plug-in indicated by a service governance plug-in identifier of the plug-in configuration file; if an interception trigger event aiming at a target service in a business end is detected, for example, a client generates a service message such as a call request, a treatment interceptor is called to intercept the target service, service treatment information is transmitted between a loaded service treatment plug-in and a service treatment system corresponding to each treatment interceptor, and related treatments such as load balancing, scheduling, authentication and the like of nodes in a network can be completed based on the service treatment information. The application can conveniently realize the service treatment function through the combination of the interceptor and the service treatment plug-in.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service management method and apparatus, and an intelligent device, a storage medium, and a program product.
Background
Currently, service management systems are various, such as a service quality information reporting system, a service call chain analysis system and the like, and a name service routing system and the like. The service management provided by the service management system can better manage various services of the target application in the business end through a series of logic processes, ensure that related services such as a remote procedure call system and the like can run correctly and stably, and provide various required services for users. With the increasing number of services that make up the product support, the relationship between services is becoming more complex, and how to access services to these service governance systems for effective service governance becomes a challenge. Service management has application in the fields of medical treatment, finance, government affairs, games, education, security, games, even traffic, internet of things and the like.
Regarding the scheme of service governance system access, the access problem of service governance can be solved through a service grid. The service grid is a service infrastructure where traffic between services is controlled by the service grid, and thus interfacing of the service remediation system is uniformly taken over by the service grid. Taking name service routing as an example, the service infrastructure intercepts the traffic from the source service to the target service, queries the ip node corresponding to the target service, forwards the traffic to the corresponding target service node according to the routing policy, waits for a response, and forwards the result to the source service.
The solution of the service grid requires that reliable network infrastructure must be deployed first, and the services in the application cannot run on platforms that do not contain these network infrastructure on the service grid, and deployment of the maintenance infrastructure also introduces a certain cost overhead.
Disclosure of Invention
The embodiment of the application provides a service treatment method and device, intelligent equipment, a storage medium and a program product, which can conveniently realize service treatment.
In one aspect, the present application provides a service governance method, including:
Determining a treatment interceptor set from the interceptor set, wherein the treatment interceptor set comprises one or more treatment interceptors, and each treatment interceptor is used for intercepting a target application at a service end according to an interception rule;
Acquiring service governance plugin identifiers from the plugin configuration file, and loading the service governance plugins indicated by the service governance plugin identifiers;
If an interception trigger event aiming at a target service in a business end is detected, calling a treatment interceptor in a treatment interceptor set to intercept the target service, and transmitting service treatment information between a loaded service treatment plug-in and a service treatment system corresponding to each treatment interceptor;
The service management information is generated according to the information acquired by the interception processing, and each service management system carries out service management on the target service through the corresponding service management information.
In another aspect, the present application provides a service administration device comprising: the system comprises a processing unit and a communication unit, wherein the processing unit is used for carrying out information interaction through the communication unit;
The processing unit is used for determining a treatment interceptor set from the interceptor set, wherein the treatment interceptor set comprises one or more treatment interceptors, and each treatment interceptor is used for intercepting a target application at a service end according to interception rules; acquiring service governance plugin identifiers from plugin configuration files, and configuring service governance plugins indicated by the service governance plugin identifiers; if an interception trigger event aiming at a target service in a business end is detected, calling a treatment interceptor in a treatment interceptor set to intercept the target service, and transmitting service treatment information between a configured service treatment plug-in and a service treatment system corresponding to each treatment interceptor; the service management information is generated according to the information acquired by the interception processing, and each service management system carries out service management on the target service through the corresponding service management information.
Correspondingly, the application provides intelligent equipment, which comprises a processor and a communication interface, wherein the processor performs information interaction through the communication interface; the processor is used for executing the service governance method.
Accordingly, the present application provides a computer readable storage medium having stored therein computer program code which, when executed, performs the service remediation method.
Accordingly, the present application provides a computer program product comprising computer program code which, when executed, implements the service remediation method.
The embodiment of the application can realize the interaction of the service management information between the service end and the service management system through the cooperation of the interceptor and the service management plug-in, thereby avoiding the problem of higher cost caused by the construction of a special network infrastructure to realize the service management and improving the flexibility and the performance of the service management to a certain extent.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a service architecture of an application interceptor provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method for service remediation according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a system framework for implementing service remediation according to an embodiment of the present application;
FIG. 4 is a schematic illustration of a service remediation system plug-in specification provided by an embodiment of the present application;
FIG. 5 is a diagram illustrating interceptor specification and management provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of interceptor execution sequence management provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a configuration file of a service remediation plug-in provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of a configuration file of an interceptor according to an embodiment of the present application;
FIG. 9 is a schematic view of the location of a intercept point according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a dependency management specification for a service remediation plug-in provided by an embodiment of the present application;
FIG. 11 is a flow chart of a method for managing dependencies of a service remediation plug-in according to an embodiment of the present application;
FIG. 12 is a schematic diagram of a service administration device according to an embodiment of the present application;
Fig. 13 is a schematic structural diagram of an intelligent device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The application provides a scheme for service management, namely, the interceptor is utilized to carry out related processing at a service end, and service management information required by interaction with a service management system is utilized to realize service management. Interceptors are a software design model that can be used when a software system or framework wants to provide a way to extend its processing cycle, for which services can be accessed in the present application by modifying configuration files (such as the plug-in and interceptor configuration files mentioned later) to implement service governance. Specifically, for some service invocation systems, for example, remote procedure call (remote procedure call, RPC) systems, in the implementation of the framework, interceptors capable of executing corresponding functions before and after RPC call of a service end, such as a client, and before and after RPC process of the service end, such as a server, call a set of service governance public interfaces by the interceptors, for example, public interfaces corresponding to the service governance systems based on information reporting, name routing, and the like, so as to implement interaction with the service governance systems. In one embodiment, a developer interfacing with a service remediation system may implement a plug-in (referred to as a service remediation plug-in) interfacing from an interceptor at the business end to a different service remediation system based on abstract classes containing these common interfaces, with the business of the service remediation system being able to control the choice of interceptors through a configuration file and with the appropriate service remediation plug-ins. Through the design, a large number of services can be flexibly docked to the heterogeneous service treatment system conveniently, and for the interceptor, the interceptor is not required to be modified by using code level invasion type, and only the corresponding configuration file is required to be modified, so that service deployment and operation are simpler and more flexible, and if a new service treatment system is required to be docked, only a service treatment plug-in is required to be realized, the development efficiency is high, and the service can be deployed and operated more quickly.
As shown in fig. 1, a remote call system, such as an RPC framework, may be configured to interface with a service administration system by setting interceptors at appropriate interception points in a business end in the system. As a mode of communication between services, RPC is widely used under a micro-service architecture. In the scheme of interfacing the service management system based on a framework such as RPC, taking a service end as a service end (called service end) and a client end (called service end) as an example, the service end intercepts service messages of a target service before and after processing, for example, after the service end receives an RPC call request in fig. 1, intercepts service messages of the target service before and after processing the RPC, for example, the client initiates an RPC call request, intercepts the service messages before the RPC call (for example, before issuing an RPC call request to a network IO), intercepts the service messages after receiving response messages related to the RPC call request, and collects service management information required by executing a management interceptor at corresponding 4 interception points (corresponding to the interception before RPC call, the interception after RPC response, the interception before RPC processing, and the interception after RPC processing) shown in fig. 1. For example, for invoking a time-consuming governance service, the governance interceptor of the client may count time consumption at an interception point where the RPC call ends (i.e., interception after receiving the RPC response in fig. 1), where the counted time consumption is service governance information of the client, and the governance interceptor of the server may count time consumption for processing the RPC call request at an interception point where the RPC call request is processed (i.e., interception after RPC processing in fig. 1), where the counted time consumption is service governance information of the server, and the corresponding interceptor may upload the counted time consumption data to a corresponding service governance system related to time consumption governance through a service governance plug-in related to information reporting.
For interceptor registration of the interceptors involved in each interception point in fig. 1, the interceptor registration can be supported through a code level, a mechanism of JAVA (a computer language) SPI (Service Provider Interface) (a JAVA reflection mechanism, a mechanism of instantiating a corresponding class according to a configured class object string) can be extended in an interceptor registration mode, JAVA annotation registration can be used, and the interceptor can be dynamically registered through extensible markup language xml configuration based on JAVA reflection.
For convenience of description, the description will be given by taking the example that the server represents the called server and the client represents the calling server.
The embodiment of the application can be applied to products with different requirements aiming at the type of the service management system, such as a scene needing to call chain analysis under a complex call relation scene, a scene needing to report delay related information under a performance delay sensitive scene, and the like. In one embodiment, by providing a plurality of functional interceptors and a series of service management plug-ins for interfacing with different team service management systems, the remotely invoked service can be quickly accessed into different service management systems according to service scene requirements only by changing the modes of starting and stopping configuration files, modifying plug-in parameters and the like, thereby greatly saving labor cost for developing the service and quickly and iteratively upgrading the power-assisted product.
It can be understood that the service end related to the present application may provide related services through one or more servers, where a server may be an independent physical server, or may be a server cluster or a distributed system formed by multiple physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. The client related to the present application corresponds to a terminal, which may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
Fig. 2 is a schematic flow chart of a service governance method according to an embodiment of the present application, where the method according to the embodiment of the present application may be applied to a service end, for example, the above-mentioned client or server, or a calling server and a called server. The service ends can be intelligent devices such as mobile phones, tablet computers, personal computers, servers and the like, and can also be service platforms such as server groups and the like. The method comprises the following steps.
S201: and determining a governance interceptor set from the interceptor set, wherein the governance interceptor set comprises one or more governance interceptors, and each governance interceptor is used for intercepting the target application at the service end according to the interception rules. The interception rules mainly refer to interception processing logic defined when developing interceptors, which can be set based on actual requirements of service governance, and can be set in combination with specifications of service governance plugins or specifications of docking service governance systems, which are mentioned below. Various interceptors will have completed registration in advance and may be centrally managed in the interceptor set, for example, registration before RPC service start up: information reporting interceptors, call chain interceptors, remote log reporting interceptors, authentication interceptors, current limiting interceptors, node selection interceptors, and the like, the relevant functions of which are described in the embodiments that will follow. After the service end starts the target application to complete initialization, S201 may be executed, where an appropriate governance interceptor is selected from the interceptor set to implement various services. In one embodiment, each desired abatement interceptor may be selected for a target application of a business end based on an interceptor profile configured for the business end. The interceptor configuration files can be respectively configured with the interceptors needed by different target services, for example, for the target service svc1, the interceptor identification of the used interceptor for governance can be: remote-log-system1 (a remote log reporting interceptor) - > metrics-system1 (an information reporting interceptor), for the target service svc2, the interceptor identification of the governance interceptor used may be: remote-log-system1 (a remote log report interceptor) - > tracking-system 1 (a call chain interceptor) - > metrics-system2 (another call chain interceptor). Of course, the interceptors corresponding to each target service are acquired and recorded in the governance interceptor set in S201.
Each treatment interceptor has different interception rules, and the interception rules correspond to the specifications of various service treatment plug-ins mentioned later, so that the treatment interceptors can acquire information required by service treatment and upload the information to corresponding service treatment systems through corresponding service treatment plug-ins to realize service treatment.
For some interceptors, execution parameters may be further configured, for example, during the intercepting process, the information reporting interceptor may report the collected information to the service management system related to information reporting according to an interval of execution parameter=1000 ms, for example, report the time-consuming information that has been counted according to 1000 ms, etc.
S202: and acquiring service governance plugin identifiers from the plugin configuration file, and loading the service governance plugins indicated by the service governance plugin identifiers. The service governance plug-in can provide an interactive function between the governance interceptor and the service governance system, and the governance interceptor interacts information required for service governance with the service governance system by calling a corresponding service governance plug-in. S202 may be performed at the time of starting the target application. S202 may be executed earlier than S201 or may be executed later than S201, as long as loading or initialization of each required service governance plug-in is completed before S203 described below.
The meaning of loading the service governance plugins indicated by the service governance plugin identifications in S202 is that when the governance interceptor needs, the service governance plugins indicated by the service governance plugin identifications are in a usable state, and after the service governance plugins complete registration, for example, after the registration of the dependency relationships pointed out later is completed, the service governance plugins configured on the plugin configuration file for the target application can be acquired in the process of starting the target application or in the process of initializing the service, so that the governance interceptor for the target application can conveniently call the service governance plugins.
S203: and if the interception trigger event aiming at the target service in the business end is detected, calling the treatment interceptors in the treatment interceptor set to intercept the target service, and transmitting service treatment information between the loaded service treatment plug-in and the service treatment system corresponding to each treatment interceptor. The service management information is generated based on information obtained by the interception processing, and the information obtained by the interception processing will be described in the following. Each service management system carries out service management treatment on the target service through corresponding service management information. The administration interceptors are developed according to the requirement specifications of the corresponding service administration system, for example, in the service administration system related to the log, the interceptors correspondingly developed can acquire the log file or store the address of the log file and then report to the service administration system related to the log, for example, in the service administration system related to the authentication, the interceptors correspondingly developed can acquire the information of the authentication certificate token and the like and then report to the service administration system related to the authentication.
For the interception trigger event of the target service in the service end, when the fact that the corresponding service message is generated by the target service in the service end and needs to be processed is detected, the interception trigger event of the target service is considered to be generated, for example, the service message can be a call request about the target service, or a response message aiming at the service message, and the like, and the interception trigger event of the target service can be considered to be generated.
The service governance information may be generated by the governance interceptors, or after the interceptors are instructed to gather information required for service governance, service governance information that may be sent to the service governance system may be generated in the corresponding service governance plug-in according to the required information, and content of the service governance information may be different for different interceptors or different service governance systems, which will be described in the following embodiments.
In the embodiment of the application, the interception is performed by setting the interceptor, the intercepted service governance information can be sent to the service governance system through the loaded service governance plug-in, and the related service governance information returned by the service governance system can be acquired from the service governance system, so that the service governance is realized by accessing the service governance system in a scene such as remote procedure call, special service infrastructure is not required to be deployed, the hardware cost is reduced, and the convenience and the flexibility of the service governance are improved.
In one embodiment, invoking each governance interceptor to intercept the target service includes: acquiring a calling sequence for a governance interceptor in the governance interceptor set according to the interceptor configuration file; and sequentially calling one or more treatment interceptors to intercept the target service according to the calling sequence. That is, the interceptor configuration file may include two parts of content, that is, interceptor identifiers and calling orders, and specifically, in the interceptor configuration file, all the interceptors for governance required by the target application in the service end may be recorded separately, and the interceptors for governance required by different target services and the calling orders related to the interceptors under each service may be recorded separately.
In one embodiment, if an interception trigger event for a target service in a service end is detected, calling each governance interceptor to intercept the target service, and transmitting service governance information between a loaded service governance plug-in and a service governance system corresponding to each governance interceptor, including:
If a service message such as an RPC request aiming at a target service in a business end is detected, determining that an interception trigger event aiming at the target service is detected, and calling a target interceptor in a treatment interceptor according to a calling sequence to intercept the target service; the calling sequence is the calling sequence of the acquired governance interceptor for the target service. The service treatment information obtained by the interception processing of the target interceptor is sent to a matched service treatment system through a service treatment plug-in; each service abatement plugin matches at least one service abatement system; the interception processing is mainly used for acquiring information required by service management, and can directly acquire one piece of service management information according to the acquired information, or acquire some pieces of information required by service management, and then the information is processed in the corresponding service management plug-in to generate corresponding service management information.
Wherein the interception points defined for the target interceptor include: a logical trigger point set in the target interceptor with reference to the transmission time of the service message, allowing the set interception point to be determined before or after the transmission time of the service message; the service message includes: a calling request sent by a service end serving as a client and a response message returned by the service end serving as a service end in response to the calling request; the interception point set at the service end serving as the client comprises: one or two of the interception point set before sending the call request and the interception point set after receiving the response message; the interception point set at the service end serving as the service end comprises the following steps: the intercept point set after receiving the call request, the intercept point set before sending the response message.
In the embodiment of the present application, it should be noted that, an interceptor required for a certain application related to service governance (for example, a target application) of a certain service end (for example, a target service end) is called an governance interceptor, and the governance interceptor is merely a special naming of the interceptor for the purpose of descriptive convenience, and the governance interceptor is still essentially an interceptor only for being distinguished from other interceptors in description, and these other interceptors are not applied or configured in the target application related to service governance of a certain service end. These governance interceptors will be loaded into the business end to effect service governance of the respective target services in the target application for the target application.
The service management method of the embodiment of the application can be applied to the field of Cloud technology according to the need, wherein Cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. Cloud technology (Cloud technology) is based on the general terms of network technology, information technology, integration technology, management platform technology, application technology and the like applied by Cloud computing business models, and can form a resource pool, so that the Cloud computing business model is flexible and convenient as required. Cloud computing technology will become an important support. Background services of technical networking systems require a large amount of computing, storage resources, such as video websites, picture-like websites, and more portals. Along with the high development and application of the internet industry, each article possibly has an own identification mark in the future, the identification mark needs to be transmitted to a background system for logic processing, data of different levels can be processed separately, and various industry data needs strong system rear shield support and can be realized through cloud computing.
Cloud computing refers to the delivery and usage mode of an IT infrastructure, meaning that required resources are obtained in an on-demand and easily-extensible manner through a network; generalized cloud computing refers to the delivery and usage patterns of services, meaning that the required services are obtained in an on-demand, easily scalable manner over a network. Such services may be IT, software, internet related, or other services.
Cloud Computing is a product of fusion of traditional computer and network technology developments such as Grid Computing (Grid Computing), distributed Computing (DistributedComputing), parallel Computing (Parallel Computing), utility Computing (Utility Computing), network storage (Network Storage Technologies), virtualization (Virtualization), load balancing (Load Balance), and the like. With the development of the internet, real-time data flow and diversification of connected devices, and the promotion of demands of search services, social networks, mobile commerce, open collaboration and the like, cloud computing is rapidly developed. Unlike the previous parallel distributed computing, the generation of cloud computing will promote the revolutionary transformation of the whole internet mode and enterprise management mode in concept.
Some information and data generated by the embodiment of the application, such as the above mentioned service management information, can be stored as required in a cloud storage mode so as to be checked when required, the cloud storage (closed storage) is a new concept which is extended and developed in the concept of cloud computing, the distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system which provides data storage and service access functions together and jointly by integrating a large number of storage devices (storage devices are also called storage nodes) of different types in a network through application software or application interfaces through functions of cluster application, grid technology, distributed storage file systems and the like.
The storage method of the storage system comprises the following steps: when creating logical volumes, each logical volume is allocated a physical storage space, which may be a disk composition of a certain storage device or of several storage devices. The client stores data on a certain logical volume, that is, the data is stored on a file system, the file system divides the data into a plurality of parts, each part is an object, the object not only contains the data but also contains additional information such as a data Identification (ID) and the like, the file system writes each object into a physical storage space of the logical volume, and the file system records storage position information of each object, so that when the client requests to access the data, the file system can enable the client to access the data according to the storage position information of each object.
The process of allocating physical storage space for the logical volume by the storage system specifically includes: physical storage space is divided into stripes in advance according to the set of capacity measures for objects stored on a logical volume (which measures tend to have a large margin with respect to the capacity of the object actually to be stored) and redundant array of independent disks (RAID, redundant Array of INDEPENDENT DISK), and a logical volume can be understood as a stripe, whereby physical storage space is allocated for the logical volume.
The service governance scheme of an embodiment of the present application is described in more detail below.
Referring to fig. 3, a system framework diagram of service governance according to an embodiment of the present invention is divided into two blocks, one of which is configured to load an interceptor and the other of which is an access service governance system. The service management system is configured to load a management interceptor required by service management, and the interaction between the management interceptor and the service management system is realized before and after a service message of a target service, such as an RPC request message or a response message. It can be seen that the system architecture proposed by the present invention has a total of one or two service interactable profiles (plug-in profile and/or interceptor profile), six modules, and the interaction between the profiles and modules can be described as follows. It should be noted that, regarding the number of modules, for the purpose of description, in some embodiments, more modules may be divided, or two or more modules among six modules may be combined into one module, and the number of the final modules may be less than six, which is not limited.
The use of the configuration files and the individual modules is briefly described as follows.
The configuration file is mainly used for conveniently configuring and starting the service governance plug-ins corresponding to one or more service governance systems and configuring various parameters of the service governance plug-ins, and can also configure interceptor identifiers aiming at target services to determine governance interceptors aiming at the target services.
The interceptor selecting module 301 is mainly configured to select an interceptor according to a configuration file as a governance interceptor of a target service, for example, each governance interceptor in the governance interceptor set mentioned in S201 is selected by the interceptor selecting module 301 from registered interceptors according to the configuration file.
The interceptor execution controller 302 is mainly used for executing a corresponding abatement interceptor so as to dock the service abatement system, so as to realize service abatement on the target service.
The service governance plug-in module 303 is mainly used for completing the functions of service governance plug-in development specification, service governance plug-in configuration specification, service governance plug-in dependency management and the like. Based on the various specifications obtained at the service governance plug-in module 303, development, configuration, and dependency management of the various service governance plug-ins can be accomplished.
The service governance plugin registration module 304 is mainly used for registering service governance plugins and obtaining service governance plugins, and is convenient for the interceptor execution controller 302 to call corresponding service governance plugins to access the service governance system when executing the governance interceptor.
The interceptor plug-in module 305 is mainly used for completing the development specification of the interceptor plug-in and the management of the interceptor. The developer can realize the development of various interceptors based on the development specification of the interceptor plug-in.
The interceptor registration module 306 is mainly used for completing the registration of the interceptor and obtaining the abatement interceptor.
The relationship between the configuration file and the module is as follows.
1. Loading interceptors by configuration:
user- > profile: the user may interact with other modules via the configuration files (plug-in configuration files and/or interceptor configuration files), and the other modules perform relevant processing based on the configuration files accordingly.
Profile- > interceptor selection module 301: the interceptor selecting module 301 will determine a service governance plug-in from the service governance plug-in registration module 304 according to the content configured in the configuration files (plug-in configuration file and interceptor configuration file), and select and load the corresponding interceptor from the interceptors registered by the interceptor registration module 306 as a governance interceptor.
Interceptor selection module 301- > interceptor execution controller 302: the interceptor execution controller 302 is configured to execute service governance information corresponding to the interceptor interaction with the service governance system at the interception point, and specifically may execute different interception operations before and after the interception point according to the type of the service governance plug-in or the type of the service governance system, so as to obtain information required by different service governances to access the service governance system.
2. Access service management system:
Service governance plugin module 303- > service governance plugin registration module 304: the service governance plug-in module 303 can define development specifications of various types of service governance systems such as name service routing, time-consuming index reporting of service call and the like, and a developer realizes the service governance plug-in according to the specifications and registers the service governance plug-in through a corresponding registration module.
Service governance plug-in registration module 304- > interceptor plug-in module 305: the service administration plug-in registration module 304 is used to complete registration of each service administration plug-in into a service related to service administration, the interceptor calls the service administration plug-in at the interception point, logic for interacting with the service administration system is implemented, and the interceptor plug-in module 305 also introduces the manner in which the interceptor is managed.
Interceptor plug-in module 305- > interceptor registration module 306: the various interceptors are registered such that each interceptor is registered in the service system with respect to the service governance.
3. The access service administration system supports loading interceptors by configuration:
Service administration plug-in module 303- > profile: the service governance plug-in module 303 standardizes configuration files, and can access the types of service governance systems and manage the service governance systems in different configuration classes.
Interceptor registration module 306- > interceptor selection module 301: according to the canonical configuration file, the interceptor selecting module 301 may obtain all required governance interceptors through the interceptor registering module 306, so as to achieve the purpose of configuring and loading governance interceptors in the service end.
After development and registration of interceptors and service governance plugins are completed, loading each interceptor based on plugin parameters, operating each target interceptor in the governance interceptor set through an interceptor execution controller 302, and transferring service governance information between the service governance plugins and corresponding service governance systems by using the target interceptors, wherein the target interceptors and the service governance plugins which can be called by the target interceptors can be continuously developed and generated according to interception specification information of the corresponding service governance systems; the interception specification information includes any one or more of information reporting specification information, call chain specification information, log specification information, authentication specification information, service discovery specification information, load balancing specification information, flow limiting specification information, and service registration specification information. The relevant contents of the respective specification information will be described in the following contents.
By means of the above mentioned service governance plug-in module 303, specifications for developing name service routing, service message reporting, call chain analysis, authentication, remote configuration, etc. of various docking service governance systems in plug-in manner can be provided, the specifications specifying actions of interacting with general service governance systems, such as that interaction with a service governance system regarding information reporting is information reporting, that interaction with a service governance system regarding name service routing is querying available nodes according to call service names, etc.
In one embodiment, under the condition that the specifications of various service governance plugins are determined, the corresponding service governance plugins can be implemented by using an object-oriented programming language, specifically, according to the specifications, a set of abstract classes are designed, the abstract classes define interfaces for interaction with corresponding service governance systems, the service governance plugins can be obtained by only integrating and implementing the abstract classes. It will be appreciated that the implementation of the service governance plugins based on the language of object-oriented programming is merely an example, and after the specifications corresponding to the service governance plugins are defined, the specification can be implemented, and the computer programming language adopted in the specific implementation is not limited by the present application.
FIG. 4 schematically illustrates specifications of various defined docking service remediation systems. The abatement interceptor interfaces the service abatement system using a service abatement plug-in developed to meet these specifications.
Each specification in the diagram and the interceptors corresponding to the specifications are described in turn, service governance plug-ins can be developed based on the specifications, and the corresponding interceptors can call the corresponding service governance plug-ins to interact with the service governance system when being taken as governance interceptors. Wherein the name service governance plug-in specification is a collection comprising a number of plug-in specifications.
1. Plug-in specification:
basic properties of the plug-in are defined: plug-in name, plug-in type.
Resource management of plug-ins is defined: initializing plug-in resources and destroying the plug-in resources. The service governance plug-in typically invokes a software development kit (Software Development Kit, SDK) provided by the service governance system to interact with these systems, with the use of the SDK typically involving resource initialization and destruction.
Plug-in internal management is defined: the plug-in is started and stopped. When the method is started, corresponding tasks can be started for plug-in timing refreshing data or the requirements of other scenes, and one common scene is that the available ip addresses of the back-end service management system are acquired at regular time through the timing tasks.
The plug-in specification section for service administration defines the basic specifications of all plug-ins.
2. Information reporting plug-in specification:
The plug-in is defined to be able to make a modular tone report (modular tone report in fig. 4): the information reporting generally provides calling among services, time-consuming/qps (number of requests processed in one second) information reporting, and the information reporting interceptor generally uses a service management plug-in to perform modular reporting, namely reporting among service modules. The information defined herein may be referred to as transmission time information, processing time information of a service message regarding a certain target service.
The plug-in is defined to be capable of single-dimensional attribute reporting (single-dimensional reporting in fig. 4): the number of service queues reported, the number of transmission control protocol (Transmission Control Protocol, TCP) connections established, etc.
The plug-in is defined to be capable of multidimensional attribute reporting (multidimensional reporting in fig. 4): such as the type and province of an object that needs to be looked at.
The single-dimensional attribute report or the multi-dimensional attribute report corresponds to service object attribute information for a certain target service.
Information reporting interceptor: the developer can develop different types of service management plug-ins related to information reporting according to the self business and the scene of the butt-joint service management system, and the information reporting interceptor calls three corresponding interfaces in the service management plug-ins related to information reporting according to the need to report information and data. The three interfaces correspond to the three reporting specifications defined above, and the three interfaces include: the module reports the corresponding report interface (or report interface between service modules), single-dimension attribute report interface, and multi-dimension attribute report interface.
Based on the information reporting plug-in specification, a service management plug-in related to information reporting can be generated, and the service management plug-in is combined with the information reporting interceptor to realize the service management function of information reporting.
3. Invoking a chain plugin specification:
Defines that a plug-in can create a label span: inheriting the unique identity of the upstream call chain creates a span, which is the basic unit of analyzing the service call link, representing one call across services.
Plug-in fillable span is defined: the information populating the current service (e.g., which service the current service belongs to, which interface downstream is invoked, etc.) corresponds to service description information for the target service in the remediation process for the particular target service.
The plug-in can report span is defined: the span information is reported to the call chain analysis system to complete the service governance about the call chain.
Calling a chain interceptor: the developer calls the three interfaces through developing a call chain interceptor, and fills and reports the call chain information suitable for the service scene at each stage of the RPC.
Based on the above-mentioned call chain plug-in specification, a service governance plug-in for the call chain can be developed, which, in combination with the call chain interceptor, implements a service governance function for the call chain.
4. Log plug-in specification:
it is defined that the plug-in can make a setting acquisition of log level (corresponding to the setting acquisition log level in fig. 4). It is defined that the plug-in can log (corresponding to the print log in fig. 4).
Remote log reporting interceptor: the log-related service governance plug-in that interacts with the remote log system (development is done based on the log plug-in specification) may be used to print log information at the intercept point, send the log information to the remote log-related service governance system. And (3) printing the log: information is output to a log file/remote log; log level acquisition: the log can define the levels of trace, error and the like according to the key level of the information, the trace represents that all information is required to be printed into the log, the error represents that only error information of program logic is printed into the log, and the information quantity/information key level output into the log can be controlled by adjusting the log level.
Based on the log plug-in specification, a service governance plug-in related to the log can be developed, and the service governance plug-in related to the log can be combined with a remote log reporting interceptor to realize the service governance function related to the log.
5. Authentication plug-in specification:
It is defined that the plug-in can authenticate upon request received by the server, corresponding to the server authentication request rights in fig. 4.
It is defined that the plug-in can add authentication information to the request issued by the client, corresponding to the client given the request rights in fig. 4.
Authentication interceptor: before the client sends a request, the server interacts with the service governance system regarding authentication through a service governance plug-in developed based on the authentication plug-in specification to authenticate the rights before processing the request.
Based on the authentication plug-in specification, a service governance plug-in for authentication can be developed, which in combination with the authentication interceptor is capable of implementing a service governance function for authentication.
6. Service discovery plug-in specification:
Defines an available node at which the plug-in can obtain the tuned service: the next available point of a service (e.g., a target service) is typically obtained directly through the identification of the service (e.g., domain name, unique service name, etc.), and the next available node may be returned by the name service system according to some policy.
Defines all available nodes that a plug-in can obtain a tuned service: and acquiring all the nodes of the service through the regulated service identifier, and selecting corresponding nodes for providing to a service end by using a service management plug-in custom strategy about load balancing.
A service governance plug-in for service discovery may be developed based on the service discovery plug-in specification, the service governance plug-in for service discovery capable of requesting acquisition of one or more service available node information for the tuned service based on node request information for the node selection interceptor.
Defines that the plug-in can report the call state: after a call is initiated to a node corresponding to one or more service available node information, the result of the call may generally reflect the status of the called service, where the status indicates that the call was successful or failed, and if the call fails too much, the fusing of the name service system may be triggered, so that a node with more failed calls (e.g., a node with the number of call failures reaching a threshold) is no longer returned as an available node for the called service.
Through corresponding service management plug-ins related to service discovery, service management information related to node states can be reported at corresponding interception points, the service management information related to the node states is used as a factor for judging whether to fuse a node indicated by service available node information, and the node states are used for indicating that the node indicated by the service available node information responds successfully or fails to respond to a service message of a target service.
Defining that the plug-in can set an error code fusing white list: the calling result of the node indicated by the service available node information is identified by a return code, when the return code is a designated value, the calling is normal, and when the return code is a non-designated value, the calling is considered to be failed. The return code is generally considered to be not 0, but represents failure, and is 0 to indicate normal, but sometimes the service scenario is special, the return code is not 0 to be considered normal, the designated value of the return code can be defined in a customized manner, for example, a certain non-0 value is defined in a fusing white list, if the value in the return code is the non-0 value in the fusing white list, the call of one or more nodes is considered to be normal, if the value in the return code is not the non-0 value, the call of one or more nodes is abnormal, the name service system (a service management system related to the name service) can determine whether to fuse the node indicated by the existing service available node information according to the return code, and the customized designated value related to the return code can avoid unexpected fusing of the name service system.
Defines that the plug-in can set the tuned service routing information: the list of tuned service nodes may be set by a set operation when service available node information cannot be found in the name service system by the tuned service identification. Namely: a list of tuned service routing nodes can be set by a service administration plug-in for service discovery; when service available node information cannot be fed back for the service management information about node selection, service available node information can be acquired based on the set tuned service routing node list so as to feed back the service available node information to the corresponding service end.
Node selection interceptor: and interacting with the name service system to obtain service available node information, wherein the related load balancing strategy is determined by the name service system.
The service discovery plug-in specification, in combination with the node selection interceptor, enables service governance with respect to service discovery.
7. Service governance plug-in specifications for load balancing:
Defines that the plug-in can update routing node information in the plug-in: the update operation may update the node address list in the service governance plugin with respect to load balancing, reject unhealthy nodes, and provide updated node sources may be provided by the service governance plugin with respect to load balancing, or may be provided separately.
It is defined that the plug-in can return to being tuned to serve a node: the service governance plugin about load balancing can return node information of one or more available nodes from the node address list to the service governance plugin about service discovery, and various strategies can be defined to achieve the effect of more adapting to service scenes, so that the service governance plugin about service discovery can acquire the node information of one or more available nodes of the service so as to feed back the node information to a corresponding service end.
Node selection interceptor: service availability node information may be obtained by invoking a service governance plug-in with respect to service discovery (optional) with respect to load balancing.
The node interceptor, the service governance plug-in related to service discovery and the service governance plug-in related to load balancing can realize the service governance functions related to service discovery and load balancing.
Service governance plugins regarding service discovery can be developed based on service discovery plugin specifications, and the service governance plugins regarding service discovery can set up a tuned service routing node list by initiating an update operation on the service governance plugins regarding load balancing developed based on the service governance plugin specifications regarding load balancing as needed; the updating operation includes: the method comprises the steps that node identification of a new node is added to a regulated service routing node list, node identification of an abnormal node is deleted, and a service governance plug-in related to load balancing is allowed to respond to the call of the service governance plug-in related to service discovery, so that service available node information is determined according to the updated regulated service routing node list and returned to the service governance plug-in related to service discovery.
8. Current limiting plug-in specification:
The plug-in is defined to be able to obtain a current limit state: the current limiting state comprises current limiting or non-current limiting, whether the calling times of the current node in the specified time exceeds a threshold value is obtained from the name service system, if yes, the current node is marked to need current limiting, otherwise, the current limiting is not needed. The obtained number of calls of the current node in the specified time may include reporting the current node to the service administration system regarding the current node in the current node query information.
Definition plug-ins may report after current limiting: when the current limiting operation is finished, reporting a report of the completion of the current limiting operation, facilitating statistics of name service system data for the current node which is stopped from being invoked by the current limiting operation, and better providing a load balancing strategy.
Flow-limiting interceptor: and calling a current limiting plug-in, wherein when current limiting is required, the client directly returns failure before sending a request, determines that the calling of the node corresponding to the service message about the target service cannot be completed, and the server directly returns failure before processing the request, determines that the node corresponding to the service message about the target service cannot be called to respond to the corresponding service message about the target service.
Based on the current limiting plug-in specification, a service governance plug-in for current limiting can be developed, which is combined with a current limiting interceptor to realize a service governance function for current limiting.
9. Service registration plug-in specification:
service registration is defined: a certain node of the service, which can provide the service, is registered as an available node under the corresponding service identifier on the name service system.
Service de-registration is defined: when a certain node which can provide service is disconnected, the node which needs to be disconnected is unregistered from the name service system.
Defining heartbeat reporting: after the target application is accessed to the called server, the heartbeat is reported to the name service system aiming at the node which is currently called by the target service, the health of the node which is currently called is indicated, the node which is not reported for a long time, and the system can identify the node which is currently called as abnormal.
No interceptor: the plug-in is related to the docking of the name service system, only the current node for carrying out the target application (or the node called by the target application) is required to register and unregister with the name service system (a service management system) when the service management plug-in related to service registration is started/stopped, and the heartbeat message related to the node called by the target application is reported when the target application runs.
The specific description is as follows: although not related to the governance interceptor, the governance interceptor is still part of interfacing with the name service system, and the developer realizes the service governance plugin related to service registration based on the service registration plugin specification, so that the purpose of service governance can be better achieved.
The above describes specifications for various service governance plugins based on which corresponding service governance plugins can be generated. The specifications of various corresponding interceptors for realizing service governance in cooperation with various service governance plug-ins, and the management modes of the interceptors are described below.
As shown in fig. 5, in general, under the interceptor plug-in specification, the interceptor can be classified according to the service end where the interceptor is located to obtain end types, the end types can be divided into a client interceptor and a server interceptor, and each subclass under the two large end type interceptors uses a service governance plug-in register according to the interceptor plug-in specification to obtain each registered required service governance plug-in, so as to realize the interception processing of the interceptor.
Each interceptor will complete registration through the interceptor registrar, then the interceptor selection module selects the treatment interceptor according to the configuration file, and can add the required treatment interceptor of the server and the treatment interceptor of the client to the interceptor execution controller respectively, and then execute the corresponding treatment interceptor at the server and the client in sequence at the corresponding interception point such as mentioned in fig. 1 through the interceptor execution controller of the client and the interceptor execution controller of the server respectively.
1. Interceptor specification:
Interceptor basic properties are defined: interceptor name, interceptor type.
Initialization may be performed: a service governance plugin registry may be used where the corresponding service governance plugin is obtained for invocation in a subsequent interceptor, as well as other initialization operations.
Intercept points of execution interceptors can be defined, completing intercept point selection: for the server, two interception points before and after the RPC request (corresponding to the service message of the target service) is processed can be selected, and for the client (calling the server), the interception points before and after the RPC request (corresponding to the service message of the target service) is sent out can be selected. Regarding the abatement interceptors in combination with the service abatement plug-in, it is recommended at which point to perform the interception operation is described in the following embodiments.
The abatement interceptor may be defined to execute a corresponding type of service abatement plug-in at a designated interception point. The service management information interaction method and device can be used for determining that service management plug-ins interact with corresponding service management systems on the interception points when the interceptors are developed.
In the embodiment of the application, the service end is divided into two types, namely a calling service end and a called service end, and the corresponding interceptor is also divided into two end types, namely: the interceptors of the calling server and the interceptors of the called server are usually called services provided by the server by the client, so that the interceptors of the two types of the clients can be intuitively called as a client interceptor and a server interceptor.
Corresponding to fig. 4, each type of interceptor acquires a corresponding service governance plug-in through a service governance plug-in registry to implement service governance for each service governance system. The interceptors are registered by the interceptor registrar. Before determining a governance interceptor set from the interceptor set, registering a service governance plugin corresponding to each service governance system by a service governance plugin register; and registering each interceptor by an interceptor registrar.
Service governance information may be stored between a client and a server by context, which may be a host service name, a called service name, call time consumption, call return code, etc., the client and server typically have different contexts, such as: the client needs to set the name of the tuned service, the server is used as a request processor, such attributes are not needed, or the call time of the client comprises network transmission time and server processing time, the time of the server=server processing time, and the information required by different contexts on the docking service management system is different, so that the client interceptors and the server interceptors are classified into two types, and the interceptors of different types have the same overall functions (such as the client and the server have information reporting interceptors), but the information required to be collected and the corresponding service management information are not completely the same, can be partially the same, can be all the same, and can be the same in certain service scenes.
In one embodiment, the client interceptor is more type than the server, and the node selection interceptor need not be deployed on the server, because only the calling client needs to select the node needed for the target service by service identification, and the server does not need to make node selection.
The interceptor executing controller can execute the required treatment interceptor, so that interception processing is performed at the interception point of the client or the server, and service treatment information is acquired and reported. After the corresponding target application capable of initiating the call is started, the interceptor selection module acquires the governance interceptors aiming at the target application at the local end by using the interceptor register according to the interceptor configuration file, and adds each governance interceptor into the interceptor execution controller. In the client, the interceptor executing controller can add and execute the corresponding governance interceptor of the client, and in the server, the interceptor executing controller can add and execute the corresponding governance interceptor of the server.
The interceptor execution controller can execute the governance interceptor with the service level as granularity, the service end can provide a plurality of services, each service can execute a different service end interceptor, the client can call a plurality of downstream (i.e. call a plurality of services), and when each downstream is called, different client interceptors can also be executed.
The interceptor execution controller may employ an onion model to manage the order of execution of the plurality of interceptors when executing the abatement interceptors. As shown in fig. 6. After receiving a service message of a target service from a client, for example, after an RPC request, the service message is intercepted by a treatment interceptor 1 of the client, then is intercepted by a treatment interceptor 2 of the client, and after receiving a response of the service message of the client about the target service, for example, after receiving a response of the RPC, the service message is intercepted by a treatment interceptor 2 of the client, and then is intercepted by a treatment interceptor 1 of the client. The server processes the service information of the target service, firstly, the service information is intercepted by the treatment interceptor 1 of the server, then the service information is intercepted by the treatment interceptor 2 of the server, and the response information is returned to the client, firstly, the service information is intercepted by the treatment interceptor 2 of the server, and then the service information is intercepted by the treatment interceptor 1 of the server.
The above embodiment sequentially describes the specifications of the service governance plugin and the specifications of the interceptor, based on the specifications of the service governance plugin, a developer can realize the service governance plugin interacting with a corresponding service governance system, based on the specifications of the interceptor, the developer can realize various client interceptors and service interceptors, and the purpose of interfacing with the service governance system and realizing service governance is achieved by combining the interceptor with the service governance plugin.
In the following description of the configuration file according to the embodiments of the present application, in one embodiment, the configuration file may be in yaml format (a data format used to express data serialization and having high readability), through which a service governance plug-in may be configured for a target application in a client or a server, and governance interceptors corresponding to the service governance plug-in may be configured with service granularity in the client and the server.
In one embodiment, the configuration files include a plug-in configuration file and an interceptor configuration file; the plug-in configuration file is configured with service governance plug-in identifiers aiming at target applications in the service end, and plug-in parameters of the service governance plug-ins indicated by each service governance plug-in identifier; the interceptor configuration file comprises interceptor identifications configured for target applications in the service end, and records the calling sequence of the interceptors indicated by each interceptor identification; the recorded interceptor identifications comprise interceptor identifications of interceptors executing globally and interceptor identifications of interceptors executing exclusively under one or more target services; the interceptor configured in the interceptor configuration file is allowed to collect information required for service remediation for a target service in the target application, generate service remediation information according to the collected information required for service remediation, and send the service remediation information to a corresponding service remediation system.
FIG. 7 is a schematic diagram of a plugin configuration file according to an embodiment of the present application, through which each service governance plugin identifier and plugin parameter may be configured, and when configured, service governance plugins may be mutually utilized, for example, a service governance plugin related to load balancing may be configured as a plugin parameter in a service governance plugin related to service discovery, because a service governance plugin related to load balancing may be used by a service governance plugin related to service discovery.
In the configuration file format shown in fig. 7, the first layer configuration item indicates that a corresponding type of service governance plug-in can be configured for the target application of the service end, for example, a service governance plug-in for service registration can be set in configuration item 701, a service governance plug-in for service discovery can be set in configuration item 702, a service governance plug-in for current limiting can be set in configuration item 703, a service governance plug-in for call chaining can be set in configuration item 704, and a service governance plug-in for information reporting can be set in configuration item 705.
In this second tier configuration item of the plug-in configuration file, a service governance plug-in identification may be configured, for example, a service governance plug-in identification (e.g., plug-in name) for service registration may be set to "registry-system1" in configuration item 711, a service governance plug-in identification (e.g., plug-in name) for service discovery may be set to "selector-system1" in configuration item 712, a service governance plug-in identification (e.g., plug-in name) for current limiting may be set to "limiter-system1" in configuration item 713, a service governance plug-in identification (e.g., plug-in name) for call chain may be set to "pulling-system 1" in configuration item 714, and two service governance plug-in identifications (e.g., plug-in names) for information reporting may be set to "metrics-system1" and "metrics-system2", respectively.
The plug-in parameters specifically used can be configured in the third layer configuration item, for example, for the configuration item 712, a service governance plug-in related to service discovery with a plug-in name of "selector-system1" can be set, and a service governance plug-in identifier related to load balancing (such as a plug-in name) is set as a plug-in parameter 721, so that when the service governance plug-in related to service discovery is called, the service governance plug-in related to load balancing can be indirectly called to obtain service available node information; for the configuration item 715, plug-in parameters 722 and 723 may be set for two service governance plug-ins related to information reporting, such as reporting frequency parameters of information, where the plug-ins related to information reporting may be respectively named as "metrics-system1" and "metrics-system2", and then the two service governance plug-ins related to information reporting may report service governance information to corresponding service governance systems according to the reporting frequency indicated by the respective reporting frequency parameters.
Fig. 8 shows a schematic diagram of an interceptor configuration file according to an embodiment of the present application, where the plug-in configuration file and the interceptor configuration file may be different parts in the same configuration file, or may be separate configuration files, and may all be presented in yaml format. The interceptors configured are interfaced with the service remediation system, and thus the interceptors can be named using the name of the service remediation system to complete the configuration of the interceptor identification in the configuration file, in one embodiment, the name of the service remediation system is the same as the name of the corresponding interceptor. As shown in fig. 8, a type indication configuration item 801 for indicating whether the interceptor configuration file is a server configuration file or a client configuration file is included, and further specifically, an identifier of the target service may be configured in the service configuration item 802 (for example, svc1, svc2, svc3, and svc4 are configured under the service in fig. 8), one or more interceptor configuration items 803 specifically used for the target service may be configured under the service configuration item 802, and further, a corresponding interceptor identifier may be configured under the interceptor configuration item 803, for example, an interceptor identifier meta-system 1 may be configured under the identifier svc1 of the target service, an interceptor identifier meta-system 1 may be configured under the identifier svc2 of the target service, and an interceptor identifier meta-system 2 may be configured.
The interceptor configuration file may include a global configuration item 804, where in the global configuration item 804, an interceptor identifier of an interceptor that is used by all target services, that is, an interceptor identifier of an interceptor that is executed globally, and in each target service, an interceptor that is only used by a current target service, that is, an interceptor identifier of an interceptor that is executed exclusively under each target service, is configured.
The order of calls may then be determined based on priority, with respect to the priority of each interceptor configured, that all target services need to use being performed preferentially over interceptors set up at a particular target service, with the interceptors configured to be forward under a particular target service being performed preferentially over the following interceptors. The specification of interceptor profiles is described in more detail below with examples.
When the service end processes a call request (service message of a target service) aiming at the target service svc1, according to interceptor data and a call sequence of interceptor configuration files, the treating interceptors which are used in sequence are as follows: remote-log-system1- > metrics-system1;
When the service end processes a call request (service message of a target service) aiming at the target service svc2, according to interceptor data and a call sequence of interceptor configuration files, the treating interceptors which are used in sequence are as follows: remote-log-system1- > tracking-system 1- > metrics-system2;
When a client initiates a call request for a target service identifier svc3, according to interceptor data and a call sequence of interceptor configuration files, treating interceptors which are used in sequence are as follows: selector-system1- > auth-system1;
When a client initiates a call request for a target service identifier svc4, according to interceptor data and a call sequence of interceptor configuration files, treating interceptors which are used in sequence are as follows: selector-system1- > limit-system1.
In the following, the execution of the treatment interceptor by the interceptor execution controller is described, for convenience of description, RPC is taken as an example to describe the execution of the treatment interceptor, and other related interception processes related to the calling server and the called server are the same as the interception process in the RPC scene described below. The requests, responses mentioned below may each correspond to a service message of a target service to which the present application relates. And, for the information required by the service governance collected by each governance interceptor, the corresponding service governance information can be generated at the governance interceptor, or the corresponding service governance plug-in can be used for generating the service governance information according to the information required by the service governance.
1. For the information reporting interceptor, the information reporting interceptor can be divided into a server interceptor and a client interceptor.
The server information reporting interceptor arranged at the server can execute the following interception processing when the interceptor executes the process executed by the controller:
RPC pre-treatment intercept point: a timestamp of the arrival of the request may be recorded; i.e. a timestamp of when the service message of the target service was received from the client;
intercept point after RPC processing: calculating the time of RPC processing, filling other information reporting indexes such as calling results and the like, and reporting by using a service management plug-in related to information reporting.
The client information reporting interceptor arranged on the client can execute the following interception processing when being executed by the interceptor executing controller:
RPC calls pre-intercept point: a timestamp of the initiation request may be recorded; such as a timestamp when the service message for the target service was generated;
RPC post response intercept point: calculating the time of RPC call, filling other information reporting indexes such as call results, and reporting by using a service management plug-in related to information reporting.
That is, the target interceptors in the administration interceptor set for intercepting the target applications of the service end (the service end and the client end) include an information reporting interceptor, and the target interceptor in the administration interceptor is called according to the calling sequence to intercept the target service, including: when determining a calling information reporting interceptor according to the calling sequence, the calling information reporting interceptor gathers service reporting information aiming at the target service; packaging the information reported by each service to obtain service management information about information reporting; wherein, the service reporting information comprises: any one or more of transmission time information of a service message of a target service (which may be calculated based on the above-mentioned time stamp), processing time information of a service message (which may be calculated based on the above-mentioned time stamp), and service object attribute information of the target service; the transmission time information of the service message includes a transmission time or a reception time of the service message;
For the server information reporting interceptor, the transmission time information of the service message of the target service refers to "time stamp of arrival of the request (service message)", the processing time information of the service message refers to "time of calculating RPC processing", and for the client information reporting interceptor, the transmission time information of the service message of the target service refers to "time stamp of initiating the request (service message)", the processing time information of the service message refers to "time of calculating RPC call", and the service object attribute information of the target service may refer to: information such as the number of service queues, the number of established TCP connections, etc. reported by the one-dimensional attribute, and information such as the type, province, or address, account number, etc. of a request object reported by the one-dimensional attribute.
Calling a service management plug-in for reporting the service management information at an interception point defined for the information reporting interceptor, wherein the service management plug-in for reporting the information reports the service management information through a set reporting interface; wherein, the reporting interface includes: the service modules are connected with each other through a reporting interface, a single-dimensional attribute reporting interface and a multi-dimensional attribute reporting interface.
The interception points defined for the information reporting interceptor refer to: the pre-RPC interception point and the post-RPC interception point for the server may specifically refer to the pre-RPC interception point before the RPC is processed after the RPC finishes processing and before the RPC sends a response message to the client after the RPC receives the call request or the service message; the pre-RPC call interception point for the client may specifically be the pre-RPC call interception point before the initiation of the call request or the service message, and the post-RPC response interception point after the response fed back by the server is received. The service governance information comprises information required by various service governance collected by the server information reporting interceptor or information required by various service governance collected by the client information reporting interceptor.
The corresponding information reporting interceptor encapsulates the collected information required by the service management to obtain service management information about information reporting, and then invokes a service management plug-in related to information reporting to send the service management information comprising the service reporting information to the corresponding service management system. The information required for service governance may also be encapsulated by a service governance plug-in for reporting information to obtain service governance information, which is not limited in this application.
2. For call chain interceptors, it can be classified into a server interceptor and a client interceptor.
The server side arranged at the server side calls the chain interceptor, and when the interceptor executes the process executed by the controller, the following interception process can be executed:
RPC pre-treatment intercept point: creating and populating a span using a service governance plug-in with respect to the call chain;
intercept point after RPC processing: reporting the span to the call chain system using a service governance plug-in with respect to the call chain;
the client provided on the client calls the chain interceptor, and when executed by the interceptor execution controller, the following interception process may be executed:
RPC calls pre-intercept point: creating and populating a span using a service governance plug-in with respect to the call chain;
RPC post response intercept point: the span is reported to the call chain system using a service governance plug-in with respect to the call chain.
That is, the target interceptors in the administration interceptor set for intercepting the target applications of the service end (the service end and the client end) include call chain interceptors, and call the target interceptors in the administration interceptors according to the call sequence to intercept the target services, including: when determining a call chain interceptor according to the call sequence, the call chain interceptor gathers call chain information about the target service; filling the collected call chain information into a tag field at an interception point defined for a call chain interceptor to generate service governance information about the call chain, and reporting the service governance information about the call chain through a service governance plug-in about the call chain; wherein, the call chain information includes: the unique identification of the upstream call chain of the target service and the service description information of the target service.
The call chain information is related to the information mentioned in the specification corresponding to the service governance plugin about the call chain, namely: the unique identification of the upstream call chain of the target service refers to: inheriting a unique identifier of an upstream call chain, wherein the unique identifier is a basic unit for analyzing a service call chain and represents one-time call of cross services; the service description information of the target service is information of only the current target service, such as which service the current target service belongs to, which interface downstream is called, and the like.
The intercept points defined for the call chain interceptor refer to: the pre-RPC processing interception point for the server may specifically refer to the pre-RPC processing interception point before processing the RPC after receiving the call request or the service message, and the post-RPC processing interception point for the server may specifically refer to the post-RPC processing interception point before sending a response to the client after the RPC completes processing; the pre-RPC call interception point for the client may specifically refer to the pre-RPC call interception point before the call request or the service message is initiated; and the RPC post-response interception point for the client can specifically be the RPC post-response interception point after receiving the response fed back by the server.
The corresponding call chain interceptor may call the service governance plugin about the call chain to create a tag field span at the corresponding interception point after collecting the corresponding call chain information, and populate the tag field span with the information to generate service governance information about the call chain, and the service governance plugin about the call chain sends the generated service governance information including the call chain information to the corresponding service governance system.
3. The remote log reporting interceptor can be divided into a server-side remote log reporting interceptor and a client-side remote log reporting interceptor.
The server-side remote log reporting interceptor arranged at the server side can execute the following interception processing when being executed by the interceptor executing controller:
RPC pre-treatment intercept point: before starting to process the request, reporting a pre-processing log by using a service management plug-in related to the log;
Intercept point after RPC processing: after processing the request, reporting a post-processing log by using a service management plug-in related to the log;
The client remote log provided on the client reports the interceptor, and when the interceptor executes the process executed by the controller, the following interception process can be executed:
RPC calls pre-intercept point: before starting to initiate the call, reporting the pre-processing log by using a service management plug-in related to the log;
RPC post response intercept point: after the response is obtained, reporting the post-processing log by using a service management plug-in related to the log;
That is, the target interceptors in the administration interceptor set for intercepting the target applications of the service end (the service end and the client end) include a remote log reporting interceptor, and the target interceptor in the administration interceptor is called according to the calling sequence to intercept the target service, including: when the remote log reporting interceptor is determined to be called according to the calling sequence, the remote log reporting interceptor is called to collect log information about the target service; generating service management information about the log according to the log information, and reporting the service management information about the log through a service management plug-in about the log at an interception point defined for a remote log reporting interceptor; wherein the log information includes: processing logs generated in the business processing process aiming at the target service, wherein the processing logs needing to be reported comprise: and each pre-processing log and each post-processing log which are reported at each interception point and are generated in the process of carrying out business processing on the target service.
The intercept points defined for the remote log reporting interceptor refer to: the pre-RPC interception point and the post-RPC interception point for the server may specifically refer to the pre-RPC interception point before the RPC is processed after the call request or the service message is received, and the post-RPC interception point before the RPC is sent to the client after the RPC is processed; the pre-RPC call interception point for the client may specifically be the pre-RPC call interception point before the initiation of the call request or the service message, and the post-RPC response interception point after the response fed back by the server is received. The service management information comprises log information required by various service management collected by a server-side remote log reporting interceptor or a client-side remote log reporting interceptor. The log information may refer to the log file itself or may refer to the address of the log file, and the remote log report interceptor may send the log file or the address of the log file as service administration information to a service administration system performing log processing through a service administration plug-in related to the log.
4. For the authentication interceptor, it can be classified into a server authentication interceptor and a client authentication interceptor.
The server authentication interceptor is arranged at the server, and when the interceptor is executed by the interceptor executing controller, the following interception processing can be executed:
RPC pre-treatment intercept point: and acquiring authentication information from the request, using a service management plug-in related to authentication to interact with an authentication center, judging whether the current request has authority, directly refusing without authority, and ending RPC processing.
Intercept point after RPC processing: no treatment is required.
The client authentication interceptor provided on the client may perform the following interception process when executed by the interceptor execution controller:
RPC calls pre-intercept point: and using a service management plug-in related to authentication to interact with the authentication center, adding information such as authentication token to the current request, and initiating a call.
RPC post response intercept point: authentication success generally needs no processing, and prompt service needs to be executed according to the situation when authentication fails.
That is, the target interceptors in the administration interceptor set for intercepting the target applications of the service end (the service end and the client end) include authentication interceptors, and call the target interceptors in the administration interceptors according to the call sequence to intercept the target service, including: when determining to call an authentication interceptor according to the call sequence, calling the authentication interceptor to acquire authentication request information aiming at the target service; generating service governance information about request authentication according to the authentication request information, and reporting the service governance information about request authentication through a service governance plugin about authentication at an interception point defined for an authentication interceptor; if the authentication success notification message returned according to the service management information about the request authentication is received, information such as authentication credentials is added into the service message of the target service so as to send the service message with at least the authentication credentials to the service terminal.
For the authentication interceptor, the processing modes of the client authentication interceptor and the server authentication interceptor are not the same. For the client authentication interceptor, the authentication request information may carry information required for authentication, such as a user name, a password, a key, etc. for verifying the authority, and these information are reported to the authentication center (i.e. about the authenticated service administration system) through the service administration plug-in for authentication, and interact with the authentication center to determine whether the current RPC request (or the service message) has the authority to execute the corresponding remote call. If the authority is available, the authentication center can feed back an authentication success notification message through the authentication service management plug-in, and the authentication success notification message can carry authentication credentials. The service message of the target service can be sent to the server side with the authentication credentials, and the server side can rapidly authenticate based on the authentication credentials without exposing the information of the client side such as the user name, the password, the secret key and the like to the server side. If the notification message of successful authentication is not received or the notification message of failed authentication is received, some message prompts, such as prompt information of user name or password error, can be performed according to the situation.
The interception point defined for the authentication interceptor of the client may be an RPC pre-call interception point, and in particular may refer to an RPC pre-call interception point before initiating a call request or a service message.
For the server authentication interceptor, when the call authentication interceptor is determined according to the call sequence, the call authentication interceptor acquires authentication information for the target service from the service message, wherein the authentication information can be the authentication credential; generating service governance information about the request authentication according to the authentication information, and reporting the service governance information about the request authentication through a service governance plug-in about the authentication at an interception point defined for the authentication interceptor; and if receiving an authentication success notification message returned according to the service management information about the request authentication, triggering the service end to carry out service processing on the target service, namely after the authentication is successful, the service end accurately responds to the service message of the target service. If the authentication fails, the service message responding to the target service can be directly refused, and the RPC processing is ended.
The interception point defined for the authentication interceptor of the server may be an RPC pre-processing interception point, and specifically may refer to an RPC pre-processing interception point before processing the RPC after receiving the call request or the service message.
5. For the current limiting interceptor, it can be classified into a server current limiting interceptor and a client current limiting interceptor:
the server-side current limiting interceptor arranged at the server side can execute the following interception processing when being executed by the interceptor executing controller:
RPC pre-treatment intercept point: and using a service management plug-in related to the current limiting, interacting with a current limiting service management system, confirming whether the current request is required to be limited, and if so, directly returning to the RPC processing failure.
Intercept point after RPC processing: if the current limit is triggered, reporting the action of executing the current limit by using the service management plug-in related to the current limit, so that statistics of the current limit service management system are facilitated.
The client-side current limiting interceptor arranged at the client side can execute the following interception processing when being executed by the interceptor executing controller:
RPC calls pre-intercept point: and using a service management plug-in related to the current limiting, interacting with a current limiting service management system, confirming whether the current request is required to be limited, and if so, directly returning to the RPC processing failure.
RPC post response intercept point: if the current limit is triggered, reporting the action of executing the current limit by using the service management plug-in related to the current limit, so that statistics of the current limit service management system are facilitated.
That is, the target interceptor current limiting interceptors in the administration interceptor set for intercepting the target applications of the service end (the service end and the client end) call the target interceptors in the administration interceptors according to the call sequence to intercept the target services, including: when determining to call the current limiting interceptor according to the call sequence, calling the current limiting interceptor to generate current limiting query information; generating service governance information about the current limit according to the current limit query information, and reporting the service governance information about the current limit through a service governance plug-in unit about the current limit at a first interception point defined by a current limit interceptor; if the flow limit determining information returned in response to the flow limit service management information is received, the flow limit information is acquired, the flow limit information is generated, and the flow limit information service management information is reported through the flow limit service management plug-in at a second interception point defined by the flow limit interceptor.
The current limiting query information includes an identifier of a node to be called by the service message of the target service, and is used for obtaining whether the calling number of the node to be called exceeds a threshold value, specifically, whether the calling number in a preset time range exceeds the threshold value, if so, current limiting processing is required. Triggering the service end to perform the current limiting processing according to the current limiting execution rule may include: and sending out a prompt about node call failure, wherein the business end can stop the current target service or reinitiate a new service message about the target service so as to call a new node for the service message of the target service.
The flow limiting information comprises information of the called node, and is used for indicating that the service end has executed corresponding flow limiting action aiming at the information of the called node, and on the other hand, the name service system can conveniently carry out data statistics and better provide a load balancing strategy after reporting.
The first interception point defined at the flow-restricting interceptor is: the pre-RPC processing interception point for the server may specifically refer to an pre-RPC processing interception point after receiving a call request or a service message and before processing the RPC; the pre-RPC call interception point for the client may specifically refer to the pre-RPC call interception point before the call request or the service message is initiated;
The second interception point defined at the flow-restricting interceptor means: the post-RPC processing interception point for the server may specifically refer to an post-RPC processing interception point before a response is sent to the client after the RPC completes processing; the post-RPC response interception point for the client may specifically refer to an post-RPC response interception point after receiving a response fed back by the server.
6. For the node selection interceptor, only the client node selector is present.
The client node provided on the client selects the interceptor, and when executed by the interceptor execution controller, may execute the following interception process:
RPC calls pre-intercept point: downstream service availability nodes are obtained from the name service system using service governance plug-ins for service discovery, and nodes (optional) are selected using service governance plug-ins for load balancing.
RPC post response intercept point: using a service governance plug-in with respect to service discovery, the report name service system invokes the state of this node, which will trigger a fuse if the invocation fails too much.
That is, the target interceptors in the governance interceptor set for intercepting the target applications of the service end (the service end and the client end) include node selection interceptors, and call the target interceptors in the governance interceptors according to the call sequence to intercept the target service, including: when determining a calling node selection interceptor according to the calling sequence, calling the node selection interceptor to generate node request information; generating service governance information about node selection according to the node request information, and transmitting the service governance information about node selection through a service governance plugin about service discovery at a first interception point defined for the node selection interceptor; receiving service available node information for feedback of service governance information regarding node selection; generating service governance information about a node state, which is a response state of a node indicated by service available node information, in response to a service message of a target service, after the node indicated by the service available node information responds to the service message of the target service; at a second interception point defined for the node selection interceptor, service governance information about the node's state is reported by a service governance plug-in with respect to service discovery.
The node request information is generated and used for requesting to acquire the available nodes of the downstream service, and the node selection interceptor is matched with the service management plug-in related to the service discovery and developed based on the service discovery plug-in specification and can acquire the information of the available nodes of the downstream service.
In one embodiment, by sending service governance information regarding node selection by a service governance plug-in regarding service discovery, a node selection interceptor is able to obtain node information regarding one or more available nodes of a target service, which may be determined based on a load balancing policy; the reported service management information about the node state is used as a factor for whether to fuse the node indicated by the service available node information, and the node state is used for indicating that the node indicated by the service available node information responds successfully or fails to respond to the service message of the target service. Reporting the response success or failure information of the node indicated by the service available node information to the name service system, and judging whether the node indicated by the service available node information is fused or not can be conveniently carried out.
In one embodiment, the list of tuned service routing nodes can be set by a service governance plug-in with respect to service discovery; when service available node information cannot be fed back for service governance information about node selection, the service available node information can be acquired based on the set tuned service routing node list so as to feed back the service available node information.
In one embodiment, a service governance plugin for service discovery sets a list of tuned service routing nodes by initiating an update operation on the service governance plugin for load balancing; the updating operation includes: adding node identification of new node in the regulated service routing node list, deleting node identification of abnormal node, allowing service governance plug-in related to load balancing to respond to the call of service governance plug-in related to service discovery, determining and returning service available node information according to the updated regulated service routing node list.
The specific specifications of the service governance plugin for service discovery and the service governance plugin for load balancing described above may be referred to the description of the relevant content in the previous embodiments.
In addition, the first interception point defined at the node selection interceptor means: RPC before the client initiates the call request or the service message calls the front interception point; the second intercept point defined at the node selection interceptor means: the client receives the RPC response after the response fed back by the server and intercepts the RPC response after the response.
Referring again to fig. 9, a schematic diagram of the intercept points involved in each interceptor of an embodiment of the present application is shown. In the embodiment of the application, the service message about the target service on the service end comprises: a calling request sent by a service end serving as a client and a response message returned by the service end serving as a service end in response to the calling request; the call request may be, for example, an RPC call request, and the response message includes an RPC response message corresponding to the RPC call request. The interception point set at the service end serving as the client comprises: one or two of an interception point (corresponding to the interception before RPC call in fig. 9) set before sending the call request and an interception point (corresponding to the interception after RPC response in fig. 9) set after receiving the response message; the interception point set at the service end serving as the service end comprises the following steps: the intercept point set after receiving the call request (corresponds to the pre-RPC processing intercept in fig. 9), the intercept point set before sending the response message (corresponds to the post-RPC processing intercept in fig. 9).
For the above mentioned service governance plugins and interceptors, registration is done first to select the service governance plugins and interceptors based on the configuration files (plugin configuration files and interceptor configuration files). Thus, prior to determining the abatement interceptor set from the interceptor set, further comprising: registering service management plug-ins corresponding to the service management systems, and registering interceptors, wherein the interceptors comprise calling server interceptors and called server interceptors. The service governance plugins of each development can be registered through a service governance plugin register, and the interceptors of each development can be registered through an interceptor register.
Registration of both the service governance plug-in and interceptor may be maintained using a key-value mapping table, such as map. A general implementation regarding registration is provided below, as well as a more convenient registration implementation based on both cpp language (a computer programming language) and go language (a computer programming language).
1. The general implementation: before the service is started, the service governance plug-in and the interceptor are uniformly registered in the key-value mapping table.
2. Cpp language easy-to-use implementation: while writing the service governance plugins and interceptors, defining an auxiliary class (namely, registration auxiliary objects) related to the service governance plugins and interceptors, and registering the service governance plugins and interceptors into a static key-value mapping table by executing the auxiliary class by the service governance plugins and interceptors registrars using a static registration method.
3. The go language is easy to use and realize: when go is in the import component (component insertion process), the service governance plug-in registrar and the interceptor registrar register in the initialization method by automatically executing the initialization method of the component.
That is, before determining the interceptor set, the embodiment of the application registers the service governance plugins corresponding to each service governance system; wherein, for cpp language, each service governance plugin is configured with a registration auxiliary object, the registration auxiliary object executes corresponding service governance plugin registration processing through a static registration method, and for go language, each service governance plugin completes registration processing of the corresponding service governance plugin through an initialization method of executing a component when performing component insertion processing (import component); before determining the interceptor set, registering each interceptor, wherein the interceptor comprises a calling server interceptor and a called server interceptor; wherein, for cpp language, each interceptor is configured with a registration auxiliary object that performs a corresponding interceptor registration process by a static registration method, and for go language, each interceptor performs a corresponding interceptor registration process by an initialization method of executing a component when performing a component insertion process (import component).
The interceptor is selected according to the interceptor configuration file, or a key-value mapping table can be used for maintenance, after the analysis configuration is started, the corresponding service governance plug-in and the interceptor plug-in are loaded to the corresponding key-value mapping table, and the service governance plug-in and the interceptor required by all service services of the target application and the current target service are required to be loaded when the interceptor plug-in is loaded.
In an embodiment of the application, there is also a dependency management mechanism for the service governance plugins. The dependency is quite common in that a service governance plug-in needs a service governance plug-in for a name service, such as a remote configuration plug-in, needs to acquire the ip address of a configuration center through the service governance plug-in for the name service, that is, before the remote configuration plug-in is initialized, the service governance plug-in for the name service needs to complete initialization.
In one embodiment, a new dependency management specification is added to a service governance plugin specification, as shown in fig. 10, before each governance interceptor is invoked to intercept a target service, or when a service end target application is started, dependency management on each service governance plugin can be completed, and the dependency management specification according to the embodiment of the present application includes: dependencies of one plug-in on other plug-ins are divided into a first dependency (also known as a strong dependency) and a second dependency (also known as a weak dependency). After the target application is started, firstly, a service governance plugin set comprising all service governance plugins required by the target application can be obtained according to the related information corresponding to the above-mentioned service governance plugin specification, and then each service governance plugin in the service governance plugin set is initialized according to the first dependency relationship and the second dependency relationship among defined service governance plugins so as to conveniently execute calling of each governance interceptor to intercept the target service after initialization is completed. Exemplary, the definition and dependency detection order between service governance plugins is as follows:
Service governance plugin a is strongly dependent on service governance plugin B, meaning that service governance plugin B must exist and service governance plugin B has been properly initialized, service governance plugin a can only be initialized. Service governance plugin a is weakly dependent on service governance plugin B, meaning that if service governance plugin B exists, service governance plugin a will be initialized after service governance plugin B is properly initialized. In one embodiment, when performing dependency detection, weak dependencies are detected after strong dependency detection is completed.
For each service governance plugin in the service governance plugin set, the initializing process of each service governance plugin according to the first dependency relationship and the second dependency relationship between each defined service governance plugin may include: acquiring a target service governance plugin from a service governance plugin set; judging whether each first service governance plugin with the first dependency relationship with the target service governance plugin is initialized or not; if each first service governance plugin is initialized, further judging whether each second service governance plugin with a second dependency relationship with the target service governance plugin is initialized; if each second service governance plugin is initialized, initializing the target service governance plugin; if the service governance plugin set does not have the service governance plugin with the first dependency relationship with the target service governance plugin, determining that the initialization of the service governance plugin fails.
In one embodiment, initializing each service governance plugin in the service governance plugin set according to a first dependency and a second dependency between defined service governance plugins includes: acquiring a target service governance plugin from a service governance plugin set; judging whether each first service governance plugin with the first dependency relationship with the target service governance plugin is initialized or not; if each first service governance plugin is initialized, further judging whether each second service governance plugin with a second dependency relationship with the target service governance plugin is initialized; if each second service governance plugin is initialized, initializing the target service governance plugin; if the service governance plugin set does not have the service governance plugin with the first dependency relationship with the target service governance plugin, determining that the initialization of the service governance plugin fails.
If each service governance plug-in the service governance plug-in set is recorded in the initialization queue; according to the first and second dependency relationships between the defined service governance plugins, initializing each service governance plugin in a service governance plugin set, including: if each first service governance plugin is not initialized or each second service governance plugin is not initialized, inserting the target service governance plugin into the tail of the initialization queue; if the initialization queue is detected to be empty, the initialization of the service governance plugin is determined to be completed.
In one embodiment, please refer to fig. 11, and referring to the flowchart shown in fig. 11, the steps of the dependency management method according to the embodiments of the present application may be executed by a service end (client or server), and the service end may initialize each service governance plugin when a program that needs to start a target application executes an RPC service, such as a remote procedure call, so that each corresponding service governance plugin can be correctly invoked by each governance interceptor. The dependency management method of the embodiment of the application comprises the following steps.
In S1101, the configuration file is parsed, service administration plug-ins to be used are obtained, and each service administration plug-in is added to the queue Q, i.e. the service administration plug-ins to be used are loaded from the plug-in configuration file and placed in the queue Q.
In S1102, it is determined whether the queue Q is empty, if so, it indicates that the service governance plugins have been completely initialized, and the process in S1110 may be executed to start normally, the target application starts normally, and the above mentioned function of implementing service governance by cooperation of the interceptor and the service governance plugins is executed, otherwise, it indicates that there are more service governance plugins that have not been initialized, and S1103 is executed.
In S1103, one service governance plugin P is popped out of the queue Q, and one service governance plugin P is acquired from the queue Q at a time so as to perform initialization processing on the service governance plugin P.
In S1104, it is determined whether a service governance plugin with a strong dependency relationship of the service governance plugin P exists, if not, the execution of the program in S1111 is triggered to exit abnormally, and the target application cannot be started because the function of executing the interaction of service governance information between the governance interceptor and the service governance system in the calling process of remote procedure call or the like cannot be completed, service governance cannot be performed, and if a service governance plugin with a strong dependency relationship exists, the execution of S1105 is triggered.
In S1105, it is determined whether the service governance plug-in with the strong dependency relationship has completed initialization, if not, execution is triggered S1108, and if the service governance plug-in with the strong dependency relationship has completed initialization, execution S1106 is executed.
In S1108, the service governance plugin P is inserted into the queue Q, i.e. the service governance plugin P is added to the queue Q, waiting for the service governance plugin with its strong dependency to be initialized. S1102 may be continued to be performed after waiting a predetermined period of time.
After the service governance plugins of the strong dependency relationship of the service governance plugins P have been initialized, in S1106, it is determined whether the service governance plugins of the weak dependency relationship exist, and if not, S1109 is executed; if a weak dependency service governance plug-in exists, then S1107 is performed.
If there is a service governance plugin with a weak dependency, it is determined in S1107 whether all the service governance plugins with a weak dependency have been initialized, if all the service governance plugins with a weak dependency have been initialized, S1109 is executed to initialize the service governance plugin P, and if the service governance plugins with a weak dependency have not been initialized, S1108 is executed as described above. After the initialization of the service governance plugin P at this time is completed, determining the next service governance plugin P in the queue Q, and operating according to the above until the queue Q is empty, and then normally starting the target application.
Through the dependency management scheme, all service governance plugins required by the target application or the service end can be ensured to be correctly initialized, so that functions such as Remote Procedure Call (RPC) and the like can be correctly completed after the target application of the service end is started, service governance information can be interacted between the interceptor and the service governance system through the interceptor and the service governance plugins, and service governance is completed.
Through the dependency management scheme, all service governance plugins required by the target application or the service end can be ensured to be correctly initialized, so that functions such as Remote Procedure Call (RPC) and the like can be correctly completed after the target application of the service end is started, service governance information can be interacted between the interceptor and the service governance system through the interceptor and the service governance plugins, and service governance is completed.
Referring to fig. 12 again, a schematic structural diagram of a service administration device according to an embodiment of the present application is shown, where the device according to the embodiment of the present application includes a processing unit 1202 and a communication unit 1201. The device may be disposed in an intelligent device, where the intelligent device may be a device of the above-mentioned service end, and the intelligent device may be, for example, the above-mentioned client or service end, and specifically, the intelligent device may be an intelligent device such as a mobile phone, a tablet computer, a personal computer, a server, or may also correspond to a service platform such as a server group.
The communication unit 1201 is mainly used for interacting corresponding information generated by the processing unit 1202, and the processing unit 1202 can interact information with other external devices or other internal software and hardware modules through the communication unit 1201.
A processing unit 1202, configured to determine a treatment interceptor set from the interceptor set, where the treatment interceptor set includes one or more treatment interceptors, where each treatment interceptor is configured to intercept the target application at the service end according to an interception rule; acquiring service governance plugin identifiers from the plugin configuration file, and loading the service governance plugins indicated by the service governance plugin identifiers; if an interception trigger event aiming at a target service in a business end is detected, calling a treatment interceptor in a treatment interceptor set to intercept the target service, and transmitting service treatment information between a loaded service treatment plug-in and a service treatment system corresponding to each treatment interceptor; the service management information is generated according to the information acquired by the interception processing, and each service management system carries out service management on the target service through the corresponding service management information.
In one embodiment, the abatement interceptor set is determined from the interceptor set according to an interceptor identifier included in the interceptor configuration file, and the processing unit 1202 is configured to obtain, when configured to invoke each abatement interceptor to intercept the target service, an invocation order for the abatement interceptors in the abatement interceptor set according to the interceptor configuration file; and sequentially calling one or more treatment interceptors to intercept the target service according to the calling sequence.
In one embodiment, after a target interceptor in the administration interceptor set is operated, service administration information is transmitted between a service administration plug-in and a corresponding service administration system by using the target interceptor, and the target interceptor and the service administration plug-in which the target interceptor can call are generated according to interception specification information of the corresponding service administration system; the interception specification information includes any one or more of information reporting specification information, call chain specification information, log specification information, authentication specification information, service discovery specification information, load balancing specification information, flow limiting specification information, and service registration specification information.
In one embodiment, the processing unit 1202 is configured to, when detecting a blocking trigger event for a target service in the service end, invoke each governance interceptor to intercept the target service, and transmit service governance information between the loaded service governance plugin and a service governance system corresponding to each governance interceptor, and when detecting a service message for the target service in the service end, determine that the blocking trigger event for the target service is detected, invoke the target interceptor in the governance interceptors to intercept the target service according to an invocation order, where the invocation order is an invocation order of the acquired governance interceptors for the target service; the service treatment information obtained by the interception processing of the target interceptor is sent to a matched service treatment system through a service treatment plug-in; each service abatement plugin matches at least one service abatement system; wherein the interception points defined for the target interceptor include: the logical trigger point set in the target interceptor with reference to the transmission time of the service message allows determining the set interception point before and/or after the transmission time of the service message.
In one embodiment, the service message includes: a calling request sent by a service end serving as a client and a response message returned by the service end serving as a service end in response to the calling request; the interception point set at the service end serving as the client comprises: one or two of the interception point set before sending the call request and the interception point set after receiving the response message; the interception point set at the service end serving as the service end comprises the following steps: the intercept point set after receiving the call request, the intercept point set before sending the response message.
In one embodiment, a service governance plugin identifier for a target application in a service end is configured in a plugin configuration file, and plugin parameters of the service governance plugins indicated by each service governance plugin identifier are configured; the interceptor configuration file comprises interceptor identifications configured for target applications in the service end, and records the calling sequence of the interceptors indicated by each interceptor identification; the recorded interceptor identifications comprise interceptor identifications of interceptors executing globally and interceptor identifications of interceptors executing exclusively under respective target services.
In one embodiment, the target interceptors in the administration interceptor set include an information reporting interceptor, and the processing unit 1202 is configured to, when the target interceptor in the administration interceptor is used to invoke the target interceptor in the administration interceptor in the calling order to intercept the target service, invoke the information reporting interceptor to collect service reporting information for the target service when the information reporting interceptor is determined to invoke the information reporting interceptor in the calling order; packaging the information reported by each service to obtain service management information about information reporting; wherein, the service reporting information comprises: any one or more of transmission time information of a service message of a target service, processing time information of the service message, and service object attribute information of the target service; the transmission time information of the service message includes a transmission time or a reception time of the service message; calling a service management plug-in for reporting the service management information at an interception point defined for the information reporting interceptor, wherein the service management plug-in for reporting the information reports the service management information through a set reporting interface; wherein, the reporting interface includes: the service modules are connected with each other through a reporting interface, a single-dimensional attribute reporting interface and a multi-dimensional attribute reporting interface.
In one embodiment, the target interceptors in the administration interceptor set include a call chain interceptor, and the processing unit 1202 is configured to, when the target interceptors in the administration interceptor are used for invoking the target interceptors in the order of invocation to intercept the target service, invoke the call chain interceptor to gather call chain information about the target service when determining the call chain interceptors in the order of invocation; filling the collected call chain information into a tag field at an interception point defined for a call chain interceptor to generate service governance information about the call chain, and reporting the service governance information about the call chain through a service governance plug-in about the call chain; wherein, the call chain information includes: the unique identification of the upstream call chain of the target service and the service description information of the target service.
In one embodiment, the target interceptors in the administration interceptor set include remote log reporting interceptors, and the processing unit 1202 is configured to, when configured to invoke the target interceptors in the administration interceptors to intercept the target service according to the invocation order, invoke the remote log reporting interceptors to collect log information about the target service when determining to invoke the remote log reporting interceptors according to the invocation order; generating service management information about the log according to the log information, and reporting the service management information about the log through a service management plug-in unit about the log at an interception point defined for a remote log reporting interceptor; wherein the log information includes: processing logs generated in the process of business processing for the target service.
In one embodiment, the target interceptors in the administration interceptor set include an authentication interceptor, and the processing unit 1202 is configured to, when the target interceptor in the administration interceptor is used to invoke the target interceptor in the administration interceptor in the calling order to intercept the target service, invoke the authentication interceptor to obtain authentication request information for the target service when the authentication interceptor is determined to be invoked in the calling order; generating service governance information about request authentication according to the authentication request information, and reporting the service governance information about request authentication through a service governance plugin about authentication at an interception point defined for an authentication interceptor; if an authentication success notification message returned according to the service management information about the request authentication is received, an authentication credential is added to the service message of the target service so as to send the service message with the authentication credential.
In one embodiment, the target interceptors in the administration interceptor set include an authentication interceptor, and the processing unit 1202 is configured to, when the target interceptor in the administration interceptor is called according to the calling sequence to intercept the target service, call the authentication interceptor to obtain authentication information for the target service from the service message when the authentication interceptor is determined to be called according to the calling sequence; generating service governance information about the request authentication according to the authentication information, and reporting the service governance information about the request authentication through a service governance plug-in about the authentication at an interception point defined for the authentication interceptor; and if receiving an authentication success notification message returned according to the service management information about the request authentication, triggering the service terminal to carry out service processing on the target service.
In one embodiment, the target interceptors in the administration interceptor set include a current-limiting interceptor, and the processing unit 1202 is configured to, when the target interceptor in the administration interceptor is used for invoking the target interceptor in the administration interceptor in the order of invocation to intercept the target service, invoke the current-limiting interceptor to generate the current-limiting query information when determining to invoke the current-limiting interceptor in the order of invocation; the current limiting query information comprises the identification of the node to be called by the service message of the target service, and is used for acquiring whether the calling times of the node to be called exceeds a threshold value or not; generating service governance information about the current limit according to the current limit query information, and reporting the service governance information about the current limit through a service governance plug-in unit about the current limit at a first interception point defined by a current limit interceptor; and if the current limit determining information returned in response to the service management information about the current limit is received, acquiring the current limit information, generating the service management information about the current limit information, and reporting the service management information about the current limit information through a service management plug-in about the current limit at a second interception point defined by the current limit interceptor, wherein the current limit information comprises the identification of a node to be called by the service message of the target service.
In one embodiment, the target interceptors in the administration interceptor set include node selection interceptors, and the processing unit 1202 is configured to, when the target interceptors in the administration interceptors are used for invoking the target interceptors in the administration interceptors according to the invoking sequence to intercept the target service, invoke the node selection interceptors to generate node request information when determining to invoke the node selection interceptors according to the invoking sequence; generating service governance information about node selection according to the node request information, and transmitting the service governance information about node selection through a service governance plugin about service discovery at a first interception point defined for the node selection interceptor; receiving service available node information for feedback of service governance information regarding node selection; generating service governance information about a node state, which is a response state of a node indicated by service available node information, in response to a service message of a target service, after the node indicated by the service available node information responds to the service message of the target service; at a second interception point defined for the node selection interceptor, service governance information about the node's state is reported by a service governance plug-in with respect to service discovery.
In one embodiment, node information about one or more available nodes of a target service can be obtained by sending service governance information about node selection by a service governance plug-in about service discovery, the one or more available nodes being allowed to be determined based on a load balancing policy; the reported service management information about the node state is used as a factor for whether to fuse the node indicated by the service available node information, and the node state is used for indicating that the node indicated by the service available node information responds successfully or fails to respond to the service message of the target service.
In one embodiment, the list of tuned service routing nodes can be set by a service governance plug-in with respect to service discovery; when service available node information cannot be fed back for service governance information about node selection, the service available node information can be acquired based on the set tuned service routing node list so as to feed back the service available node information.
In one embodiment, a service governance plugin for service discovery sets a list of tuned service routing nodes by initiating an update operation on the service governance plugin for load balancing; the updating operation includes: and adding the node identification of the new node in the regulated service routing node list, deleting the node identification of the abnormal node, and allowing the service governance plug-in related to load balancing to respond to the call of the service governance plug-in related to service discovery, determining and returning service available node information according to the updated regulated service routing node list.
In one embodiment, the processing unit 1202 is further configured to register a service governance plugin corresponding to each service governance system before being configured to perform determining a governance interceptor set from the interceptor sets; each service governance plugin is configured with a registration auxiliary object, the registration auxiliary object executes corresponding service governance plugin registration processing through a static registration method, or when each service governance plugin performs component insertion processing, the registration processing of the corresponding service governance plugin is completed through an initialization method of executing a component; registering each interceptor, wherein the interceptor comprises a calling server interceptor and a called server interceptor; each interceptor is configured with a registration auxiliary object, and the registration auxiliary object executes corresponding interceptor registration processing through a static registration method, or when each interceptor performs component insertion processing, the corresponding interceptor registration processing is completed through an initialization method of executing a component.
In one embodiment, processing unit 1202 is further configured to obtain a set of service governance plug-ins before being used to perform an interception process for invoking each governance interceptor for a target service; and initializing each service governance plugin in the service governance plugin set according to the defined first dependency relationship and second dependency relationship among the service governance plugins so as to conveniently call each governance interceptor to intercept the target service after the initialization is completed.
In one embodiment, the processing unit 1202 is configured to obtain the target service governance plugin from the service governance plugin set when performing initialization processing on each service governance plugin in the service governance plugin set according to the defined first dependency and the second dependency between each service governance plugin; judging whether each first service governance plugin with the first dependency relationship with the target service governance plugin is initialized or not; if each first service governance plugin is initialized, further judging whether each second service governance plugin with a second dependency relationship with the target service governance plugin is initialized; if each second service governance plugin is initialized, initializing the target service governance plugin; if the service governance plugin set does not have the service governance plugin with the first dependency relationship with the target service governance plugin, determining that the initialization of the service governance plugin fails.
In one embodiment, each service governance plug-in the set of service governance plug-ins is recorded into an initialization queue; a processing unit 1202, configured to insert, when performing initialization processing on each service administration plug-in the service administration plug-in set according to the defined first dependency relationship and the second dependency relationship between each service administration plug-in, the target service administration plug-in into a tail of the initialization queue if each first service administration plug-in is not initialized or each second service administration plug-in is not initialized; if the initialization queue is detected to be empty, the initialization of the service governance plugin is determined to be completed.
In one embodiment, a service remediation plug-in includes: a service governance plug-in for service registration; after the service governance plugin related to service registration is loaded, the service governance plugin related to service registration is used for registering and anti-registering the node called by the target application with the corresponding service governance system, and the heartbeat message related to the node called by the target application is reported in the running process of the target application.
The specific implementation of the processing unit 1202 of the apparatus according to the embodiment of the present application may refer to the description of the related content in the foregoing embodiments, and the beneficial effects that can be achieved by the implementation of the processing unit may also refer to the description in the foregoing embodiments, which is not repeated herein.
Referring to fig. 13 again, a schematic structural diagram of an intelligent device according to an embodiment of the present application may correspond to the service end mentioned in the foregoing embodiment. The intelligent device can be a mobile phone, a tablet personal computer, a server and other intelligent devices, and can also correspond to a server group and other service platforms. In an embodiment of the present application, the smart device includes a processor 1301 and a communication interface 1303. In some embodiments, the smart device may also include memory 1302, power circuitry, and other components.
In one embodiment, processor 1301 may be a central processing unit (Central Processing Unit, CPU), digital signal processor (DIGITAL SIGNAL processor, DSP), application Specific Integrated Circuit (ASIC), field programmable gate array (field programmable GATE ARRAY, FPGA), or other programmable logic device.
Memory 1302 may include any of, or a combination of, volatile memory, non-volatile memory. Specifically, the memory 1302 may specifically be: read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (erasable PROM, EPROM), electrically erasable programmable EPROM (EEPROM), flash memory, various random access memories (random access memory, RAM), etc., the memory 1302 to which the present application relates includes, but is not limited to, the above-mentioned memories.
In one embodiment, the memory 1302 may store a computer program, and the processor 1301 executes the computer program to determine a set of abatement interceptors from the set of interceptors, where the set of abatement interceptors includes one or more abatement interceptors, each of which is configured to intercept the target application at the service end according to an interception rule; acquiring service governance plugin identifiers from the plugin configuration file, and loading the service governance plugins indicated by the service governance plugin identifiers; if an interception trigger event aiming at a target service in a business end is detected, calling a treatment interceptor in a treatment interceptor set to intercept the target service, and transmitting service treatment information between a loaded service treatment plug-in and a service treatment system corresponding to each treatment interceptor; the service management information is generated according to the information acquired by the interception processing, and each service management system carries out service management on the target service through the corresponding service management information.
In one embodiment, the abatement interceptor set is determined from the interceptor set according to an interceptor identifier included in the interceptor configuration file, and the processor 1301 is configured to obtain, when configured to invoke each abatement interceptor to intercept the target service, a call sequence for an abatement interceptor in the abatement interceptor set according to the interceptor configuration file; and sequentially calling one or more treatment interceptors to intercept the target service according to the calling sequence.
In one embodiment, after a target interceptor in the administration interceptor set is operated, service administration information is transmitted between a service administration plug-in and a corresponding service administration system by using the target interceptor, and the target interceptor and the service administration plug-in which the target interceptor can call are generated according to interception specification information of the corresponding service administration system; the interception specification information includes any one or more of information reporting specification information, call chain specification information, log specification information, authentication specification information, service discovery specification information, load balancing specification information, flow limiting specification information, and service registration specification information.
In one embodiment, the processor 1301 is configured to, when detecting a blocking trigger event for a target service in the service end, invoke each governance interceptor to intercept the target service, and transmit service governance information between the loaded service governance plugin and a service governance system corresponding to each governance interceptor, determine that the blocking trigger event for the target service is detected if a service message for the target service in the service end is detected, invoke a target interceptor in the governance interceptor to intercept the target service according to an invocation order, where the invocation order is an invocation order of the acquired governance interceptors for the target service; the service treatment information obtained by the interception processing of the target interceptor is sent to a matched service treatment system through a service treatment plug-in; each service abatement plugin matches at least one service abatement system; wherein the interception points defined for the target interceptor include: the logical trigger point set in the target interceptor with reference to the transmission time of the service message allows determining the set interception point before and/or after the transmission time of the service message.
In one embodiment, the service message includes: a calling request sent by a service end serving as a client and a response message returned by the service end serving as a service end in response to the calling request; the interception point set at the service end serving as the client comprises: one or two of the interception point set before sending the call request and the interception point set after receiving the response message; the interception point set at the service end serving as the service end comprises the following steps: the intercept point set after receiving the call request, the intercept point set before sending the response message.
In one embodiment, a service governance plugin identifier for a target application in a service end is configured in a plugin configuration file, and plugin parameters of the service governance plugins indicated by each service governance plugin identifier are configured; the interceptor configuration file comprises interceptor identifications configured for target applications in the service end, and records the calling sequence of the interceptors indicated by each interceptor identification; the recorded interceptor identifications comprise interceptor identifications of interceptors executing globally and interceptor identifications of interceptors executing exclusively under respective target services.
In one embodiment, the target interceptors in the administration interceptor set include an information reporting interceptor, and the processor 1301 is configured to, when the target interceptor in the administration interceptor is used to invoke the target interceptor in the administration interceptor in the calling order to intercept the target service, invoke the information reporting interceptor to collect service reporting information for the target service when the information reporting interceptor is determined to be invoked in the calling order; packaging the information reported by each service to obtain service management information about information reporting; wherein, the service reporting information comprises: any one or more of transmission time information of a service message of a target service, processing time information of the service message, and service object attribute information of the target service; the transmission time information of the service message includes a transmission time or a reception time of the service message; calling a service management plug-in for reporting the service management information at an interception point defined for the information reporting interceptor, wherein the service management plug-in for reporting the information reports the service management information through a set reporting interface; wherein, the reporting interface includes: the service modules are connected with each other through a reporting interface, a single-dimensional attribute reporting interface and a multi-dimensional attribute reporting interface.
In one embodiment, the target interceptors in the administration interceptor set include a call chain interceptor, and the processor 1301 is configured to, when the target interceptors in the administration interceptor are used to invoke in the order of invocation to intercept the target service, invoke the call chain interceptor to gather call chain information about the target service when the call chain interceptors are determined in the order of invocation; filling the collected call chain information into a tag field at an interception point defined for a call chain interceptor to generate service governance information about the call chain, and reporting the service governance information about the call chain through a service governance plug-in about the call chain; wherein, the call chain information includes: the unique identification of the upstream call chain of the target service and the service description information of the target service.
In one embodiment, the target interceptors in the administration interceptor set include remote log-reporting interceptors, and the processor 1301 is configured to, when performing interception processing on the target service by calling the target interceptors in the administration interceptors according to the calling order, call the remote log-reporting interceptors to collect log information about the target service when determining that the remote log-reporting interceptors are called according to the calling order; generating service management information about the log according to the log information, and reporting the service management information about the log through a service management plug-in about the log at an interception point defined for a remote log reporting interceptor; wherein the log information includes: processing logs generated in the process of business processing for the target service.
In one embodiment, the target interceptors in the administration interceptor set include an authentication interceptor, and the processor 1301 is configured to, when performing interception processing on the target service by calling the target interceptors in the administration interceptor according to the calling sequence, call the authentication interceptor to obtain authentication request information for the target service when determining to call the authentication interceptor according to the calling sequence; generating service governance information about request authentication according to the authentication request information, and reporting the service governance information about request authentication through a service governance plugin about authentication at an interception point defined for an authentication interceptor; if an authentication success notification message returned according to the service management information about the request authentication is received, an authentication credential is added to the service message of the target service so as to send the service message with the authentication credential.
In one embodiment, the target interceptors in the administration interceptor set include an authentication interceptor, and the processor 1301 is configured to, when performing interception processing on the target service by calling the target interceptors in the administration interceptor according to the calling sequence, call the authentication interceptor to obtain authentication information for the target service from the service message when determining to call the authentication interceptor according to the calling sequence; generating service governance information about the request authentication according to the authentication information, and reporting the service governance information about the request authentication through a service governance plug-in about the authentication at an interception point defined for the authentication interceptor; and if receiving an authentication success notification message returned according to the service management information about the request authentication, triggering the service terminal to carry out service processing on the target service.
In one embodiment, the target interceptors in the administration interceptor set include a current-limiting interceptor, and the processor 1301 is configured to, when the target interceptor in the administration interceptor is used for invoking the target interceptor in the administration interceptor in the order of invocation to intercept the target service, invoke the current-limiting interceptor to generate the current-limiting query information when determining to invoke the current-limiting interceptor in the order of invocation; the current limiting query information comprises the identification of the node to be called by the service message of the target service, and is used for acquiring whether the calling times of the node to be called exceeds a threshold value or not; generating service governance information about the current limit according to the current limit query information, and reporting the service governance information about the current limit through a service governance plug-in unit about the current limit at a first interception point defined by a current limit interceptor; and if the current limit determining information returned in response to the service management information about the current limit is received, acquiring the current limit information, generating the service management information about the current limit information, and reporting the service management information about the current limit information through a service management plug-in about the current limit at a second interception point defined by the current limit interceptor, wherein the current limit information comprises the identification of a node to be called by the service message of the target service.
In one embodiment, the target interceptors in the administration interceptor set include node selection interceptors, and the processor 1301 is configured to, when the target interceptors in the administration interceptors are used to invoke the target interceptors in the administration interceptors in the invocation order to intercept the target service, invoke the node selection interceptors to generate node request information when the node selection interceptors are determined to be invoked in the invocation order; generating service governance information about node selection according to the node request information, and transmitting the service governance information about node selection through a service governance plugin about service discovery at a first interception point defined for the node selection interceptor; receiving service available node information for feedback of service governance information regarding node selection; generating service governance information about a node state, which is a response state of a node indicated by service available node information, in response to a service message of a target service, after the node indicated by the service available node information responds to the service message of the target service; at a second interception point defined for the node selection interceptor, service governance information about the node's state is reported by a service governance plug-in with respect to service discovery.
In one embodiment, node information about one or more available nodes of a target service can be obtained by sending service governance information about node selection by a service governance plug-in about service discovery, the one or more available nodes being allowed to be determined based on a load balancing policy; the reported service management information about the node state is used as a factor for whether to fuse the node indicated by the service available node information, and the node state is used for indicating that the node indicated by the service available node information responds successfully or fails to respond to the service message of the target service.
In one embodiment, the list of tuned service routing nodes can be set by a service governance plug-in with respect to service discovery; when service available node information cannot be fed back for service governance information about node selection, the service available node information can be acquired based on the set tuned service routing node list so as to feed back the service available node information.
In one embodiment, a service governance plugin for service discovery sets a list of tuned service routing nodes by initiating an update operation on the service governance plugin for load balancing; the updating operation includes: and adding the node identification of the new node in the regulated service routing node list, deleting the node identification of the abnormal node, and allowing the service governance plug-in related to load balancing to respond to the call of the service governance plug-in related to service discovery, determining and returning service available node information according to the updated regulated service routing node list.
In one embodiment, processor 1301, prior to being configured to perform determining an abatement interceptor set from among the interceptor sets, is further configured to register a service abatement plugin corresponding to each service abatement system; each service governance plugin is configured with a registration auxiliary object, the registration auxiliary object executes corresponding service governance plugin registration processing through a static registration method, or when each service governance plugin performs component insertion processing, the registration processing of the corresponding service governance plugin is completed through an initialization method of executing a component; registering each interceptor, wherein the interceptor comprises a calling server interceptor and a called server interceptor; each interceptor is configured with a registration auxiliary object, and the registration auxiliary object executes corresponding interceptor registration processing through a static registration method, or when each interceptor performs component insertion processing, the corresponding interceptor registration processing is completed through an initialization method of executing a component.
In one embodiment, processor 1301 is further configured to obtain a set of service governance plug-ins before being configured to perform invoking each governance interceptor to intercept the target service; and initializing each service governance plugin in the service governance plugin set according to the defined first dependency relationship and second dependency relationship among the service governance plugins so as to conveniently call each governance interceptor to intercept the target service after the initialization is completed.
In one embodiment, processor 1301 is configured to obtain a target service abatement plugin from the service abatement plugin set when performing an initialization process for each service abatement plugin in the service abatement plugin set according to the defined first and second dependencies between each service abatement plugin; judging whether each first service governance plugin with the first dependency relationship with the target service governance plugin is initialized or not; if each first service governance plugin is initialized, further judging whether each second service governance plugin with a second dependency relationship with the target service governance plugin is initialized; if each second service governance plugin is initialized, initializing the target service governance plugin; if the service governance plugin set does not have the service governance plugin with the first dependency relationship with the target service governance plugin, determining that the initialization of the service governance plugin fails.
In one embodiment, each service governance plug-in the set of service governance plug-ins is recorded into an initialization queue; processor 1301, configured to insert, when performing initialization processing on each service administration plug-in the service administration plug-in set according to the defined first dependency relationship and the second dependency relationship between each service administration plug-in, the target service administration plug-in into a tail of the initialization queue if each first service administration plug-in is not initialized or each second service administration plug-in is not initialized; if the initialization queue is detected to be empty, the initialization of the service governance plugin is determined to be completed.
In one embodiment, a service remediation plug-in includes: a service governance plug-in for service registration; after the service governance plugin related to service registration is loaded, the service governance plugin related to service registration is used for registering and anti-registering the node called by the target application with the corresponding service governance system, and the heartbeat message related to the node called by the target application is reported in the running process of the target application.
The specific implementation of the processor 1301 of the apparatus in the embodiment of the present application may refer to the description of the related content in the foregoing embodiments, and the beneficial effects that can be achieved by the specific implementation may also refer to the description in the foregoing embodiments, which is not repeated herein.
The application also provides a computer readable medium having stored therein a computer program or instructions which, when executed by a communication device, implement the functions of any of the method embodiments described above.
The application also provides a computer program product comprising instructions which, when read and executed by a computer, cause the computer to carry out the functions of any of the method embodiments described above.
It should be noted that, in the embodiments of the present application, one or more of the above mentioned embodiments are meant to include one, two, three, four or more, and meanwhile, the "first", "second", etc. mentioned in the embodiments of the present application are only for the purpose of distinguishing and describing some objects, and do not represent a specific order or precedence of such objects.
Those skilled in the art will appreciate that the processes implementing all or part of the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, and the program may include the processes of the embodiments of the methods as above when executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The above disclosure is only a few examples of the present invention, and it is not intended to limit the scope of the present invention, but it is understood by those skilled in the art that all or a part of the above embodiments may be implemented and equivalents thereof may be modified according to the scope of the present invention.
Claims (20)
1. A method of service remediation, comprising:
Determining a governance interceptor set from the interceptor set, wherein the governance interceptor set comprises one or more governance interceptors, and each governance interceptor is used for intercepting a target application at a service end according to an interception rule;
Acquiring service governance plugin identifiers from the plugin configuration file, and loading the service governance plugins indicated by the service governance plugin identifiers;
if an interception trigger event aiming at a target service in a business end is detected, calling an administration interceptor in an administration interceptor set to intercept the target service, and transmitting service administration information between a loaded service administration plug-in and a service administration system corresponding to each administration interceptor;
The service management information is generated according to the information acquired by the interception processing, and each service management system carries out service management on the target service through the corresponding service management information.
2. The method of claim 1, wherein if an interception trigger event for a target service in a business end is detected, invoking each governance interceptor to intercept the target service comprises:
If a service message aiming at a target service in a business end is detected, determining that an interception trigger event aiming at the target service is detected, and calling a target interceptor in a treatment interceptor according to a calling sequence to intercept the target service;
The service treatment information obtained by the interception processing of the target interceptor is sent to a matched service treatment system through a service treatment plug-in; each service remediation plug-in matches at least one service remediation system.
3. The method of claim 2, wherein the target interceptors in the governance interceptor set include information reporting interceptors, and the invoking the target interceptors in the governance interceptors to intercept the target service in the order of the invocation includes:
When the information reporting interceptor is determined to be called according to the calling sequence, the information reporting interceptor is called to collect service reporting information aiming at the target service;
Packaging the information reported by each service to obtain service management information about information reporting; wherein the service reporting information includes: any one or more of transmission time information of a service message of the target service, processing time information of the service message and service object attribute information of the target service; the transmission time information of the service message comprises the sending time or the receiving time of the service message;
Calling a service governance plug-in related to information reporting to report the service governance information at an interception point defined for the information reporting interceptor, wherein the service governance plug-in related to information reporting reports the service governance information through a set reporting interface; wherein, the reporting interface includes: and any one or more of a reporting interface, a single-dimensional attribute reporting interface and a multi-dimensional attribute reporting interface among the service modules.
4. The method of claim 2, wherein the target interceptors in the governance interceptor set include call chain interceptors, and the invoking the target interceptors in the governance interceptors to intercept the target service in the order of the call comprises:
When determining to call the call chain interceptor according to the call sequence, calling the call chain interceptor to collect call chain information about the target service;
Filling the collected call chain information into a tag field at an interception point defined for a call chain interceptor to generate service governance information about the call chain, and reporting the service governance information about the call chain through a service governance plug-in about the call chain;
wherein the call chain information includes: the unique identification of the upstream call chain of the target service and the service description information of the target service.
5. The method of claim 2, wherein the target interceptors in the governance interceptor set include remote log reporting interceptors, and the invoking the target interceptors in the governance interceptors to intercept the target service in the order of the call includes:
when the remote log reporting interceptor is determined to be called according to the calling sequence, the remote log reporting interceptor is called to collect log information about the target service;
Generating service management information about the log according to the log information, and reporting the service management information about the log through a service management plug-in about the log at an interception point defined for a remote log reporting interceptor;
Wherein the log information includes: and processing logs generated in the business processing process of the target service.
6. The method of claim 2, wherein the target interceptors in the governance interceptor set include authentication interceptors, and the invoking the target interceptors in the governance interceptors in the order of the call to intercept the target service includes:
When determining to call the authentication interceptor according to the call sequence, calling the authentication interceptor to acquire authentication request information aiming at the target service;
generating service governance information about request authentication according to the authentication request information, and reporting the service governance information about request authentication through a service governance plug-in about authentication at an interception point defined for the authentication interceptor;
and if the authentication success notification message returned according to the service management information about the request authentication is received, adding authentication credentials into the service message of the target service so as to send the service message with the authentication credentials.
7. The method of claim 2, wherein the target interceptors in the governance interceptor set include authentication interceptors, and the invoking the target interceptors in the governance interceptors in the order of the call to intercept the target service includes:
When determining to call the authentication interceptor according to the call sequence, calling the authentication interceptor to acquire authentication information aiming at the target service from the service message;
Generating service governance information about request authentication according to the authentication information, and reporting the service governance information about request authentication through a service governance plug-in about authentication at an interception point defined for the authentication interceptor;
and if receiving an authentication success notification message returned according to the service management information about the request authentication, triggering a service end to carry out service processing on the target service.
8. The method of claim 2, wherein the target interceptors in the governance interceptor set include a current-limiting interceptor, and the invoking the target interceptors in the governance interceptor to intercept the target service in the order of the call comprises:
When determining to call the current limiting interceptor according to the call sequence, calling the current limiting interceptor to generate current limiting query information; the current limiting query information comprises the identification of the node to be called by the service message of the target service, and is used for acquiring whether the calling times of the node to be called exceeds a threshold value;
Generating service governance information about the current limit according to the current limit query information, and reporting the service governance information about the current limit through a service governance plug-in about the current limit at a first interception point defined for the current limit interceptor;
And if the current limit determining information returned in response to the current limit-related service management information is received, acquiring the current limit information, generating the service management information related to the current limit information, and reporting the service management information related to the current limit information through a current limit-related service management plug-in at a second interception point defined for the current limit interceptor, wherein the current limit information comprises the identification of a node to be invoked by the service message of the target service.
9. The method of claim 2, wherein the target interceptors in the governance interceptor set include node selection interceptors, and the invoking the target interceptors in the governance interceptors in the order of call to intercept the target service includes:
When the node selection interceptor is determined to be called according to the calling sequence, the node selection interceptor is called to generate node request information;
generating service governance information about node selection according to the node request information, and sending the service governance information about node selection through a service governance plug-in about service discovery at a first interception point defined by an interceptor for the node selection;
Receiving service available node information fed back for the service governance information about node selection;
Generating service governance information about a node state after responding to a service message of the target service according to a node indicated by the service available node information, the node state being a response state of the node indicated by the service available node information responding to the service message of the target service;
And at a second interception point defined by the interceptor for the node, reporting the service governance information about the node state through a service governance plug-in about service discovery.
10. The method of claim 9, wherein node information for one or more available nodes of the target service is available by sending the service governance information for node selection by a service governance plug-in for service discovery, the one or more available nodes being allowed to be determined based on a load balancing policy;
the reported service management information about the node state is used as a factor for judging whether to fuse the node indicated by the service available node information, and the node state is used for indicating that the node indicated by the service available node information responds successfully or fails to respond to the service message of the target service.
11. The method of claim 9, wherein the list of tuned service routing nodes is configurable by a service administration plug-in for service discovery; when the service available node information cannot be fed back aiming at the service management information about node selection, the service available node information can be acquired based on the set regulated service routing node list so as to feed back the service available node information.
12. The method of claim 11, wherein the service governance plugin for service discovery sets a list of tuned service routing nodes by initiating an update operation on the service governance plugin for load balancing; the updating operation includes: and adding the node identification of the new node in the regulated service routing node list, deleting the node identification of the abnormal node, wherein the service governance plug-in related to load balancing is allowed to respond to the call of the service governance plug-in related to service discovery, and the service available node information is determined and returned according to the updated regulated service routing node list.
13. The method of claim 1, wherein prior to determining the abatement interceptor set from the interceptor sets, further comprising:
registering the service management plug-in corresponding to each service management system; each service governance plugin is configured with a registration auxiliary object, the registration auxiliary object executes corresponding service governance plugin registration processing through a static registration method, or when each service governance plugin performs component insertion processing, the registration processing of the corresponding service governance plugin is completed through an initialization method of executing a component;
Registering each interceptor, wherein the interceptor comprises a calling server interceptor and a called server interceptor; each interceptor is configured with a registration auxiliary object, and the registration auxiliary object executes corresponding interceptor registration processing through a static registration method, or when each interceptor performs component insertion processing, the corresponding interceptor registration processing is completed through an initialization method of executing a component.
14. The method of claim 1, wherein the invoking each governance interceptor prior to intercepting the target service further comprises:
acquiring a service management plug-in set;
And initializing each service governance plugin in the service governance plugin set according to the defined first dependency relationship and second dependency relationship among the service governance plugins so as to execute the interception processing of calling each governance interceptor to the target service after the initialization is completed.
15. The method of claim 14, wherein initializing each service governance plugin in the set of service governance plugins according to the defined first and second dependencies between each service governance plugin comprises:
Acquiring a target service governance plugin from a service governance plugin set;
judging whether each first service governance plugin with the first dependency relationship with the target service governance plugin is initialized or not;
if each first service governance plugin is initialized, further judging whether each second service governance plugin with a second dependency relationship with the target service governance plugin is initialized;
If each second service governance plugin is initialized, initializing the target service governance plugin;
if the service governance plugin set does not have the service governance plugin with the first dependency relationship with the target service governance plugin, determining that the initialization of the service governance plugin fails.
16. The method of claim 1, wherein the service governance plug-in comprises: a service governance plug-in for service registration; after the service governance plugin related to service registration is loaded, the service governance plugin related to service registration is used for registering and deregistering the node called by the target application to the corresponding service governance system, and the heartbeat message related to the node called by the target application is reported in the running process of the target application.
17. A service remediation device, comprising: the system comprises a processing unit and a communication unit, wherein the processing unit is used for carrying out information interaction through the communication unit;
The processing unit is used for determining a treatment interceptor set from the interceptor set, the treatment interceptor set comprises one or more treatment interceptors, and each treatment interceptor is used for intercepting a target application at a service end according to interception rules; acquiring service governance plugin identifiers from plugin configuration files, and configuring service governance plugins indicated by the service governance plugin identifiers; if an interception trigger event aiming at a target service in a business end is detected, calling an administration interceptor in an administration interceptor set to intercept the target service, and transmitting service administration information between a configured service administration plug-in and a service administration system corresponding to each administration interceptor; the service management information is generated according to the information obtained by the interception processing, and each service management system carries out service management on the target service through the corresponding service management information.
18. The intelligent device is characterized by comprising a processor and a communication interface, wherein the processor performs information interaction through the communication interface; the processor is configured to perform the method of any of claims 1-16.
19. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein computer program code which, when executed, is adapted to carry out the method according to any one of claims 1-16.
20. A computer program product, characterized in that the computer program product comprises computer program code which, when executed, is intended to implement the method of any one of claims 1-16.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211690178.4A CN118264719A (en) | 2022-12-27 | 2022-12-27 | Service management method and device, intelligent equipment, storage medium and program product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211690178.4A CN118264719A (en) | 2022-12-27 | 2022-12-27 | Service management method and device, intelligent equipment, storage medium and program product |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118264719A true CN118264719A (en) | 2024-06-28 |
Family
ID=91603872
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211690178.4A Pending CN118264719A (en) | 2022-12-27 | 2022-12-27 | Service management method and device, intelligent equipment, storage medium and program product |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118264719A (en) |
-
2022
- 2022-12-27 CN CN202211690178.4A patent/CN118264719A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11909604B2 (en) | Automatic provisioning of monitoring for containerized microservices | |
| US10908926B2 (en) | Plug-in management wrappers | |
| US11513864B2 (en) | Adoption of existing virtual computing resources into logical containers for management operations | |
| US11086685B1 (en) | Deployment of virtual computing resources with repeatable configuration as a resource set | |
| US10198210B2 (en) | Access control in a decentralized control plane of a computing system | |
| US11675774B2 (en) | Remote policy validation for managing distributed system resources | |
| EP3198436B1 (en) | System and method for providing an end-to-end lifecycle in a multitenant application server environment | |
| US10255102B2 (en) | Transaction control arrangement for device management system | |
| US20180324261A1 (en) | Method of network service descriptor management in a network functions virtualization | |
| EP1711891B1 (en) | Method and apparatus for composite user interface creation | |
| US20180091583A1 (en) | Multi-party updates to distributed systems | |
| CN112350978A (en) | Service processing method, system, device and storage medium | |
| US10397051B1 (en) | Configuration and testing of network-based service platform resources using a service platform specific language | |
| US9350738B2 (en) | Template representation of security resources | |
| US11570182B1 (en) | Compute-less authorization | |
| US12242634B2 (en) | Highly flexible, scalable multi blockchain, hierarchical data sharing and data storing system and method thereof | |
| US20170019455A1 (en) | Service onboarding | |
| US11567923B2 (en) | Application driven data change conflict handling system | |
| CN111385124A (en) | Gateway service implementation method, control device and gateway | |
| CN115086166A (en) | Computing system, container network configuration method, and storage medium | |
| CN112187501A (en) | Terminal grouping management method, device, equipment and storage medium | |
| CN110324722B (en) | Method, device, equipment and storage medium for acquiring data in live broadcast room | |
| CN112181599A (en) | Model training method, device and storage medium | |
| CN118264719A (en) | Service management method and device, intelligent equipment, storage medium and program product | |
| US20230376501A1 (en) | Asik: modular interface to blockchain |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication |