CN112235406A - Subnet equipment information synchronization method based on multicast and memory backup - Google Patents

Subnet equipment information synchronization method based on multicast and memory backup Download PDF

Info

Publication number
CN112235406A
CN112235406A CN202011102723.4A CN202011102723A CN112235406A CN 112235406 A CN112235406 A CN 112235406A CN 202011102723 A CN202011102723 A CN 202011102723A CN 112235406 A CN112235406 A CN 112235406A
Authority
CN
China
Prior art keywords
data
multicast
subnet
buffer
method based
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
Application number
CN202011102723.4A
Other languages
Chinese (zh)
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.)
Ruan Internet Of Things Technology Group Co ltd
Original Assignee
Ruan Internet Of Things Technology Group 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 Ruan Internet Of Things Technology Group Co ltd filed Critical Ruan Internet Of Things Technology Group Co ltd
Priority to CN202011102723.4A priority Critical patent/CN112235406A/en
Publication of CN112235406A publication Critical patent/CN112235406A/en
Pending legal-status Critical Current

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/1859Arrangements for providing special services to substations for broadcast or conference, e.g. multicast adapted to provide push services, e.g. data channels
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/1886Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with traffic restrictions for efficiency improvement, e.g. involving subnets or subdomains
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/189Arrangements for providing special services to substations for broadcast or conference, e.g. multicast in combination with wireless systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a subnet equipment information synchronization method based on multicast and memory backup, which comprises the following steps: s1: data acquisition, namely collecting equipment data every 2 seconds through a data collection submodule to realize the collection of wired link data and wireless link data of a single equipment node; s2: data transmission, namely transmitting data in the sub-network in a multicast mode through a data transmission sub-module; s3: data reception and synchronization. The invention adopts a multicast mode to send data, and adopts a data receiving address pair to synchronize data with a comparison source IP, thereby ensuring that the data of all devices in the subnet are received without omission, and the data received by all devices in the subnet are synchronized, solving the three defects of the traditional P2P mode, greatly improving the convenience of device management, efficiently saving bandwidth, improving the synchronism of data among devices, and simultaneously improving the robustness and safety of the whole subnet.

Description

