CN114124431A - Real-time automatic file synchronization method and system for isolation device - Google Patents

Real-time automatic file synchronization method and system for isolation device Download PDF

Info

Publication number
CN114124431A
CN114124431A CN202111070758.9A CN202111070758A CN114124431A CN 114124431 A CN114124431 A CN 114124431A CN 202111070758 A CN202111070758 A CN 202111070758A CN 114124431 A CN114124431 A CN 114124431A
Authority
CN
China
Prior art keywords
file
synchronized
configuration
synchronization
files
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
CN202111070758.9A
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.)
Xuchang XJ Software Technology Co Ltd
Original Assignee
Xuchang XJ Software Technology 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 Xuchang XJ Software Technology Co Ltd filed Critical Xuchang XJ Software Technology Co Ltd
Priority to CN202111070758.9A priority Critical patent/CN114124431A/en
Publication of CN114124431A publication Critical patent/CN114124431A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • 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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • H04L67/306User profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

An intranet synchronization module acquires file synchronization messages sent by other intranet business modules, establishes a corresponding relation between configuration files to be synchronized, file information and task nodes contained in the synchronization messages, and sends the configuration files to be synchronized and the file information corresponding to the task nodes to an extranet file synchronization module through an isolation card in sequence, so that the extranet synchronization module puts the corresponding configuration files to be synchronized into a directory contained in received file information according to the received file information to realize synchronous configuration. The method can finish the consistent configuration of the internal network and the external network only by once configuration of the internal network, reduces the workload of managers, particularly needs to frequently modify the configuration in the engineering debugging stage, improves the working efficiency of the debugging stage, and greatly reduces the workload of the managers.

Description

