A real-time automatic file synchronization method and system for an isolation device
Real-time automatic synchronization of files of the isolation device is realized through the intranet file synchronization module and the isolation card, which solves the problem of low efficiency in modifying the configuration of the isolation device in the existing technology, realizes the automatic consistency of the internal and external network configuration, and significantly reduces the work of management personnel. Measurement and improvement of engineering debugging efficiency.
Patent Information
- Application Number
- CN202111070758.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-13
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-09-13
AI Technical Summary
When modifying the configuration of existing isolation devices, managers need to frequently perform configuration operations on the internal and external networks, resulting in heavy workload and low efficiency, especially during the engineering debugging stage.
Using the real-time automatic file synchronization method, the file synchronization message is obtained through the intranet file synchronization module, task nodes are added to the file synchronization list based on time order, and the configuration files and information in the file list to be synchronized are sent to the external network files through the isolation card. The synchronization module realizes automatic verification and synchronization, and only needs to be configured once on the internal network to achieve consistent configuration of the internal and external networks.
It greatly reduces the workload of management personnel, improves work efficiency during the project debugging phase, and realizes real-time automatic synchronization of internal and external network configurations.
Smart Images

Figure CN114124431B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of isolation devices, and in particular to a real-time automatic file synchronization method and system for isolation devices. Background Art
[0002] The isolation device is mainly used between two areas with different security levels in the power network. The hardware has a "2+1" structure, which is divided into three parts: intranet, extranet and isolation card. The isolation card data ferry is used to realize the transmission of internal and external network data, so as to achieve the purpose of physical isolation and logical isolation of the communication network.
[0003] Most of the current isolation devices require separate configuration for the internal and external networks. The administrator first logs in to the internal network to configure, then backs up the internal network configuration, and then logs in to the external network to restore the backed-up configuration file on the external network to achieve consistent configuration of the internal and external networks.
[0004] When the isolation device needs to be modified in configuration, such as frequently during the engineering commissioning phase, the workload for management personnel is huge and the configuration efficiency is low. Summary of the invention
[0005] (I) Purpose of the invention
[0006] The purpose of the present invention is to provide a real-time automatic file synchronization method and system for an isolation device, which only needs to be configured once in the intranet to achieve consistency in the internal and external network configurations, thereby reducing the workload of management personnel, especially in the engineering debugging stage where frequent configuration modifications are required, thereby improving the work efficiency in the debugging stage and greatly reducing the workload of management personnel.
[0007] (II) Technical solution
[0008] To solve the above problem, a first aspect of the present invention provides a method for real-time automatic synchronization of files for an isolation device, comprising:
[0009] The intranet file synchronization module obtains the file synchronization message sent by other intranet business modules through the message bus, and the file synchronization message includes the configuration file to be synchronized and the corresponding file information;
[0010] Based on the order of acquisition time, task nodes are sequentially added to the file synchronization linked list, and one task node corresponds to one file synchronization message;
[0011] The configuration files and file information to be synchronized corresponding to each task node in the linked list of files to be synchronized are sent to the external network file synchronization module in sequence through the isolation card;
[0012] 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;
[0013] If the verification is passed, the corresponding configuration file to be synchronized is placed in the directory contained in the received file information according to the received file information to realize synchronization configuration.
[0014] Specifically, the file information includes the file name and the file speed attribute, and the configuration files and file information to be synchronized corresponding to each task node in the file list to be synchronized are sent to the external network file synchronization module in sequence through the isolation card, including:
[0015] Determine the transmission rate of the configuration file and file name to be synchronized corresponding to the task node according to the file speed attribute corresponding to the task node;
[0016] According to the determined transmission rate, the configuration files and file names to be synchronized corresponding to each task node in the linked list of files to be synchronized are sent to the external network file synchronization module in sequence through the isolation card.
[0017] Specifically, the configuration files and file names to be synchronized corresponding to each task node in the file list to be synchronized are sent to the external network file synchronization module in sequence through the isolation card, specifically including:
[0018] Determine the current task node according to the task node sequence;
[0019] Generate a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node, wherein the custom message includes a frame sequence number and a payload, and the payload includes the configuration file data or the file name to be synchronized;
[0020] Send the custom message corresponding to the current task node to the external network file synchronization module.
[0021] Specifically, generating a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node specifically includes:
[0022] Calculate the hash value of the file name corresponding to the current task node and the hash value of the corresponding configuration file to be synchronized;
[0023] The file name and the hash value of the file name are used as the payload of the first frame of the custom message, the hash value of the configuration file to be synchronized is used as the payload of the last frame of the custom message, and the configuration file data to be synchronized is used as the payload of other frames except the first frame and the last frame.
[0024] 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:
[0025] The external network file synchronization module regularly receives the custom message corresponding to each task node;
[0026] When the external network file synchronization module receives the first frame of the custom message, the file name and hash value contained in the first frame of the custom message are obtained;
[0027] Calculate the file name hash value based on the file name contained in the first frame message;
[0028] Compare the calculated file name hash value with the file name hash value contained in the first frame of the custom message. If the hash values are consistent, continue to receive and process the message until the last frame of the custom message is received.
[0029] Parse the custom message between the first frame and the last frame, extract the data group package of the configuration file to be synchronized to obtain the complete configuration file to be synchronized;
[0030] The hash value of the configuration file to be synchronized obtained by package assembly is calculated and compared with the hash value of the configuration file to be synchronized contained in the last frame of the custom message. If they are consistent, it is determined that the configuration file to be synchronized obtained by package assembly is correct.
[0031] Specifically, according to the received file information, the corresponding configuration file to be synchronized is placed in the directory contained in the received file information, including:
[0032] The path of the configuration file to be synchronized obtained by assembling the package is determined according to the corresponding file name, and the configuration file to be synchronized obtained by assembling the package is placed in the directory contained in the file name according to the determined path.
[0033] Furthermore, the synchronization method further includes:
[0034] If the verification passes, a synchronization success signal is sent to the intranet file synchronization module;
[0035] After receiving the synchronization success signal, the intranet file synchronization module processes the task of the next task node in the list of files to be synchronized.
[0036] Furthermore, the synchronization method further includes:
[0037] After the isolation device is powered on and the system is initialized, the internal network initialization file synchronization thread sends the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list to the external network file synchronization module;
[0038] The external network file synchronization module periodically receives the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list and verifies the received configuration files to be synchronized and the corresponding file names;
[0039] If the verification passes, the corresponding configuration file to be synchronized is placed in the directory contained in the received file name according to the received file name to realize synchronization configuration.
[0040] Furthermore, the synchronization method further includes:
[0041] If the verification fails, the received data is discarded and a failure signal is returned to the intranet initialization file synchronization thread;
[0042] If a failure signal is received, the intranet initialization file synchronization thread resends the current configuration file to be synchronized and the corresponding file information.
[0043] A second aspect of the present invention provides a real-time automatic file synchronization system for an isolation device, comprising:
[0044] Message bus, used to send file synchronization messages sent by other business modules in the intranet;
[0045] The intranet file synchronization module is used to obtain file synchronization messages sent by other intranet business modules through the message bus, wherein the file synchronization messages contain configuration files to be synchronized and corresponding file information; based on the order of acquisition time, task nodes are sequentially added to the file synchronization linked list, and one task node corresponds to one file synchronization message; and configuration files to be synchronized and file information corresponding to each task node in the file linked list to be synchronized are sequentially sent to the isolation card;
[0046] The isolation card is used to sequentially send the configuration files and file information to be synchronized corresponding to each task node in the linked list of files to be synchronized to the external network file synchronization module;
[0047] The external network file synchronization module is used to regularly receive the configuration files to be synchronized and the corresponding file information and verify the received configuration files to be synchronized and the corresponding file information; if the verification passes, the corresponding configuration files to be synchronized are placed in the directory contained in the received file information according to the received file information to realize synchronization configuration.
[0048] (III) Beneficial effects
[0049] The above technical solution of the present invention has the following beneficial technical effects:
[0050] The embodiment of the present invention provides a method and system for real-time automatic synchronization of files for an isolation device, in which the intranet synchronization module obtains file synchronization messages sent by other business modules in the intranet, and establishes a corresponding relationship between the configuration files to be synchronized, the file information contained in the synchronization messages and the task nodes, and sequentially sends the configuration files to be synchronized and the file information corresponding to each task node to the external network file synchronization module through the isolation card, so that the external network synchronization module puts the corresponding configuration files to be synchronized into the directory contained in the received file information according to the received file information, thereby realizing synchronous configuration. The method only needs to be configured once in the intranet to complete the consistency of the internal and external network configurations, reducing the workload of management personnel, especially in the engineering debugging stage where the configuration needs to be frequently modified, improving the work efficiency in the debugging stage, and greatly reducing the workload of management personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a flow chart of a method for real-time automatic synchronization of files for an isolation device provided by an embodiment of the present invention;
[0052] Figure 2 It is a schematic diagram of a real-time automatic synchronization system for files in an isolation device provided by a specific embodiment of the present invention;
[0053] Figure 3 It is a schematic diagram of an intranet file synchronization module provided by a specific embodiment of the present invention;
[0054] Figure 4 The figure is a schematic diagram of the file format of the initialization file synchronization list provided by a specific embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0056] See also Figure 1 and 2 As shown, an embodiment of the present invention provides a method for real-time automatic synchronization of files for an isolation device, comprising:
[0057] Step 101: The intranet file synchronization module obtains a file synchronization message sent by other intranet service modules through a message bus, wherein the file synchronization message includes a configuration file to be synchronized and corresponding file information;
[0058] Specifically, the other intranet business modules refer to any business modules that need to be configured except the intranet file synchronization module, such as a server of a C / S structure, etc., and the present invention does not make specific limitations.
[0059] Step 102: based on the order of acquisition time, sequentially add task nodes to the file synchronization linked list, one task node corresponds to one file synchronization message;
[0060] Step 103: Send the configuration files and file information to be synchronized corresponding to each task node in the file list to be synchronized to the external network file synchronization module in sequence through the isolation card;
[0061] 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;
[0062] Step 105: If the verification is passed, the corresponding configuration file to be synchronized is placed in the directory contained in the received file information according to the received file information to realize synchronous configuration.
[0063] The embodiment of the present invention provides a method for real-time automatic synchronization of files for an isolation device. In this method, the intranet synchronization module obtains file synchronization messages sent by other business modules in the intranet, and establishes a corresponding relationship between the configuration files to be synchronized, the file information and the task nodes contained in the synchronization messages. The configuration files to be synchronized and the file information corresponding to each task node are sent to the external network file synchronization module in sequence through the isolation card, so that the external network synchronization module puts the corresponding configuration files to be synchronized into the directory contained in the received file information according to the received file information, thereby realizing synchronous configuration. This method only needs to be configured once in the intranet to complete the consistency of the internal and external network configurations, reducing the workload of management personnel, especially in the engineering debugging stage where the configuration needs to be frequently modified, improving the work efficiency in the debugging stage, and greatly reducing the workload of management personnel.
[0064] Specifically, the file information includes the file name and the file speed attribute, and the configuration files and file information to be synchronized corresponding to each task node in the file list to be synchronized are sent to the external network file synchronization module in sequence through the isolation card, including:
[0065] Determine the transmission rate of the configuration file and file name to be synchronized corresponding to the task node according to the file speed attribute corresponding to the task node;
[0066] According to the determined transmission rate, the configuration files and file names to be synchronized corresponding to each task node in the linked list of files to be synchronized are sent to the external network file synchronization module in sequence through the isolation card.
[0067] Specifically, the configuration files and file names to be synchronized corresponding to each task node in the file list to be synchronized are sent to the external network file synchronization module in sequence through the isolation card, specifically including:
[0068] Determine the current task node according to the task node sequence;
[0069] Generate a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node, wherein the custom message includes a frame sequence number and a payload, and the payload includes the configuration file data or the file name to be synchronized;
[0070] Send the custom message corresponding to the current task node to the external network file synchronization module.
[0071] Specifically, generating a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node specifically includes:
[0072] Calculate the hash value of the file name corresponding to the current task node and the hash value of the corresponding configuration file to be synchronized; specifically, the calculation can be performed using the MD5 encryption algorithm, etc., which is not specifically limited in the present invention;
[0073] The file name and the hash value of the file name are used as the payload of the first frame of the custom message, the hash value of the configuration file to be synchronized is used as the payload of the last frame of the custom message, and the configuration file data to be synchronized is used as the payload of other frames except the first frame and the last frame.
[0074] 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:
[0075] The external network file synchronization module regularly receives the custom message corresponding to each task node;
[0076] When the external network file synchronization module receives the first frame of the custom message, the file name and hash value contained in the first frame of the custom message are obtained;
[0077] Calculate the file name hash value based on the file name contained in the first frame message;
[0078] Compare the calculated file name hash value with the file name hash value contained in the first frame of the custom message. If the hash values are consistent, continue to receive and process the message until the last frame of the custom message is received.
[0079] Parse the custom message between the first frame and the last frame, extract the data group package of the configuration file to be synchronized to obtain the complete configuration file to be synchronized;
[0080] The hash value of the configuration file to be synchronized obtained by package assembly is calculated and compared with the hash value of the configuration file to be synchronized contained in the last frame of the custom message. If they are consistent, it is determined that the configuration file to be synchronized obtained by package assembly is correct.
[0081] Specifically, according to the received file information, the corresponding configuration file to be synchronized is placed in the directory contained in the received file information, including:
[0082] The path of the configuration file to be synchronized obtained by assembling the package is determined according to the corresponding file name, and the configuration file to be synchronized obtained by assembling the package is placed in the directory contained in the file name according to the determined path.
[0083] Furthermore, the synchronization method further includes:
[0084] If the verification passes, a synchronization success signal is sent to the intranet file synchronization module;
[0085] After receiving the synchronization success signal, the intranet file synchronization module processes the task of the next task node in the list of files to be synchronized.
[0086] In a specific embodiment, the intranet periodic synchronization thread periodically queries the list of files to be synchronized every 100ms. If the list is empty, no processing is performed; if the list is not empty, the task node of the list is read, and after processing a node task and receiving a synchronization success signal, the next node task is continued. When the file speed attribute is fast, the fast transmission rate is 20,000 frames / 100ms, and when the file speed attribute is slow, the slow transmission rate is 100 frames / 100ms; the corresponding external network file synchronization module regularly processes the received configuration file data to be synchronized once every 100ms, and processes 20,000 frames of data every 100ms.
[0087] Furthermore, the synchronization method further includes:
[0088] After the isolation device is powered on and the system is initialized, the internal network initialization file synchronization thread sends the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list to the external network file synchronization module;
[0089] The external network file synchronization module periodically receives the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list and verifies the received configuration files to be synchronized and the corresponding file names;
[0090] If the verification passes, the corresponding configuration file to be synchronized is placed in the directory contained in the received file name according to the received file name to realize synchronization configuration.
[0091] Furthermore, the synchronization method further includes:
[0092] If the verification fails, the received data is discarded and a failure signal is returned to the intranet initialization file synchronization thread;
[0093] If a failure signal is received, the intranet initialization file synchronization thread resends the current configuration file to be synchronized and the corresponding file information.
[0094] See also Figure 2 The embodiment of the present invention further provides a real-time automatic file synchronization system for an isolation device, comprising:
[0095] Message bus, used to send file synchronization messages sent by other business modules in the intranet;
[0096] The intranet file synchronization module is used to obtain file synchronization messages sent by other intranet business modules through the message bus, wherein the file synchronization messages contain configuration files to be synchronized and corresponding file information; based on the order of acquisition time, establish the correspondence between the configuration files to be synchronized and the corresponding file information and the task nodes, and generate a linked list of files to be synchronized; and sequentially send the configuration files to be synchronized and the file information corresponding to each task node in the linked list of files to be synchronized to the isolation card;
[0097] The isolation card is used to sequentially send the configuration files and file information to be synchronized corresponding to each task node in the linked list of files to be synchronized to the external network file synchronization module;
[0098] The external network file synchronization module is used to regularly receive the configuration files to be synchronized and the corresponding file information and verify the received configuration files to be synchronized and the corresponding file information; if the verification passes, the corresponding configuration files to be synchronized are placed in the directory contained in the received file information according to the received file information to realize synchronization configuration.
[0099] The system and method of the present invention correspond one to one. The specific description and effects of the system can be found in the method embodiment, which will not be repeated here.
[0100] The following is a specific embodiment of the present invention:
[0101] like Figure 2 As shown, this embodiment provides a real-time automatic file synchronization system for an isolation device, wherein the intranet side of the system mainly includes a message bus, an intranet file synchronization module, an initialization synchronization thread and other business modules; the extranet side mainly includes a message bus and an extranet file synchronization module.
[0102] The process of synchronizing the configuration files in the system provided in this embodiment includes:
[0103] (1) Other business modules in the intranet modify the configuration files according to the business configuration update, and notify the intranet file synchronization module through the message bus to synchronize the files, and then send the configuration files, file names and file speed attributes to be synchronized to the intranet file synchronization module, where the file name includes the file path;
[0104] (2) Figure 3 As shown in the figure, the intranet file synchronization module mainly consists of three parts:
[0105] 1) Bus monitoring task: retrieve the messages required by the intranet file synchronization module from the message bus according to the subscription message type of the intranet file synchronization module;
[0106] 2) List of files to be synchronized: stores the configuration files to be synchronized to the external network. One configuration to be synchronized is a task node, and one task node contains two attributes: ① the file name to be synchronized; ② the speed indicator of the file to be synchronized;
[0107] 3) Periodic synchronization thread: Periodically query the list of files to be synchronized every 100ms. If the list is empty, no processing is performed; if the list is not empty, read the task node in the list. After processing a node task and receiving the synchronization success signal, continue to process the next node task. The processing process of the periodic synchronization thread is as follows:
[0108] ① The periodic synchronization thread reads the file name and speed attributes of the task node attributes, as well as the configuration file to be synchronized;
[0109] ② Calculate the hash value of the file name to be synchronized and the hash value of the configuration file to be synchronized;
[0110] ③According to the speed attributes of the node task, fast transmission or slow transmission is adopted. The fast transmission rate is 20000 frames / 100ms, and the slow transmission rate is 100 frames / 100ms;
[0111] ④ The periodic synchronization thread sends the configuration file and file name to be synchronized to the external network through the isolation card according to the custom message format shown in the following table:
[0112] Table 1 Custom message format
[0113] File attributes (1 byte) Frame number (4 bytes) Status flag (1 byte) Payload length (2 bytes) Payload (1500 bytes)
[0114] in:
[0115] File attributes: 1: file name; 2: file data
[0116] Frame number: current frame number
[0117] Status indicator: 1: first frame; 2: transmitting; 3: last frame
[0118] Payload length: the length of the current frame payload
[0119] Payload: Payload consists of two parts, payload data and hash value. The first frame of data is the name of the configuration file to be synchronized, and the payload is the file name and the hash value of the file name. The last frame of data is the hash value of the configuration file to be synchronized, the payload data is empty (all 0), and the hash value is the hash value of the configuration file to be synchronized. For other frames, the payload data part is the configuration file data, and the hash value part is empty (all 0).
[0120] The first frame message format is as shown in Table 2:
[0121] Table 2 First frame message format
[0122] Name of the configuration file to be synchronized Hash value (16 bytes)
[0123] Other frame message formats are as shown in Table 3:
[0124] Table 3 Other frame message formats
[0125] Load data Hash value (only exists in the last frame) (16 bytes)
[0126] (3) The bus monitoring task in the intranet file synchronization module retrieves the messages in the message bus in real time, notifies the periodic synchronization thread after detecting the file synchronization message, and stores the configuration file, file name and file speed attribute to be synchronized into the list of files to be synchronized after retrieving the data; the periodic synchronization thread processes each node task according to the node task attribute in the synchronization file list, and transmits the file name and file data to the external network file synchronization module through the isolation card according to the custom protocol shown in Tables 1 to 3;
[0127] (4) The external network file synchronization module processes the received configuration file data to be synchronized once every 100ms, and processes 20,000 frames of data every 100ms. The data processing flow of the external network file synchronization module is as follows:
[0128] ① After receiving the first frame of data (message), the file name and hash value in the payload are taken out, the hash value is calculated for the taken out file name, and then compared with the hash value taken out from the first frame. If the hash values are consistent, the data processing continues; if they are inconsistent, the data processing is stopped and a transmission error signal is returned to the intranet. After the bus monitoring task of the intranet file synchronization module retrieves the transmission error signal, it notifies the intranet periodic synchronization thread to retransmit;
[0129] ② Continue to extract the payload data of the received data frames until the last frame is received, and then stop. Parse the payload data of the frames except the last frame according to the self-defined protocol, extract the payload data for packetization, obtain the complete configuration file to be synchronized, and calculate the hash value;
[0130] ③ Take out the value of the hash part of the last frame load and compare it with the hash of the complete configuration file to be synchronized. If they are consistent, put the configuration file in the directory contained in the file name and return a synchronization success signal. After the bus monitoring task of the intranet file synchronization module retrieves the synchronization success signal, it notifies the intranet periodic synchronization thread to process the next node task; if they are inconsistent, it returns a synchronization failure signal. After the bus monitoring task of the intranet file synchronization module retrieves the synchronization failure signal, it notifies the intranet periodic synchronization thread to retransmit. If it fails after 10 retransmissions, it returns a synchronization failure signal to the business module and starts processing the next node task.
[0131] The system provided in this embodiment also includes starting the synchronization of internal and external network files at startup, specifically including:
[0132] 1. Initialization file synchronization list file: This file is a txt text file. The initialization file synchronization list file is configurable. The product developer configures the file name that needs to be initialized and synchronized at startup. The format of the initialization file synchronization list file is as follows: Figure 4 As shown, file[n]name is the name of the configuration file.
[0133] 2. The startup initialization synchronization process includes:
[0134] (1) After the isolation device is turned on and the system is initialized, the initialization synchronization thread of the intranet is automatically started to read the first configuration file name in the intranet initial file synchronization list file;
[0135] (2) Initialize the synchronization process to read the corresponding configuration file according to the read configuration file name, and then send the configuration file to the external network through the isolation card at a speed of 20,000 frames / 100 ms according to the custom protocol;
[0136] (3) The external network file synchronization module periodically processes the received configuration file data once every 100 ms, processes 20,000 frames of data every 100 ms, parses the received configuration file data according to the custom protocol, and verifies the received file name and configuration file;
[0137] (4) If the verification succeeds, the configuration file is placed in the path contained in the file name, and a success signal is returned to the intranet initialization synchronization process; if the verification fails, the file is discarded, and a failure signal is returned to the intranet initialization synchronization process;
[0138] If the intranet initialization synchronization process receives a success signal, it will continue to read the next configuration file name in the intranet initial file synchronization list file until the next configuration file name is empty. At this time, it is considered that all initialization synchronization configuration files have been synchronized successfully, and the initialization synchronization process ends automatically. If a failure signal is received, the current configuration file will be resynchronized. If a configuration file still fails after synchronization 10 times, the initialization synchronization process ends automatically, and the device alarm file synchronization function error.
[0139] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.
Claims
1. A method for real-time automatic synchronization of files in an isolation device, It is characterized in that include: The intranet file synchronization module obtains the file synchronization message sent by other intranet business modules through the message bus. The file synchronization message contains the configuration file to be synchronized and the corresponding file information. The file information includes the file name and the file speed attribute. Based on the order of acquisition time, task nodes are sequentially added to the file synchronization linked list, and one task node corresponds to one file synchronization message; The method includes: determining the transmission rate of the configuration file to be synchronized and the file name corresponding to the task node in the file list to be synchronized according to the file speed attribute corresponding to the task node; and sending the configuration file to be synchronized and the file name corresponding to each task node in the file list to be synchronized to the external network file synchronization module through the isolation card in sequence according to the determined transmission rate; 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 in the directory contained in the received file information according to the received file information to realize synchronization configuration.
2. The synchronization method according to claim 1, It is characterized in that The configuration files and file names to be synchronized corresponding to each task node in the file list to be synchronized are sent to the external network file synchronization module in sequence through the isolation card, specifically including: Determine the current task node according to the task node sequence; Generate a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node, wherein the custom message includes a frame sequence number and a payload, and the payload includes the configuration file data or the file name to be synchronized; Send the custom message corresponding to the current task node to the external network file synchronization module.
3. The synchronization method according to claim 2, It is characterized in that The generating of a custom message according to the configuration file to be synchronized and the file name corresponding to the current task node specifically includes: Calculate the hash value of the file name corresponding to the current task node and the hash value of the corresponding configuration file to be synchronized; The file name and the hash value of the file name are used as the payload of the first frame of the custom message, the hash value of the configuration file to be synchronized is used as the payload of the last frame of the custom message, and the configuration file data to be synchronized is used as the payload of other frames except the first frame and the last frame.
4. The synchronization method according to claim 3, It is characterized in that 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 external network file synchronization module regularly receives the custom message corresponding to each task node; When the external network file synchronization module receives the first frame of the custom message, the file name and hash value contained in the first frame of the custom message are obtained; Calculate the file name hash value based on the file name contained in the first frame of the custom message; Compare the calculated file name hash value with the file name hash value contained in the first frame of the custom message. If the hash values are consistent, continue to receive and process the message until the last frame of the custom message is received. Parse the custom message between the first frame and the last frame, extract the data group package of the configuration file to be synchronized to obtain the complete configuration file to be synchronized; The hash value of the configuration file to be synchronized obtained by package assembly is calculated and compared with the hash value of the configuration file to be synchronized contained in the last frame of the custom message. If they are consistent, it is determined that the configuration file to be synchronized obtained by package assembly is correct.
5. The synchronization method according to claim 4, It is characterized in that According to the received file information, the corresponding configuration file to be synchronized is placed in the directory contained in the received file information, including: The path of the configuration file to be synchronized obtained by assembling the package is determined according to the corresponding file name, and the configuration file to be synchronized obtained by assembling the package is placed in the directory contained in the file name according to the determined path.
6. The synchronization method according to claim 2, It is characterized in that Also includes: If the verification passes, a synchronization success signal is sent to the intranet file synchronization module; After receiving the synchronization success signal, the intranet file synchronization module processes the task of the next task node in the list of files to be synchronized.
7. The synchronization method according to claim 1, It is characterized in that Also includes: After the isolation device is powered on and the system is initialized, the internal network initialization file synchronization thread sends the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list to the external network file synchronization module; The external network file synchronization module periodically receives the configuration files to be synchronized and the corresponding file names in the initialization file synchronization list and verifies the received configuration files to be synchronized and the corresponding file names; If the verification passes, the corresponding configuration file to be synchronized is placed in the directory contained in the received file name according to the received file name to realize synchronization configuration.
8. The synchronization method according to claim 6, It is characterized in that Also includes: If the verification fails, the received data is discarded and a failure signal is returned to the intranet initialization file synchronization thread; If a failure signal is received, the intranet initialization file synchronization thread resends the current configuration file to be synchronized and the corresponding file information.
9. A real-time automatic synchronization system for files in an isolation device, It is characterized in that include: Message bus, used to send file synchronization messages sent by other business modules in the intranet; The intranet file synchronization module is used to obtain file synchronization messages sent by other intranet business modules through the message bus, wherein the file synchronization messages contain configuration files to be synchronized and corresponding file information, wherein the file information includes the file name and the file speed attribute; based on the order of acquisition time, task nodes are sequentially added to the file synchronization linked list, and one task node corresponds to one file synchronization message; and configuration files to be synchronized and file information corresponding to each task node in the file linked list to be synchronized are sequentially sent to the isolation card; The isolation card is used to sequentially send the configuration files and file information to be synchronized corresponding to each task node in the file list to be synchronized to the external network file synchronization module, including: determining the transmission rate of the configuration files and file names to be synchronized corresponding to the task nodes according to the file speed attribute corresponding to the task nodes; according to the determined transmission rate, sequentially sending the configuration files and file names to be synchronized corresponding to each task node in the file list to be synchronized to the external network file synchronization module through the isolation card; The external network file synchronization module is used to regularly receive the configuration files to be synchronized and the corresponding file information and verify the received configuration files to be synchronized and the corresponding file information; if the verification passes, the corresponding configuration files to be synchronized are placed in the directory contained in the received file information according to the received file information to realize synchronization configuration.