Subnet equipment information synchronization method based on multicast and memory backup
Technical Field
The invention relates to the technical field of subnet equipment management of the Internet of things, in particular to a subnet equipment information synchronization method based on multicast and memory backup.
Background
The traditional P2P mode is mostly adopted for information synchronization among devices in the subnet, and this mode has great limitation, the traditional P2P mode is not beneficial to management, and each time a new device is added in the subnet, it is necessary to discover information of this device, such as an IP address, and then to send its own traffic information to the new device, and at the same time, the new device also needs to discover the IP of all devices in the current network, and then to send its own information to other devices in the network.
The conventional P2P mode has a great waste of bandwidth, if the conventional mode is adopted, each device needs to send its own device information to all devices in the subnet, if there are N devices, the devices need to send out N times, and under the condition that data needs to be updated synchronously in time, network resources are greatly wasted.
The traditional P2P mode data synchronization is very poor, if there are N devices in the subnet, any one of the devices needs to send its own data N-1 times, and to other devices, because the sending is in sequence, the other N-1 devices cannot guarantee to receive the same data at the same time, which results in that the data displayed by different devices at the same time are different.
Disclosure of Invention
The invention aims to provide a subnet equipment information synchronization method based on multicast and memory backup, which adopts a multicast mode to send data and adopts a mode of receiving data address comparison to compare a source IP to synchronize the data, thereby solving the three defects of the traditional P2P mode, greatly improving the convenience of equipment management, efficiently saving bandwidth, improving the data synchronization among equipment and simultaneously improving the robustness and the safety of the whole subnet.
In order to achieve the purpose, the invention adopts the following technical scheme: the subnet equipment information synchronization method based on multicast and memory backup comprises the following steps:
s1: data acquisition, namely collecting equipment data every 2 seconds through a data collection submodule to realize the collection of wired link data and wireless link data of a single equipment node;
s2: data sending, namely, transmitting data in the sub-network in a multicast mode through a data sending sub-module, assembling the data into a json format after the data of the current equipment is collected by a data collecting sub-module, sending the json format to a multicast group marked by 224.0.0.8, wherein the receiving port number is 9865;
s3: DATA receiving and synchronizing, DATA receiving and DATA synchronizing are realized through a DATA receiving submodule, the module receives DATA of a port 9865, the DATA is placed in a BUFFER DATA, a source IP of the DATA is stored in another empty BUFFER, and after DATA is received from another host computer every time, the source IP is compared with an IP already stored in the BUFFER.
As a further description of the above technical solution:
the wired link data comprises a TX rate, an RX rate, a multicast rate and a packet loss rate of the wired link.
As a further description of the above technical solution:
the wireless link data comprises information of TX rate, RX rate, multicast rate, packet loss rate, signal-to-noise ratio, received signal strength and the like of the wireless link.
As a further description of the above technical solution:
the specific method for collecting the wired link data of the single equipment node is that a line is printed in a file named as flow by adopting a file cache mode according to the total package number of TX, RX, multicast and packet loss of the read interface, and the line is marked by a timestamp for data acquisition. And collecting the total package number of TX, the total package number of RX, the total package number of multicast and the total package number of packet loss of the interface again in the next re-execution, and printing the data to the file flow again, wherein the row takes the time stamp of data collection as a mark and does the same operation in each collection period in turn.
As a further description of the above technical solution:
the specific method for collecting the wireless link data of the single equipment node is to collect multiple items of data of the wireless link by adopting a memory data cache mode, store wireless link information through a two-dimensional linked list, store the MAC addresses of all the outward next-hop equipment of the equipment by the transverse nodes of the two-dimensional linked list, and store the total number of TX packets, the total number of RX packets, the total number of multicast packets, the total number of packet loss packets and the statistical time of the corresponding MAC addresses by the longitudinal nodes.
As a further description of the above technical solution:
the method for comparing the source IP with the IP stored in the BUFFER comprises the following steps:
s3.1: the source IP is not in the BUFFER, the IP is stored in the BUFFER, and the DATA is put into the DATA;
s3.2: source IP is already in BUFFER, indicating that a cycle (1s) of DATA collection is complete, at which point DATA is submitted to the upper WEB display, and then DATA and BUFFER are cleared and newly received DATA is put into DATA and a new source IP is put into BUFFER.
The invention provides a subnet equipment information synchronization method based on multicast and memory backup. The method has the following beneficial effects:
the subnet equipment information synchronization method based on multicast and memory backup adopts a multicast mode to send data, and adopts a data receiving address pair to synchronize data with a comparison source IP, so that the data of all equipment in the subnet can be received without omission, the data received by all equipment in the subnet can be synchronized, the three defects of the traditional P2P mode are overcome, the convenience of equipment management is greatly improved, the bandwidth is efficiently saved, the synchronism of data among the equipment is improved, and the robustness and the safety of the whole subnet are improved.
Drawings
FIG. 1 is a diagram illustrating a file structure of a file storage portion according to the present invention;
FIG. 2 is a linked list structure diagram of the memory storage portion of the present invention;
FIG. 3 is a schematic diagram of a data transmission sub-module according to the present invention;
fig. 4 is a flowchart of a procedure of the receiving module according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
Referring to fig. 1-4, a subnet equipment information synchronization method based on multicast and memory backup includes the following steps:
s1: data acquisition, namely collecting the equipment data every 2 seconds by the data collection submodule to realize the collection of wired link data and wireless link data of a single equipment node
Furthermore, the data collection submodule comprises two functions of data collection and data calculation, data calculation is carried out after data of one period is collected every time, a calculation result is stored in a json character string to be sent by the data sending submodule, the data collection submodule is responsible for collecting data of a network interface and data of a next hop of a link, the number of the next hops can be multiple, file storage and file storage are adopted when the data of the network interface are collected, a memory is adopted when the data of the next hop of the link are collected, and a two-dimensional linked list is adopted when the memory is stored;
s2: data sending, namely, transmitting data in the sub-network in a multicast mode through a data sending sub-module, assembling the data into a json format after the data of the current equipment is collected by a data collecting sub-module, sending the json format to a multicast group marked by 224.0.0.8, wherein the receiving port number is 9865;
s3: DATA receiving and synchronizing, DATA receiving and DATA synchronizing are realized through a DATA receiving submodule, the module receives DATA of a port 9865, the DATA is placed in a BUFFER DATA, a source IP of the DATA is stored in another empty BUFFER, and after DATA is received from another host computer every time, the source IP is compared with an IP already stored in the BUFFER.
The wired link data comprises the TX rate, the RX rate, the multicast rate and the packet loss rate of the wired link; the wireless link data includes information such as the TX rate, RX rate, multicast rate, packet loss rate, signal-to-noise ratio, and received signal strength of the wireless link.
The specific method for collecting the wired link data of the single device node is that a file cache mode is adopted to print a row of the number of the TX total packets, the number of the RX total packets, the number of the multicast total packets and the number of the packet loss total packets of the read interface in a file named as flow, and the row takes a timestamp of data acquisition as a mark. And collecting the total package number of TX, the total package number of RX, the total package number of multicast and the total package number of packet loss of the interface again in the next re-execution, and printing the data to the file flow again, wherein the row takes the time stamp of data collection as a mark and does the same operation in each collection period in turn.
Referring to fig. 1, the data collection sub-module collects data of the network interface in a file storage manner, counts RX byte number, RX total packet number, TX byte number, TX total packet number, multicast total packet number, RX packet loss total packet number, TX packet loss total packet number of the network interface (e.g., br-lan) every second, and writes the data into the file as one line, where the line is marked by the time of counting that time point, the maximum line number of the file buffer is 5 lines, and when the line number of the file is found to be less than 5 lines each time data of the network interface is collected, the data is directly written into the file according to a specified structure, and if the file is found to be greater than 5 lines, the file is moved forward by one line, so that the first line is overwritten, and then newly collected data is written into the file as the 5 th line.
Referring to fig. 2, the collection of the wireless link data of a single device node is stored in a memory, specifically, a two-dimensional linked list is used, when the collection of the next hop link data is completed in the first pass, the device sleeps for one second, then the second data collection is performed, and the data collected twice are stored in a vertical linked list,
the specific process of the linked list data storage is as follows: the horizontal direction of the two-dimensional linked list is used for storing the MAC addresses of the found next hops, when a new next hop is found, the MAC address of the newly found node is not in the horizontal linked list, a new node is opened up in the horizontal linked list, and a longitudinal node is opened up in the newly opened horizontal node and is used for storing the data of a link which is specifically connected with a certain next hop node,
when collecting data, finding the MAC address of the next hop in the horizontal linked list, finding the linked list node storing the MAC address of the device, traversing longitudinally, if finding the longitudinal depth is less than 2, opening up a new linked list node longitudinally, and storing link data and time in the new node.
And performing data calculation after completing two times of data collection, for linked list storage, subtracting Tx _ bytes of the first row from Tx _ bytes of the second longitudinal row, namely the number of bytes transmitted to the next hop by the equipment in the past one second, wherein Tx _ packets and Tx _ failed calculation methods are similar, after the data calculation is completed, storing the calculation result in a json character string, and then emptying the two-dimensional linked list, so that the longitudinal depth of the two-dimensional linked list is always two.
For file storage, the time of LineN minus the time of Line1 is set as t, the time of LineN rxb minus Line1 is set as b, then b bytes, rxp, txb, txp, multicast, tx _ drop are transmitted in the time period from LineN to Line1, the calculation methods are all similar, and the calculated result is stored in a json string
Referring to fig. 3, the data sending submodule is responsible for sending a result (json character string) calculated by the data collecting submodule, and the data sending submodule adopts a multicast mode. When device a transmits as shown in fig. three, device B, device C, device D, and device E receive data multicast by device a. Similarly, when the device B sends the slave data, the device a, the device C, the device D, and the device E receive the data multicast by the device B. The data collection and data transmission sub-modules are logically serial.
Referring to fig. 4, the DATA receiving submodule is always running, and every time the DATA is generated, the DATA receiving submodule blocks the recvfrom () function, and when receiving DATA of a certain device, the receiving device compares the source IP of the DATA with the IP already stored in the IP BUFFER, and if the source IP is not in the IP BUFFER, the receiving device puts the new DATA into DATA. If the source IP is already in the IP BUFFER, this indicates that the round of data collection has completed a complete cycle (our cycle period of data collection is 1 second), that is, this device has received the data sent by all devices in the last-cycle subnet. At this time, the apparatus transfers DATA to the front-end WEB program, and clears DATA and IP BUFFER. Then, the newly received source IP is stored again in the IP BUFFER, the newly received DATA is stored in the DATA, and the recvfrom () function is recalled waiting for reception. Because the data collection period is long (1 second), and the data collection submodule and the data sending submodule are logically parallel. Therefore, the IP comparison method ensures that the data received by each device in the same period are synchronous.
In the description herein, references to the description of "one embodiment," "an example," "a specific example," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.