Real-time automatic file synchronization method and system for isolation device
Technical Field
The invention relates to the technical field of isolation devices, in particular to a real-time automatic file synchronization method and system for an isolation device.
Background
The isolation device is mainly used between two large areas with different security levels of a power network, has a structure of 2+1 on hardware, is divided into an internal network, an external network and an isolation card, realizes data transmission of the internal network and the external network through data ferry of the isolation card, and achieves the purpose of physical isolation and logical isolation of a communication network.
Most of the existing isolation devices need independent configuration of an internal network and an external network, a manager firstly logs in the internal network for configuration, then backs up the configuration of the internal network, and then logs in the external network for restoring the backed-up configuration file in the external network, so that the aim of consistent configuration of the internal network and the external network is fulfilled.
When the configuration of the isolation device needs to be modified, if the configuration needs to be modified frequently in the engineering debugging stage, the workload of management personnel is huge, and the configuration efficiency is low.
Disclosure of Invention
Objects of the invention
The invention aims to provide a method and a system for automatically synchronizing files of an isolation device in real time, which can finish the consistent configuration of an internal network and an external network by only once configuration in an internal network, reduce the workload of managers, particularly frequently modify the configuration in an engineering debugging stage, improve the working efficiency in the debugging stage and greatly reduce the workload of the managers.
(II) technical scheme
In order to solve the above problem, a first aspect of the present invention provides a method for real-time automatic synchronization of files of an isolation device, including:
the intranet file synchronization module acquires file synchronization messages sent by other intranet service modules through a message bus, wherein the file synchronization messages comprise configuration files to be synchronized and corresponding file information;
based on the sequence of the acquisition time, sequentially adding task nodes in a file synchronization linked list, wherein one task node corresponds to one file synchronization message;
transmitting the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to an extranet file synchronization module through an isolation card in sequence;
the external network file synchronization module periodically receives the configuration file to be synchronized and the corresponding file information and verifies the received configuration file to be synchronized and the corresponding file information;
if the verification is passed, the corresponding configuration file to be synchronized is placed under the directory contained in the received file information according to the received file information, and synchronous configuration is achieved.
Specifically, the file information includes a file name and file speed attributes, and the configuration file to be synchronized and the file information corresponding to each task node in the file chain table to be synchronized are sent to the extranet file synchronization module through the isolation card sequence, including:
determining the transmission rate of the configuration file to be synchronized and the file name corresponding to the task node according to the file speed attribute corresponding to the task node;
and according to the determined transmission rate, transmitting the configuration files to be synchronized and the file names corresponding to the task nodes in the linked list of the files to be synchronized to the external network file synchronization module through the isolation card in sequence.
Specifically, the method for synchronizing the files comprises the steps of sending configuration files to be synchronized and file names corresponding to task nodes in a file chain table to be synchronized to an extranet file synchronization module through an isolation card in sequence, and specifically comprises the following steps:
determining a current task node according to the sequence of the task nodes;
generating a self-defined message according to a to-be-synchronized configuration file and a file name corresponding to a current task node, wherein the self-defined message comprises a frame number and a load, and the load comprises data or the file name of the to-be-synchronized configuration file;
and sending the self-defined message corresponding to the current task node to an external network file synchronization module.
Specifically, the generating a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node specifically includes:
calculating a hash value of a file name corresponding to the current task node and a hash value of a corresponding configuration file to be synchronized;
taking the file name and the hash value of the file name as the load of a first frame of self-defined message, taking the hash value of the configuration file to be synchronized as the load of a last frame of self-defined message, and taking the data of the configuration file to be synchronized as the loads of other frames except the first frame and the last frame.
Specifically, the external network file synchronization module periodically receives the configuration file to be synchronized and the corresponding file information, and verifies the received configuration file to be synchronized and the corresponding file information, including:
the extranet file synchronization module periodically receives custom messages corresponding to each task node;
when the external network file synchronization module receives a first frame of self-defined message, acquiring a file name and a hash value contained in the first frame of self-defined message;
calculating a file name hash value according to a file name contained in the first frame message;
comparing the calculated file name hash value with the file name hash value contained in the first frame of self-defined message, if the hash values are consistent, continuing to receive and process the message until the last frame of self-defined message is received;
analyzing the self-defined message between the first frame and the last frame, and taking out a data package of the configuration file to be synchronized to obtain a complete configuration file to be synchronized;
and calculating the hash value of the configuration file to be synchronized obtained by the packaging, comparing the hash value with the hash value of the configuration file to be synchronized contained in the last frame of self-defined message, and if the hash value is consistent with the hash value of the configuration file to be synchronized contained in the last frame of self-defined message, determining that the configuration file to be synchronized obtained by the packaging has no error.
Specifically, the step of placing the corresponding configuration file to be synchronized under a directory included in the received file information according to the received file information includes:
and determining a path of the configuration file to be synchronized obtained by the package according to the corresponding file name, and placing the configuration file to be synchronized obtained by the package under a directory contained in the file name according to the determined path.
Further, the synchronization method further includes:
if the verification is passed, a synchronization success signal is sent to the intranet file synchronization module;
and the intranet file synchronization module processes the task node of the next task node of the linked list of the files to be synchronized after receiving the synchronization success signal.
Further, the synchronization method further includes:
after the initialization of the isolation device starting system is finished, the intranet initialization file synchronization thread sends the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list to the extranet file synchronization module;
the external network file synchronization module periodically receives the configuration file to be synchronized and the corresponding file name in the initialization file synchronization list and verifies the received configuration file to be synchronized and the corresponding file name;
if the verification is passed, the corresponding file to be synchronously configured is placed under the directory contained in the received file name according to the received file name, so that synchronous configuration is realized.
Further, the synchronization method further includes:
if the verification fails, discarding the received data, and returning a failure signal to the synchronization thread of the internal network initialization file;
and if the failure signal is received, the intranet initialization file synchronization thread resends the current configuration file to be synchronized and the corresponding file information.
In a second aspect of the present invention, a real-time automatic file synchronization system for an isolation device is provided, which includes:
the message bus is used for sending file synchronization messages sent by other service modules in the intranet;
the intranet file synchronization module is used for acquiring file synchronization messages sent by other intranet service modules through a message bus, wherein the file synchronization messages comprise configuration files to be synchronized and corresponding file information; based on the sequence of the acquisition time, sequentially adding task nodes in a file synchronization linked list, wherein one task node corresponds to one file synchronization message; sequentially sending the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to the isolation card;
the isolation card is used for sequentially sending the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to the external network file synchronization module;
the external network file synchronization module is used for regularly receiving the configuration files to be synchronized and the corresponding file information and verifying the received configuration files to be synchronized and the corresponding file information; if the verification is passed, the corresponding configuration file to be synchronized is placed under the directory contained in the received file information according to the received file information, and synchronous configuration is achieved.
(III) advantageous effects
The technical scheme of the invention has the following beneficial technical effects:
the embodiment of the invention provides a method and a system for automatically synchronizing files of an isolation device in real time, wherein an intranet synchronization module in the method acquires file synchronization messages sent by other intranet business modules, establishes a corresponding relation between configuration files to be synchronized and file information contained in the synchronization messages and task nodes, and sends the configuration files to be synchronized and the file information corresponding to each task node to an extranet file synchronization module through an isolation card in sequence, so that the extranet synchronization module puts the corresponding configuration files to be synchronized into a directory contained in received file information according to the received file information to realize synchronous configuration. The method can finish the consistent configuration of the internal network and the external network only by once configuration of the internal network, reduces the workload of managers, particularly needs to frequently modify the configuration in the engineering debugging stage, improves the working efficiency of the debugging stage, and greatly reduces the workload of the managers.
Drawings
FIG. 1 is a flowchart of a method for real-time automatic synchronization of files in an isolation device according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a real-time automatic file synchronization system for an isolation device according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an intranet file synchronization module according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a format of an initialized file synchronization list file according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
Referring to fig. 1 and 2, an embodiment of the present invention provides a method for real-time automatic synchronization of files of an isolation device, including:
step 101: the intranet file synchronization module acquires file synchronization messages sent by other intranet service modules through a message bus, wherein the file synchronization messages comprise configuration files to be synchronized and corresponding file information;
specifically, the other intranet service modules refer to any service module that needs to be configured, such as a server with a C/S structure, except for the intranet file synchronization module, and the invention is not limited in particular.
Step 102: based on the sequence of the acquisition time, sequentially adding task nodes in a file synchronization linked list, wherein one task node corresponds to one file synchronization message;
step 103: transmitting the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to an extranet file synchronization module through an isolation card in sequence;
step 104: the external network file synchronization module periodically receives the configuration file to be synchronized and the corresponding file information and verifies the received configuration file to be synchronized and the corresponding file information;
step 105: if the verification is passed, the corresponding configuration file to be synchronized is placed under the directory contained in the received file information according to the received file information, and synchronous configuration is achieved.
In the method, an intranet synchronization module acquires file synchronization messages sent by other intranet service modules, establishes a corresponding relation between configuration files to be synchronized and file information contained in the synchronization messages and task nodes, and sends the configuration files to be synchronized and the file information corresponding to the task nodes to an extranet file synchronization module through an isolation card in sequence, so that the extranet synchronization module puts the corresponding configuration files to be synchronized under a directory contained in received file information according to the received file information to realize synchronous configuration. The method can finish the consistent configuration of the internal network and the external network only by once configuration of the internal network, reduces the workload of managers, particularly needs to frequently modify the configuration in the engineering debugging stage, improves the working efficiency of the debugging stage, and greatly reduces the workload of the managers.
Specifically, the file information includes a file name and file speed attributes, and the configuration file to be synchronized and the file information corresponding to each task node in the file chain table to be synchronized are sent to the extranet file synchronization module through the isolation card sequence, including:
determining the transmission rate of the configuration file to be synchronized and the file name corresponding to the task node according to the file speed attribute corresponding to the task node;
and according to the determined transmission rate, transmitting the configuration files to be synchronized and the file names corresponding to the task nodes in the linked list of the files to be synchronized to the external network file synchronization module through the isolation card in sequence.
Specifically, the method for synchronizing the files comprises the steps of sending configuration files to be synchronized and file names corresponding to task nodes in a file chain table to be synchronized to an extranet file synchronization module through an isolation card in sequence, and specifically comprises the following steps:
determining a current task node according to the sequence of the task nodes;
generating a self-defined message according to a to-be-synchronized configuration file and a file name corresponding to a current task node, wherein the self-defined message comprises a frame number and a load, and the load comprises data or the file name of the to-be-synchronized configuration file;
and sending the self-defined message corresponding to the current task node to an external network file synchronization module.
Specifically, the generating a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node specifically includes:
calculating a hash value of a file name corresponding to the current task node and a hash value of a corresponding configuration file to be synchronized; specifically, the calculation may be performed by using an MD5 encryption algorithm, etc., and the present invention is not particularly limited;
taking the file name and the hash value of the file name as the load of a first frame of self-defined message, taking the hash value of the configuration file to be synchronized as the load of a last frame of self-defined message, and taking the data of the configuration file to be synchronized as the loads of other frames except the first frame and the last frame.
Specifically, the external network file synchronization module periodically receives the configuration file to be synchronized and the corresponding file information, and verifies the received configuration file to be synchronized and the corresponding file information, including:
the extranet file synchronization module periodically receives custom messages corresponding to each task node;
when the external network file synchronization module receives a first frame of self-defined message, acquiring a file name and a hash value contained in the first frame of self-defined message;
calculating a file name hash value according to a file name contained in the first frame message;
comparing the calculated file name hash value with the file name hash value contained in the first frame of self-defined message, if the hash values are consistent, continuing to receive and process the message until the last frame of self-defined message is received;
analyzing the self-defined message between the first frame and the last frame, and taking out a data package of the configuration file to be synchronized to obtain a complete configuration file to be synchronized;
and calculating the hash value of the configuration file to be synchronized obtained by the packaging, comparing the hash value with the hash value of the configuration file to be synchronized contained in the last frame of self-defined message, and if the hash value is consistent with the hash value of the configuration file to be synchronized contained in the last frame of self-defined message, determining that the configuration file to be synchronized obtained by the packaging has no error.
Specifically, the step of placing the corresponding configuration file to be synchronized under a directory included in the received file information according to the received file information includes:
and determining a path of the configuration file to be synchronized obtained by the package according to the corresponding file name, and placing the configuration file to be synchronized obtained by the package under a directory contained in the file name according to the determined path.
Further, the synchronization method further includes:
if the verification is passed, a synchronization success signal is sent to the intranet file synchronization module;
and the intranet file synchronization module processes the task node of the next task node of the linked list of the files to be synchronized after receiving the synchronization success signal.
In a specific embodiment, the intranet periodic synchronization thread periodically queries a linked list of files to be synchronized every 100ms, and if the linked list is empty, the linked list is not processed; and if the linked list is not empty, reading the linked list task nodes, and after one node task is processed and a synchronization success signal is received, continuing the next node task. When the file fast and slow property is fast, the fast transmission rate is 20000 frames/100 ms, and when the file fast and slow property is slow, the slow transmission rate is 100 frames/100 ms; the corresponding extranet file synchronization module processes the received configuration file data to be synchronized once every 100ms at regular intervals, and processes 20000 frame data every 100 ms.
Further, the synchronization method further includes:
after the initialization of the isolation device starting system is finished, the intranet initialization file synchronization thread sends the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list to the extranet file synchronization module;
the external network file synchronization module periodically receives the configuration file to be synchronized and the corresponding file name in the initialization file synchronization list and verifies the received configuration file to be synchronized and the corresponding file name;
if the verification is passed, the corresponding file to be synchronously configured is placed under the directory contained in the received file name according to the received file name, so that synchronous configuration is realized.
Further, the synchronization method further includes:
if the verification fails, discarding the received data, and returning a failure signal to the synchronization thread of the internal network initialization file;
and if the failure signal is received, the intranet initialization file synchronization thread resends the current configuration file to be synchronized and the corresponding file information.
Referring to fig. 2, an embodiment of the present invention further provides a system for real-time automatic synchronization of files in an isolation device, including:
the message bus is used for sending file synchronization messages sent by other service modules in the intranet;
the intranet file synchronization module is used for acquiring file synchronization messages sent by other intranet service modules through a message bus, wherein the file synchronization messages comprise configuration files to be synchronized and corresponding file information; establishing a corresponding relation between the configuration files to be synchronized and corresponding file information and task nodes based on the sequence of the acquisition time, and generating a linked list of the files to be synchronized; sequentially sending the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to the isolation card;
the isolation card is used for sequentially sending the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to the external network file synchronization module;
the external network file synchronization module is used for regularly receiving the configuration files to be synchronized and the corresponding file information and verifying the received configuration files to be synchronized and the corresponding file information; if the verification is passed, the corresponding configuration file to be synchronized is placed under the directory contained in the received file information according to the received file information, and synchronous configuration is achieved.
The systems and methods of the present invention correspond to each other, and the detailed description and effects of the systems are given in the embodiments of the methods, which are not repeated herein.
The following is a specific embodiment of the present invention:
as shown in fig. 2, the present embodiment provides a real-time automatic file synchronization system for an isolation device, where an intranet side of the system mainly includes a message bus, an intranet file synchronization module, an initialization synchronization thread, and other service modules; the external network side mainly comprises a message bus and an external network file synchronization module.
The process of the system provided by this embodiment for performing the configuration file synchronization processing includes:
(1) other service modules of the intranet modify the configuration file according to the service configuration update, inform the intranet file synchronization module of file synchronization through a message bus, and send the configuration file to be synchronized, the file name and the file speed attribute to the intranet file synchronization module, wherein the file name comprises a file path;
(2) as shown in fig. 3, the intranet file synchronization module mainly has three parts:
1) bus monitoring task: retrieving the message required by the intranet file synchronization module from the message bus according to the subscription message type of the intranet file synchronization module;
2) and (3) a file chain table to be synchronized: storing a configuration file to be synchronized to an external network, wherein one configuration to be synchronized is a task node, and one task node comprises two attributes: firstly, a file name to be synchronized; secondly, identifying the speed of the file to be synchronized;
3) periodic synchronization thread: periodically inquiring a linked list of files to be synchronized every 100ms, and if the linked list is empty, not performing any processing; and if the linked list is not empty, reading the linked list task nodes, and after one node task is processed and a synchronization success signal is received, continuously processing the next node task. The periodic synchronous thread processing process is as follows:
reading a file name and a speed attribute of a task node attribute and a configuration file to be synchronized by a periodic synchronization thread;
calculating the hash value of the file name to be synchronized, and calculating the hash value of the configuration file to be synchronized;
thirdly, adopting fast transmission or slow transmission according to the fast and slow properties of the node tasks, wherein the fast transmission rate is 20000 frames/100 ms, and the slow transmission rate is 100 frames/100 ms;
and fourthly, the periodic synchronization thread sends the configuration file to be synchronized and the file name to the external network through the isolation card according to the self-defined message format shown in the following table:
table 1 custom message format
File attribute (1 byte) Frame number (4 bytes) State label (1 byte) Load length (2 bytes) Load (1500 bytes)
Wherein:
file attribute: 1: a file name; 2: file data
Frame number: current frame sequence number
And (3) state identification: 1: a first frame; 2: in transmission; 3: last frame
Load length: length of current frame load
Loading: the load consists of two parts, load data and a hash value; the first frame data is a file name to be synchronously configured, and the load is the file name and a file name hash value; the last frame of data is a hash value of the configuration file to be synchronized, the load data is null (all 0), and the hash value is the hash value of the configuration file to be synchronized; in other frames, the load data part is data with configuration files, and the hash value part is empty (all 0);
the first frame message format is as follows:
table 2 first frame message format
To-be-synchronized configuration file name hash value (16 bytes)
Other frame message formats are as follows in table 3:
table 3 other frame message formats
Load data hash value (only last frame exists) (16 bytes)
(3) A bus monitoring task in the intranet file synchronization module retrieves information in a message bus in real time, notifies a periodic synchronization thread after detecting the file synchronization information, and stores the data into a to-be-synchronized file linked list after retrieving the to-be-synchronized configuration file, the file name and the file speed attribute; the periodic synchronization thread processes each node task according to the node task attribute in the synchronous file linked list, and transmits the file name and the file data to the extranet file synchronization module through the isolation card according to the self-defined protocol shown in the tables 1-3;
(4) the extranet file synchronization module processes the received configuration file data to be synchronized once every 100ms periodically, and processes 20000 frame data every 100 ms. The data processing flow of the extranet file synchronization module is as follows:
firstly, after receiving first frame data (message), taking out a file name and a hash value in a load, calculating the hash value of the taken-out file name, then comparing the hash value with the hash value taken out from the first frame, and if the hash values are consistent, continuing to process the data; if the data are inconsistent, stopping processing the data, returning a transmission error signal to the intranet, and informing the intranet of a periodic synchronization thread to retransmit after a bus monitoring task of the intranet file synchronization module retrieves the transmission error signal;
continuously taking out load data of the received data frames until the last frame is received, analyzing the load data of other frames except the last frame according to a self-defined protocol, taking out the load data and packaging the load data to obtain a complete configuration file to be synchronized and calculating a hash value;
taking out the value of the load hash part of the last frame, comparing the value with the hash of the obtained complete configuration file to be synchronized, if the value is consistent, putting the configuration file under a directory contained by a file name, returning a synchronization success signal, and after a bus monitoring task of the intranet file synchronization module retrieves the synchronization success signal, informing an intranet of a periodic synchronization thread to process the next node task; if the two nodes are not consistent, a synchronization failure signal is returned, after the bus monitoring task of the intranet file synchronization module retrieves the synchronization failure signal, the intranet periodic synchronization thread is informed to carry out retransmission, if the retransmission still fails for 10 times, the synchronization failure signal is returned to the service module, and the next node task is processed.
The system provided by this embodiment further includes a startup internal and external network file synchronization, specifically including:
1. initializing a file synchronization list file: the file is a txt text file, the initialization file synchronization list file is configurable, and a product developer configures the file name required to be started up for initialization synchronization. Initializing file synchronization list file format as shown in fig. 4, file n name is a configuration file name.
2. The startup initialization synchronization process comprises the following steps:
(1) after the initialization of the isolation device starting system is finished, an initialization synchronization thread of an intranet is automatically started, and a first configuration file name in an intranet initial file synchronization list file is read;
(2) the initialization synchronization process reads the corresponding configuration file according to the read configuration file name, and then sends the configuration file to the external network through the isolation card at the speed of 20000 frames/100 ms according to the self-defined protocol;
(3) the external network file synchronization module processes the received configuration file data once every 100ms periodically, processes 20000 frame data every 100ms, analyzes the received configuration file data according to a custom protocol, and verifies the received file name and the configuration file;
(4) if the verification is successful, the configuration file is placed under a path contained by the file name, and a success signal is returned to the intranet initialization synchronization process; if the verification fails, discarding the file, and returning a failure signal to the intranet initialization synchronization process;
if the intranet initialization synchronization process receives the success signal, continuously reading the next configuration file name in the intranet initial file synchronization list file until the next configuration file name is empty, and at the moment, considering that all the initialization synchronization configuration files are synchronized successfully, and automatically finishing the initialization synchronization process; if a failure signal is received, the current configuration files are resynchronized, if one configuration file still fails after being synchronized for 10 times, the initialization synchronization process is automatically ended, and the alarm file synchronization function is set to be wrong.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.

