CN110417586A - Service monitoring method, service node, server and computer readable storage medium - Google Patents

Service monitoring method, service node, server and computer readable storage medium Download PDF

Info

Publication number
CN110417586A
CN110417586A CN201910649658.8A CN201910649658A CN110417586A CN 110417586 A CN110417586 A CN 110417586A CN 201910649658 A CN201910649658 A CN 201910649658A CN 110417586 A CN110417586 A CN 110417586A
Authority
CN
China
Prior art keywords
service
heartbeat message
corresponding relationship
abnormal
services
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.)
Granted
Application number
CN201910649658.8A
Other languages
Chinese (zh)
Other versions
CN110417586B (en
Inventor
郝向东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Big Data Technologies Co Ltd
Original Assignee
New H3C Big Data Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Big Data Technologies Co Ltd filed Critical New H3C Big Data Technologies Co Ltd
Priority to CN201910649658.8A priority Critical patent/CN110417586B/en
Publication of CN110417586A publication Critical patent/CN110417586A/en
Application granted granted Critical
Publication of CN110417586B publication Critical patent/CN110417586B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/535Tracking the activity of the user

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application proposes a kind of service monitoring method, service node, server and computer readable storage medium, it is related to field of computer technology, by collectively forming topological structure by multiple services including first service, and corresponding relationship is established into each service for including in topological structure and other at least one services, to make each service in topological structure, can whether abnormal by judging the reception condition of heartbeat message, determine whether be likely to occur abnormal service with the corresponding service of each service with the corresponding relationship, to realize the monitoring to multiple services states, compared with the prior art, by collectively forming topological structure by multiple services, and respectively other services corresponding with the service in topological structure are monitored by each service, there is Single Point of Faliure etc. so as to avoid independent monitoring service Other service monitoring functions are caused to lose completely.

Description

Service monitoring method, service node, server and computer readable storage medium
Technical field
This application involves field of computer technology, in particular to a kind of service monitoring method, service node, service Device and computer readable storage medium.
Background technique
When the service cluster system being made of multiple services provides service for user, in order to avoid certain services are different Often, lead to loss of data either system function failure etc., generally require the work to each service in service cluster system State is monitored, to ensure the operation of service cluster system normal table.
It is generally serviced at present using independent monitoring, each service in service cluster system is uniformly monitored;But Independent monitoring service can have Single Point of Faliure, if monitoring service itself exception occurs, may cause entire service The monitoring function of group system is lost, and can not persistently be monitored to entire service cluster system.
Summary of the invention
The application's is designed to provide a kind of service monitoring method, service node, server and computer-readable storage Medium persistently can provide monitoring service to topological structure.
To achieve the goals above, the embodiment of the present application the technical solution adopted is as follows:
In a first aspect, the embodiment of the present application provides a kind of service monitoring method, there is the service of first service applied to operation Node, the first service and other multiple services collectively form topological structure;Each service that the topological structure includes with Other at least one services, which are established, corresponding relationship, and the heart that each service is sent for receiving other corresponding services of the service Hop-information carries out abnormality detection other services corresponding to the service;The described method includes:
The first service judges whether the reception condition of heartbeat message is abnormal;
If it is determined that exception occurs in the reception condition of heartbeat message, then the first service judges that the first service is corresponding Whether there is abnormal service in other services.
Second aspect, the embodiment of the present application provide a kind of service node, and the service node operation has first service, described First service and other multiple services collectively form topological structure;Each service that the topological structure includes and other at least one A service foundation has corresponding relationship, and the heartbeat message that each service is sent for receiving other corresponding services of the service, right Other services corresponding to the service carry out abnormality detection;The service node includes:
Judgment module, for judging whether the case where first service receives heartbeat message be abnormal;
Processing module is used for if it is determined that exception occurs in the case where first service receives heartbeat message, then described in judgement Whether there is abnormal service in other corresponding services of first service.
The third aspect, the embodiment of the present application provide a kind of server, and the server includes memory, for storing one Or multiple programs;Processor;When one or more of programs are executed by the processor, above-mentioned service monitoring side is realized Method.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer program, The computer program realizes above-mentioned service monitoring method when being executed by processor.
A kind of service monitoring method, service node, server and computer-readable storage medium provided by the embodiments of the present application Matter, by each of being collectively formed topological structure by multiple services including first service, and will be included in topological structure Service establishes corresponding relationship with other at least one services, thus make each service in topological structure, it can be by judging the heart Whether whether the reception condition of hop-information is abnormal, determine with the corresponding relationship with the corresponding service of each service There is abnormal service, so that the monitoring to multiple services states is realized, compared with the prior art, so that by multiple services The monitoring function of the topological structure of composition is not necessarily to be serviced by independent monitoring and provide, but by each service pair in topological structure Other services corresponding with the service are monitored in topological structure, Single Point of Faliure occur so as to avoid independent monitoring service The topological structure service monitoring function Deng caused by is lost completely, it is ensured that persistently can provide monitoring service to topological structure.
To enable the above objects, features, and advantages of the application to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is a kind of illustrative application scene figure for monitoring service state in service cluster system;
Fig. 2 is a kind of schematic block diagram of server provided by the embodiments of the present application;
Fig. 3 is a kind of illustrative application scene figure of service monitoring method provided by the embodiments of the present application;
Fig. 4 is a kind of schematic flow chart for the service monitoring method that one embodiment of the application provides;
Fig. 5 is a kind of schematic flow chart of the sub-step of S201 in Fig. 4;
Fig. 6 is another schematic flow chart of the sub-step of S201 in Fig. 4;
Fig. 7 is a kind of schematic flow chart of the sub-step of S203 in Fig. 4;
Fig. 8 is a kind of schematic flow chart of the sub-step of S203-2 in Fig. 7;
Fig. 9 is another schematic flow chart of service monitoring method provided by the embodiments of the present application;
Figure 10 is a kind of schematic diagram of service node provided by the embodiments of the present application.
In figure: 100- server;101- memory;102- processor;103- communication interface;300- service node;301- Judgment module;302- processing module.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is implemented The component of example can be arranged and be designed with a variety of different configurations.
Therefore, the detailed description of the embodiments herein provided in the accompanying drawings is not intended to limit below claimed Scope of the present application, but be merely representative of the selected embodiment of the application.Based on the embodiment in the application, this field is common Technical staff's every other embodiment obtained without creative efforts belongs to the model of the application protection It encloses.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile the application's In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Referring to Fig. 1, Fig. 1 is a kind of illustrative application scene figure for monitoring service state in service cluster system, at present It is generally executed using monitoring scheme as shown in Figure 1 for the service cluster system that multiple services are constituted, that is, disposes independent use It is unified that all services in service cluster system are monitored in the monitoring service for carrying out service state monitoring;Service cluster Each service in system reports heartbeat message to monitoring service, if the heartbeat message that some service is reported to monitoring service goes out It is now abnormal, then the service appearance exception for servicing and determining that the heartbeat message is extremely corresponding is monitored, and generate warning information, to remind Maintenance personnel is handled.
But for monitoring scheme as shown in Figure 1, since each service in service cluster system relies on monitoring clothes Business carries out heartbeat inspecting, breaks down if the monitoring services itself, the monitoring function that may cause the service cluster system is lost It loses, cannot provide monitoring service again to all services, that is, have the defects that Single Point of Faliure.
Therefore, drawbacks described above, a kind of possible implementation provided by the embodiments of the present application are as follows: by advance more are based on In all services that the topological structure that a service is constituted is included, each service corresponding pass that at least one is serviced with other is established System, and each service receives the heartbeat message that other corresponding services of the service are sent, and the reception by judging heartbeat message Whether situation is abnormal, carries out abnormality detection to other services corresponding to the service;Even if exception occurs in some service, also only can It influences that there is the monitoring function of the service of corresponding relationship to lose with the service for exception occur, but not leads to entire topological structure Monitoring function is lost, so as to improve leading to not in the prior art because Single Point of Faliure occurs in the monitoring service of centralization to other The problem of service is monitored.
With reference to the accompanying drawing, it elaborates to some embodiments of the application.In the absence of conflict, following Feature in embodiment and embodiment can be combined with each other.
Referring to Fig. 2, Fig. 2 is a kind of schematic block diagram of server 100 provided by the embodiments of the present application.Server 100 include memory 101, processor 102 and communication interface 103,103 phase of the memory 101, processor 102 and communication interface It is directly or indirectly electrically connected between mutually, to realize the transmission or interaction of data, for example, these elements can pass through between each other One or more communication bus or signal wire, which are realized, to be electrically connected.
Memory 101 can be used for storing software program and module, and such as service node 300 provided by the embodiments of the present application is corresponding Program instruction/module, processor 102 is by executing the software program and module that are stored in memory 101, thereby executing each Kind functional application and data processing, to realize service monitoring method provided by the embodiments of the present application.The communication interface 103 can be used The communication of signaling or data is carried out in server 100 and other node devices.
Wherein, memory 101 can be but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc..
Processor 102 can be a kind of IC chip, have signal handling capacity.The processor 102 can be logical With processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processing, DSP), dedicated collection At circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components.
It is appreciated that structure shown in Fig. 2 is only to illustrate, server 100 can also include it is more than shown in Fig. 2 or Less component, or with the configuration different from shown in Fig. 2.Each component shown in Fig. 2 can using hardware, software or its Combination is realized.
Referring to Fig. 3, Fig. 3 is a kind of illustrative application scene figure of service monitoring method provided by the embodiments of the present application, Service monitoring method provided by the embodiments of the present application is applied to the service node of operation first service, such as can will be in Fig. 3 C is serviced as first service, the first service and other multiple services and collectively forms topological structure, and the topological structure includes At least one service of each service and other, which is established, corresponding relationship, and each service is for receiving other corresponding services of the service The heartbeat message of transmission carries out abnormality detection other services corresponding to the service.
Wherein, it is worth noting that, Fig. 3 is only to illustrate, and will belong to the common structure of multiple services of same service cluster system At topological structure;In some other possible implementation of the embodiment of the present application, multiple services of topological structure are collectively formed It can also be not belonging to same service cluster system, such as in application scenarios as shown in Figure 3, service A, service B, service C, clothes Business D and service E collectively forms topological structure, and service A, service B and service C belong to same service cluster system, and service D and clothes Business E belongs to another service cluster system.
Each service and other at least one services also, as a kind of possible implementation, in the topological structure The corresponding relationship of foundation can be in unidirectional such as shown in Fig. 3 application scenarios, and A and service E are serviced in the corresponding relationship Foundation has a corresponding relationship, and service B and service A foundation have a corresponding relationship, and service C and service B foundation have a corresponding relationship, service D with Service C, which is established, corresponding relationship, and service E and service D foundation have corresponding relationship, i.e., each in the corresponding relationship to service with other extremely The corresponding relationship of a service foundation is unidirectional less, and service A carries out abnormality detection service E, and it is different to service D progress to service E Often detection, service D carry out abnormality detection service C, and service C carries out abnormality detection service B, and service B carries out service A abnormal Detection.
But in some other possible application scenarios, the corresponding relationship that each service is established with other services be can also be It is two-way, such as based on application scenarios as shown in Figure 3, in the corresponding relationship service C and service corresponding relationship that E is established can be with It is heartbeat message two-way, that service C is sent for receiving service E, to be carried out abnormality detection to service E;Service E is also used for connecing The heartbeat message that business C is sent is conquered, to carry out abnormality detection to service C.
In addition, it is necessary to which explanation, all services that topological structure as shown in Figure 3 includes can be positioned at same In service node, it is also possible to be located in different service nodes;Such as in application scenarios as shown in Figure 3, to service C work For first service, service C can run on identical with others service (such as service A, service B, service D or service E) Service node, different service nodes can also be run on;Such as each service in Fig. 3 can respectively operate in it is different In service node, all service nodes for having at least one for including in the topological structure to service operation constitute service system, Service is provided for user.
The embodiment of the present application does not do any restrictions to whether each service in topological structure is located at same service node, this Depending on specific application scenarios, as long as first service and other multiple services can constitute topological structure.
Also, each service corresponding pass that at least one service is established with other in all services that the topological structure includes System, can be realized by the system program of setting;Such as service cluster system shown in Fig. 3 built, the service cluster system System is activated the either service cluster system when updating, and is serviced and other at least one services by the system program by each Corresponding relationship is established, to form topological structure.
Based on application scenarios as shown in Figure 3, referring to Fig. 4, Fig. 4 is the service monitoring side that one embodiment of the application provides A kind of schematic flow chart of method, comprising the following steps:
S201, first service judge whether the reception condition of heartbeat message is abnormal;If normal, S202 is executed;If abnormal, hold Row S203;
S202, first service determine in other corresponding services of first service do not occur abnormal service;
S203, first service judge abnormal service whether occur in other corresponding services of first service.
In the embodiment of the present application, first service receives corresponding with first service in corresponding relationship according to corresponding relationship The heartbeat message that other at least one services are sent, first service pass through judge whether the reception condition of heartbeat message is abnormal, from And it is abnormal to judge whether other services corresponding with first service service occur.
Wherein, if first service determines that exception occurs in the reception condition of heartbeat message, first service needs further to sentence Whether there is abnormal service in other the corresponding services of disconnected first service;If the reception condition of first service judgement heartbeat message Normally, then first service determines in other corresponding services of first service do not occur abnormal service, and first service may be used also at this time To be recorded to the working condition of other corresponding services of first service, to characterize first service monitoring determination and first service Other corresponding services are now at normal working condition.
For example, to service C in Fig. 3 as first service, it is assumed that in the corresponding relationship that system program is established with service C Corresponding service is service B;If the reception condition for servicing C judgement heartbeat message is normal, the working condition of service B is being characterized just Often;If service the reception condition exception of C judgement heartbeat message, the working condition for characterizing service B is likely to occur exception.
It is worth noting that above-mentioned example for ease of description, directly adopt service C with service B establish between the two it is useful It illustrates in the corresponding relationship of abnormality detection, in some other possible application scenarios of the embodiment of the present application, service C is being connect Get into the frame of mind for work hop-information when, it is also possible to without pay close attention to send the heartbeat message specific object, when service C determine heartbeat message reception When situation is normal, directly record is in normal mark letter for characterizing the working condition of other services corresponding with first service Breath;Such as in above-mentioned example, service C directly records the work for characterizing service corresponding with service C in the corresponding relationship Make state and is in normal first instruction information, it is normal without physical record service B;Heartbeat message is determined in service C Reception condition exception when, it is same only to need to record the work shape for characterizing service corresponding with service C in the corresponding relationship State is in abnormal second indication information.
Also, in some other possible application scenarios of the application, servicing C in the reception condition for judging heartbeat message is When no abnormal, it can also determine that it is service that it is corresponding in the corresponding relationship, which to service C, by way of inquiring the corresponding relationship B, to directly judge whether service B is abnormal.
As it can be seen that above scheme provided by the embodiments of the present application, by being wrapped in advance in the topological structure that multiple services are constituted In all services contained, the corresponding relationship of each service and other at least one services is established, and each service receives the service The heartbeat message that other corresponding services are sent, and whether the reception condition by judging heartbeat message is abnormal, to the service institute Other corresponding services carry out abnormality detection;Even if exception occurs in some service, it also only will affect and have with the abnormal service of appearance There is the monitoring function of the service of corresponding relationship to lose, but not the monitoring function of entire topological structure is caused to be lost.
Based on above-mentioned design, a kind of service monitoring method provided by the embodiments of the present application, by by including that first service exists Interior multiple services collectively form topological structure, and each service and other at least one service for including in topological structure is built Vertical corresponding relationship, thus make each service in topological structure, can whether abnormal by judging the reception condition of heartbeat message, Determine whether be likely to occur abnormal service with the corresponding service of each service with the corresponding relationship, thus realization pair The monitoring of multiple services states, compared with the prior art, so that the monitoring function for the topological structure being made of multiple services It is provided without being serviced by independent monitoring, but by each service in topological structure to corresponding with the service in topological structure Other services are monitored, and topological structure service monitoring caused by Single Point of Faliure etc. occur so as to avoid independent monitoring service Function is lost completely, it is ensured that persistently can provide monitoring service to topological structure.
It should be noted that the topological structure collectively formed by multiple services can be realized by diversified forms.
Optionally, the topology collectively formed as a kind of possible implementation, first service and other multiple services is tied Structure can be as shown in Figure 3 for ring topologies, each service and along ring topologies in the ring topologies The adjacent upper service composition corresponding relationship of first direction.Such as in application scenarios shown in Fig. 3, conduct in a counterclockwise direction For first direction, service A and service E establish corresponding relationship, and service B and service A establish corresponding relationship, and service C is built with service B Vertical corresponding relationship, service D and service C establish corresponding relationship, and service E and service D establish corresponding relationship, to make A, B, C, D, E It is sequentially connected to form cricoid topological structure;It is in a counterclockwise direction positive direction example in the ring topologies, services A Next service be service B, service B next service be service C, service C next service be service D, service D next clothes Business be that service E, service next service of E be service A, then according to the monitoring policy of above-mentioned corresponding relationship, service B to service A into Row, which monitors, service C is monitored service B, services D, which is monitored service C, services E is monitored service D, services A pairs Service E is monitored.
Also, as a kind of possible implementation, when forming the topological structure, system program can be set system program Monitoring cycle is jumped in centering, i.e., every each service in the cycle T of setting, topological structure to clothes corresponding in corresponding relationship Business sends heartbeat message;Similarly, then each service connects also according to the cycle T of the setting at the heartbeat detection time point of setting Receive heartbeat message transmitted by corresponding service in each comfortable corresponding relationship;Such as in application scenarios as shown in Figure 3, service B sends heartbeat message to service C according to the cycle T of setting, and similarly, service C receives what service B was sent according to the cycle T of setting Heartbeat message.
Wherein, it should be noted that the cycle T of above-mentioned setting, it can be based on each service generation business in topological structure The period of data is arranged, such as in application scenarios as shown in Figure 3, it is assumed that service A generates a business datum per minute, takes Business B and the service service data interaction of progress in C every five minutes, service A are handed over the business datum of progress in D every 10 minutes is serviced Mutually, and one business datum of generation in E every 3 minutes is serviced, then the cycle T of the setting can be set according to less than or equal to 1 minute Rule be configured, for example the cycle T of the setting can be set to 30 seconds or be 45 seconds etc., as long as the week of the setting Phase T can be less than or equal to any service in topological structure and generate between business datum or the time for carrying out service data interaction Every.
It optionally, can as one kind referring to Fig. 5, Fig. 5 is a kind of schematic flow chart of the sub-step of S201 in Fig. 4 The implementation of energy may include following sub-step when realizing S201:
S201-1, first service judge whether receive along ring topologies at the heartbeat detection time point of setting The heartbeat message that a upper service adjacent with first service is sent on one direction;If receiving, S201-2 is executed;If not receiving It arrives, then executes S201-3;
S201-2, first service determine that the reception condition of heartbeat message is normal;
S201-3, it is abnormal that first service determines that the reception condition of heartbeat message occurs.
Based on ring topologies shown in Fig. 3, each service in the ring topologies and along ring topologies An adjacent upper service forms the corresponding relationship on middle first direction, relatively, then each to service and along ring topologies Adjacent next service sends heartbeat message on first direction;Therefore, by taking first service as an example, first service according to setting week Phase T judges whether to receive in corresponding relationship adjacent with first service on first direction at the heartbeat detection time point of setting The heartbeat message that a upper service is sent, if receiving, first service determines that the reception condition of heartbeat message is normal;If not receiving It arrives, then it is abnormal to determine that the reception condition of heartbeat message occurs for first service.
In addition, if first service determines that exception, when executing S203, first service occurs in the reception condition of heartbeat message It is abnormal to determine that a upper service adjacent with first service on first direction along ring topologies occurs.Such as in such as Fig. 3 institute In the application scenarios shown, to service C as first service, counterclockwise as first direction, then in the application scenarios Under, a upper upper service adjacent with service C is service B in the counterclockwise direction in the ring topologies;If servicing C according to setting Heartbeat detection time point receive service B send heartbeat message, then service C determine service B working condition it is normal;If clothes Business C does not receive the heartbeat message that service B is sent according to the heartbeat detection time point of setting, then services the work that C determines service B State occurs abnormal.
As it can be seen that being based on above-mentioned design, a kind of service monitoring method provided by the embodiments of the present application, by setting topological structure Be set to ring-type, and make in the ring topologies it is each service in the ring topologies along first direction it is adjacent upper one Service composition corresponding relationship, thus make each service in the ring topologies in the ring topologies along first party It is monitored to an adjacent upper service, data volume when service monitoring can be simplified, reduce redundancy.
It is worth noting that above-mentioned implementation is only to illustrate, in some other possible applied field of the embodiment of the present application Jing Zhong, topological structure can be set to other forms, for example will service A, service B, service C, service D and service E arbitrarily two-by-two Corresponding relationship is established between service, so that topological structure be made to present in netted form;It either will service A, service B, service C, it services D and service E successively establishes two-way corresponding relationship, so that topological structure be made to present in the form of chain;The application is real Example is applied to the form of topological structure without limiting, if first service and other multiple services collectively form topological structure, and Each service and other at least one services in the topological structure, which are established, corresponding relationship.
In some possible application scenarios, first service may be corresponding with multiple services in the corresponding relationship, at this Under application scenarios, first service needs to receive the heartbeat message that multiple services are sent in the topological structure.Such as shown in Figure 3 Application scenarios in, illustrated using servicing C as first service, it is assumed that service C with service B establish have corresponding pass System, and service C and service E and there is service data interaction between the two;Service unit to ensure to service C and service E composition can Stable is that user provides service, can will service C and service in service C and service E there are on the basis of service data interaction E equally establishes the corresponding relationship for servicing abnormality detection;Then under the application scenarios, service C not only needs to receive service B hair The heartbeat message sent, service C also need to receive the heartbeat message that service E is sent.
Herein on basis, referring to Fig. 6, Fig. 6 is another schematic flow chart of the sub-step of S201 in Fig. 4, base In aforementioned applications scene, as alternatively possible implementation, S201 can also include following sub-step:
S201-5, first service judge the quantity and setting of the heartbeat message received at the heartbeat detection time point of setting Whether numerical value is identical;If they are the same, then S201-6 is executed;If not identical, S201-7 is executed;
S201-6, first service determine that the reception condition of heartbeat message is normal;
S201-7, it is abnormal that first service determines that the reception condition of heartbeat message occurs.
As a kind of possible implementation, system program establish either update topological structure as shown in Figure 3 when, System program can set numerical value, the setting according to the corresponding relationship of foundation for each service down distributing one in the topological structure Numerical value is the heartbeat message that each service is sent in the respective corresponding with service that the heartbeat inspecting time point of setting needs to receive Quantity.Such as in aforementioned applications scene, to service C as first service, system program is service C and service B is established There is corresponding relationship, and have corresponding relationship for service C and service E foundation, illustratively, system program is the setting for servicing C and issuing Numerical value is 2, and characterization service C needs to need to receive 2 heartbeat messages at the heartbeat inspecting time point of setting.Therefore, it is executing When S201, first service can the heartbeat message according to received by the heartbeat inspecting time point in setting quantity, with setting Numerical value is compared;If the two is identical, first service determines that the reception condition of heartbeat message is normal;Conversely, if the two is different, Then it is abnormal to determine that the reception condition of heartbeat message occurs for first service.To service C as first service and system program is service What C was issued set numerical value is is illustrated for 2, if service C receives 2 heartbeats letters at the heartbeat inspecting time point of setting Breath, it is identical as the service setting numerical value 2 of C is handed down to, then it services C and determines that the reception condition of heartbeat message is normal;If service C is being set Fixed heartbeat inspecting time point receives 0 heartbeat message (being not received by heartbeat message) or 1 heartbeat message, and issues It is not identical to the setting numerical value 2 of service C, then it services C and determines that exception occurs in the reception condition of heartbeat message.
It is worth noting that above are only example, can by first service with there are other of service data interaction services The corresponding relationship is established, the embodiment of the present application is not defined the condition for establishing the corresponding relationship, such as shown in Figure 3 Application scenarios in, it is assumed that service data interaction is simultaneously not present in service C and service both A, but still can establish service C and clothes Business A establishes the corresponding relationship between the two, this is depending on specific the application scenarios either concrete configuration of user.
In addition, in such as application scenarios shown in Fig. 3, to service C as first service and service C and service B and service E is established for having corresponding relationship, if service C determines that exception occurs in the reception condition of heartbeat message, there may be three kinds of feelings Condition: there is the heartbeat message that abnormal, service E is sent to service C and abnormal, service occurs in the heartbeat message that service B is sent to service C There is exception in the heartbeat message that B is sent to the heartbeat message of service C and service E is sent to service C.
But in aforementioned exemplary, service C and to service the relationship of both B be phase not to the utmost with the relationship for servicing both C and service B With, it is in service C and to service B based on system program when establishing the topological structure that service C and service B, which establishes corresponding relationship, Between establish the corresponding relationship;And servicing C and servicing E is that there may be service data interactions each other based on the two, to ensure Service C can be worked normally with service E, and then the corresponding relationship established between the two in service C and service E, so that service C It can judge whether the working condition of other side is in normal each other with service E.
Therefore, as a kind of possible implementation, the embodiment of the present application by each service it is corresponding other are any The corresponding relationship that service is established is divided into first kind corresponding relationship or the second class corresponding relationship, and all clothes that the topological structure includes Each service establishes first kind corresponding relationship with a service in other corresponding services in business;Wherein, for the first kind pair It should be related to, whether each service can directly judge the service that first kind corresponding relationship is established with the service extremely;And For the second class corresponding relationship, whether each service is carried out extremely to the service for establishing the second class corresponding relationship with service Auxiliary judgment.Such as in aforementioned exemplary, service C and service B establish corresponding relationship be first kind corresponding relationship, service C with Servicing the corresponding relationship that E is established is the second class corresponding relationship, then services whether C can carry out extremely the working condition of service B Directly judge, but whether exception then carries out auxiliary judgment to working condition of the service C to service E.
Wherein, it should be noted that directly judgement refers to that a service can be according to whether to receive the service corresponding Service the heartbeat message sent, directly judge the corresponding service of the service whether operation irregularity, and auxiliary judgment refers to a clothes Business according to whether receive the service it is corresponding service send heartbeat message, can only judge it is corresponding service for whether it is doubtful out It is now abnormal.
Such as in the examples described above, the corresponding relationship that service C and service B are established is first kind corresponding relationship, if then servicing C The heartbeat message that service B is sent is received, then it is working properly can to directly determine service B, services what B was sent if being not received by Heartbeat message can then directly determine service B operation irregularity;And servicing C with the corresponding relationship that E is established is serviced is that the second class is corresponding Relationship services C and determines that service E is in the state worked normally, if clothes if service C receives the heartbeat message that service E is sent Business C does not receive the heartbeat message that service E is sent, then services C and determine that the doubtful appearance of service E is abnormal, need further to judge clothes Be engaged in E whether operation irregularity.
Based on the above embodiment, next to judge first service it is corresponding other service in whether there is abnormal service Detailed process be illustrated, referring to Fig. 7, Fig. 7 be Fig. 4 in S203 sub-step a kind of schematic flow chart, as one The possible implementation of kind, S203 may include following sub-step:
S203-1, first service determine the heartbeat message and setting heartbeat letter received at the heartbeat detection time point of setting Manner of breathing is than default target heartbeat message;
S203-2, first service according to target heartbeat message, judgement need to send target heartbeat message service whether be The service of first kind corresponding relationship is established with first service;If it has, then executing S203-3;If it has not, then executing S203-4;
S203-3, the determining service for establishing first kind corresponding relationship with first service of first service occur abnormal;
S203-4, first service is determining not to occur exception with the service that first service establishes first kind corresponding relationship.
In the embodiment of the present application, first service takes in first kind corresponding relationship and the second class corresponding relationship with first Corresponding all services be engaged in when being monitored, whenever first service is according to the cycle T of setting, determines in the heartbeat detection of setting Between put heartbeat message reception condition it is normal when, first service can record the heartbeat message that the time point receives, And then using the heartbeat message of the record as setting heartbeat message, for judging that the reception condition of heartbeat message occurs next time When abnormal, the service of heartbeat exception is determined, wherein the setting heartbeat message includes first service in the heartbeat detection of setting Between point need received all heartbeat messages.
It is worth noting that the service due to heartbeat detection is usually periodic, then whenever first service determines heartbeat When the reception condition of information is normal, as a kind of possible implementation, the heartbeat letter received with current time can be used The mode that breath covers the normal heartbeat message that the last time receives, it is ensured that mistake of the first service in entire heartbeat detection Cheng Zhong, what first service recorded always sets heartbeat message as newest received normal heartbeat message.
In addition, can not also be covered last received in some other possible application scenarios of the embodiment of the present application Normal heartbeat message, and normal heartbeat message addition timestamp received each time is adopted as either according to time order and function The mode of sequence order of addition number will be determined as normal heartbeat message each time and be recorded as setting heartbeat message;As long as the One service can obtain setting heartbeat message as standard when whether the reception condition for judging heartbeat message is abnormal, with Obtain default target heartbeat message;In addition, in some other possible application scenarios of the application, it can also pass through and be The specified mode of system program, i.e. system program directly send the setting heartbeat message of generation when initializing the topological structure To first service, so that first service according to the received setting heartbeat message, obtains the heartbeat message received and the setting Heartbeat message compares default target heartbeat message.
As a result, when executing S203, heartbeat message that first service receives the heartbeat detection time point of the setting with The setting heartbeat message is compared, and obtains the heartbeat message received compared to target heartbeat letter default in setting heartbeat message Breath.Wherein, which can be in above-mentioned example, the heart that first service is recorded by way of constantly covering update Hop-information is also possible to the heartbeat message of the state-of-the-art record determined according to timestamp, or according to determined by serial number The largest number of heartbeat message;In addition, the default target heartbeat message that first service obtains, characterization is first service at this Heartbeat message lacking in the heartbeat message that the heartbeat detection time point of setting receives.
For example, for using above-mentioned service C as first service, if the setting heartbeat message of service C record includes { " flag ": [1,0] } and { " E ": urlA }, and service heartbeat message that C was received at the heartbeat detection time point set as { " E ": urlA }, then servicing the default target heartbeat message that C is determined is { " flag ": [1,0] };Alternatively, if service C is at this The heartbeat message that the heartbeat detection time point set receives then services the default mesh that C is determined as { " flag ": [1,0] } Marking heartbeat message is { " E ": urlA }.
First service be based on target heartbeat message obtained, judgement need to send the target heartbeat message service whether For the service for establishing first kind corresponding relationship with first service;If it has, then first service is determining to establish first with first service The service of class corresponding relationship occurs abnormal;If it has not, then first service is determining establishes first kind corresponding relationship with first service Service does not occur exception.
Wherein, to realize above-mentioned S203-2, optionally, referring to Fig. 8, Fig. 8 is one kind of the sub-step of S203-2 in Fig. 7 Schematic flow chart, as a kind of possible implementation, S203-2 may include following sub-step:
Whether S203-2a, first service judge in target heartbeat message comprising for characterizing first kind corresponding relationship One identification information;If including, S203-2b is executed;If not including has, S203-2c is executed.
S203-2b, first service determine that the service for needing to send target heartbeat message is to establish the first kind with first service The service of corresponding relationship;
S203-2c, first service determine that needing to send the service of target heartbeat message is not to establish first with first service The service of class corresponding relationship.
It in the embodiment of the present application, can be by the first identifier information of setting characterization first kind corresponding relationship, so that should Each service in topological structure can use the first identifier when receiving the heartbeat message that other corresponding services are sent Information determines and sends whether the service of the heartbeat message is the service for establishing first kind corresponding relationship with the service.
Therefore, first service is for the default target heartbeat message determined, judge in the target heartbeat message whether It include first identifier information;If including, first service determines that the service for needing to send target heartbeat message is and first The service of first kind corresponding relationship is established in service, so that it is determined that with first service establish first kind corresponding relationship service occur it is different Often;If not including, first service determines that needing to send the service of target heartbeat message is not to establish the first kind with first service The service of corresponding relationship may thereby determine that the service for establishing first kind corresponding relationship with first service does not occur exception.
Such as in the examples described above, as shown in connection with fig. 3, using service C as first service, service B be to establish the with service C For the service of a kind of corresponding relationship, and assume that first identifier information is " flag ";If the target heartbeat message that service C is determined It for { " flag ": [1,0] }, include first identifier information " flag " i.e. that characterization needs to send the service of the target heartbeat message and is There is exception with the service C service for establishing first kind corresponding relationship, i.e., service B occurs abnormal;If the target heart that service C is determined Hop-information is { " E ": urlA }, is not included first identifier information " flag ", that is, characterizes the service for needing to send target heartbeat message It is not the service that first kind corresponding relationship is established with service C, i.e. service B does not occur exception.
In addition, in monitoring scheme for example shown in FIG. 1, change mechanism for monitoring centered on monitoring service, generally requires pair Multiple and different service cluster systems are monitored, i.e., carry out the heart to a large amount of services from multiple and different service cluster systems Jump monitoring, and different service itself often has the function of different, if some service is caused to be broken down, the service of monitoring can only It records and alerts to maintenance personnel, so that maintenance personnel handles the service of failure, such as by maintenance personnel to out The service of existing failure, which restart, either removes service cluster system etc..
Therefore, it is the operation for reducing maintenance personnel, human resources is saved, referring to Fig. 9, Fig. 9 mentions for the embodiment of the present application Another schematic flow chart of the service monitoring method of confession, if executing, first service after S203 is determining to establish the with first service The service of a kind of corresponding relationship occurs abnormal, for example when servicing C in above-mentioned example and determining that service B occurs abnormal, then the service is supervised Prosecutor method is further comprising the steps of:
S204, first service judgement with first service establish first kind corresponding relationship service whether in topological structure Other services, which are established, the second class corresponding relationship;If foundation has, S205 is executed;If not set up, S206 is executed;
The update of identification information that working condition is used to indicate in target heartbeat message is abnormal mark by S205, first service Know, with more new settings heartbeat message;
Whether S206, the service that first service judgement establishes first kind corresponding relationship with first service are unloaded;If by unloading It carries, then executes S207;If not being unloaded, S209 is executed;
S207, first service instruction removes in topological structure establishes the service of first kind corresponding relationship simultaneously with first service Topological structure is reconstructed based on remaining service;
S208, first service remove target heartbeat message from setting heartbeat message;
The service that first kind corresponding relationship is established with first service is restarted in S209, first service instruction, and by target heartbeat The update of identification information that working condition is used to indicate in information is to restart mark, with more new settings heartbeat message.
In the embodiment of the present application, if first service judgement is established with first service have the service of first kind corresponding relationship with Other services in the topological structure, which are established, the second class corresponding relationship, then characterizes first service and be only used for building to first service The working condition of the service of vertical first kind corresponding relationship is recorded, then first service will be used to refer in target heartbeat message at this time Show that the update of identification information of working condition is built with instruction with first service for abnormal mark to update the setting heartbeat message The vertical service for having first kind corresponding relationship occurs abnormal.
Conversely, if first service is determining to establish the service of first kind corresponding relationship not and in the topological structure with first service Other services establish the second class corresponding relationship, then first service need to the clothes for establishing first kind corresponding relationship with first service Business carries out attended operation, it may be assumed that if first service determines that the service for establishing first kind corresponding relationship with first service has been unloaded, Then first service instruction removes the service that first kind corresponding relationship is established with first service in the topological structure, and based on residue Service reconstruct topological structure, and by target heartbeat message from setting heartbeat message in remove;If first service determines and first The service that first kind corresponding relationship is established in service is not unloaded, then first service instruction, which is restarted, establishes the first kind pair with first service The service that should be related to, and be to restart mark by the update of identification information for being used to indicate working condition in target heartbeat message, with more New setting heartbeat message, to indicate that the service for establishing first kind corresponding relationship in the topological structure with first service is weighing It opens.
It is worth noting that for above-mentioned S206 when realizing, first service can pass through tune as a kind of possible implementation It is realized with system program.For example, system program records the state of each service in topological structure in real time, for example, extremely, normally, quilt Unloading etc., first service can inquire the system program directly to judge the service for establishing first kind corresponding relationship with first service Whether it has been unloaded.
Furthermore it is possible to be responsible for safeguarding the topological structure by system program, for example topological structure is initialized, service is restarted, incites somebody to action It services and the topological structure is added and removal etc. from the topological structure will be serviced, first service is being indicated from topological structure When middle removal establishes the service of first kind corresponding relationship with first service, it can also be realized by calling system program;Certainly, may be used With understanding, in some other possible implementation of the embodiment of the present application, removal and first service in topological structure The operation of the service of first kind corresponding relationship is established, it can also be by the way that the topology of implantation setting updates journey in first service in advance Sequence removes the service for establishing first kind corresponding relationship with first service to realize in topological structure, updates the topological structure, only It wants to realize the service for removing and establishing first kind corresponding relationship with first service in the topological structure, and can be based on residue Service reconstruct topological structure.
Similarly, when realization first service instruction restarts and establishes the service of first kind corresponding relationship with first service, It can be realized by first service calling system program;It can also be appreciated that some other possible in the embodiment of the present application In implementation, can also by the way that instruction program is restarted in implantation setting in first service in advance, and then by first service from Row restarts the service that first kind corresponding relationship is established with first service, and each service of the embodiment of the present application indicates other server resets Mode of operation without limitation;Such as can be with are as follows: each service be previously provided with can be used for voluntarily restarting restart journey Sequence, first service can pass through Xiang Yu when the determining service for establishing first kind corresponding relationship with first service is not unloaded The mode that the reset routine being arranged in the service of first kind corresponding relationship sends activation instruction is established in one service, so that with the first clothes The service that first kind corresponding relationship is established in business is voluntarily restarted.
Illustratively, it is assumed that first service records the normal heart of service corresponding with first service in first kind corresponding relationship The format of hop-information is { " flag ": [x, y] };In the format, " flag " is first identifier information;X is in working condition mark, The value of " x " is used to indicate the working condition of the service, for example can indicate that (i.e. first service does not receive and first failure with 0 The heartbeat message that the service of first kind corresponding relationship is sent is established in service), 1 indicate that normal (i.e. first service receives and first The heartbeat message that the service of first kind corresponding relationship is sent is established in service), 2 indicate to restart and (establish the first kind with first service The service of corresponding relationship is being restarted);Y be synchronous regime mark, the value of " y " be used to indicate the service whether in topological structure Other services establish and have the second class corresponding relationship, for example can be indicated not set up the corresponding pass of the second class with other services with 0 System, 1, which indicate to establish with other services, the second class corresponding relationship.
Then application scenarios according to above-mentioned example and as shown in connection with fig. 3, it is assumed that service C is first service, and service B is first Service corresponding with service C in class corresponding relationship.If servicing the target heartbeat message that C is obtained is { " flag ": [1,0] }, then root According to the first identifier information " flag " for including in the target heartbeat message { " flag ": [1,0] }, services C and determine exception occur Service is service B;And according to deputy 0 in " [1,0] ", determine that service B and other services have not set up the corresponding pass of the second class System then services C calling system program and judges to service whether B is unloaded;If service C determines that service B has been unloaded, calling system Program is removed B is serviced from topological structure, and rebuilds topology based on remaining service A, service C, service D and service E Structure, and { " flag ": [1,0] } is removed from the setting heartbeat message that service C is recorded;If service C determines that service B is not unloaded It carries, then instruction restarts service B, such as calling system program to restart service B, and " 1 " in target heartbeat message is updated to " 2 ", 2 be to restart mark, i.e. target heartbeat message is updated to { " flag ": [2,0] }, indicates that service B is being restarted.
It is worth noting that in the examples described above, for servicing the target heartbeat message { " flag ": [1,0] } of C record, 1 in the target heartbeat message can be by service C record, and 0 in the target heartbeat message is recorded by service B;Take Business C when normally receiving the heartbeat message that service B is sent, the heartbeat message content that receives of service C can for " flag ": [x, 0] }, wherein x is that unknown quantity (or may be known quantity, for example be defaulted as 1), when service C determines to receive service B When heartbeat message is normal, x is updated to 1 by service C, i.e. the setting heartbeat message of service C record is updated to { " flag ": [1,0] }; If servicing C determines that the heartbeat message for receiving service B is abnormal, services C and fails to normally receive the heartbeat message that service B is sent, C is then serviced to be updated to " 1 " in target heartbeat message " 0 ", i.e. the heartbeat message of record service B is { " flag ": [0,0] }, Characterization service B failure;If service C determines that receiving service B is restarting, and services C and is updated to " 1 " in target heartbeat message " 2 ", the i.e. heartbeat message of record service B are { " flag ": [2,0] }, and characterization service B is being restarted.
In addition, if the target heartbeat message that service C is obtained is { " flag ": [1,1] }, indicating service B in aforementioned exemplary With other service establish have the second class corresponding relationship, then service C directly record service B heartbeat message for " flag ": [0, 1] }, service B failure is indicated.
On the other hand, please continue to refer to Fig. 9, if first service determine the service for needing to send target heartbeat message be not with First service establishes the service of first kind corresponding relationship, then the service monitoring method is further comprising the steps of:
S210, first service need to send the target heart according to the second identifier information for including in target heartbeat message, determination The service of hop-information is doubtful abnormal service, and determining establish with doubtful abnormal service has the of first kind corresponding relationship Two services;
S211, first service inquire the working condition of doubtful abnormal service to second service;If first service inquires Doubtful abnormal service is normal or is restarting, then executes S212;If it is different that first service inquires doubtful abnormal services Often, then S213 is executed;
S212, next heartbeat inspection at heartbeat detection time point of the doubtful abnormal service to be received such as first service in setting Survey the heartbeat message of time point transmission;
S213, first service judge whether doubtful abnormal service is unloaded;If being unloaded, S214 is executed;If not by Unloading, then execute S215;
Doubtful abnormal service is removed from topological structure and is reconstructed based on remaining service by S214, first service instruction Topological structure;
S208, first service remove target heartbeat message from setting heartbeat message;
S215, doubtful abnormal service is restarted in first service instruction, and restarts recording instruction to second service transmission, so that The case where second service is restarting doubtful abnormal service records.
In the embodiment of the present application, it establishes in transmitted heartbeat message between two of the second class corresponding relationship services and includes There is second identifier information, which is used to indicate has the first kind is corresponding to close with the service foundation for sending the heartbeat message The service of system;Such as, it is assumed that establishing transmitted heartbeat message between two of the second class corresponding relationship services is { " E ": urlA }, Then indicate that the service for sending the heartbeat message is service E, second identifier information is " urlA ", and urlA (inquiry address) is indicated and hair Giving the service E of the heartbeat message to establish has the service of first kind corresponding relationship for service A.Therefore, if first service determines to need The service for sending target heartbeat message is not the service that first kind corresponding relationship is established with first service, then first service is according to mesh The second identifier information for including in mark heartbeat message determines that the service for needing to send the target heartbeat message is doubtful abnormal clothes The second service for having first kind corresponding relationship is established in business, and the determining service with the exception;Such as in the examples described above, if with C is serviced as first service, it is assumed that the target heartbeat message that service C is determined is { " E ": urlA }, then services C and determine that service E is Doubtful abnormal service, and be second service with the service E service A for establishing first kind corresponding relationship.
Herein on basis, first service can inquire the working condition of the doubtful abnormal service to second service;One Aspect, if second service inquires the doubtful abnormal service normally or restarting, first service waits the doubtful exception Service the setting heartbeat detection time point next heartbeat detection time point send heartbeat message send heartbeat letter Breath.
On the other hand, if second service inquires the exception of the doubtful abnormal service, first service further judges Whether the doubtful abnormal service is unloaded, if first service determines that the doubtful abnormal service has been unloaded, first service Determine that not receiving the heartbeat message that the doubtful abnormal service is sent is since the doubtful abnormal service has been unloaded, no longer Belong to the topological structure, first service then indicates to remove the doubtful abnormal service in the topological structure, and based on remaining Service reconstruct topological structure;Conversely, first service determination does not receive if first determines that the doubtful abnormal service is not unloaded The heartbeat message sent to the doubtful abnormal service is the first service at this time since exception occurs in the doubtful abnormal service Then the doubtful abnormal service is restarted in instruction, and restarts recording instruction to second service transmission, so that second service is doubtful by this The case where abnormal service is being restarted is recorded.
Such as above-mentioned to service in example of the C as first service, if the target heartbeat message that service C is determined is { " E ": urlA }, then it represents that with service E (doubtful abnormal service) composition first kind corresponding relationship be service A (second clothes Business), service C is the working condition to service A query service E;If service C inquire service E working condition be " flag ": [1,1] } or { " flag ": [2,1] }, then it represents that service E is normal or is restarting, and services the service E to be received such as C at this time and sets at this The heartbeat message that next heartbeat detection time point at fixed heartbeat detection time point sends;If service C inquires the work of service E State is { " flag ": [0,1] }, then it represents that service E operation irregularity, service C calling system program judge to service whether E is unloaded It carries;If service C determines that service E has been unloaded, services C instruction and remove service E in topological structure, by remaining service A, clothes Business B, service C and service D rebuild topological structure, for example calling system program removes service E in topological structure;If service C determines that service E is not unloaded, then services C instruction and restart service E, to automatically process the service E for being in abnormal operation, and Recording instruction is restarted to service A transmission, is recorded with indicating service A for the state that E is being restarted is serviced, such as service A note The working condition of the service E of record is updated to { " flag ": [2,1] }.
It should be noted that first service inquires the doubtful exception to second service as a kind of possible implementation Service working condition mode, can using first service to second service send inquiry instruction by the way of, by second clothes The mode for the working condition for directly feeding back the doubtful abnormal service to first service of being engaged in is realized, either, using first service The corresponding heartbeat message of the doubtful abnormal service that record is obtained to second service, then parses second service by first service The heartbeat message of feedback is realized;The embodiment of the present application inquires to second service first service the work of the doubtful abnormal service The mode of state is without limiting, as long as first service can inquire the work shape of the doubtful abnormal service to second service State, such as, first service inquires the mode of the working condition of the doubtful abnormal service to second service, can also be First service calls the interface of second service, in the doubtful abnormal service that second service local parsing second service is recorded Corresponding heartbeat message, to obtain the working condition of the doubtful abnormal service.
Based on inventive concept identical with above-mentioned service monitoring method provided by the embodiments of the present application, referring to Fig. 10, figure 10 be a kind of schematic diagram of service node 300 provided by the embodiments of the present application, and the service node 300 operation has the first clothes Business, first service and other multiple services collectively form topological structure;Each service that topological structure includes and other at least one A service foundation has corresponding relationship, and the heartbeat message that each service is sent for receiving other corresponding services of the service, right Other services corresponding to the service carry out abnormality detection;The service node 300 includes judgment module 301 and processing module 302; Wherein:
Judgment module 301 is for judging whether the case where first service receives heartbeat message be abnormal;
Processing module 302 is used for if it is determined that the case where first service receives heartbeat message appearance exception, then judge the first clothes It is engaged in abnormal service whether occur in other corresponding services.
Optionally, as a kind of possible implementation, other corresponding services of first service there are it is multiple when, judge mould Block 301 is specifically used for when judging whether the case where first service receives heartbeat message be abnormal:
The quantity and setting numerical value for judging the heartbeat message that first service received at the heartbeat detection time point of setting is It is no identical, wherein to set the number for the heartbeat message that numerical value is received as first service in the heartbeat detection time point needs of setting Amount;
If it is different, it is abnormal then to determine that the case where first service receives heartbeat message occurs;
If they are the same, it is determined that it is normal that first service receives the case where heartbeat message.
Optionally, pair established as a kind of possible implementation, other corresponding any services of each service It should be related to for first kind corresponding relationship or the second class corresponding relationship, wherein each service in all services that topological structure includes First kind corresponding relationship is established with a service in other corresponding services, each service establishes the first kind pair to the service Whether the service that should be related to directly is judged that each service is to the service for establishing the second class corresponding relationship with the service extremely No abnormal progress auxiliary judgment;
It is specific to use when whether processing module 302 abnormal service occurs in judging other corresponding services of first service In:
Determine first service in the heartbeat message that the heartbeat detection time point of setting receives compared with setting heartbeat message Default target heartbeat message, wherein setting heartbeat message includes that first service needs to receive at heartbeat detection time point All heartbeat messages;
According to target heartbeat message, whether the service that judgement needs to send target heartbeat message is that the is established with first service The service of a kind of corresponding relationship;
If so, there is exception in the determining service for establishing first kind corresponding relationship with first service.
Optionally, as a kind of possible implementation, processing module 302 judges to need according to target heartbeat message Whether the service for sending target heartbeat message is when establishing the service of first kind corresponding relationship with first service, to be specifically used for:
Whether judge in target heartbeat message comprising the first identifier information for characterizing first kind corresponding relationship;
If including, it is determined that needing to send the service of target heartbeat message, the first kind is corresponding to close to establish with first service The service of system.
Optionally, as a kind of possible implementation, however, it is determined that establish the clothes of first kind corresponding relationship with first service There is exception in business, then processing module 302 is also used to:
Whether the service that judgement and first service establish first kind corresponding relationship establishes with other services in topological structure There is the second class corresponding relationship;
It is abnormal mark by the update of identification information for being used to indicate working condition in target heartbeat message if foundation has, With more new settings heartbeat message.
Optionally, as a kind of possible implementation, processing module 302 is also used to:
If the service for establishing first kind corresponding relationship with first service, which is not established with other services in topological structure, the Whether two class corresponding relationships, the then service that judgement establishes first kind corresponding relationship with first service are unloaded;
If being unloaded, indicate to remove service and the base for establishing first kind corresponding relationship with first service in topological structure Topological structure is reconstructed in remaining service;First service removes target heartbeat message from setting heartbeat message;
If not being unloaded, the service that first kind corresponding relationship is established with first service is restarted in instruction, and by target heartbeat The update of identification information that working condition is used to indicate in information is to restart mark, with more new settings heartbeat message.
Optionally, as a kind of possible implementation, processing module 302 is also used to:
If it is determined that the service for needing to send target heartbeat message is not the clothes for establishing first kind corresponding relationship with first service Business determines that it is doubtful for needing to send the service of target heartbeat message then according to the second identifier information for including in target heartbeat message Like abnormal service, and the determining second service for having first kind corresponding relationship with doubtful abnormal service foundation, wherein second It is second service that identification information, which is used to indicate and establishes the service for having first kind corresponding relationship with doubtful abnormal service,;
The working condition of doubtful abnormal service is inquired to second service;
If inquiring doubtful abnormal service normally or restarting, etc. doubtful abnormal service to be received in setting The heartbeat message that next heartbeat detection time point at heartbeat detection time point sends;
If it is abnormal to inquire doubtful abnormal services, judge whether doubtful abnormal service is unloaded;
If being unloaded, doubtful abnormal service is removed from topological structure and is opened up based on remaining service reconstruct by instruction Flutter structure;Target heartbeat message is removed from setting heartbeat message;
If not being unloaded, doubtful abnormal service is restarted in instruction, and restarts recording instruction to second service transmission, so that The case where second service is restarting doubtful abnormal service records.
Optionally, as a kind of possible implementation, topological structure is ring topologies;In ring topologies In, each service upper service composition corresponding relationship adjacent with the first direction along ring topologies;
Judgment module 301 is specifically used for when judging whether the case where first service receives heartbeat message be abnormal:
Judge whether receive along ring topologies on first direction with first at the heartbeat detection time point of setting Service the heartbeat message that an adjacent upper service is sent;
If receiving, determine that the case where first service receives heartbeat message is normal;
If not receiving, it is abnormal to determine that the case where first service receives heartbeat message occurs;
If it is determined that first service, which receives the case where heartbeat message, exception occurs, processing module 302 judges that first service is corresponding Other services in when whether there is abnormal service, be specifically used for:
It is abnormal to determine that a upper service adjacent with first service on first direction along ring topologies occurs.
It should be noted that judgment module 301 and processing module 302 that service node 300 includes, can be belonging The functional module of one service, for example one section of program code that first service includes is executed by the processor 102 in server 100, To realize above-mentioned service monitoring method;In some other possible implementation of the embodiment of the present application, service node 300 Including judgment module 301 and processing module 302 can also be the functional module unrelated to first service, at this time first clothes Business can realize above-mentioned service monitoring method by way of calling and executing the judgment module 301 and processing module 302.
In embodiment provided herein, it should be understood that disclosed device and method, it can also be by other Mode realize.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are shown According to the device of the embodiment of the present application, the architecture, function and operation in the cards of method and computer program product. In this regard, each box in flowchart or block diagram can represent a part of a module, section or code, the mould A part of block, program segment or code includes one or more executable instructions for implementing the specified logical function.
It should also be noted that function marked in the box can also be with difference in some implementations as replacement The sequence marked in attached drawing occurs.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes It can also execute in the opposite order, this depends on the function involved.
It is also noted that each box in block diagram and or flow chart and the box in block diagram and or flow chart Combination, can the dedicated hardware based system of as defined in executing function or movement realize, or can be with dedicated The combination of hardware and computer instruction is realized.
In addition, each functional module in the embodiment of the present application can integrate one independent part of formation together, It can be modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute the embodiment of the present application the method all or part of the steps.And it is preceding The storage medium stated includes: that USB flash disk, mobile hard disk, read-only memory, random access memory, magnetic or disk etc. are various can To store the medium of program code.
In conclusion a kind of service monitoring method, service node, server and computer provided by the embodiments of the present application can Storage medium is read, by collectively forming topological structure by multiple services including first service, and will be wrapped in topological structure Corresponding relationship is established in each service and other at least one services contained, to make each service in topological structure, Neng Goutong It crosses and judges whether the reception condition of heartbeat message is abnormal, determine to service corresponding service with each with the corresponding relationship Whether abnormal service is likely to occur, thus realize the monitoring to multiple services states, compared with the prior art, so that by The monitoring function for the topological structure that multiple services are constituted is not necessarily to be serviced by independent monitoring and provide, but by every in topological structure One service is monitored other services corresponding with the service in topological structure, services and occurs so as to avoid independent monitoring Topological structure service monitoring function caused by Single Point of Faliure etc. is lost completely, it is ensured that persistently can provide monitoring clothes to topological structure Business.
Also, by setting cyclic annular for topological structure, and make in the ring topologies each service with the ring-type Along the upper service composition corresponding relationship that first direction is adjacent in topological structure, to make each clothes in the ring topologies Business is monitored in the ring topologies along the adjacent upper service of first direction, can simplify number when service monitoring According to amount, redundancy is reduced.
The foregoing is merely preferred embodiment of the present application, are not intended to limit this application, for the skill of this field For art personnel, various changes and changes are possible in this application.Within the spirit and principles of this application, made any to repair Change, equivalent replacement, improvement etc., should be included within the scope of protection of this application.
It is obvious to a person skilled in the art that the application is not limited to the details of above-mentioned exemplary embodiment, Er Qie In the case where without departing substantially from spirit herein or essential characteristic, the application can be realized in other specific forms.Therefore, no matter From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and scope of the present application is by appended power Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims Variation is included in the application.Any reference signs in the claims should not be construed as limiting the involved claims.