Claims (6)

1. The subnet equipment information synchronization method based on multicast and memory backup is characterized by comprising the following steps:
s1: data acquisition, namely collecting equipment data every 2 seconds through a data collection submodule to realize the collection of wired link data and wireless link data of a single equipment node;
s2: data sending, namely, transmitting data in the sub-network in a multicast mode through a data sending sub-module, assembling the data into a json format after the data of the current equipment is collected by a data collecting sub-module, sending the json format to a multicast group marked by 224.0.0.8, wherein the receiving port number is 9865;
s3: DATA receiving and synchronizing, DATA receiving and DATA synchronizing are realized through a DATA receiving submodule, the module receives DATA of a port 9865, the DATA is placed in a BUFFER DATA, a source IP of the DATA is stored in another empty BUFFER, and after DATA is received from another host computer every time, the source IP is compared with an IP already stored in the BUFFER.
2. The subnet apparatus information synchronization method based on multicast and memory backup as claimed in claim 1, wherein the wired link data comprises TX rate, RX rate, multicast rate, packet loss rate of the wired link.
3. The subnet apparatus information synchronization method based on multicast and memory backup as claimed in claim 1, wherein the wireless link data comprises TX rate, RX rate, multicast rate, packet loss rate, signal-to-noise ratio, received signal strength, etc. of the wireless link.
4. The subnet equipment information synchronization method based on multicast and memory backup as claimed in claim 1, wherein the specific method for collecting the wired link data of the single equipment node is to print the total number of TX packets, the total number of RX packets, the total number of multicast packets and the total number of packet loss of the read interface in a file named flows file by using a file cache way, and the line is marked by a timestamp of data collection. And collecting the total package number of TX, the total package number of RX, the total package number of multicast and the total package number of packet loss of the interface again in the next re-execution, and printing the data to the file flow again, wherein the row takes the time stamp of data collection as a mark and does the same operation in each collection period in turn.
5. The subnet equipment information synchronization method based on multicast and memory backup as claimed in claim 1, wherein the specific method for collecting the wireless link data of a single equipment node is to collect multiple items of data of the wireless link by using a memory data cache mode, and store the wireless link information by using a two-dimensional linked list, the horizontal nodes of the two-dimensional linked list store the MAC addresses of all the next hop equipments outward from the equipment, and the vertical nodes store the total number of TX packets, the total number of RX packets, the total number of multicast packets, the total number of packet loss packets and the statistical time corresponding to the MAC addresses.
6. The subnet equipment information synchronization method based on multicast and memory backup as claimed in claim 1, wherein the comparing method between the source IP and the IP already stored in the BUFFER comprises the following steps:
s3.1: the source IP is not in the BUFFER, the IP is stored in the BUFFER, and the DATA is put into the DATA;
s3.2: source IP is already in BUFFER, indicating that a cycle (1s) of DATA collection is complete, at which point DATA is submitted to the upper WEB display, and then DATA and BUFFER are cleared and newly received DATA is put into DATA and a new source IP is put into BUFFER.
CN202011102723.4A 2020-10-15 2020-10-15 Subnet equipment information synchronization method based on multicast and memory backup Pending CN112235406A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011102723.4A CN112235406A (en) 2020-10-15 2020-10-15 Subnet equipment information synchronization method based on multicast and memory backup

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011102723.4A CN112235406A (en) 2020-10-15 2020-10-15 Subnet equipment information synchronization method based on multicast and memory backup