Claims (10)

1. A real-time automatic file synchronization method for an isolation device is characterized by comprising the following steps:
the intranet file synchronization module acquires file synchronization messages sent by other intranet service modules through a message bus, wherein the file synchronization messages comprise configuration files to be synchronized and corresponding file information;
based on the sequence of the acquisition time, sequentially adding task nodes in a file synchronization linked list, wherein one task node corresponds to one file synchronization message;
transmitting the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to an extranet file synchronization module through an isolation card in sequence;
the external network file synchronization module periodically receives the configuration file to be synchronized and the corresponding file information and verifies the received configuration file to be synchronized and the corresponding file information;
if the verification is passed, the corresponding configuration file to be synchronized is placed under the directory contained in the received file information according to the received file information, and synchronous configuration is achieved.
2. The synchronization method according to claim 1, wherein the file information includes a file name and file speed attributes, and the step of sending the configuration file to be synchronized and the file information corresponding to each task node in the file chain table to be synchronized to the extranet file synchronization module through the isolation card sequentially comprises:
determining the transmission rate of the configuration file to be synchronized and the file name corresponding to the task node according to the file speed attribute corresponding to the task node;
and according to the determined transmission rate, transmitting the configuration files to be synchronized and the file names corresponding to the task nodes in the linked list of the files to be synchronized to the external network file synchronization module through the isolation card in sequence.
3. The synchronization method according to claim 2, wherein the configuration files to be synchronized and the file names corresponding to the task nodes in the file chain table to be synchronized are sequentially sent to the extranet file synchronization module through the isolation card, and the method specifically comprises the following steps:
determining a current task node according to the sequence of the task nodes;
generating a self-defined message according to a to-be-synchronized configuration file and a file name corresponding to a current task node, wherein the self-defined message comprises a frame number and a load, and the load comprises data or the file name of the to-be-synchronized configuration file;
and sending the self-defined message corresponding to the current task node to an external network file synchronization module.
4. The synchronization method according to claim 3, wherein the generating a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node specifically comprises:
calculating a hash value of a file name corresponding to the current task node and a hash value of a corresponding configuration file to be synchronized;
taking the file name and the hash value of the file name as the load of a first frame of self-defined message, taking the hash value of the configuration file to be synchronized as the load of a last frame of self-defined message, and taking the data of the configuration file to be synchronized as the loads of other frames except the first frame and the last frame.
5. The synchronization method according to claim 4, wherein the extranet file synchronization module periodically receives the configuration file to be synchronized and the corresponding file information and verifies the received configuration file to be synchronized and the corresponding file information, and the synchronization method comprises:
the extranet file synchronization module periodically receives custom messages corresponding to each task node;
when the external network file synchronization module receives a first frame of self-defined message, acquiring a file name and a hash value contained in the first frame of self-defined message;
calculating a file name hash value according to a file name contained in the first frame custom message;
comparing the calculated file name hash value with the file name hash value contained in the first frame of self-defined message, if the hash values are consistent, continuing to receive and process the message until the last frame of self-defined message is received;
analyzing the self-defined message between the first frame and the last frame, and taking out a data package of the configuration file to be synchronized to obtain a complete configuration file to be synchronized;
and calculating the hash value of the configuration file to be synchronized obtained by the packaging, comparing the hash value with the hash value of the configuration file to be synchronized contained in the last frame of self-defined message, and if the hash value is consistent with the hash value of the configuration file to be synchronized contained in the last frame of self-defined message, determining that the configuration file to be synchronized obtained by the packaging has no error.
6. The synchronization method according to claim 5, wherein the step of placing the corresponding configuration file to be synchronized under a directory included in the received file information according to the received file information comprises:
and determining a path of the configuration file to be synchronized obtained by the package according to the corresponding file name, and placing the configuration file to be synchronized obtained by the package under a directory contained in the file name according to the determined path.
7. The synchronization method of claim 3, further comprising:
if the verification is passed, a synchronization success signal is sent to the intranet file synchronization module;
and the intranet file synchronization module processes the task node of the next task node of the linked list of the files to be synchronized after receiving the synchronization success signal.
8. The synchronization method of claim 1, further comprising:
after the initialization of the isolation device starting system is finished, the intranet initialization file synchronization thread sends the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list to the extranet file synchronization module;
the external network file synchronization module periodically receives the configuration file to be synchronized and the corresponding file name in the initialization file synchronization list and verifies the received configuration file to be synchronized and the corresponding file name;
if the verification is passed, the corresponding file to be synchronously configured is placed under the directory contained in the received file name according to the received file name, so that synchronous configuration is realized.
9. The synchronization method of claim 7, further comprising:
if the verification fails, discarding the received data, and returning a failure signal to the synchronization thread of the internal network initialization file;
and if the failure signal is received, the intranet initialization file synchronization thread resends the current configuration file to be synchronized and the corresponding file information.
10. A system for real-time automatic synchronization of files for an isolation device, comprising:
the message bus is used for sending file synchronization messages sent by other service modules in the intranet;
the intranet file synchronization module is used for acquiring file synchronization messages sent by other intranet service modules through a message bus, wherein the file synchronization messages comprise configuration files to be synchronized and corresponding file information; based on the sequence of the acquisition time, sequentially adding task nodes in a file synchronization linked list, wherein one task node corresponds to one file synchronization message; sequentially sending the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to the isolation card;
the isolation card is used for sequentially sending the configuration files to be synchronized and the file information corresponding to each task node in the linked list of the files to be synchronized to the external network file synchronization module;
the external network file synchronization module is used for regularly receiving the configuration files to be synchronized and the corresponding file information and verifying the received configuration files to be synchronized and the corresponding file information; if the verification is passed, the corresponding configuration file to be synchronized is placed under the directory contained in the received file information according to the received file information, and synchronous configuration is achieved.
CN202111070758.9A 2021-09-13 2021-09-13 Real-time automatic file synchronization method and system for isolation device Pending CN114124431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111070758.9A CN114124431A (en) 2021-09-13 2021-09-13 Real-time automatic file synchronization method and system for isolation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111070758.9A CN114124431A (en) 2021-09-13 2021-09-13 Real-time automatic file synchronization method and system for isolation device