Claims (11)

1. a kind of service monitoring method, which is characterized in that applied to operation first service service node, the first service with Other multiple services collectively form topological structure;
The each service and other at least one services that the topological structure includes, which are established, corresponding relationship, and each service is used for The heartbeat message that other corresponding services of the service are sent is received, other services corresponding to the service are carried out abnormality detection;
The described method includes:
The first service judges whether the reception condition of heartbeat message is abnormal;
If it is determined that the reception condition of heartbeat message occur it is abnormal, then the first service judge the first service it is corresponding other Whether abnormal service is occurred in service.
2. the method as described in claim 1, which is characterized in that other corresponding services of the first service there are it is multiple when, The first service judges whether the reception condition of heartbeat message is abnormal, comprising:
The first service judges that the quantity of the heartbeat message received at the heartbeat detection time point of setting and setting numerical value are It is no identical, wherein described to set what numerical value needed to receive as the first service at the heartbeat detection time point of the setting The quantity of heartbeat message;
If it is different, then the first service determines that exception occurs in the reception condition of heartbeat message;
If they are the same, then the first service determines that the reception condition of heartbeat message is normal.
3. method according to claim 2, which is characterized in that pair that other corresponding any services of each service are established It should be related to for first kind corresponding relationship or the second class corresponding relationship, wherein each in all services that the topological structure includes It services and establishes the first kind corresponding relationship with a service in other corresponding services, each service is established to the service Whether the service of the first kind corresponding relationship is directly judged that each service establishes second class to the service extremely Whether the service of corresponding relationship carries out auxiliary judgment extremely;
The first service judges abnormal service whether occur in other corresponding services of the first service, comprising:
The first service determines the heartbeat message and setting heartbeat message received at the heartbeat detection time point of the setting Compared to default target heartbeat message, wherein the setting heartbeat message includes the first service in the heartbeat detection Between point need all heartbeat messages for receiving;
The first service according to the target heartbeat message, judgement need to send the target heartbeat message service whether be The service of the first kind corresponding relationship is established with the first service;
If so, the determining service appearance for establishing the first kind corresponding relationship with the first service of the first service is different Often.
4. method as claimed in claim 3, which is characterized in that the first service is according to the target heartbeat message, judgement Whether the service for needing to send the target heartbeat message is the clothes that the first kind corresponding relationship is established with the first service Business, comprising:
Whether the first service judges in the target heartbeat message comprising for characterizing the first kind corresponding relationship One identification information;
If including, the first service determines that the service for needing to send the target heartbeat message is and the first service Establish the service of the first kind corresponding relationship.
5. the method as claimed in claim 3 or 4, which is characterized in that if first service determination is built with the first service Stand the first kind corresponding relationship service occur it is abnormal, then the method also includes:
First service judgement and the first service establish the first kind corresponding relationship service whether with the topology Other services in structure, which are established, the second class corresponding relationship;
If foundation has, the first service will be used to indicate the update of identification information of working condition in the target heartbeat message For abnormal mark, to update the setting heartbeat message.
6. method as claimed in claim 5, which is characterized in that the method also includes:
If with the first service establish the first kind corresponding relationship service not in the topological structure other service Foundation has the second class corresponding relationship, then first service judgement and the first service establish the corresponding pass of the first kind Whether the service of system is unloaded;
If being unloaded, the first service instruction removes in the topological structure establishes described first with the first service The service of class corresponding relationship simultaneously reconstructs topological structure based on remaining service;The first service by the target heartbeat message from It is removed in the setting heartbeat message;
If not being unloaded, the clothes that the first kind corresponding relationship is established with the first service are restarted in the first service instruction Business, and be to restart mark by the update of identification information for being used to indicate working condition in the target heartbeat message, described in updating Set heartbeat message.
7. the method as claimed in claim 3 or 4, which is characterized in that the method also includes:
If it is not to establish institute with the first service that the first service judgement, which needs to send the service of the target heartbeat message, The service of first kind corresponding relationship is stated, then the first service is believed according to the second identifier for including in the target heartbeat message Breath determines that the service for needing to send the target heartbeat message is doubtful abnormal service, and the determining and doubtful exception Service establish and have the second service of the first kind corresponding relationship, wherein the second identifier information be used to indicate with it is described It is the second service that the service for having the first kind corresponding relationship is established in doubtful abnormal service;
The first service inquires the working condition of the doubtful abnormal service to the second service;
If the first service inquires the doubtful abnormal service normally or restarting, described first service etc. is waiting Receive the heartbeat that the doubtful abnormal service is sent at next heartbeat detection time point at the heartbeat detection time point of the setting Information;
If the first service inquires, the doubtful abnormal services is abnormal, and the first service judges described doubtful Whether abnormal service is unloaded;
If being unloaded, the doubtful abnormal service is removed and is based on from the topological structure by the first service instruction Remaining service reconstructs topological structure;The first service moves the target heartbeat message from the setting heartbeat message It removes;
If not being unloaded, the doubtful abnormal service is restarted in the first service instruction, and is sent to the second service Recording instruction is restarted, so that the second service records the case where restarting the doubtful abnormal service.
8. the method as described in claim 1, which is characterized in that the topological structure is ring topologies;In the ring-type In topological structure, each service upper service composition corresponding pass adjacent with the first direction along the ring topologies System;
The first service judges whether the reception condition of heartbeat message is abnormal, comprising:
The first service judges whether receive first along the ring topologies at the heartbeat detection time point of setting The heartbeat message that a upper service adjacent with the first service is sent on direction;
If receiving, the first service determines that the reception condition of heartbeat message is normal;
If not receiving, it is abnormal that the first service determines that the reception condition of heartbeat message occurs;
If it is abnormal that the first service determines that the reception condition of heartbeat message occurs, the first service judges the first service Whether there is abnormal service in other corresponding services, comprising:
The first service determines a upper clothes adjacent with the first service on first direction along the ring topologies Business occurs abnormal.
9. a kind of service node, which is characterized in that service node operation has a first service, the first service and it is multiple its He collectively forms topological structure at service;
The each service and other at least one services that the topological structure includes, which are established, corresponding relationship, and each service is used for The heartbeat message that other corresponding services of the service are sent is received, other services corresponding to the service are carried out abnormality detection;
The service node includes:
Judgment module, for judging whether the case where first service receives heartbeat message be abnormal;
Processing module is used for if it is determined that the case where first service receives heartbeat message appearance exception, then judge described first It services in other corresponding services and abnormal service whether occurs.
10. a kind of server characterized by comprising
Memory, for storing one or more programs;
Processor;
When one or more of programs are executed by the processor, such as side of any of claims 1-8 is realized Method.
11. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt Such as method of any of claims 1-8 is realized when processor executes.
CN201910649658.8A 2019-07-18 2019-07-18 Service monitoring method, service node, server and computer readable storage medium Active CN110417586B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910649658.8A CN110417586B (en) 2019-07-18 2019-07-18 Service monitoring method, service node, server and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910649658.8A CN110417586B (en) 2019-07-18 2019-07-18 Service monitoring method, service node, server and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110417586A true CN110417586A (en) 2019-11-05
CN110417586B CN110417586B (en) 2022-04-08