Publications (1)

Publication Number Publication Date
CN112235406A true CN112235406A (en) 2021-01-15

Family

ID=74113616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011102723.4A Pending CN112235406A (en) 2020-10-15 2020-10-15 Subnet equipment information synchronization method based on multicast and memory backup

Country Status (1)

Country Link
CN (1) CN112235406A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150098466A1 (en) * 2013-10-06 2015-04-09 Mellanox Technologies Ltd. Simplified packet routing
CN104661111A (en) * 2013-11-25 2015-05-27 上海益尚信息科技有限公司 Method and device for transmitting I-frame analysis method uplink multicast data
CN105791054A (en) * 2016-04-22 2016-07-20 西安交通大学 Autonomous controllable and reliable multicast transmission method based on flow classification realization
CN106453451A (en) * 2015-08-08 2017-02-22 陈昶宇 Shared adaptive content data cache network (SADCN)
CN108155999A (en) * 2017-12-27 2018-06-12 罗建平 The intelligent UDP Multicast Files dissemination system and method for machine contracting system are mended with TCP
CN108809840A (en) * 2018-06-12 2018-11-13 天津卓越信通科技有限公司 A method of for controlling and multicast group in management subnet
CN111221861A (en) * 2019-12-31 2020-06-02 武汉中海庭数据技术有限公司 Method and device for synchronizing local cache and database data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150098466A1 (en) * 2013-10-06 2015-04-09 Mellanox Technologies Ltd. Simplified packet routing
CN104661111A (en) * 2013-11-25 2015-05-27 上海益尚信息科技有限公司 Method and device for transmitting I-frame analysis method uplink multicast data
CN106453451A (en) * 2015-08-08 2017-02-22 陈昶宇 Shared adaptive content data cache network (SADCN)
CN105791054A (en) * 2016-04-22 2016-07-20 西安交通大学 Autonomous controllable and reliable multicast transmission method based on flow classification realization
CN108155999A (en) * 2017-12-27 2018-06-12 罗建平 The intelligent UDP Multicast Files dissemination system and method for machine contracting system are mended with TCP
CN108809840A (en) * 2018-06-12 2018-11-13 天津卓越信通科技有限公司 A method of for controlling and multicast group in management subnet
CN111221861A (en) * 2019-12-31 2020-06-02 武汉中海庭数据技术有限公司 Method and device for synchronizing local cache and database data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邱静怡: "一种支持单向链路的PUMA改进组播路由协议", 《计算机应用与软件》, no. 10, 15 October 2017 (2017-10-15) *