Publications (1)

Publication Number Publication Date
CN114124431A true CN114124431A (en) 2022-03-01

Family

ID=80441329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111070758.9A Pending CN114124431A (en) 2021-09-13 2021-09-13 Real-time automatic file synchronization method and system for isolation device

Country Status (1)

Country Link
CN (1) CN114124431A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102916960A (en) * 2012-10-18 2013-02-06 中国电力科学研究院 Strategy synchronization method and system applied to physical isolation gap
CN106227822A (en) * 2016-07-22 2016-12-14 深圳市中润四方信息技术有限公司 A kind of data distributing method and data synchronous system
WO2017045345A1 (en) * 2015-09-14 2017-03-23 中兴通讯股份有限公司 Resource management method and apparatus, and multi-mode soft base station unified network management
WO2018045820A1 (en) * 2016-09-07 2018-03-15 华为技术有限公司 File synchronization method, device, and system
CN109189749A (en) * 2018-09-03 2019-01-11 中国平安人寿保险股份有限公司 File synchronisation method and terminal device
CN110300120A (en) * 2019-07-10 2019-10-01 国电南京自动化股份有限公司 The hierarchical synchronization method and system of reverse data under the conditions of a kind of physical isolation
CN110941621A (en) * 2018-09-25 2020-03-31 北京国双科技有限公司 Method and device for synchronizing databases between internal network and external network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102916960A (en) * 2012-10-18 2013-02-06 中国电力科学研究院 Strategy synchronization method and system applied to physical isolation gap
WO2017045345A1 (en) * 2015-09-14 2017-03-23 中兴通讯股份有限公司 Resource management method and apparatus, and multi-mode soft base station unified network management
CN106227822A (en) * 2016-07-22 2016-12-14 深圳市中润四方信息技术有限公司 A kind of data distributing method and data synchronous system
WO2018045820A1 (en) * 2016-09-07 2018-03-15 华为技术有限公司 File synchronization method, device, and system
CN109189749A (en) * 2018-09-03 2019-01-11 中国平安人寿保险股份有限公司 File synchronisation method and terminal device
CN110941621A (en) * 2018-09-25 2020-03-31 北京国双科技有限公司 Method and device for synchronizing databases between internal network and external network
CN110300120A (en) * 2019-07-10 2019-10-01 国电南京自动化股份有限公司 The hierarchical synchronization method and system of reverse data under the conditions of a kind of physical isolation