Family

ID=68361945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910649658.8A Active CN110417586B (en) 2019-07-18 2019-07-18 Service monitoring method, service node, server and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110417586B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651294A (en) * 2020-05-13 2020-09-11 浙江华创视讯科技有限公司 Node abnormity detection method and device
CN113645102A (en) * 2021-10-14 2021-11-12 腾讯科技(深圳)有限公司 Method and device for determining route convergence time
CN114189464A (en) * 2021-11-24 2022-03-15 国能大渡河瀑布沟发电有限公司 Communication abnormity monitoring and alarming method for power monitoring system
WO2022199229A1 (en) * 2021-03-25 2022-09-29 北京金山云网络技术有限公司 Suspended transaction inspection method and apparatus, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215123A (en) * 2011-06-07 2011-10-12 南京邮电大学 Multi-ring-network-topology-structure-based large-scale trunking system
CN103763155A (en) * 2014-01-24 2014-04-30 国家电网公司 Multi-service heartbeat monitoring method for distributed type cloud storage system
CN104811325A (en) * 2014-01-24 2015-07-29 华为技术有限公司 Cluster node controller monitoring method, related device and controller
CN107733684A (en) * 2017-08-31 2018-02-23 北京宇航系统工程研究所 A kind of multi-controller computing redundancy cluster based on Loongson processor
CN109361525A (en) * 2018-10-25 2019-02-19 珠海派诺科技股份有限公司 Restart method, apparatus, controlling terminal and medium that distributed deployment services more
CN109714183A (en) * 2017-10-26 2019-05-03 阿里巴巴集团控股有限公司 Data processing method and device in a kind of cluster

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102215123A (en) * 2011-06-07 2011-10-12 南京邮电大学 Multi-ring-network-topology-structure-based large-scale trunking system
CN103763155A (en) * 2014-01-24 2014-04-30 国家电网公司 Multi-service heartbeat monitoring method for distributed type cloud storage system
CN104811325A (en) * 2014-01-24 2015-07-29 华为技术有限公司 Cluster node controller monitoring method, related device and controller
CN107733684A (en) * 2017-08-31 2018-02-23 北京宇航系统工程研究所 A kind of multi-controller computing redundancy cluster based on Loongson processor
CN109714183A (en) * 2017-10-26 2019-05-03 阿里巴巴集团控股有限公司 Data processing method and device in a kind of cluster
CN109361525A (en) * 2018-10-25 2019-02-19 珠海派诺科技股份有限公司 Restart method, apparatus, controlling terminal and medium that distributed deployment services more

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651294A (en) * 2020-05-13 2020-09-11 浙江华创视讯科技有限公司 Node abnormity detection method and device
WO2022199229A1 (en) * 2021-03-25 2022-09-29 北京金山云网络技术有限公司 Suspended transaction inspection method and apparatus, electronic device and storage medium
CN113645102A (en) * 2021-10-14 2021-11-12 腾讯科技(深圳)有限公司 Method and device for determining route convergence time
CN113645102B (en) * 2021-10-14 2022-02-08 腾讯科技(深圳)有限公司 Method and device for determining route convergence time
CN114189464A (en) * 2021-11-24 2022-03-15 国能大渡河瀑布沟发电有限公司 Communication abnormity monitoring and alarming method for power monitoring system

