CN105338075A - Method and system for sharing data between nodes in cluster - Google Patents
Method and system for sharing data between nodes in cluster Download PDFInfo
- Publication number
- CN105338075A CN105338075A CN201510689258.1A CN201510689258A CN105338075A CN 105338075 A CN105338075 A CN 105338075A CN 201510689258 A CN201510689258 A CN 201510689258A CN 105338075 A CN105338075 A CN 105338075A
- Authority
- CN
- China
- Prior art keywords
- data
- nodes
- data information
- node
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000001514 detection method Methods 0.000 claims description 35
- 238000012806 monitoring device Methods 0.000 claims description 24
- 238000012544 monitoring process Methods 0.000 claims description 17
- 230000005540 biological transmission Effects 0.000 abstract description 13
- 239000002699 waste material Substances 0.000 abstract description 8
- 238000010586 diagram Methods 0.000 description 11
- 238000012546 transfer Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明实施例提供一种集群中各节点间数据共享方法和系统,其中,方法包括:各节点检测自身数据信息是否发生改变,若发生改变,则确定发生改变的改变信息,将所述改变信息发送给其他节点;当各节点接收到其他节点发送来的改变信息时,根据所述其他节点发送来的改变信息对自身数据信息进行更新,保证集群中所有节点的数据信息相同。各节点间只相互传送发生了改变的数据信息,那些在特定时间段内没有发生改变的数据信息,将不会再在网络中传输,取消了网络中重复数据的传输,避免了网络带宽的浪费,减轻了网络带宽负载,进而保证了网络中数据传递的实时性和各节点内数据的可靠性。
Embodiments of the present invention provide a data sharing method and system among nodes in a cluster, wherein the method includes: each node detects whether its own data information changes, and if it changes, determines the changed change information, and stores the changed information sent to other nodes; when each node receives the change information sent by other nodes, it updates its own data information according to the change information sent by the other nodes to ensure that the data information of all nodes in the cluster is the same. Each node only transmits the changed data information to each other, and those data information that has not changed within a certain period of time will not be transmitted in the network again, canceling the transmission of repeated data in the network, and avoiding the waste of network bandwidth , reducing the network bandwidth load, thereby ensuring the real-time data transmission in the network and the reliability of data in each node.
Description
技术领域technical field
本发明涉及集群节点数据处理技术领域,特别是涉及一种集群中各节点间数据共享方法和系统。The invention relates to the technical field of cluster node data processing, in particular to a data sharing method and system among nodes in a cluster.
背景技术Background technique
在集群中,各个节点之间通过相互间传送数据信息来实现数据共享,若某节点发现自身数据信息发生改变,则该节点将将该改变后的数据信息发送给其他节点,其他节点在接收到该改变后的数据信息后,对自身的数据信息进行更新,使该集群中所有节点的数据信息相同。其中,在该改变后的数据信息,即各节点间相互间传送的数据信息中,包括节点中一些在特定时间段内不会发生改变的数据信息,例如节点的硬盘总容量,内存大小和CPU的数量等数据信息,集群中各节点间数据信息在网络中进行传输,在网络中传输这些在特定时间段内不会发生改变的数据信息,网络中将会有大量重复数据被传输,造成网络带宽的浪费,且集群中的节点数目越多,传输的数据量越大,网络带宽消耗越多,造成的网络带宽浪费也将越大,严重时可能造成网络拥堵。同时,由于各节点间通过UDP传送数据,若发生网络拥堵,在网络拥堵严重情况下,UDP包丢失的概率将增大,将造成各节点间数据信息不能及时共享,且影响到每个节点内数据信息的可靠性。In the cluster, each node realizes data sharing by transmitting data information between each other. If a node finds that its own data information has changed, the node will send the changed data information to other nodes. After the changed data information is obtained, the data information of itself is updated to make the data information of all nodes in the cluster the same. Among them, the changed data information, that is, the data information transmitted between each node, includes some data information in the node that will not change within a specific period of time, such as the total capacity of the hard disk of the node, memory size and CPU The data information such as the number of data, the data information between the nodes in the cluster is transmitted in the network, and the data information that will not change within a specific period of time is transmitted in the network, and a large amount of duplicate data will be transmitted in the network, causing the network The waste of bandwidth, and the more nodes in the cluster, the greater the amount of data transmitted, the more network bandwidth consumption, the greater the waste of network bandwidth, and may cause network congestion in severe cases. At the same time, due to the transmission of data between nodes through UDP, if network congestion occurs, the probability of UDP packet loss will increase under severe network congestion conditions, which will cause data information between nodes to not be shared in time, and affect the internal network of each node. reliability of data information.
发明内容Contents of the invention
有鉴于此,本发明实施例提供一种集群中各节点间数据共享方法,以解决现有技术中各节点间相互间传送的数据信息中,包括节点中一些在特定时间段内不会发生改变的数据信息,造成网络带宽的浪费,严重时可能造成网络拥堵,造成各节点间数据信息不能及时共享,且影响到每个节点内数据信息的准确性的问题。In view of this, the embodiment of the present invention provides a data sharing method among the nodes in the cluster to solve the problem of the data information transmitted between the nodes in the prior art, including that some of the nodes do not change within a specific period of time. In severe cases, it may cause network congestion, causing data information between nodes to not be shared in time, and affecting the accuracy of data information in each node.
为实现上述目的,本发明实施例提供如下技术方案:In order to achieve the above purpose, embodiments of the present invention provide the following technical solutions:
一种集群中各节点间数据共享方法,包括:A data sharing method among nodes in a cluster, comprising:
各节点检测自身数据信息是否发生改变,若发生改变,则确定发生改变的改变信息,将所述改变信息发送给其他节点;Each node detects whether its own data information changes, and if it changes, determines the changed change information, and sends the change information to other nodes;
当各节点接收到其他节点发送来的改变信息时,根据所述其他节点发送来的改变信息对自身数据信息进行更新,保证集群中所有节点的数据信息相同。When each node receives the change information sent by other nodes, it updates its own data information according to the change information sent by the other nodes, so as to ensure that the data information of all nodes in the cluster is the same.
其中,各节点将所述改变信息发送给其他节点后还包括:Wherein, after each node sends the change information to other nodes, it also includes:
将所述改变信息发送给数据监测设备;sending said change information to a data monitoring device;
所述数据监测设备将所述改变信息发送给数据库进行保存。The data monitoring device sends the change information to a database for storage.
其中,所述数据监测设备将所述改变信息发送给数据库进行保存后还包括:Wherein, after the data monitoring device sends the change information to the database for saving, it also includes:
所述数据库根据所述改变信息绘制资源曲线图,并将所述资源曲线图发送给显示器进行显示。The database draws a resource graph according to the change information, and sends the resource graph to a display for display.
其中,所述各节点检测自身数据信息是否发生改变为:Wherein, each node detects whether its own data information changes as follows:
每隔预设时间间隔各节点检测自身数据信息是否发生改变;Each node detects whether its own data information has changed every preset time interval;
和/或,当接收到监测指令时各节点检测自身数据信息是否发生改变。And/or, each node detects whether its own data information changes when receiving the monitoring instruction.
其中,所述每隔预设时间间隔各节点检测自身数据信息是否发生改变包括:Wherein, each node detecting whether its own data information changes at a preset time interval includes:
各节点在获取自身上一数据信息的预设时间后获取自身当前数据信息;Each node obtains its own current data information after the preset time for obtaining its own previous data information;
各所述节点判断自身当前数据信息与自身上一数据信息是否相同;Each node judges whether its own current data information is the same as its own previous data information;
若不相同,则判定自身数据信息发生改变,确定发生改变的改变信息;If they are not the same, it is determined that the data information of the self has changed, and the changed change information is determined;
若相同,则判定自身数据信息没有发生改变,在所述预设时间间隔后获取自身下一数据信息。If they are the same, it is determined that the self-data information has not changed, and the next self-data information is obtained after the preset time interval.
其中,所述当接收到监测指令时各节点检测自身数据信息是否发生改变包括:Wherein, when each node detects whether its own data information changes when receiving the monitoring instruction, it includes:
各节点判断是否接收到检测指令,若接收到,则各节点获取自身当前数据信息;Each node judges whether the detection instruction is received, and if received, each node obtains its own current data information;
各所述节点判断自身当前数据信息与自身上一数据信息是否相同;Each node judges whether its own current data information is the same as its own previous data information;
若不相同,则判定自身数据信息发生改变,确定发生改变的改变信息;If they are not the same, it is determined that the data information of the self has changed, and the changed change information is determined;
若相同,则判定自身数据信息没有发生改变,判断是否接收到下一检测指令。If they are the same, it is determined that the self-data information has not changed, and it is determined whether the next detection instruction is received.
一种集群中各节点间数据共享系统,包括:至少两个节点,其中,每个所述节点包括:检测模块、第一发送模块和接收模块;其中,A data sharing system among nodes in a cluster, comprising: at least two nodes, wherein each node comprises: a detection module, a first sending module, and a receiving module; wherein,
所述检测模块,用于检测自身数据信息是否发生改变,若发生改变,则确定发生改变的改变信息;The detection module is used to detect whether its own data information has changed, and if it has changed, determine the changed change information;
所述第一发送模块,用于将所述改变信息发送给其他节点;The first sending module is configured to send the change information to other nodes;
所述接收模块,用于当接收到其他节点发送来的改变信息时,根据所述其他节点发送来的改变信息对自身数据信息进行更新,保证集群中所有节点的数据信息相同。The receiving module is configured to update its own data information according to the change information sent by other nodes when receiving the change information sent by other nodes, so as to ensure that the data information of all nodes in the cluster is the same.
其中,所述节点还包括:第二发送模块,用于将所述改变信息发送给数据监测设备;Wherein, the node further includes: a second sending module, configured to send the change information to the data monitoring device;
所述系统还包括:数据监测设备和数据库,其中,The system also includes: data monitoring equipment and a database, wherein,
所述数据监测设备,用于接收所述第二发送模块发送的改变信息,并将所述发送改变信息发送给所述数据库;The data monitoring device is configured to receive the change information sent by the second sending module, and send the send change information to the database;
所述数据库包括接收单元和存储单元,其中,所述接收单元用于接收所述数据监测设备发送的所述改变信息,所述存储单元将所述改变信息进行保存。The database includes a receiving unit and a storage unit, wherein the receiving unit is configured to receive the change information sent by the data monitoring device, and the storage unit stores the change information.
其中,所述数据库还包括:绘图单元和发送单元,其中,所述绘图单元用于根据所述改变信息绘制资源曲线图,所述发送单元用于将所述资源曲线图发送给显示器;Wherein, the database further includes: a drawing unit and a sending unit, wherein the drawing unit is used to draw a resource graph according to the change information, and the sending unit is used to send the resource graph to a display;
所述系统还包括:显示器,用于接收所述数据库发送的资源曲线图,并对所述资源曲线图进行显示。The system further includes: a display, configured to receive the resource curve sent by the database and display the resource curve.
其中,所述检测模块包括第一检测单元和/或第二检测单元;其中,Wherein, the detection module includes a first detection unit and/or a second detection unit; wherein,
所述第一检测单元,用于每隔预设时间间隔各节点检测自身数据信息是否发生改变;The first detection unit is used for each node to detect whether its own data information has changed every preset time interval;
所述第二检测单元,用于当接收到监测指令时各节点检测自身数据信息是否发生改变。The second detection unit is used for each node to detect whether its own data information changes when receiving the monitoring instruction.
基于上述技术方案,本发明实施例提供的集群中各节点间数据共享方法和系统,集群中包括至少两个节点,各节点检测自身数据信息是否发生改变,若检测到自身数据信息发生改变,则确定自身数据信息中发生了改变的改变信息,将该改变信息发送给其他节点,当各节点接收到其他节点发送来的改变信息时,则根据该其他节点发送来的改变信息对自身数据信息进行更新,保证集群中所有节点的数据信息相同。各节点间只相互传送发生了改变的数据信息,那些在特定时间段内没有发生改变的数据信息,将不会再在网络中传输,取消了网络中重复数据的传输,避免了网络带宽的浪费,减轻了网络带宽负载,进而保证了网络中数据传递的实时性和各节点内数据的可靠性。Based on the above technical solution, the embodiments of the present invention provide a data sharing method and system among nodes in a cluster. The cluster includes at least two nodes, and each node detects whether its own data information has changed. If it detects that its own data information has changed, then Determine the change information that has changed in its own data information, and send the change information to other nodes. When each node receives the change information sent by other nodes, it will update its own data information according to the change information sent by the other nodes. Update to ensure that the data information of all nodes in the cluster is the same. Each node only transmits the changed data information to each other, and those data information that has not changed within a certain period of time will not be transmitted in the network again, canceling the transmission of repeated data in the network, and avoiding the waste of network bandwidth , reducing the network bandwidth load, thereby ensuring the real-time data transmission in the network and the reliability of data in each node.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.
图1为本发明实施例提供的集群中各节点间数据共享方法的流程图;FIG. 1 is a flowchart of a data sharing method among nodes in a cluster provided by an embodiment of the present invention;
图2为本发明实施例提供的集群中各节点间数据共享方法中保存改变信息的方法流程图;FIG. 2 is a flow chart of a method for saving change information in a data sharing method among nodes in a cluster provided by an embodiment of the present invention;
图3为本发明实施例提供的集群中各节点间数据共享方法中显示资源曲线图的方法流程图;3 is a flow chart of a method for displaying a resource graph in a data sharing method among nodes in a cluster provided by an embodiment of the present invention;
图4为本发明实施例提供的集群中各节点间数据共享方法中每隔预设时间间隔各节点检测自身数据信息是否发生改变的方法流程图;4 is a flowchart of a method for each node to detect whether its own data information has changed at a preset time interval in the data sharing method among nodes in a cluster provided by an embodiment of the present invention;
图5为本发明实施例提供的集群中各节点间数据共享方法中当接收到监测指令时各节点检测自身数据信息是否发生改变的方法流程图;5 is a flowchart of a method for each node to detect whether its own data information has changed when receiving a monitoring instruction in the data sharing method among nodes in the cluster provided by an embodiment of the present invention;
图6为本发明实施例提供的集群中各节点间数据共享系统的系统框图;FIG. 6 is a system block diagram of a data sharing system among nodes in a cluster provided by an embodiment of the present invention;
图7为本发明实施例提供的集群中各节点间数据共享系统的另一系统框图;FIG. 7 is another system block diagram of a data sharing system among nodes in a cluster provided by an embodiment of the present invention;
图8为本发明实施例提供的集群中各节点间数据共享系统的又一系统框图;FIG. 8 is another system block diagram of a data sharing system among nodes in a cluster provided by an embodiment of the present invention;
图9为本发明实施例提供的集群中各节点间数据共享系统中检测模块110的结构框图。FIG. 9 is a structural block diagram of a detection module 110 in a data sharing system among nodes in a cluster provided by an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
图1为本发明实施例提供的集群中各节点间数据共享方法的流程图,各节点间只相互传送发生了改变的数据信息,那些在特定时间段内没有发生改变的数据信息,将不会再在网络中传输,取消了网络中重复数据的传输,避免了网络带宽的浪费,减轻了网络带宽负载,进而保证了网络中数据传递的实时性和各节点内数据的可靠性;参照图1,该集群中各节点间数据共享方法可以包括:Figure 1 is a flow chart of the data sharing method among the nodes in the cluster provided by the embodiment of the present invention. The nodes only transmit the changed data information to each other, and the data information that has not changed within a specific period of time will not Then transmit in the network, cancel the transmission of repeated data in the network, avoid the waste of network bandwidth, reduce the load of network bandwidth, and then ensure the real-time data transmission in the network and the reliability of data in each node; refer to Figure 1 , the data sharing methods between nodes in the cluster may include:
步骤S100:各节点检测自身数据信息是否发生改变,若发生改变,则确定发生改变的改变信息,将所述改变信息发送给其他节点;Step S100: Each node detects whether its own data information changes, and if it changes, determines the changed change information, and sends the change information to other nodes;
集群中包括至少2个节点,各节点分别检测自身的数据信息是否发生改变,若检测到自身的数据信息发生改变,则确定发生改变的改变信息,然后将该确定的改变信息发送给其他节点,使其他节点在接收到该改变信息后对自身的数据信息进行更新,保证其他节点的数据信息在该数据信息发生改变的节点的数据信息发生改变后也进行相应的改变,保证集群中所有节点的数据信息相同。The cluster includes at least 2 nodes, and each node detects whether its own data information has changed. If it detects that its own data information has changed, it determines the changed change information, and then sends the determined change information to other nodes. Make other nodes update their own data information after receiving the change information, and ensure that the data information of other nodes is also changed accordingly after the data information of the node whose data information changes changes, ensuring that all nodes in the cluster The data information is the same.
可选的,为了得到集群中各节点间的资源传递情况,可以各节点在检测到自身节点信息发生改变后,除了将确定改变的改变信息发生给其他节点外,还可以将该确定的改变信息发送给数据监测设备,然后该数据监测设备将在得到该改变信息后将该改变信息发送给数据库中进行保存。Optionally, in order to obtain the resource transfer status among the nodes in the cluster, after each node detects that its own node information has changed, in addition to sending the confirmed change information to other nodes, the determined change information can also be Send it to the data monitoring device, and then the data monitoring device will send the change information to the database for saving after obtaining the change information.
可选的,为了直观得观察到集群中各节点间的资源传递情况,数据库可以在得到数据监测设备发送来改变信息后,根据该改变信息绘制资源曲线图,并将该资源曲线图发送给显示器进行显示。Optionally, in order to visually observe the resource transfer situation among the nodes in the cluster, the database can draw a resource curve graph according to the change information after receiving the change information sent by the data monitoring device, and send the resource curve graph to the display to display.
可选的,各节点可以是每隔预设时间间隔检测一次自身数据信息是否发生改变,也可以是当接收到监测指令时检测自身数据信息是否发生改变,还可以是既每隔预设时间间隔检测一次自身数据信息是否发生改变,又在每次接收到监测指令时检测自身数据信息是否发生改变。Optionally, each node may detect whether its own data information has changed every preset time interval, or detect whether its own data information has changed when receiving a monitoring instruction, or both every preset time interval It detects whether the self-data information changes once, and detects whether the self-data information changes each time a monitoring instruction is received.
可选的,可以通过各节点在获取自身上一数据信息的预设时间后获取自身当前数据信息,判断自身当前数据信息与自身上一数据信息是否相同,若不相同,则判定自身数据信息发生改变,继续下一步操作,确定发生改变的改变信息,若相同,则判定自身数据信息没有发生改变,在预设时间间隔后获取自身下一数据信息,来实现各节点每隔预设时间间隔检测一次自身数据信息是否发生改变。Optionally, each node can obtain its own current data information after the preset time of acquiring its own previous data information, and judge whether its own current data information is the same as its own previous data information, and if not, determine that its own data information has occurred Change, continue to the next step, determine the changed change information, if the same, determine that the data information has not changed, and obtain the next data information of itself after the preset time interval, so as to realize the detection of each node every preset time interval Whether the self-data information has changed.
可选的,可以通过各节点判断是否接收到检测指令,若接收到,则各节点获取自身当前数据信息,各节点判断自身当前数据信息与自身上一数据信息是否相同,若不相同,则判定自身数据信息发生改变,继续下一步操作,确定发生改变的改变信息,若相同,则判定自身数据信息没有发生改变,判断是否接收到下一检测指令,来实现各节点每当接收到监测指令时检测自身数据信息是否发生改变。Optionally, each node can judge whether the detection instruction is received. If received, each node obtains its own current data information, and each node judges whether its own current data information is the same as its own previous data information. If not, then judge If the self-data information changes, continue to the next step to determine the changed change information. If it is the same, determine that the self-data information has not changed, and judge whether the next detection instruction is received, so as to realize that each node receives the monitoring instruction. Detect whether its own data information has changed.
步骤S110:当各节点接收到其他节点发送来的改变信息时,根据所述其他节点发送来的改变信息对自身数据信息进行更新,保证集群中所有节点的数据信息相同。Step S110: When each node receives the change information sent by other nodes, it updates its own data information according to the change information sent by the other nodes to ensure that the data information of all nodes in the cluster is the same.
各节点除了需要检测自身的数据信息是否发生改变外,还需要检测是否接收到其他节点发送来的改变信息,若接收到其他节点发送来的改变信息,则说明其他节点有的数据信息发生改变,需要根据其他节点发送来的改变信息对自身数据信息进行更新,保证自身数据信息与该数据信息发生改变的节点的数据信息相同,从而保证集群中所有节点的数据信息相同。In addition to detecting whether its own data information has changed, each node also needs to detect whether it has received the change information sent by other nodes. If it receives the change information sent by other nodes, it means that the data information of other nodes has changed. It is necessary to update its own data information according to the change information sent by other nodes to ensure that its own data information is the same as the data information of the node whose data information has changed, so as to ensure that the data information of all nodes in the cluster is the same.
其中,若数据信息发生改变的节点发生的数据信息改变为数据增加,即若改变信息为增加数据信息,则各节点在接收到该增加的改变信息后,各节点根据该改变信息对自身数据信息进行更新,即为将该改变信息增加到自身的数据信息中,保证各节点的数据信息均与该数据信息发生改变的节点的数据信息相同。Among them, if the data information of the node where the data information changes is changed to data increase, that is, if the change information is to add data information, after each node receives the increased change information, each node updates its own data information according to the change information. Updating is to add the change information to its own data information to ensure that the data information of each node is the same as the data information of the node whose data information has changed.
若数据信息发生改变的节点发生的数据信息改变为数据减少,即若改变信息为减少的数据信息,则各节点在接收到该增加的改变信息后,各节点根据该改变信息对自身数据信息进行更新,即为将该改变信息从自身的数据信息中删去,保证各节点的数据信息均与该数据信息发生改变的节点的数据信息相同。If the data information of the node where the data information changes is changed to data reduction, that is, if the change information is reduced data information, after each node receives the increased change information, each node will perform data processing on its own data information according to the change information. Updating is to delete the change information from its own data information, so as to ensure that the data information of each node is the same as the data information of the node whose data information has changed.
若数据信息发生改变的节点发生的数据信息改变为数据更改,即若改变信息为更改的数据信息,则各节点在接收到该增加的改变信息后,各节点根据该改变信息对自身数据信息进行更新,即为将自身该改变信息相对应数据信息修改为与该改变信息相同,保证各节点的数据信息均与该数据信息发生改变的节点的数据信息相同。If the data information of the node where the data information changes is changed to data change, that is, if the change information is changed data information, after each node receives the added change information, each node will perform a process on its own data information according to the change information. Updating means to modify the data information corresponding to the change information to be the same as the change information, and ensure that the data information of each node is the same as the data information of the node whose data information has changed.
基于上述技术方案,本发明实施例提供的集群中各节点间数据共享方法,集群中包括至少两个节点,各节点检测自身数据信息是否发生改变,若检测到自身数据信息发生改变,则确定自身数据信息中发生了改变的改变信息,将该改变信息发送给其他节点,当各节点接收到其他节点发送来的改变信息时,则根据该其他节点发送来的改变信息对自身数据信息进行更新,保证集群中所有节点的数据信息相同。各节点间只相互传送发生了改变的数据信息,那些在特定时间段内没有发生改变的数据信息,将不会再在网络中传输,取消了网络中重复数据的传输,避免了网络带宽的浪费,减轻了网络带宽负载,进而保证了网络中数据传递的实时性和各节点内数据的可靠性。Based on the above technical solution, the embodiment of the present invention provides a data sharing method among nodes in a cluster. The cluster includes at least two nodes, and each node detects whether its own data information has changed. If it detects that its own data information has changed, it will determine its own The change information that has changed in the data information is sent to other nodes. When each node receives the change information sent by other nodes, it updates its own data information according to the change information sent by the other nodes. Ensure that the data information of all nodes in the cluster is the same. Each node only transmits the changed data information to each other, and those data information that has not changed within a certain period of time will not be transmitted in the network again, canceling the transmission of repeated data in the network, and avoiding the waste of network bandwidth , reducing the network bandwidth load, thereby ensuring the real-time data transmission in the network and the reliability of data in each node.
可选的,图2示出了本发明实施例提供的集群中各节点间数据共享方法中保存改变信息的方法流程图,参照图2,该保存改变信息的方法可以包括:Optionally, FIG. 2 shows a flow chart of a method for saving change information in the data sharing method among nodes in a cluster provided by an embodiment of the present invention. Referring to FIG. 2 , the method for saving change information may include:
步骤S200:将所述改变信息发送给数据监测设备;Step S200: Send the change information to the data monitoring device;
可选的,为了得到集群中各节点间的资源传递情况,可以各节点在检测到自身节点信息发生改变后,除了将确定改变的改变信息发生给其他节点外,还可以将该确定的改变信息发送给数据监测设备。Optionally, in order to obtain the resource transfer status among the nodes in the cluster, after each node detects that its own node information has changed, in addition to sending the confirmed change information to other nodes, the determined change information can also be Send to data monitoring equipment.
步骤S210:所述数据监测设备将所述改变信息发送给数据库进行保存。Step S210: the data monitoring device sends the change information to a database for storage.
数据监测设备在得到各节点发上来的改变信息后,将该改变信息发送给数据库,由数据库对该改变数据进行保存。After obtaining the change information sent by each node, the data monitoring device sends the change information to the database, and the database saves the change data.
可选的,图3示出了本发明实施例提供的集群中各节点间数据共享方法中显示资源曲线图的方法流程图,参照图3,该显示资源曲线图的方法可以包括:Optionally, FIG. 3 shows a flowchart of a method for displaying a resource graph in the data sharing method among nodes in a cluster provided by an embodiment of the present invention. Referring to FIG. 3, the method for displaying a resource graph may include:
步骤S300:所述数据库根据所述改变信息绘制资源曲线图;Step S300: the database draws a resource graph according to the change information;
为了直观得观察到集群中各节点间的资源传递情况,数据库可以在得到数据监测设备发送来改变信息后,根据该改变信息绘制资源曲线图。In order to intuitively observe the resource transfer situation among the nodes in the cluster, the database can draw a resource curve graph according to the change information after receiving the change information sent by the data monitoring device.
步骤S310:将所述资源曲线图发送给显示器进行显示。Step S310: Send the resource graph to a display for display.
数据库在根据改变信息绘制资源曲线图后,将该资源曲线图发送给显示器,有显示器对该制资源曲线图进行显示,供用户观看。After the database draws the resource curve according to the change information, it sends the resource curve to the display, and the display displays the resource curve for the user to watch.
可选的,图4示出了本发明实施例提供的集群中各节点间数据共享方法中每隔预设时间间隔各节点检测自身数据信息是否发生改变的方法流程图,参照图4,该每隔预设时间间隔各节点检测自身数据信息是否发生改变的方法可以包括:Optionally, FIG. 4 shows a flowchart of a method for each node to detect whether its own data information has changed at a preset time interval in the data sharing method among nodes in a cluster provided by an embodiment of the present invention. Referring to FIG. 4 , each The method for each node to detect whether its own data information has changed at a preset time interval may include:
步骤S400:判断是否达到预设时间间隔;Step S400: judging whether the preset time interval is reached;
步骤S410:若达到,则各节点获取自身数据信息;Step S410: If reached, each node obtains its own data information;
当每隔预设时间间隔各节点检测自身数据信息是否发生改变时,因为每隔预设时间间隔各节点检测自身数据信息是否发生改变,因此,每隔预设时间间隔各节点采集一次自身数据信息,在获取上一自身数据信息后,若达到预设时间间隔,则获取当前自身数据信息。When each node detects whether its own data information has changed every preset time interval, because each node detects whether its own data information has changed every preset time interval, therefore, each node collects its own data information every preset time interval , after obtaining the last self-data information, if the preset time interval is reached, the current self-data information is obtained.
步骤S420:各节点判断本次获取的自身数据信息与上次获取的自身数据信息是否相同;Step S420: Each node judges whether the self-data information obtained this time is the same as the self-data information obtained last time;
各节点判断本次获取的自身数据信息与上次获取的自身数据信息是否相同,即各节点判断获取的当前自身数据信息与上一自身数据信息是否相同。Each node judges whether the self-data information obtained this time is the same as the self-data information obtained last time, that is, each node judges whether the current self-data information obtained is the same as the previous self-data information.
步骤S430:若不相同,则判定自身数据信息发生改变,确定发生改变的改变信息;Step S430: If not the same, determine that the data information of the self has changed, and determine the changed change information;
若某节点获取的当前自身数据信息与上一自身数据信息不相同,则可判定该节点自身数据信息发生改变,可继续下一步操作,确定发生改变的改变信息。If the current self-data information obtained by a node is different from the previous self-data information, it can be determined that the self-data information of the node has changed, and the next step can be continued to determine the changed change information.
步骤S440:若相同,则判定自身数据信息没有发生改变,返回步骤S400。Step S440: If they are the same, it is determined that the self-data information has not changed, and return to step S400.
若某节点获取的当前自身数据信息与上一自身数据信息相同,则可判定该节点自身数据信息没有发生改变,返回步骤S400,在预设时间间隔后获取下一自身数据信息。If the current self-data information acquired by a node is the same as the previous self-data information, it can be determined that the node's self-data information has not changed, and returns to step S400 to obtain the next self-data information after a preset time interval.
可选的,图5示出了本发明实施例提供的集群中各节点间数据共享方法中当接收到监测指令时各节点检测自身数据信息是否发生改变的方法流程图,参照图5,该当接收到监测指令时各节点检测自身数据信息是否发生改变的方法可以包括:Optionally, FIG. 5 shows a flowchart of a method for each node to detect whether its own data information has changed when a monitoring instruction is received in the method for sharing data among nodes in a cluster provided by an embodiment of the present invention. Referring to FIG. 5 , it should receive The method for each node to detect whether its own data information has changed when the monitoring instruction is received may include:
步骤S500:各节点判断是否接收到检测指令;Step S500: Each node judges whether a detection instruction is received;
当接收到监测指令时各节点检测自身数据信息是否发生改变时,当用户需要各节点检测自身数据信息时,将向各节点发送检测指令,因此,各节点可通过判断是否接收到检测指令来确定是否检测自身数据信息。When each node detects whether its own data information has changed when receiving the monitoring command, when the user needs each node to detect its own data information, it will send a detection command to each node. Therefore, each node can determine whether it has received the detection command. Whether to detect its own data information.
步骤S510:若接收到,则各节点获取自身数据信息;Step S510: If received, each node obtains its own data information;
若接收到检测指令,则各节点获取自身数据信息。If a detection instruction is received, each node obtains its own data information.
步骤S520:各节点判断本次获取的自身数据信息与上次获取的自身数据信息是否相同;Step S520: Each node judges whether the self-data information obtained this time is the same as the self-data information obtained last time;
各节点在获取自身数据信息后,本次获取的自身数据信息即为当前自身数据信息,上次获取的自身数据信息即为上一自身数据信息,通过判断本次获取的自身数据信息与上次获取的自身数据信息是否相同来判定自身数据信息是否发生改变。After each node obtains its own data information, the self-data information obtained this time is the current self-data information, and the self-data information obtained last time is the previous self-data information. By judging the self-data information obtained this time and the last time Whether the obtained self-data information is the same is used to determine whether the self-data information has changed.
步骤S530:若不相同,则判定自身数据信息发生改变,确定发生改变的改变信息;Step S530: If not the same, determine that the data information of the self has changed, and determine the changed change information;
若某节点获取的当前自身数据信息与上一自身数据信息不相同,则可判定该节点自身数据信息发生改变,可继续下一步操作,确定发生改变的改变信息。If the current self-data information obtained by a node is different from the previous self-data information, it can be determined that the self-data information of the node has changed, and the next step can be continued to determine the changed change information.
步骤S540:若相同,则判定自身数据信息没有发生改变,返回步骤S500。Step S540: If they are the same, it is determined that the self-data information has not changed, and return to step S500.
若某节点获取的当前自身数据信息与上一自身数据信息相同,则可判定该节点自身数据信息没有发生改变,返回步骤S400,在预设时间间隔后获取下一自身数据信息。If the current self-data information acquired by a node is the same as the previous self-data information, it can be determined that the node's self-data information has not changed, and returns to step S400 to obtain the next self-data information after a preset time interval.
本发明实施例提供的集群中各节点间数据共享方法,各节点间只相互传送发生了改变的数据信息,那些在特定时间段内没有发生改变的数据信息,将不会再在网络中传输,取消了网络中重复数据的传输,避免了网络带宽的浪费,减轻了网络带宽负载,进而保证了网络中数据传递的实时性和各节点内数据的可靠性。In the data sharing method among the nodes in the cluster provided by the embodiment of the present invention, each node only transmits the changed data information to each other, and those data information that has not changed within a specific period of time will not be transmitted in the network again. It cancels the transmission of repeated data in the network, avoids the waste of network bandwidth, reduces the load of network bandwidth, and then ensures the real-time data transmission in the network and the reliability of data in each node.
下面对本发明实施例提供的集群中各节点间数据共享系统进行介绍,下文描述的集群中各节点间数据共享系统与上文描述的集群中各节点间数据共享方法可相互对应参照。The following describes the data sharing system among the nodes in the cluster provided by the embodiment of the present invention. The data sharing system among the nodes in the cluster described below and the data sharing method among the nodes in the cluster described above can be used for mutual reference.
图6为本发明实施例提供的集群中各节点间数据共享系统的系统框图,参照图6,该集群中各节点间数据共享系统可以包括:至少两个节点100,其中,每个节点100包括:检测模块110、第一发送模块120和接收模块130;其中,FIG. 6 is a system block diagram of a data sharing system among nodes in a cluster provided by an embodiment of the present invention. Referring to FIG. : detection module 110, first sending module 120 and receiving module 130; wherein,
检测模块110,用于检测自身数据信息是否发生改变,若发生改变,则确定发生改变的改变信息;The detection module 110 is used to detect whether the self-data information has changed, and if there is a change, determine the changed change information;
第一发送模块120,用于将所述改变信息发送给其他节点;The first sending module 120 is configured to send the change information to other nodes;
接收模块130,用于当接收到其他节点发送来的改变信息时,根据所述其他节点发送来的改变信息对自身数据信息进行更新,保证集群中所有节点的数据信息相同。The receiving module 130 is configured to update its own data information according to the change information sent by other nodes when receiving the change information sent by other nodes, so as to ensure that the data information of all nodes in the cluster are the same.
可选的,图7示出了本发明实施例提供的集群中各节点间数据共享系统的另一系统框图,参照图7,每个节点100还可以包括:第二发送模块140。Optionally, FIG. 7 shows another system block diagram of a data sharing system among nodes in a cluster provided by an embodiment of the present invention. Referring to FIG. 7 , each node 100 may further include: a second sending module 140 .
第二发送模块140,用于将所述改变信息发送给数据监测设备;The second sending module 140 is configured to send the change information to the data monitoring device;
参照图7,本发明实施例提供的集群中各节点间数据共享系统的另一系统框图,该集群中各节点间数据共享系统还可以包括:数据监测设备200和数据库300;其中,Referring to FIG. 7 , another system block diagram of the data sharing system among the nodes in the cluster provided by the embodiment of the present invention, the data sharing system among the nodes in the cluster may also include: a data monitoring device 200 and a database 300; wherein,
数据监测设备200,用于接收第二发送模块140发送的改变信息,并将所述发送改变信息发送给数据库300;The data monitoring device 200 is configured to receive the change information sent by the second sending module 140, and send the change information to the database 300;
数据库300,用于接收数据监测设备200发送的所述改变信息,并将所述改变信息进行保存。The database 300 is configured to receive the change information sent by the data monitoring device 200 and store the change information.
参照图7,本发明实施例提供的集群中各节点间数据共享系统的另一系统框图,数据库300可以包括:接收单元310和存储单元320;其中,Referring to FIG. 7 , another system block diagram of a data sharing system among nodes in a cluster provided by an embodiment of the present invention, the database 300 may include: a receiving unit 310 and a storage unit 320; wherein,
接收单元310,用于接收所述数据监测设备发送的所述改变信息,;a receiving unit 310, configured to receive the change information sent by the data monitoring device;
存储单元320,用于将所述改变信息进行保存。The storage unit 320 is configured to store the change information.
可选的,图8示出了本发明实施例提供的集群中各节点间数据共享系统的又一系统框图,参照图8,数据库300还可以包括:绘图单元330和发送单元340;其中,Optionally, FIG. 8 shows another system block diagram of a data sharing system among nodes in a cluster provided by an embodiment of the present invention. Referring to FIG. 8, the database 300 may further include: a drawing unit 330 and a sending unit 340; wherein,
绘图单元330,用于根据所述改变信息绘制资源曲线图;A drawing unit 330, configured to draw a resource graph according to the change information;
发送单元340,用于将所述资源曲线图发送给显示器。A sending unit 340, configured to send the resource graph to a display.
参照图8,本发明实施例提供的集群中各节点间数据共享系统的又一系统框图,该集群中各节点间数据共享系统还可以包括:显示器400。Referring to FIG. 8 , another system block diagram of a data sharing system among nodes in a cluster provided by an embodiment of the present invention, the data sharing system among nodes in a cluster may further include: a display 400 .
显示器400,用于接收数据库300发送的资源曲线图,并对所述资源曲线图进行显示。The display 400 is configured to receive the resource graph sent by the database 300 and display the resource graph.
可选的,图9示出了本发明实施例提供的集群中各节点间数据共享系统中检测模块110的结构框图,参照图9,该检测模块110可以包括:第一检测单元111和/或第二检测112单元;其中,Optionally, FIG. 9 shows a structural block diagram of a detection module 110 in a data sharing system among nodes in a cluster provided by an embodiment of the present invention. Referring to FIG. 9 , the detection module 110 may include: a first detection unit 111 and/or The second detection unit 112; wherein,
第一检测单元111,用于每隔预设时间间隔各节点检测自身数据信息是否发生改变;The first detection unit 111 is used for each node to detect whether its own data information has changed every preset time interval;
第二检测单元112,用于当接收到监测指令时各节点检测自身数据信息是否发生改变。The second detection unit 112 is configured for each node to detect whether its own data information changes when receiving the monitoring instruction.
本发明实施例提供的集群中各节点间数据共享系统,各节点间只相互传送发生了改变的数据信息,那些在特定时间段内没有发生改变的数据信息,将不会再在网络中传输,取消了网络中重复数据的传输,避免了网络带宽的浪费,减轻了网络带宽负载,进而保证了网络中数据传递的实时性和各节点内数据的可靠性。In the data sharing system among the nodes in the cluster provided by the embodiment of the present invention, each node only transmits the changed data information to each other, and those data information that has not changed within a specific period of time will not be transmitted in the network again. It cancels the transmission of repeated data in the network, avoids the waste of network bandwidth, reduces the load of network bandwidth, and then ensures the real-time data transmission in the network and the reliability of data in each node.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510689258.1A CN105338075A (en) | 2015-10-21 | 2015-10-21 | Method and system for sharing data between nodes in cluster |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510689258.1A CN105338075A (en) | 2015-10-21 | 2015-10-21 | Method and system for sharing data between nodes in cluster |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105338075A true CN105338075A (en) | 2016-02-17 |
Family
ID=55288350
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510689258.1A Pending CN105338075A (en) | 2015-10-21 | 2015-10-21 | Method and system for sharing data between nodes in cluster |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105338075A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105721601A (en) * | 2016-03-07 | 2016-06-29 | 深圳市创想天空科技股份有限公司 | Data recovery method and system |
WO2024152644A1 (en) * | 2023-01-18 | 2024-07-25 | 华为云计算技术有限公司 | Data query method and system, device cluster, medium and program product |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050138517A1 (en) * | 2003-11-06 | 2005-06-23 | Arnold Monitzer | Processing device management system |
CN101232514A (en) * | 2008-01-24 | 2008-07-30 | 创新科存储技术(深圳)有限公司 | Metadata synchronization method of network additional memory node and network additional memory node |
CN104468274A (en) * | 2014-12-16 | 2015-03-25 | 深圳大学 | Cluster monitor and management method and system |
-
2015
- 2015-10-21 CN CN201510689258.1A patent/CN105338075A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050138517A1 (en) * | 2003-11-06 | 2005-06-23 | Arnold Monitzer | Processing device management system |
CN101232514A (en) * | 2008-01-24 | 2008-07-30 | 创新科存储技术(深圳)有限公司 | Metadata synchronization method of network additional memory node and network additional memory node |
CN104468274A (en) * | 2014-12-16 | 2015-03-25 | 深圳大学 | Cluster monitor and management method and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105721601A (en) * | 2016-03-07 | 2016-06-29 | 深圳市创想天空科技股份有限公司 | Data recovery method and system |
WO2024152644A1 (en) * | 2023-01-18 | 2024-07-25 | 华为云计算技术有限公司 | Data query method and system, device cluster, medium and program product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8095495B2 (en) | Exchange of syncronization data and metadata | |
US20150220556A1 (en) | Methods, apparatuses and computer program products for providing a protocol to resolve synchronization conflicts when synchronizing between multiple devices | |
CN105099763B (en) | Equipment goes offline based reminding method and device | |
US20190200287A1 (en) | Method for Identifying Access Point and Hotspot and Terminal | |
WO2016058133A1 (en) | Software upgrading method and device | |
JP2015513128A5 (en) | ||
CN105657000A (en) | Message transmission method and device | |
US20200007488A1 (en) | Message Notification Method and Terminal | |
CN112817992B (en) | Method, apparatus, electronic device and readable storage medium for executing change task | |
CN112838980B (en) | Message processing method, system, device, electronic equipment and storage medium | |
JP6531593B2 (en) | Communication method, communication program and information processing apparatus | |
CN105245408A (en) | Synchronous data monitoring method and device | |
JP2019067176A (en) | Distributed process management system, distributed process management method, and information processing apparatus | |
US20190132105A1 (en) | Parent node device, terminal device for wireless network and data transmission method thereof | |
CN105338075A (en) | Method and system for sharing data between nodes in cluster | |
WO2022188614A1 (en) | Apparatus, method and system for monitoring image forming apparatus, and storage medium | |
JP2012235400A (en) | Switching device and aging method for switching device | |
CN112860431B (en) | Connection method, system, equipment and storage medium of micro service node | |
CN111737084B (en) | Information monitoring method, device, intelligent equipment, computer equipment and medium | |
CN107332739A (en) | Network detection method, network detection device and intelligent terminal | |
CN107276856A (en) | Network detection method, network detection device and intelligent terminal | |
WO2018083710A2 (en) | An improved management and internetworking of devices to collect and exchange data without requiring interaction | |
CN113595894B (en) | Communication method, device, equipment and medium between service nodes and client nodes | |
CN114244860B (en) | A method, device, electronic device and storage medium for managing Internet of Things devices | |
CN105721531B (en) | message synchronization method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160217 |
|
RJ01 | Rejection of invention patent application after publication |