Similar Documents

Publication Publication Date Title
US9009234B2 (en) Complex event processing system having multiple redundant event processing engines
CN107567000B (en) Method and system for intelligently selecting short message sending channel
CN109039779B (en) Equipment upgrading method, data transmission unit, controller local area network equipment and network
CN113238913A (en) Intelligent server fault pushing method, device, equipment and storage medium
CN107231400B (en) Data synchronization method and device
CA2319303A1 (en) Carrier-grade snmp interface for fault monitoring
EP3258653A1 (en) Message pushing method and device
GB2589211A (en) Methods and systems of using remote subscriber identification modules at device
CN109361525B (en) Method, device, control terminal and medium for restarting distributed deployment of multiple services
CN107231435B (en) Data synchronization monitoring method and system
KR100728076B1 (en) Method, device and system for synchronizing of data providing for the handling of an interrupted synchronization process
CN109379764B (en) Message sending method and device
CN104601366A (en) Configuration service method and device for control and service nodes
CN112416614A (en) Data processing method, system and server based on message queue
CN104954101A (en) Multi-terminal data synchronization method based on ACK synchronization
CN107066341B (en) Event routing framework and method between software modules
CN111680106B (en) Method and device for synchronizing data of multiple application systems
CN107172112B (en) Computer file transmission method and device
CN114124431A (en) Real-time automatic file synchronization method and system for isolation device
CN107231284B (en) Message sending method and terminal equipment
CN113949658B (en) Table entry processing method, system, device, electronic equipment and storage medium
EP3710929B1 (en) Optimized reconciliation in a controller switch network
CN114124646B (en) Websocket mode integrated network management system and method
CN113794620B (en) Message sending method, device, equipment, system and storage medium
CN101877653A (en) Method and system for judging whether alarm variable information is lost or not as well as master control board

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