Also Published As

Publication number Publication date
CN110417586B (en) 2022-04-08

Similar Documents

Publication Publication Date Title
CN110417586A (en) Service monitoring method, service node, server and computer readable storage medium
CN104615497B (en) A kind of processing method and processing device of thread suspension
CN110213068B (en) Message middleware monitoring method and related equipment
CN105610648B (en) A kind of acquisition method and server of O&M monitoring data
CN112311617A (en) Configured data monitoring and alarming method and system
CN106940677A (en) One kind application daily record data alarm method and device
CN112650642B (en) Alarm processing method and device, equipment and storage medium
CN109245966A (en) The monitoring method and device of the service state of cloud platform
CN111143167B (en) Alarm merging method, device, equipment and storage medium for multiple platforms
CN110502326A (en) Cloud service scheduling and recovering method based on fault detection and terminal equipment
CN110196780B (en) Method, device, storage medium and electronic device for determining server state
CN114091610A (en) Intelligent decision method and device
CN113364628A (en) Method and equipment for establishing topological relation between server and switch
CN114070711A (en) Alarm information processing method and device, electronic equipment and storage medium
CN106487597A (en) A kind of service monitoring system and method based on Zookeeper
CN112860504A (en) Monitoring method and device, computer storage medium and electronic equipment
CN110750425A (en) Database monitoring method, device and system and storage medium
CN111062503A (en) Power grid monitoring alarm processing method, system, terminal and storage medium
CN105357026B (en) A kind of resource information collection method and calculate node
CN111209333B (en) Data updating method, device, terminal and storage medium
CN112260902A (en) Network equipment monitoring method, device, equipment and storage medium
CN110401570B (en) Alarm method, device, system, equipment and readable storage medium
CN108248641A (en) A kind of urban track traffic data processing method and device
CN116136801B (en) Cloud platform data processing method and device, electronic equipment and storage medium
CN113835961B (en) Alarm information monitoring method, device, server and storage medium

Legal Events

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