CN108833205B - Information processing method, information processing device, electronic equipment and storage medium - Google Patents

Information processing method, information processing device, electronic equipment and storage medium Download PDF

Info

Publication number
CN108833205B
CN108833205B CN201810577765.XA CN201810577765A CN108833205B CN 108833205 B CN108833205 B CN 108833205B CN 201810577765 A CN201810577765 A CN 201810577765A CN 108833205 B CN108833205 B CN 108833205B
Authority
CN
China
Prior art keywords
information
service node
node
connection information
service
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.)
Active
Application number
CN201810577765.XA
Other languages
Chinese (zh)
Other versions
CN108833205A (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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201810577765.XA priority Critical patent/CN108833205B/en
Publication of CN108833205A publication Critical patent/CN108833205A/en
Application granted granted Critical
Publication of CN108833205B publication Critical patent/CN108833205B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • 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/0677Localisation of faults
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Abstract

The embodiment of the invention provides an information processing method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method is applied to a distributed system with a plurality of service nodes, and comprises the following steps: acquiring a connection information table containing connection information of the plurality of service nodes and a main control node in the distributed system; receiving heartbeat information sent to the master control node by each service node in the plurality of service nodes; judging whether the connection between the service node and the main control node is failed or not based on the heartbeat information; and if the connection is judged to be failed, deleting the connection information of the service node from the connection information table. The technical scheme of the embodiment of the invention can automatically shield unavailable service nodes, thereby ensuring the service availability of each service node of the distributed system.

Description

Information processing method, information processing device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an information processing method, an information processing apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of the internet, the amount of data to be processed increases in a geometric progression, a single computer cannot provide enough storage space and processing capacity, and a distributed system is also receiving more and more attention.
A distributed system is a system in which hardware or software components are distributed among different network computers, communicating and coordinating with each other through messaging. In a distributed system, when a service node, i.e., a network computer, fails, for example, under an excessive load, and a hard disk fails, the service node may not provide a service to the outside, and it is difficult to ensure the availability of the service of the entire distributed system.
Accordingly, it is desirable to provide an information processing method, an information processing apparatus, an electronic device, and a computer-readable storage medium capable of solving one or more of the above-described problems.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the invention and therefore may include information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
An object of embodiments of the present invention is to provide an information processing method, an information processing apparatus, an electronic device, and a computer-readable storage medium, which overcome one or more of the problems due to the limitations and disadvantages of the related art, at least to some extent.
According to a first aspect of the embodiments of the present invention, there is provided an information processing method applied to a distributed system having a plurality of service nodes, including: acquiring a connection information table containing connection information of the plurality of service nodes and a main control node in the distributed system; receiving heartbeat information sent to the master control node by each service node in the plurality of service nodes; judging whether the connection between the service node and the main control node is failed or not based on the heartbeat information; and if the connection is judged to be failed, deleting the connection information of the service node from the connection information table.
In some embodiments of the present invention, based on the foregoing solution, acquiring a connection information table including connection information between the plurality of service nodes and a master node in the distributed system includes: acquiring connection information of the plurality of service nodes and a master control node in the distributed system; and establishing the connection information table based on the connection information, and refreshing the connection information table at preset time intervals.
In some embodiments of the present invention, based on the foregoing scheme, determining whether the connection between the service node and the master node fails based on the heartbeat information includes: acquiring confirmation information returned to the service node by the master control node in response to the heartbeat information; judging whether the difference between the frequency of the heartbeat information and the frequency of the confirmation information is larger than a first preset value or not; and if the judgment result is larger than the first preset value, determining that the connection between the service node and the main control node fails.
In some embodiments of the present invention, based on the foregoing scheme, the information processing method further includes: sending communication detection information to each service node in the plurality of service nodes through the master control node; acquiring detection confirmation information which is received by the master control node and returned by each service node in response to the communication detection information; and determining whether the main control node fails or not based on the proportion of the total times of the detection confirmation information and the total times of the communication detection information.
In some embodiments of the present invention, based on the foregoing solution, determining whether the master node fails based on a ratio of the total number of times of the detection confirmation information to the total number of times of the communication detection information includes: counting the total times of the communication detection information and the total times of the detection confirmation information; judging whether the ratio of the total times of the detection confirmation information to the total times of the communication detection information in a preset time is smaller than a second preset value or not; and if the judgment result is smaller than the second preset value, determining that the main control node fails.
In some embodiments of the present invention, based on the foregoing solution, before removing the connection information of the service node from the connection information table, the information processing method further includes: determining another service node connected with the service node in the connection information table; and loading the data on the service node to the other service node.
In some embodiments of the present invention, based on the foregoing scheme, the information processing method further includes: and after the connection information table is refreshed, sending the refreshed connection information table to each service node in the connection information table.
According to a second aspect of the embodiments of the present invention, there is provided an information processing apparatus applied to a distributed system having a plurality of service nodes, including: an obtaining unit, configured to obtain a connection information table including connection information between the plurality of service nodes and a master node in the distributed system; a receiving unit, configured to receive heartbeat information sent by each service node in the multiple service nodes to the master control node; the judging unit is used for judging whether the connection between the service node and the main control node fails or not based on the heartbeat information; and the removing unit is used for removing the connection information of the service node from the connection information table when the connection is judged to be failed.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including: a processor; and a memory having stored thereon computer-readable instructions which, when executed by the processor, implement the information processing method according to the first aspect described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the information processing method according to the first aspect described above.
In the technical solutions provided in some embodiments of the present invention, on one hand, a connection information table including connection information of a service node and a master node is obtained, and connection information of available service nodes can be obtained; on the other hand, whether the connection fails is judged based on the heartbeat information sent by the service node to the main control node, and the connection information of the service node is deleted from the connection information table when the connection fails, so that the unavailable service node can be automatically shielded, and the service availability of each service node of the distributed system can be ensured.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 illustrates a flow diagram of an information processing method according to some embodiments of the invention;
FIG. 2 illustrates a flow diagram for determining whether a connection of a serving node to a master node has failed in accordance with some embodiments of the invention;
FIG. 3 illustrates a flow diagram for determining whether a master node has failed in accordance with some embodiments of the invention;
fig. 4 shows a schematic block diagram of an information processing apparatus according to an exemplary embodiment of the present invention;
FIG. 5 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
FIG. 1 illustrates a flow diagram of an information processing method applied to a distributed system having a plurality of service nodes, according to some embodiments of the invention. Referring to fig. 1, the information processing method includes the steps of:
step S110, obtaining a connection information table containing connection information of the plurality of service nodes and the main control node in the distributed system;
step S120, receiving heartbeat information sent to the master control node by each service node in the plurality of service nodes;
step S130, judging whether the connection between the service node and the main control node is failed or not based on the heartbeat information;
step S140, if it is determined that the connection fails, deleting the connection information of the service node from the connection information table.
According to the information processing method in the example embodiment of fig. 1, on one hand, a connection information table containing connection information between a service node and a master node is obtained, so that connection information of available service nodes can be obtained; on the other hand, whether the connection fails is judged based on the heartbeat information sent by the service node to the main control node, and the connection information of the service node is deleted from the connection information table when the connection fails, so that the unavailable service node can be automatically shielded, and the service availability of each service node of the distributed system can be ensured.
Next, the information processing method in the exemplary embodiment of fig. 1 will be described in detail.
In step S110, a connection information table including connection information between the plurality of service nodes and the master node in the distributed system is obtained.
The information processing method in the example of fig. 1 may be applied to a server of a distributed system having a plurality of service nodes, each of which stores a static resource and a dynamic resource corresponding to a service provided by the distributed system. For example, when the service provided by the distributed system is a commodity sales service, information such as website page information, commodity information, order information, and the like may be stored in each service node. In addition, each service node has a function of independently interacting data with the outside, each service node can monitor the heartbeat signal, and when one service node monitors that the heartbeat signal cannot be kept, the other service node is driven to load corresponding data onto the other service node.
Further, the distributed system may further include a master control node, where the master control node is a node that controls the plurality of service nodes, and the master control node may receive monitoring data sent by each service node, and when the monitoring data of a service node indicates that the heartbeat signal of the service node cannot be maintained, drive the service node to load corresponding data thereon to another service node. In some embodiments, the server may act as a master node for a distributed system. The connection information of the service node and the master node of the distributed system may include: IP (Internet Protocol) address information of the service node, port name information, and the like.
In some embodiments, connection information of a plurality of service nodes and a master node in the distributed system may be obtained, and a connection information table may be established based on the connection information of each service node and the master node. Further, the connection information table, i.e. the contact information between each service node and the master node, may be refreshed at predetermined time intervals.
It should be noted that the predetermined time interval may be set according to the number of service nodes in the distributed system and the number of currently available service nodes, for example, a connection information table may be refreshed every 5 minutes, before the refreshing, the a1, a2, and A3 service nodes are connected to the master node, the connection information table includes connection information of the a1, a2, and A3 service nodes, and after the refreshing, the a2 service node is dropped, that is, connection information of the a2 service node cannot be obtained, the connection information table includes connection information of the a1 and A3 service nodes.
In step S120, heartbeat information sent by each service node of the plurality of service nodes to the master node is received.
In some embodiments, each service node in the distributed system sends heartbeat information to the master control node at regular time, where the heartbeat information is a self-defined information field that informs the other side of its own state at regular time between the sending end and the receiving end, and the heartbeat information may be sent at a certain time interval, for example, 1 s. The heartbeat information can be used to determine whether the connection between the service node and the master node has failed.
Step S130, judging whether the connection between the service node and the main control node is failed or not based on the heartbeat information.
In some embodiments, if the master node does not receive the heartbeat information within a predetermined time, for example, 1s, a count of reception failures is performed, and if the count of reception failures reaches a predetermined value, it is determined that the connection between the service node and the master node has failed. For example, when the master node cannot receive the heartbeat information of the a2 service node 3 times in succession, it is determined that the connection between the a2 service node and the master node has failed.
Step S140, if it is determined that the connection fails, deleting the connection information of the service node from the connection information table.
In some embodiments, when it is determined that the connection between the service node and the master node fails, the connection information of the service node may be deleted from the connection information table, and after the service node is deleted, other service nodes may not be able to call the deleted service node. For example, when it is determined that the connection between the a2 service node and the master node is failed, the connection information of the a2 service node is deleted from the connection information table, and the remaining service nodes cannot retrieve the connection information of the a2 service node.
In addition, in some embodiments, when the connection between the service node and the master node fails, before the connection information of the service node is removed from the connection information table, another service node connected to the service node in the connection information table may be determined, and data on the service node is loaded to the another service node. By loading the data node on the failed service node onto another service node that is available, the availability of the services of the entire distributed system can be guaranteed.
Further, in some embodiments, after refreshing the connection information table, the refreshed connection information table is sent to each serving node in the connection information table. For example, at the current time, it is detected that a1, A3, B1, and B2 service nodes in the distributed system are connected to the master node, and after connection information between a1, A3, B1, and B2 service nodes and the master node is acquired, the connection information is collected and sorted into a connection information list, and the connection information list is sent to a1, A3, B1, and B2 service nodes, respectively, and after a predetermined time elapses, the connection information list is refreshed, and is sent to a1, A3, B1, and B2 service nodes, respectively, so as to ensure that the a1, A3, B1, and B2 service nodes can receive the latest connection information. When the B1 service node calls the data of the a1 service node, it knows that the a1 service node is available according to the connection information, and calls the data of the a1 service node according to the predetermined routing rule.
Fig. 2 illustrates a flow diagram for determining whether a connection of a serving node with a master node has failed in accordance with some embodiments of the invention.
Referring to fig. 2, in step S210, confirmation information returned by the master node to the service node in response to the heartbeat information is obtained.
In an example embodiment, when receiving heartbeat information sent by a service node, a master control node sends acknowledgement information to the corresponding service node in response to the heartbeat information, wherein the acknowledgement information indicates that the heartbeat information of the corresponding service node has been received.
In step S220, it is determined whether a difference between the number of times of the heartbeat information and the number of times of the confirmation information is greater than a first predetermined value.
In an example embodiment, whether the connection between the service node and the main control node fails may be determined by comparing the number of the heartbeat information sent by the service node with the number of the acknowledgement information returned by the main control node. For example, when the first predetermined value is 3 and the service node sends 10 times of heartbeat information, the main control node only returns 6 times of confirmation information, and the difference between the number of times of heartbeat information sent by the service node and the number of times of confirmation information returned by the main control node is 4, which is greater than the first predetermined value 3.
In step S230, if it is determined that the connection between the service node and the main control node is greater than the first predetermined value, it is determined that the connection between the service node and the main control node fails.
And if the difference between the number of times of the heartbeat information sent by the service node and the number of times of the confirmation information returned by the main control node is larger than a first preset value, determining that the connection between the service node and the main control node fails.
It should be noted that the first predetermined value is set according to the number of service nodes in the distributed system and the number of currently available service nodes, and when the number of service nodes in the distributed system and the number of currently available service nodes are large, the first predetermined value may be set to be large, for example, 5 times.
Fig. 3 illustrates a flow diagram for determining whether a master node has failed in accordance with some embodiments of the invention.
Referring to fig. 3, in step S310, communication detection information is sent to each of the plurality of service nodes through the master node. For example, the master node may send the communication detection information to all the service nodes, and count the total number of times of sending the communication detection information.
In step S320, detection confirmation information returned by each service node in response to the communication detection information received by the master node is obtained. In an example embodiment, the service node sends heartbeat information, i.e. detection confirmation information, to the master node according to the received communication detection information. Further, the total number of times of heartbeat information received by the master node may be counted.
In step S330, it is determined whether the master node fails based on a ratio of the total number of times of the detection confirmation information and the total number of times of the communication detection information.
The ratio of the total number of times of communication detection information to the total number of times of detection confirmation information in a predetermined time may be calculated, and it is determined whether the ratio is smaller than a second predetermined value, where the second predetermined value may be set according to the number of service nodes in the distributed system and the processing capability of the master node. And if the ratio is smaller than the second preset value, determining that the main control node fails.
For example, if the second predetermined value is 80%, the master node receives a piece of corresponding heartbeat information after sending the communication detection information once, and determines that the communication is successful, and if the master node does not receive a piece of corresponding heartbeat information after sending the communication detection information once, the communication is failed. If the master control node accumulatively sends 100 pieces of communication detection information to all the service nodes within 15 minutes, only 50 pieces of heartbeat information are received, the successful receiving proportion is 50 percent and is less than the preset communication success proportion 80 percent, and the master control node is in a fault state at the moment.
Furthermore, in an embodiment of the present invention, an information processing apparatus is also provided. Referring to fig. 4, the information processing apparatus 400 is applied to a distributed system having a plurality of service nodes, and the information processing apparatus 400 may include: an acquisition unit 410, a receiving unit 420, a judging unit 430 and a removing unit 440. The obtaining unit 410 is configured to obtain a connection information table including connection information between the plurality of service nodes and a master node in the distributed system; the receiving unit 420 is configured to receive heartbeat information sent by each service node in the multiple service nodes to the master control node; the judging unit 430 is configured to judge whether the connection between the service node and the master node fails based on the heartbeat information; the removing unit 440 is configured to remove the connection information of the service node from the connection information table when it is determined that the connection fails.
In some embodiments, based on the foregoing scheme, the obtaining unit 410 includes: a connection information obtaining unit, configured to obtain connection information between the multiple service nodes and a master control node in the distributed system; and the information table establishing unit is used for establishing the connection information table based on the connection information and refreshing the connection information table at preset time intervals.
In some embodiments, based on the foregoing scheme, the determining unit 430 is configured to: acquiring confirmation information returned to the service node by the master control node in response to the heartbeat information; judging whether the difference between the frequency of the heartbeat information and the frequency of the confirmation information is larger than a first preset value or not; and if the judgment result is larger than the first preset value, determining that the connection between the service node and the main control node fails.
In some embodiments, based on the foregoing scheme, the information processing apparatus 400 further includes: a sending unit, configured to send communication detection information to each service node in the plurality of service nodes through the master control node; a confirmation information obtaining unit, configured to obtain detection confirmation information, which is returned by each service node in response to the communication detection information and received by the master control node; and the determining unit is used for determining whether the main control node fails or not based on the proportion of the total times of the detection confirmation information and the total times of the communication detection information.
In some embodiments, based on the foregoing scheme, the determining unit is configured to: counting the total times of the communication detection information and the total times of the detection confirmation information; judging whether the ratio of the total times of the detection confirmation information to the total times of the communication detection information in a preset time is smaller than a second preset value or not; and if the judgment result is smaller than the second preset value, determining that the main control node fails.
In some embodiments, based on the foregoing scheme, the information processing apparatus 400 is configured to: before removing the connection information of the service node from the connection information table, determining another service node connected with the service node in the connection information table; and loading the data on the service node to the other service node.
In some embodiments, based on the foregoing scheme, the information processing apparatus further includes: and an information table sending unit, configured to send the refreshed connection information table to each service node in the connection information table after the connection information table is refreshed.
Since each functional block of the information processing apparatus 400 according to the exemplary embodiment of the present invention corresponds to the step of the above-described exemplary embodiment of the information processing method, it is not described herein again.
In an exemplary embodiment of the present invention, there is also provided an electronic device capable of implementing the above method.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use in implementing an electronic device of an embodiment of the present invention. The computer system 500 of the electronic device shown in fig. 5 is only an example, and should not bring any limitation to the function and the scope of the use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for system operation are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer-readable medium carries one or more programs which, when executed by one of the electronic devices, cause the electronic device to implement the information processing method described in the above embodiments.
For example, the electronic device may implement the following as shown in fig. 1: step S110, obtaining a connection information table containing connection information of the plurality of service nodes and the main control node in the distributed system; step S120, receiving heartbeat information sent to the master control node by each service node in the plurality of service nodes; step S130, judging whether the connection between the service node and the main control node is failed or not based on the heartbeat information; step S140, if it is determined that the connection fails, deleting the connection information of the service node from the connection information table.
It should be noted that although in the above detailed description several modules or units of a device or apparatus for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

1. An information processing method applied to a distributed system with a plurality of service nodes is characterized by comprising the following steps:
acquiring a connection information table containing connection information of the plurality of service nodes and a master control node in the distributed system, wherein the connection information table is used for acquiring the connection information of available service nodes, and the connection information comprises address information and port name information of the service nodes;
receiving heartbeat information sent to the master control node by each service node in the plurality of service nodes;
judging whether the connection between the service node and the main control node is failed or not based on the heartbeat information;
if the connection is judged to be failed, deleting the connection information of the service node from the connection information table,
the information processing method further includes:
refreshing the connection information table, and after refreshing the connection information table, sending the refreshed connection information table to each service node in the connection information table;
when the first service node calls data of a second service node, determining whether the connection information of the second service node is available according to the refreshed connection information table;
if the connection information of the second service node is available, calling the data of the second service node according to a predetermined routing rule,
when one service node monitors that the heartbeat information cannot be kept, the other service node is driven, and the corresponding data of the service node is loaded to the other service node.
2. The information processing method according to claim 1, wherein obtaining a connection information table containing connection information between the plurality of service nodes and a master node in the distributed system comprises:
acquiring connection information of the plurality of service nodes and a master control node in the distributed system;
and establishing the connection information table based on the connection information, and refreshing the connection information table at preset time intervals.
3. The information processing method according to claim 1, wherein determining whether the connection between the service node and the master node has failed based on the heartbeat information includes:
acquiring confirmation information returned to the service node by the master control node in response to the heartbeat information;
judging whether the difference between the frequency of the heartbeat information and the frequency of the confirmation information is larger than a first preset value or not;
and if the judgment result is larger than the first preset value, determining that the connection between the service node and the main control node fails.
4. The information processing method according to claim 1, characterized by further comprising:
sending communication detection information to each service node in the plurality of service nodes through the master control node;
acquiring detection confirmation information which is received by the master control node and returned by each service node in response to the communication detection information;
and determining whether the main control node fails or not based on the proportion of the total times of the detection confirmation information and the total times of the communication detection information.
5. The information processing method according to claim 4, wherein determining whether the master node has failed based on a ratio of the total number of times of the detection confirmation information to the total number of times of the communication detection information includes:
counting the total times of the communication detection information and the total times of the detection confirmation information;
judging whether the ratio of the total times of the detection confirmation information to the total times of the communication detection information in a preset time is smaller than a second preset value or not;
and if the judgment result is smaller than the second preset value, determining that the main control node fails.
6. The information processing method according to claim 1, wherein before removing the connection information of the service node from the connection information table, the information processing method further comprises:
determining another service node connected with the service node in the connection information table;
and loading the data on the service node to the other service node.
7. An information processing apparatus applied to a distributed system having a plurality of service nodes, comprising:
an obtaining unit, configured to obtain a connection information table including connection information between the plurality of service nodes and a master control node in the distributed system, where the connection information table is used to obtain connection information of available service nodes;
a receiving unit, configured to receive heartbeat information sent by each service node in the multiple service nodes to the master control node;
the judging unit is used for judging whether the connection between the service node and the main control node fails or not based on the heartbeat information;
a removing unit configured to remove the connection information of the service node from the connection information table when it is determined that the connection fails,
the information processing apparatus further includes:
an information table sending module, configured to refresh the connection information table, and send the refreshed connection information table to each service node in the connection information table after the connection information table is refreshed;
when the first service node calls data of a second service node, determining whether the connection information of the second service node is available according to the refreshed connection information table; if the connection information of the second service node is available, calling the data of the second service node according to a predetermined routing rule,
when one service node monitors that the heartbeat information cannot be kept, the other service node is driven, and the corresponding data of the service node is loaded to the other service node.
8. An electronic device, comprising:
a processor; and
a memory having stored thereon computer-readable instructions which, when executed by the processor, implement the information processing method of any one of claims 1 to 6.
9. A computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements the information processing method according to any one of claims 1 to 6.
CN201810577765.XA 2018-06-05 2018-06-05 Information processing method, information processing device, electronic equipment and storage medium Active CN108833205B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810577765.XA CN108833205B (en) 2018-06-05 2018-06-05 Information processing method, information processing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810577765.XA CN108833205B (en) 2018-06-05 2018-06-05 Information processing method, information processing device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108833205A CN108833205A (en) 2018-11-16
CN108833205B true CN108833205B (en) 2022-03-29

Family

ID=64144341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810577765.XA Active CN108833205B (en) 2018-06-05 2018-06-05 Information processing method, information processing device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108833205B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111342986B (en) * 2018-12-19 2022-09-16 杭州海康威视系统技术有限公司 Distributed node management method and device, distributed system and storage medium
CN110458582B (en) * 2019-01-29 2023-12-12 深圳市智税链科技有限公司 Business processing method, device, medium and electronic equipment based on block chain system
CN110113412A (en) * 2019-04-30 2019-08-09 北京奇艺世纪科技有限公司 A kind of method of data synchronization and device
CN110535720B (en) * 2019-08-20 2022-01-25 新华三技术有限公司合肥分公司 BFD multi-hop detection method and device
CN113411237B (en) * 2021-08-18 2021-11-30 成都丰硕智能数字科技有限公司 Method, storage medium and system for detecting terminal state with low delay

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012071695A1 (en) * 2010-11-29 2012-06-07 华为技术有限公司 Node fault processing method, system and related device
CN106020977A (en) * 2016-05-16 2016-10-12 深圳市中业智能系统控制有限公司 Distributed task scheduling method and apparatus used for monitoring system
CN106411659A (en) * 2016-11-29 2017-02-15 福建中金在线信息科技有限公司 Business data monitoring method and apparatus
CN106533798A (en) * 2016-12-15 2017-03-22 北京小米移动软件有限公司 Detection method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294799B (en) * 2016-03-31 2020-09-01 阿里巴巴集团控股有限公司 Method and device for processing nodes in distributed system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012071695A1 (en) * 2010-11-29 2012-06-07 华为技术有限公司 Node fault processing method, system and related device
CN106020977A (en) * 2016-05-16 2016-10-12 深圳市中业智能系统控制有限公司 Distributed task scheduling method and apparatus used for monitoring system
CN106411659A (en) * 2016-11-29 2017-02-15 福建中金在线信息科技有限公司 Business data monitoring method and apparatus
CN106533798A (en) * 2016-12-15 2017-03-22 北京小米移动软件有限公司 Detection method and device

Also Published As

Publication number Publication date
CN108833205A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN108833205B (en) Information processing method, information processing device, electronic equipment and storage medium
CN109936613B (en) Disaster recovery method and device applied to server
CN108737132B (en) Alarm information processing method and device
CN108156252B (en) Data access method and device, server and client
CN111181765A (en) Task processing method and device
CN109428926B (en) Method and device for scheduling task nodes
CN112905930A (en) Interface request retransmission method and device
CN108764866B (en) Method and equipment for allocating resources and drawing resources
CN112653736B (en) Parallel source returning method and device and electronic equipment
WO2024066374A1 (en) Service degradation method and apparatus, device, computer-readable medium and program product
CN111176641B (en) Flow node execution method, device, medium and electronic equipment
CN112751689A (en) Network connectivity detection method, monitoring server and monitoring agent device
CN109324914B (en) Service calling method, service calling device and central server
CN112637121B (en) Data port updating method and device, electronic equipment and readable storage medium
CN112688982B (en) User request processing method and device
CN113760693A (en) Method and apparatus for local debugging of microservice systems
CN110888770B (en) Method and device for transmitting information
CN113535020A (en) Method, apparatus, device, medium and product for generating application icons
CN113254245A (en) Fault detection method and system for storage cluster
CN112463514A (en) Monitoring method and device for distributed cache cluster
CN113766437B (en) Short message sending method and device
CN112825586B (en) Service processing method, terminal and computer readable storage medium
CN112532699B (en) Data port updating method and device, electronic equipment and readable storage medium
CN115242687B (en) Node activity detection method, device, equipment and medium
CN109614439B (en) Data synchronization method, device, electronic equipment and storage medium

Legal Events

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