Similar Documents

Publication Publication Date Title
US7619987B2 (en) Node device
CN100512194C (en) Sending and receiving method and system for link aggregation method, device and MAC frame
CN102035692B (en) Method and device for detecting quality of link
CN101409666B (en) Ring network, ring network topology discovering method and node
CN106131919B (en) A kind of synchronous method of non-stop layer self-organized network topology
CN102857354B (en) Alarm information reporting method, apparatus and system
CN101651510B (en) Method and device for recovery processing in service data synchronous transmission
CN101800679A (en) Message packet loss detection method and system
CN101729391A (en) Method, node and system for acquiring link aggregation group information
CN104243630A (en) MAC (media access control) address learning method and MAC address learning device in VXLAN (virtual extensible local area network)
CN1725733A (en) Method of route backup in combination equipment and combination equipment
WO2018171641A1 (en) Method and device for transmitting and receiving network management information, transmitting apparatus and receiving apparatus
CN109743136B (en) Transmission message transmitting method, receiving method and processing device
CN110691379A (en) Active routing communication method suitable for wireless ad hoc network
CN105515901A (en) Message processing apparatus and method
CN102045233B (en) Method and device for controlling message forwarding in network communication
CN101527645A (en) Method, system and relevant device for collecting network topology information
CN112235406A (en) Subnet equipment information synchronization method based on multicast and memory backup
CN109951388B (en) Routing uninterrupted method and main control board
CN105142175B (en) A kind of method of rapid link state-detection between Wireless Communication Equipment
CN101272326A (en) Method for packet transmission by polymerization link and communication equipment thereof
CN103023793B (en) Management device and management method of address resolution protocol table
CN113225376B (en) Ethernet frame and SDN data frame adapting method based on FPGA
CN104869041A (en) Method for dynamic path planning in ring network
CN105306362B (en) The passive acquisition method and system of ospf network routing iinformation based on IPv6

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210115

WD01 Invention patent application deemed withdrawn after publication