CN112532721B - Cluster calling method and device, electronic equipment and storage medium - Google Patents

Cluster calling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112532721B
CN112532721B CN202011362120.8A CN202011362120A CN112532721B CN 112532721 B CN112532721 B CN 112532721B CN 202011362120 A CN202011362120 A CN 202011362120A CN 112532721 B CN112532721 B CN 112532721B
Authority
CN
China
Prior art keywords
node
nodes
identification point
task
central node
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
CN202011362120.8A
Other languages
Chinese (zh)
Other versions
CN112532721A (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 Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011362120.8A priority Critical patent/CN112532721B/en
Publication of CN112532721A publication Critical patent/CN112532721A/en
Application granted granted Critical
Publication of CN112532721B publication Critical patent/CN112532721B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/62Establishing a time schedule for servicing the requests
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to a block chain, and provides a cluster calling method, which comprises selecting any node in a server cluster as a central node, storing preset time on the central node, then establishing a docking authentication mechanism, storing the unique broadcast identification point in the docking authentication mechanism in a central node, storing the child identification points matching the unique broadcast identification point in other nodes except the central node, and the communication between the central node and other nodes is carried out based on the communication protocol, so that other nodes can obtain the value of the unique broadcast identification point of the central node according to the preset time, if the value of the unique broadcast identification point is verified with the preset threshold value in other nodes, the timing task is executed, and the whole cluster is monitored in real time, when the timing task is executed, the timing task is prevented from being executed by a plurality of machines, and the abnormal condition of the service is reduced.

Description

Cluster calling method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of block chains, and in particular, to a method and an apparatus for intelligent cluster call, an electronic device, and a computer-readable storage medium.
Background
In daily life, timing tasks such as timing broadcast inside a company, timing conference notification inside a school and timing on-duty calling inside a hospital generally exist, in the software development process, no matter business requirement development or system optimization function development, the timing tasks are very common, but the machine resource conditions of the current development environment, test environment and production environment are clusters of multiple machines except the development environment. While some timing tasks do not support multiple machines to start and execute within a certain time period (e.g., 10 minutes), the redis locking mechanism cannot be solved, and the development environment cannot simulate the scenario.
Therefore, a cluster calling method which is simple and convenient to implement and can avoid service exception caused by the fact that one timing task is executed by a plurality of machines is needed, and particularly relates to a cluster calling method based on Redis characteristics.
Disclosure of Invention
The invention provides a cluster calling method, a cluster calling device, electronic equipment and a computer readable storage medium, and mainly aims to monitor the whole cluster in real time and avoid service abnormity caused by the fact that one timing task is executed by a plurality of machines.
In order to achieve the above object, the present invention provides a cluster calling method, including:
each node in the server cluster is arranged in a decentralized point-to-point distributed block chain network which is built through a communication protocol;
selecting any node in the server cluster as a central node, and storing preset time on the central node;
establishing a docking authentication mechanism, storing a unique broadcast identification point in the docking authentication mechanism in the central node, and storing a sub-identification point matched with the unique broadcast identification point in other nodes except the central node;
and communicating the central node with other nodes based on the communication protocol, enabling the other nodes to acquire the numerical value of the unique broadcast identification point of the central node according to the preset time, and executing a timing task if the numerical value of the unique broadcast identification point is verified with a preset threshold value in the other nodes.
Optionally, before disposing each node in the server cluster in the decentralized point-to-point distributed blockchain network built through the communication protocol, building the server cluster, wherein,
the process of building the server cluster comprises the following steps:
enabling each node in the server cluster to acquire IP identity information of adjacent nodes;
storing the acquired IP identity information of each node on each node in the server cluster according to a predefined structure by adopting a block chain distributed account book technology; wherein, the IP identity information of each node in the server cluster at least comprises: the system comprises a host model, an asset number, a task domain, a task type and an administrator number corresponding to the task.
Optionally, in the process of placing each node in a server cluster in a decentralized, point-to-point distributed blockchain network built through a communication protocol,
judging whether each node in the server cluster is in an online state or not through a confirmation mechanism among the server clusters, and pre-storing a task data packet on each node;
the confirmation mechanism is as follows:
sending connection confirmation characters to each node at fixed time, and judging the validity of connection among the nodes in the server cluster according to feedback results of the nodes after receiving the connection confirmation characters; wherein the content of the first and second substances,
if the connection between the nodes in the server cluster is judged to be invalid, a reconnection instruction is sent out; and if the connection between the nodes in the server cluster is judged to be effective, confirming the network state of the node according to the feedback numerical value of each node after receiving the connection confirmation character, and if the network state is not good, sending a reminding notice to the node with the poor network state based on a communication protocol.
Optionally, the process of selecting any node in the server cluster as a central node includes:
establishing a first transmission channel based on any one of a DUBBO protocol, a TCP protocol and an HTTP protocol;
collecting IP identity information and starting-up time of each node on any node in the server cluster through the first transmission channel;
and integrating and comparing the IP identity information and the starting time of each node, taking the score of the starting time as a main line score, taking the score of the IP identity information as an auxiliary line score to obtain the score of each host node, and selecting the node with the highest score as a central node.
Optionally, the process of storing the sub-identification point matching the unique broadcast identification point in other nodes except the central node includes:
numbering each of the other nodes except the central node;
collecting node information and node numbers of each node in the other nodes;
forming an identification point pair at the central node, wherein the identification point pair comprises a unique broadcast identification point and a sub-identification point which is generated according to the node information and corresponds to the node number;
and establishing a second transmission channel based on any one of a DUBBO protocol, a TCP protocol and an HTTP protocol, wherein the sub-identification point enters the node corresponding to the sub-identification point through the second transmission channel.
Optionally, the other nodes obtain the value of the unique broadcast identification point of the central node according to the preset time, and if the value of the unique broadcast identification point is verified with a preset threshold value in the other nodes, the process of executing the timing task includes:
setting a threshold value on the other nodes, selecting task nodes from the other nodes, and determining the number of nodes needing to execute tasks in the task nodes;
enabling the central node to send the task data packet to the task node at the preset time;
and the sub-identification point of the task node and the unique broadcast identification point of the central node carry out decryption operation, if the decryption is successful, the task node acquires the numerical value of the unique broadcast identification point of the central node and compares the numerical value of the unique broadcast identification point with the threshold value.
Optionally, if the value of the unique broadcast identification point is consistent with the value of the threshold, the task in the task data packet is abandoned; and if the sub-identification value is not consistent with the threshold value, executing the task in the task data packet, and sending a task execution receipt to the central node.
In order to solve the above problem, the present invention further provides a cluster calling apparatus, including:
the cluster building module is used for setting each node in the server cluster in a decentralized point-to-point distributed block chain network built through a communication protocol;
the node selection module is used for selecting any node in the server cluster as a central node and storing preset time on the central node;
the system comprises a docking authentication module, a central node and a sub-identification point, wherein the docking authentication module is used for establishing a docking authentication mechanism, storing a unique broadcast identification point in the docking authentication mechanism in the central node and storing a sub-identification point matched with the unique broadcast identification point in other nodes except the central node;
and the task execution module is used for carrying out communication between the central node and other nodes based on the communication protocol, so that the other nodes obtain the value of the unique broadcast identification point of the central node according to the preset time, and if the value of the unique broadcast identification point is verified with the preset threshold value in the other nodes, the timing task is executed.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the cluster calling method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, which stores at least one instruction, where the at least one instruction is executed by a processor in an electronic device to implement the above cluster call method.
The embodiment of the invention firstly selects any node in a server cluster as a central node, stores preset time on the central node, establishes a docking authentication mechanism, stores a unique broadcast identification point in the docking authentication mechanism in the central node, stores a sub-identification point matched with the unique broadcast identification point in other nodes except the central node, sets a threshold value on other nodes, selects a task node from other nodes, determines the number of nodes needing to execute tasks in the task node, enables the central node to send a task data packet to the task node at the preset time, decrypts the sub-identification point of the task node and the unique broadcast identification point of the central node, if decryption is successful, the task node acquires the value of the unique broadcast identification point of the central node and compares the value of the unique broadcast identification point with the value of the threshold value (the value is changed by the unique broadcast identification point after the task is completed), if the task is executed, the unique broadcast identification point changes, so that if the sub-identification value is inconsistent with the threshold value, the task in the task data packet is executed, a task execution receipt is sent to the central node, if the value of the unique broadcast identification point is consistent with the threshold value, the task in the task data packet is abandoned, the whole cluster is monitored in real time, one timing task is prevented from being executed by a plurality of machines when the timing task is executed, and abnormal service conditions are reduced.
Drawings
Fig. 1 is a schematic flowchart of a cluster calling method according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of a cluster calling apparatus according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an internal structure of an electronic device implementing a cluster calling method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a cluster calling method. Fig. 1 is a schematic flowchart of a cluster calling method according to an embodiment of the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the cluster calling method includes:
s1: each node in the server cluster is arranged in a decentralized point-to-point distributed block chain network which is set up through a communication protocol;
before step S1, a server cluster is built, wherein,
the process of building the server cluster comprises the following steps:
enabling each node in the server cluster to acquire IP identity information of adjacent nodes;
storing the acquired IP identity information of each node on each node in a server cluster according to a predefined structure by adopting a block chain distributed account book technology; wherein, the IP identity information of each node in the server cluster at least comprises: the system comprises a host model, an asset number, a task domain, a task type and an administrator number corresponding to the task.
In step S1, in the process of setting each node in a server cluster in a decentralized point-to-point distributed block chain network built by a communication protocol, the server clusters determine whether each node in the server cluster is in an online state by a confirmation mechanism, and a task data packet is pre-stored in each node; the task data packet at least comprises announcement content bytes, template bytes and filling content bytes.
The confirmation mechanism is as follows:
sending connection confirmation characters to each node at fixed time, and judging the validity of the connection between the nodes in the server cluster according to the feedback result of each node after receiving the connection confirmation characters; wherein the content of the first and second substances,
if the connection between the nodes in the server cluster is judged to be invalid, a reconnection instruction is sent out; if the connection between the nodes in the server cluster is judged to be effective, the network state of the node is confirmed according to the feedback numerical value of the node after the connection confirmation character is received, and if the network state is not good, a reminding notice is sent to the node with the poor network state based on the communication protocol.
Specifically, in step S1, the communication protocol is not particularly limited, and in the present embodiment, the tcp protocol is adopted as the communication protocol.
S2: selecting any node in the server cluster as a central node, and storing preset time on the central node; wherein the content of the first and second substances,
the preset time is determined according to the task data packets in step S1, and each preset time corresponds to each task data packet;
in a specific embodiment, the process of selecting any node in the server cluster as the central node includes:
s21: establishing a first transmission channel based on any one of a DUBBO protocol, a TCP protocol and an HTTP protocol;
s22: collecting IP identity information and starting-up time of each node on any node in the server cluster through the first transmission channel;
s123: integrating and comparing the IP identity information and the starting-up time of each node, taking the score of the starting-up time as a main line score, taking the score of the IP identity information as an auxiliary line score to obtain the score of each host node, and selecting the node with the highest score as a central node; in this embodiment, the ratio of the main line portion is 0.8, and the ratio of the auxiliary line portion is 0.2.
In another embodiment, a node corresponding to the administrator level is selected as the central node according to the level of the node administrator, such as selecting a high-management host in an office as the central node, selecting a school leader host in a school as the central node, and so on.
S3: establishing a docking authentication mechanism, storing a unique broadcast identification point in the docking authentication mechanism in a central node, and storing a sub-identification point matched with the unique broadcast identification point in other nodes except the central node, specifically, the method includes:
s31: numbering each node in other nodes except the central node;
s32: collecting node information and node numbers of each node in other nodes;
s33: forming an identification point pair at the central node, wherein the identification point pair comprises a unique broadcast identification point and a sub-identification point which is generated according to the node information and corresponds to the node number;
s34: and establishing a second transmission channel based on any one of the DUBBO protocol, the TCP protocol and the HTTP protocol, and enabling the sub-identification point to enter the node corresponding to the sub-identification point through the second transmission channel.
Specifically, taking a single department of an enterprise as an example, in a certain department of the enterprise, 21 hosts are shared, a host with a captain is selected as a central node, and at first, other 20 hosts are numbered on the central node, the numbering form is not particularly limited, and the hosts can be numbered with the single digit of 1-20, or prefixes of the numbers of the middle departments of the enterprise, such as 3-1 to 3-20; and the host of the back leader collects the node information of the numbered 20 nodes and forms an identification point pair on the host of the back leader, wherein because some of the 20 nodes have high computer versions and some have low computer versions, the 20 nodes are required to be respectively transmitted to the 20 sub-identification points through a second transmission channel according to the node information of the 20 nodes.
S4: and carrying out communication between the central node and other nodes based on a communication protocol, so that other nodes obtain the value of the unique broadcast identification point of the central node according to preset time, and if the value of the unique broadcast identification point is verified with a preset threshold value in other nodes, executing a timing task.
Step S4 includes:
s41: setting threshold values on other nodes, selecting task nodes from the other nodes, and determining the number of nodes needing to execute tasks in the task nodes; the task node refers to a node by whom a task can be executed, but not all task nodes execute the task;
s42: enabling the central node to send the task data packet to the task node at preset time;
s43: and the sub identification point of the task node and the unique broadcast identification point of the central node carry out decryption operation, if the decryption is successful, the task node acquires the numerical value of the unique broadcast identification point of the central node and compares the numerical value of the unique broadcast identification point with the threshold value.
Specifically, the value of the threshold set on the other node and the value of the unique broadcast identification point of the central node are preset in advance, and the values are not limited specifically, and may be preset as two values, such as 0 and non-0, or may be preset as an array similar to 1, 2, and 3.
In one embodiment, if the value of the unique broadcast identification point is consistent with the value of the threshold, the execution of the task in the task data packet is abandoned; and if the sub identification value is not consistent with the threshold value, executing the task in the task data packet, and sending a task execution receipt to the central node, setting the threshold value and the unique broadcast identification point after the task is completed as non-0, setting the unique broadcast identification point before the task is completed as 0, if the value of the threshold value is not matched with the value of the unique broadcast identification point of the central node, namely the value of the unique broadcast identification point of the uncompleted task is 0, and the value of the threshold value is not 0, executing the timing task, and if the value of the threshold value is the same as the value of the unique broadcast identification point of the central node, namely the unique broadcast identification point after the task is completed is changed into non-0, and the value of the threshold value is 0, abandoning the task execution.
Specifically, in this embodiment, non-0 and 0 are used as the value of setting the threshold on other nodes and the initial value of the unique broadcast identification point of the central node, the task is a task of sending mails, which may be the same mail or two mails, taking the example that one mail must be sent at ten points as an example, in order to prevent unsuccessful sending, all three task nodes capable of sending mails are selected, because the network speed and the configuration of the three nodes are different, the time setting thereof has some deviation, when reaching ten points, the child identification point of the task node which reaches ten points first and the unique broadcast identification point of the central node perform decryption operation, when the decryption succeeds, the task node acquires the value of the unique broadcast identification point, if the value is 0, it executes the task of sending mails, and after the decryption, the task node sends a receipt back to the central node, then the value of the unique broadcast identification point is changed to be not 0, when another task node also reaches ten o' clock, the sub identification point of the another task node also carries out decryption operation with the unique broadcast identification point of the central node, when the decryption is successful, the another task node acquires the value of the unique broadcast identification point, at the moment, the unique broadcast identification point is already changed to be not 0, so that the threshold value which is stored in the another task node and is not 0 is consistent, the task is proved to be completed, and the task is not executed repeatedly.
In another embodiment, if the value of the unique broadcast identification point is consistent with the value of the threshold, executing the task in the task data packet; if the sub-identification value is not consistent with the threshold value, the task in the task data packet is abandoned, and the task execution receipt is sent to the central node, the method is more suitable for executing tasks by a plurality of task nodes, for example, if three task nodes are needed to complete the tasks, the threshold value can be preset to be 1, 2 and 3, when no task node completes the task, the value of the unique broadcast identification point is 1, when one task node completes the task, the value of the unique broadcast identification point is changed to be 2, when another task node completes the task, the value of the unique broadcast identification point is changed to be 3, therefore, when the value of the unique broadcast identification point is the same as the preset threshold value, the task can be executed, and so on, when the value of the unique broadcast identification point is 3, the task can be executed again, after the execution is completed, the value of the unique broadcast identification point is increased, if the value is not matched with the preset threshold value, the task is abandoned, which is not described herein.
Specifically, the server cluster related to the cluster calling method provided by the present invention may be each department server in an enterprise, each server in a hospital, or each server in a school, and no further description is given herein, in the above application scenario, a timing task may be executed based on the cluster calling method, first, any node is selected as a central node in the server cluster in the above scenario, a preset time is stored on the central node, then, a docking authentication mechanism is established, a unique broadcast identification point in the docking authentication mechanism is stored in the central node of the server cluster in the above scenario, a sub identification point matched with the unique broadcast identification point is stored in other nodes except the central node, then, the central node communicates with other nodes, so that the other nodes obtain a value of the unique broadcast identification point of the central node according to the preset time, if the value of the unique broadcast identification point is checked with the preset threshold value in the other nodes, executing the timing task in each scene, wherein the timing task can be any calling task to each node in the server cluster in the scene, can be a timing enterprise announcement sent to each node in an enterprise, can be a timing broadcast in a hospital for on-duty planning, or a timing conference plan sent in a school for real-time monitoring of the clusters in the scene, and can avoid the fact that one timing task is executed by a plurality of machines when the timing task is executed, thereby reducing the abnormal task execution condition.
As shown in fig. 2, the present invention provides a cluster calling apparatus 100, which may be installed in an electronic device. According to the implemented functions, the cluster calling apparatus 100 may include a cluster building module 101, a node selecting module 102, a docking authentication module 103, and a task executing module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions of the respective modules/units are as follows:
the cluster building module 101 is used for setting each node in the server cluster in a decentralized point-to-point distributed block chain network built through a communication protocol;
a node selection module 102, configured to select any node in the server cluster as a central node, and store a preset time on the central node;
the docking authentication module 103 is configured to establish a docking authentication mechanism, store the unique broadcast identification point in the docking authentication mechanism in the central node, and store the sub-identification point matched with the unique broadcast identification point in other nodes except the central node;
the task execution module 104 is configured to perform communication between the central node and other nodes based on a communication protocol, so that the other nodes obtain a value of the unique broadcast identification point of the central node according to preset time, and if the value of the unique broadcast identification point is verified with a preset threshold value in the other nodes, a timing task is executed to monitor task execution in real time, thereby preventing the same task from being executed for multiple times.
As shown in fig. 3, the present invention provides an electronic device 1 for implementing a cluster calling method.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a group calling program 12, stored in the memory 11 and executable on said processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of a group calling program, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., a group call program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The memory 11 of the electronic device 1 stores a group calling program 12, which is a combination of instructions that, when executed in the processor 10, can implement:
each node in the server cluster is arranged in a decentralized point-to-point distributed block chain network which is set up through a communication protocol;
selecting any node in the server cluster as a central node, and storing preset time on the central node;
establishing a docking authentication mechanism, storing a unique broadcast identification point in the docking authentication mechanism in a central node, and storing a sub-identification point matched with the unique broadcast identification point in other nodes except the central node;
and communicating the central node with other nodes based on a communication protocol, so that the other nodes obtain the value of the unique broadcast identification point of the central node according to preset time, and if the value of the unique broadcast identification point is verified with a preset threshold value in the other nodes, executing a timing task.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not described herein again. It should be emphasized that, in order to further ensure the privacy and security of the cluster call, the cluster call data is stored in the node of the blockchain where the server cluster is located.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for cluster calling, comprising:
each node in the server cluster is arranged in a decentralized point-to-point distributed block chain network which is set up through a communication protocol;
selecting any node in the server cluster as a central node, and storing preset time on the central node;
establishing a docking authentication mechanism, storing a unique broadcast identification point in the docking authentication mechanism in the central node, and storing a sub-identification point matched with the unique broadcast identification point in other nodes except the central node;
and communicating the central node with other nodes based on the communication protocol, enabling the other nodes to acquire the numerical value of the unique broadcast identification point of the central node according to the preset time, and executing a timing task if the numerical value of the unique broadcast identification point is verified with a preset threshold value in the other nodes.
2. The method of cluster calling according to claim 1, further comprising building a server cluster prior to placing each node in the server cluster in a decentralized, point-to-point distributed blockchain network built through a communication protocol, wherein,
the process of building the server cluster comprises the following steps:
enabling each node in the server cluster to acquire IP identity information of adjacent nodes;
storing the acquired IP identity information of each node on each node in the server cluster according to a predefined structure by adopting a block chain distributed account book technology; wherein, the IP identity information of each node in the server cluster at least comprises: the system comprises a host model, an asset number, a task domain, a task type and an administrator number corresponding to the task.
3. The method of claim 1, wherein in placing each node in a server cluster in a decentralized, point-to-point distributed blockchain network built through a communication protocol,
judging whether each node in the server cluster is in an online state or not through a confirmation mechanism among the server clusters, and pre-storing a task data packet on each node;
the confirmation mechanism is as follows:
sending connection confirmation characters to each node at fixed time, and judging the validity of connection among the nodes in the server cluster according to feedback results of the nodes after receiving the connection confirmation characters; wherein the content of the first and second substances,
if the connection between the nodes in the server cluster is judged to be invalid, a reconnection instruction is sent out; and if the connection between the nodes in the server cluster is judged to be effective, confirming the network state of the node according to the feedback numerical value of each node after receiving the connection confirmation character, and if the network state is not good, sending a reminding notice to the node with the poor network state based on a communication protocol.
4. The cluster call method of claim 2, wherein the process of selecting any node in the server cluster as a central node comprises:
establishing a first transmission channel based on any one of a DUBBO protocol, a TCP protocol and an HTTP protocol;
collecting IP identity information and starting-up time of each node on any node in the server cluster through the first transmission channel;
and integrating and comparing the IP identity information and the starting time of each node, taking the score of the starting time as a main line score, taking the score of the IP identity information as an auxiliary line score to obtain the score of each host node, and selecting the node with the highest score as a central node.
5. The cluster call method as set forth in claim 3, wherein the process of storing the child identification point matching the unique broadcast identification point in a node other than the central node comprises:
numbering each of the other nodes except the central node;
collecting node information and node numbers of each node in the other nodes;
forming an identification point pair at the central node, wherein the identification point pair comprises a unique broadcast identification point and a sub-identification point which is generated according to the node information and corresponds to the node number;
and establishing a second transmission channel based on any one of a DUBBO protocol, a TCP protocol and an HTTP protocol, wherein the sub-identification point enters the node corresponding to the sub-identification point through the second transmission channel.
6. The cluster calling method according to claim 5, wherein the process of causing other nodes to obtain the value of the unique broadcast identification point of the central node according to the preset time, and if the value of the unique broadcast identification point is checked against a threshold value preset in the other nodes, executing a timing task comprises:
setting a threshold value on the other nodes, selecting task nodes from the other nodes, and determining the number of nodes needing to execute tasks in the task nodes;
enabling the central node to send the task data packet to the task node at the preset time;
and decrypting the sub identification point of the task node and the unique broadcast identification point of the central node, and if decryption is successful, acquiring the numerical value of the unique broadcast identification point of the central node by the task node, and comparing the numerical value of the unique broadcast identification point with the threshold value.
7. The method of claim 6,
if the numerical value of the unique broadcast identification point is consistent with the threshold value, the task in the task data packet is abandoned to be executed; and if the sub-identification numerical value is inconsistent with the threshold value, executing the task in the task data packet, and sending a task execution receipt to the central node.
8. An apparatus for cluster calling, the apparatus comprising:
the cluster building module is used for setting each node in the server cluster in a decentralized point-to-point distributed block chain network built through a communication protocol;
the node selection module is used for selecting any node in the server cluster as a central node and storing preset time on the central node;
the system comprises a docking authentication module, a central node and a sub-node, wherein the docking authentication module is used for establishing a docking authentication mechanism, storing a unique broadcast identification point in the docking authentication mechanism in the central node and storing a sub-identification point matched with the unique broadcast identification point in other nodes except the central node;
and the task execution module is used for carrying out communication between the central node and other nodes based on the communication protocol, so that the other nodes obtain the value of the unique broadcast identification point of the central node according to the preset time, and if the value of the unique broadcast identification point is verified with the preset threshold value in the other nodes, the timing task is executed.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the cluster call method of any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the cluster call method according to any one of claims 1 to 7.
CN202011362120.8A 2020-11-27 2020-11-27 Cluster calling method and device, electronic equipment and storage medium Active CN112532721B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011362120.8A CN112532721B (en) 2020-11-27 2020-11-27 Cluster calling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011362120.8A CN112532721B (en) 2020-11-27 2020-11-27 Cluster calling method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112532721A CN112532721A (en) 2021-03-19
CN112532721B true CN112532721B (en) 2022-09-16

Family

ID=74994407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011362120.8A Active CN112532721B (en) 2020-11-27 2020-11-27 Cluster calling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112532721B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572468A (en) * 2019-09-17 2019-12-13 平安科技(深圳)有限公司 server cluster file synchronization method and device, electronic equipment and storage medium
CN110704172A (en) * 2019-09-20 2020-01-17 深圳市递四方信息科技有限公司 Cluster system timing task scheduling method and cluster system
CN111416839A (en) * 2020-02-26 2020-07-14 平安科技(深圳)有限公司 Cluster environment timed task processing method, system, device and storage medium
CN111580948A (en) * 2020-04-30 2020-08-25 中国平安财产保险股份有限公司 Task scheduling method and device and computer equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572468A (en) * 2019-09-17 2019-12-13 平安科技(深圳)有限公司 server cluster file synchronization method and device, electronic equipment and storage medium
CN110704172A (en) * 2019-09-20 2020-01-17 深圳市递四方信息科技有限公司 Cluster system timing task scheduling method and cluster system
CN111416839A (en) * 2020-02-26 2020-07-14 平安科技(深圳)有限公司 Cluster environment timed task processing method, system, device and storage medium
CN111580948A (en) * 2020-04-30 2020-08-25 中国平安财产保险股份有限公司 Task scheduling method and device and computer equipment

Also Published As

Publication number Publication date
CN112532721A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN113055380B (en) Message processing method and device, electronic equipment and medium
CN112506559A (en) Gray scale publishing method and device based on gateway, electronic equipment and storage medium
CN113422686A (en) Gateway layer authentication method, system, electronic device and storage medium
CN112256783A (en) Data export method and device, electronic equipment and storage medium
CN114827354A (en) Identity authentication information display method and device, electronic equipment and readable storage medium
CN113360321B (en) Micro-service retry calling method and device, electronic equipment and storage medium
CN114519084A (en) Block chain-based medical data inspection method, device, equipment and medium
CN113486316A (en) User identity authentication method and device, electronic equipment and readable storage medium
CN112532721B (en) Cluster calling method and device, electronic equipment and storage medium
CN112579452A (en) Software automation test method, device, equipment and storage medium
CN115687384A (en) UUID (user identifier) identification generation method, device, equipment and storage medium
CN113515265B (en) Site configuration method, device, equipment and computer readable storage medium
CN114826725A (en) Data interaction method, device, equipment and storage medium
CN115021995A (en) Multi-channel login method, device, equipment and storage medium
CN113723813A (en) Performance ranking method and device, electronic equipment and readable storage medium
CN112667244A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN114036068A (en) Update detection method, device, equipment and storage medium based on privacy security
CN114185502A (en) Log printing method, device, equipment and medium based on production line environment
CN114125158A (en) Anti-harassment method, device, equipment and storage medium based on trusted telephone
CN113626533B (en) Ultraviolet power detection method and device and electronic equipment
CN111652682B (en) Service data matching method and device, electronic equipment and computer storage medium
CN112632042A (en) Time data scheduling method and device, electronic equipment and readable storage medium
CN112860394A (en) Timing task scheduling execution method and device, electronic equipment and storage medium
CN113452768A (en) Data reminding method, device, equipment and storage medium based on associated equipment
CN116610465A (en) Event notification-based message sending method and device, electronic equipment and 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