A method and system for achieving consistency of key file copies in an airborne environment

By using logging and incremental transmission methods, the problem of inconsistency in critical file copies caused by equipment anomalies in airborne environments was solved, achieving high-performance and high-reliability file consistency management and meeting the high reliability requirements of airborne environments.

CN116069750BActive Publication Date: 2026-01-16XIAN AVIATION COMPUTING TECH RES INST OF AVIATION IND CORP OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211617707.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2026-01-16
Estimated Expiration
2042-12-15

AI Technical Summary

Technical Problem

In an airborne environment, existing technologies cannot effectively solve the problem of inconsistencies in critical file copies caused by sudden power outages or restarts of the main file server device. Furthermore, existing methods consume CPU resources and network bandwidth, making it difficult to meet the requirements of high performance and high reliability.

Method used

A combination of logging and incremental transfer is used. By creating log files to record replica consistency, the master and slave file servers record logs before and after file write operations, and perform roll-forward/roll-back operations using incremental transfer in case of abnormal situations to ensure file consistency.

Benefits of technology

It enables consistency management of critical file copies in an airborne environment, supports high-performance and high-reliability file roll-forward/roll-back operations, and solves the file inconsistency problem caused by device anomalies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116069750B_ABST
    Figure CN116069750B_ABST
Patent Text Reader

Abstract

The application relates to the field of airborne embedded information security, and provides a method and system for realizing consistency of key file copies in an airborne environment, which is composed of a client node, a master file server node and a slave file server node, and copy consistency management is applied to the master file server and the slave file server. The method for realizing consistency of key file copies in the airborne environment is designed, the problem that local write operation is abnormal due to sudden power-off and restart of equipment and the like in a single-node write process of a file server on a key file / copy, thereby causing inconsistency of key file copies is solved, and the requirement that high performance and high reliability should be supported when a file forward roll / rollback operation is performed on the key file / copy in the airborne environment is met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of airborne embedded information security, and particularly relates to a method and system for realizing consistency of key file copies in an airborne environment. BACKGROUND

[0002] With the application of network file systems in airborne distributed computing platforms, the requirement for key data security protection is also increasingly high. In an airborne environment, a dual-copy mode is usually adopted to backup key files on master and slave file servers, and how to ensure consistency of key file copies is a problem that needs to be focused on. In existing methods, a master file server periodically acquires copy file attributes from a slave file server and compares them with key file attributes to determine consistency of key file copies. If inconsistent, the slave file server is rewritten with full transmission. In this way, if the master file server suddenly powers off, restarts or causes abnormal local write operation, the key file cannot be restored to the state before the local write operation, that is, the file rollback operation cannot be realized. At the same time, the combination of periodic comparison of file attributes and full transmission occupies a large amount of CPU resources and network bandwidth, and it is difficult to meet the requirements of high performance and high reliability in an airborne environment. Therefore, a copy consistency management technology combining log recording and incremental transmission is needed to improve the reliability and availability of the airborne network file system. SUMMARY

[0003] Therefore, the embodiments of the present application provide a method for realizing consistency of key file copies in an airborne environment to solve the technical problem that in the prior art, during a single-node write process of a file server on a key file / copy, a device suddenly powers off, restarts or causes abnormal local write operation, resulting in inconsistency of key file copies, the method comprising:

[0004] creating a log file, the log file being used to record copy consistency;

[0005] the master file server receiving a remote file write request, performing a local file write operation, and recording logs before and after the local file write operation;

[0006] the master file server sending a copy file synchronous write request to the slave file server;

[0007] the slave file server responding to the copy file synchronous write request, performing a local file write operation, and recording logs before and after the local file write operation;

[0008] the master file server and the slave file server periodically checking the transaction log table, and if there is an abnormality, respectively performing a forward roll / rollback operation on the key file / copy file by using incremental transmission.

[0009] The master file server or the slave file server checks the key file / copy file after the pre-rolling / rolling back operation is completed.

[0010] Further, the log file is created, including:

[0011] The master file server and the slave file server respectively perform a local file opening operation in a device initialization stage to open the log file.

[0012] If the log file opening is successful, the master file server and the slave file server respectively perform a local file reading operation to read the log file and store the log file into a corresponding log management structure.

[0013] The master file server and the slave file server respectively perform a local file writing operation to write the updated log management structure into the log file.

[0014] If the log file opening fails, the master file server and the slave file server respectively perform a local file creation operation to create the log file and create the log management structure, and store the log file in the log management structure.

[0015] The master file server and the slave file server respectively perform a local file writing operation to write the updated log management structure into the log file.

[0016] Further, the master file server receives a remote file writing request, performs a local file writing operation, and records logs before and after the local file writing operation, including:

[0017] The master file server opens a key file by performing a local file opening operation in response to a remote file writing request sent by a client, and obtains a first file descriptor.

[0018] If the key file opening is successful, a pre-writing log operation is performed, and the master file server first reads the log file into a first log management structure by performing a local file reading operation, then applies a log entry resource table item to a log management unit of the master file server, modifies a log occupancy list, obtains a current time of the system as a writing time of the key file, and records the writing time and file information in the first log management structure, wherein the first log management structure is a log management structure of the master file server.

[0019] The master file server writes the first log management structure into the log file by performing a local file writing operation, and performs persistent storage.

[0020] If the master file server successfully performs the pre-write log operation, the master file server performs a local file write operation on the key file;

[0021] If the master file server successfully performs the key file local write operation, a local file read operation is performed to read the log file into the first log management structure, and the master file server locates the file block number corresponding to the start write position according to the offset of the key file local write operation. Then, the MD5 code corresponding to each file block from the file block to the tail file block is recalculated, and the corrected MD5 code and the file block offset are recorded in the file block check table corresponding to the file. After that, the log entry resource is released, the log occupancy list is modified, and the local file write operation is performed to write the log management structure into the log file for persistent storage.

[0022] Further, when the master file server sends a copy file synchronous write request to the slave file server, the master file server fills the preset information into the RPC request header and then sends the synchronous write request to the slave file server.

[0023] Further, the slave file server performs a local file write operation in response to the copy file synchronous write request and performs log recording before and after the local file write operation, including:

[0024] The slave file server performs a local file open operation on the copy file in response to the synchronous write request sent by the master file server to obtain a second file descriptor;

[0025] If the copy file is successfully opened, a pre-write log operation is performed. The slave file server first performs a local file read operation to read the log file into a second log management structure. Then, the slave file server applies for a log entry resource table item to the log management unit of the slave file server and modifies the log occupancy list to obtain the current time of the system as the copy file write time. The copy file write time and the copy file information are recorded in the second log management structure, a local file write operation is performed to write the second log management structure into the log file for persistent storage, and the second log management structure is the log management structure of the slave file server;

[0026] If the slave file server successfully performs the pre-write log operation, the slave file server performs a local file write operation on the copy file;

[0027] If the slave file server successfully performs the local file write operation on the copy file, the slave file server performs a local file read operation to read the log file into a second log management structure, the master file server locates the file block number corresponding to the start write position according to the offset of the local write operation of the copy file. Then, the MD5 code corresponding to each file block from the file block to the tail file block is recalculated, and the corrected MD5 code and the file block offset are recorded in the file block check table corresponding to the copy file. After that, the log entry resource is released, the log occupancy list is modified, and a local file write operation is performed to write the second log management structure into the log file for persistent storage.

[0028] Further, the master file server and the slave file server periodically check the transaction log table, including:

[0029] The master file server and the slave file server determine whether the local write operation of the key file at the current node is timed out according to the log entry write time;

[0030] If it is timed out, it is considered as an abnormal local write operation, and the current node records the abnormal position and performs a file forward / rollback operation. When performing the file forward / rollback operation, the file block is obtained from the target node in an incremental manner from the position of the abnormal file block, and a local write operation is performed. After the key file / the copy file completes the local write operation, the MD5 code corresponding to each file block from the start file block to the tail file block is recalculated, and the corrected MD5 code and the file block offset are recorded in the file block check table corresponding to the key file / the copy file.

[0031] Further, the master file server or the slave file server checks the key file / copy after the forward / rollback operation is completed, including:

[0032] After the master file server or the slave file server completes the file forward / rollback operation of the abnormal file with a write operation exception, the current node initiates an RPC request to compare whether the key file and the copy file are consistent;

[0033] If the key file and the copy file are consistent, it proves that the file forward / rollback operation is successful;

[0034] If the key file and the copy file are inconsistent, the master file server or the slave file server re-performs the forward / rollback operation on the abnormal file from the start position of the abnormal file. After that, the log entry resource is released, the log occupancy list is modified, and a local file write operation is performed to write the log management structure corresponding to the abnormal file into the log file for persistent storage.

[0035] Furthermore, the application also provides a system for realizing consistency of key file copies in an airborne environment, to solve the technical problem of inconsistency of key file copies caused by abnormal local write operation due to sudden power-off, restart and the like of equipment in a single-node write process of a key file / copy by a file server in the prior art, and the system comprises:

[0036] a log file creation module configured to create a log file, the log file being used to record copy consistency;

[0037] a first file write request module configured to receive a remote file write request by a master file server, perform a local file write operation, and perform log recording before and after the local file write operation;

[0038] a copy synchronization write request sending module configured to send a copy file synchronization write request to a slave file server by the master file server;

[0039] a second file write request module configured to respond to the copy file synchronization write request by the slave file server, perform a local file write operation, and perform log recording before and after the local file write operation;

[0040] a log period checking module configured to periodically check a transaction log table by the master file server and the slave file server respectively, and if there is an abnormality, perform a forward roll / rollback operation on a key file / copy file by using an incremental transmission mode.

[0041] a key file verification module configured to verify the key file / copy file after the forward roll / rollback operation by the master file server or the slave file server.

[0042] Compared with the prior art, the above at least one technical solution adopted by the embodiments of the present application can achieve at least the following beneficial effects: the application provides a method for realizing consistency of key file copies in an airborne environment, which is composed of a client node, a master file server node and a slave file server node, and copy consistency management is applied to the master file server and the slave file server. The problem of inconsistency of key file copies caused by abnormal local write operation due to sudden power-off, restart and the like of equipment in a single-node write process of a key file / copy by a file server is solved, and the requirement of supporting high performance and high reliability when performing a file forward roll / rollback operation on a key file / copy in an airborne environment is met. BRIEF DESCRIPTION OF DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description only represent some of the embodiments of the present application, and the present application can also be implemented or applied through other different specific embodiments, and various modifications or changes can be made to the details in the present application based on different views and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor also belong to the protection scope of the present application.

[0044] Figure 1 is a method architecture provided by an embodiment of the present application for realizing consistency of key file copies in an airborne environment;

[0045] Figure 2 is a node deployment diagram provided by an embodiment of the present application for realizing consistency of key file copies in an airborne environment;

[0046] Figure 3 is a first method timing diagram provided by an embodiment of the present application;

[0047] Figure 4 is a second method timing diagram provided by an embodiment of the present application;

[0048] Figure 5 is a third method timing diagram provided by an embodiment of the present application;

[0049] Figure 6 is a system structure diagram provided by an embodiment of the present application for realizing consistency of key file copies in an airborne environment.

[0050] In the figure, the reference signs are as follows: 600, system; 601, log file creation module; 602, first file write request module; 603, copy synchronization write request sending module; 604, second file write request module; 605, log period checking module; 606, key file checking module. DETAILED DESCRIPTION

[0051] The embodiments of the present application will be described in detail below with reference to the drawings.

[0052] The embodiments of the present application are described below through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the disclosure. Obviously, the described embodiments are only some of the embodiments of the present application, not all. The present application can also be implemented or applied through other different specific embodiments, and various modifications or changes can be made to the details in the present application based on different views and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor also belong to the protection scope of the present application.

[0053] The application provides a method for realizing consistency of key file copies in an airborne environment, which is composed of a client node, a master file server node and a slave file server node, and copy consistency management is applied to the master file server and the slave file server. The method solves the problem of inconsistency of key file copies caused by abnormal local write operation due to sudden power-off and restart of equipment during single-node write process of the file server on key files / copies, and meets the requirement of high performance and high reliability when performing file forward roll / rollback operation on key files / copies in the airborne environment.

[0054] Specifically, as shown in Figure 2 The application provides a method for realizing consistency of key file copies in an airborne environment, which is composed of a client node, a master file server node and a slave file server node, and copy consistency management is applied to the master file server and the slave file server. The method solves the problem of inconsistency of key file copies caused by abnormal local write operation due to sudden power-off and restart of equipment during single-node write process of the file server on key files / copies, and meets the requirement of high performance and high reliability when performing file forward roll / rollback operation on key files / copies in the airborne environment. Figure 1 The method specifically includes the following steps:

[0055] Step S100: creating a log file, which is used for recording copy consistency;

[0056] Specifically, the master file server and the slave file server perform local file opening operation in the initialization stage after power-on of the equipment, and open a log file used for recording copy consistency operation.

[0057] If the log file opening is successful, local file read operation is performed, log content is read out to the log management structure in the memory, a mutual lock used for local operation of the file is created and stored in the log management structure, local file write operation is performed, and the modified log management structure is written into the log file.

[0058] If the log file opening fails, local file creation operation is performed, and the log file is created. The log management structure is created and initialized, the log occupation list and the transaction log table are initialized, the local write operation timeout is set, the mutual lock used for local operation of the file is created and stored in the log management structure, the current system time is obtained as the log creation time and stored in the log management structure, and local file write operation is performed, and the log management structure is written into the log file.

[0059] Step S200: the master file server receives a remote file write request, performs local file write operation, and records logs before and after the local file write operation;

[0060] Specifically, the master file server, in response to the remote file write request sent by the client, performs a local file opening operation to obtain a file descriptor. If the file opening is successful, a pre-write log operation is performed. The master file server first performs a local file reading operation to read the log file into a log management structure. Then, the master file server applies for a log entry resource table item from a log management unit and modifies a log occupancy list. The master file server obtains the current system time as a file start writing time and records the time and related information such as a file path in the log management structure. Subsequently, the master file server performs a local file writing operation to write the log management structure into the log file for persistent storage.

[0061] If the pre-write log operation is successful, the master file server performs a local file writing operation on the key file.

[0062] If the local file writing operation on the key file is successful, a local file reading operation is performed to read the log file into a log management structure. The master file server locates a file block number corresponding to a start writing position according to an offset of the local file writing operation on the key file. Then, the master file server recalculates MD5 codes corresponding to each file block from the file block to a tail file block and records the corrected MD5 codes and file block offsets in a file block check table corresponding to the file. Subsequently, the master file server releases the log entry resource, modifies the log occupancy list, and performs a local file writing operation to write the log management structure into the log file for persistent storage.

[0063] Step S300: The master file server sends a replica file synchronous write request to the slave file server.

[0064] Specifically, the master file server fills information such as a source node ID, a destination node ID, a process number, a file path, file writing content, and a file offset into an RPC request header and then sends the synchronous write request to the slave file server.

[0065] Step S400: The slave file server, in response to the replica file synchronous write request, performs a local file writing operation and records logs before and after the local file writing operation.

[0066] Specifically, the slave file server, in response to the synchronous write request sent by the master file server, performs a local file opening operation on the replica file to obtain a file descriptor. If the replica file opening is successful, a pre-write log operation is performed. The slave file server first performs a local file reading operation to read the log file into a log management structure. Then, the slave file server applies for a log entry resource table item from a log management unit and modifies a log occupancy list. The slave file server obtains the current system time as a replica file start writing time and records the time and related information such as a replica file path in the log management structure. Subsequently, the slave file server performs a local file writing operation to write the log management structure into the log file for persistent storage.

[0067] If the write-ahead log operation is successful, a local file write operation is performed on the replica file from the file server.

[0068] If the replica file local write operation is successful, a local file read operation is performed to read the log file into the log management structure. The primary file server locates the file block number corresponding to the start write position according to the offset of the replica file local write operation. Then, the MD5 code corresponding to each file block from the file block to the tail file block is recalculated, and the modified MD5 code and the file block offset are recorded in the file block check table corresponding to the replica file. After that, the log entry resource is released, the log occupancy list is modified, and a local file write operation is performed to write the log management structure into the log file for persistent storage.

[0069] Step S500: The primary file server and the slave file server periodically check the transaction log table, and if there is an exception, a forward roll / back roll operation is performed on the key file / replica file in an incremental transmission manner.

[0070] Specifically, the primary and slave file servers periodically check the transaction log table, and determine whether the local write operation of the key file (replica) at the node is timed out according to the log entry write time. If it is timed out, it is considered that the local write operation is abnormal, and the node records the abnormal position and performs a file forward roll / back roll action. When performing the file forward roll / back roll action, the file block is obtained from the target node in an incremental manner from the position of the abnormal file block, and a local write operation is performed. After the key file / replica completes the local write operation, the MD5 code corresponding to each file block from the start file block to the tail file block is recalculated, and the modified MD5 code and the file block offset are recorded in the file block check table corresponding to the key file / replica.

[0071] Step S600: The primary file server or the slave file server checks the key file / replica file after the forward roll / back roll operation is completed.

[0072] Specifically, after the file forward roll / back roll action is completed, the node initiatively initiates an RPC request to compare whether the key file and the replica are consistent, and checks whether the file block check lists corresponding to the key file and the replica are consistent. If they are consistent, it proves that the file forward roll / back roll operation is successful; if they are not consistent, the file forward roll / back roll action is re-performed from the start position of the file. After that, the log entry resource is released, the log occupancy list is modified, and a local file write operation is performed to write the log management structure into the log file for persistent storage.

[0073] Embodiment One

[0074] Embodiment One describes a normal write scenario of a key file / replica file.

[0075] (1) Typical operating environment

[0076] An airborne distributed computing platform consists of three physical nodes: module A, module B, and module C. The underlying network communication uses FC, and the local file system uses an airborne high-reliability file system. The Tianmai 3-partition operating system is deployed on each physical node.

[0077] Module A deploys the network file system client, Module B deploys the network file system master file server, and Module C deploys the network file system slave file server.

[0078] (2) Configuration and configuration file generation and loading

[0079] Module A is configured with node identifier 1 and role CLIENT.

[0080] Module B is configured with node identifier 2, role MASTER_SERV, and local write operation timeout set to 5000ms.

[0081] Module C is configured with node identifier 3, role SLAVE_SERV, and local write operation timeout set to 5000ms.

[0082] Configuration file generation and loading method: Generate a configuration file efmsconfig.cfg for the three nodes and load it into the root directory of the local file system of module A, module B and module C.

[0083] (3) Application effect

[0084] a. Power on modules A, B, and C, and load the efmsconfig.cfg configuration file from the root directory of the local file system of each module to complete system initialization.

[0085] b. Module A loads the test program and remotely writes a key file named testcons.txt, the content of which is 1024 bytes of all "A" characters.

[0086] c. Modules B and C create log files to record replica consistency operations.

[0087] d. For example Figure 3 As shown, module B responds to the remote file write request sent by module A. It requests log entry resource entries, modifies the log occupancy list, and completes the pre-write log operation. If the pre-write log operation succeeds, it executes the local write operation to the testcons.txt file. If the local write operation to the testcons.txt file succeeds, it corrects the file block checksum table, releases log entry resources, modifies the log occupancy list, and completes the post-write log operation.

[0088] e. As Figure 3 Module B sends a copy file sync write request to Module C.

[0089] f. Module C responds to the copy file sync write request. Apply log entry resource table entry, modify log occupancy list, complete pre-write log operation. Pre-write log operation succeeds, execute testcons.txt copy file local write operation. Testcons.txt copy file local write operation succeeds, modify file block check table, release log entry resource, modify log occupancy list, complete post-write log operation. Figure 3

[0090] g. Module B, Module C periodically check transaction log table, no abnormal log entry.

[0091] Example Two

[0092] Example Two describes a scenario of a key file write exception, the main file server executes file rollback operation.

[0093] (1) Typical operating environment

[0094] An airborne distributed computing platform, including three physical nodes of Module A, Module B, Module C, using FC network communication at the bottom, using airborne high reliability file system for local file system, deploying Tianmai 3 partition operating system on each physical node.

[0095] Module A deploys a network file system client, Module B deploys a network file system main file server, and Module C deploys a network file system slave file server.

[0096] (2) Configuration and generation and loading of configuration file

[0097] Module A is configured with node identification 1 and role CLIENT.

[0098] Module B is configured with node identification 2 and role MASTER_SERV, and the local write operation timeout time is set to 5000ms.

[0099] Module C is configured with node identification 3 and role SLAVE_SERV, and the local write operation timeout time is set to 5000ms.

[0100] Configuration file generation and loading method: generate a configuration file efmsconfig.cfg for the three nodes and load it to the root directory of the local file system of Module A, Module B and Module C.

[0101] 3) Application effect

[0102] ​a. Power on modules A, B, and C, and load the efmsconfig.cfg configuration file from the root directory of the local file system of each module to complete system initialization.

[0103] b. Module A loads the test program and remotely writes a key file named testcons.txt, the content of which is 1024 bytes of all "A" characters.

[0104] c. Modules B and C create log files to record replica consistency operations.

[0105] d. For example Figure 4 As shown, module B responds to the remote file write request sent by module A. It requests log entry resource table entries, modifies the log usage list, and completes the pre-write log operation. The pre-write log operation succeeds, and the local write operation to the testcons.txt file is executed. During the local write of the testcons.txt file, module B is powered off.

[0106] e. For example Figure 4 As shown, module B periodically checks the transaction log table and finds abnormal log entries. Starting from the position where the abnormal file block exists, module B incrementally retrieves file blocks from module C and performs local write operations. After testcons.txt completes the local write operation, it recalculates the MD5 hash of each file block from the starting file block to the ending file block, and records the corrected MD5 hash and file block offset in the corresponding file block verification table of testcons.txt.

[0107] f. such as Figure 4 As shown, module B sends a file verification request to module C. The request verifies whether the file block verification table of the testcons.txt file after the rollback operation is performed matches that of the copy of testcons.txt stored on module C.

[0108] Example 3

[0109] Example 3 describes a scenario where a copy file write failure occurs, and a file roll-forward operation is performed from the file server.

[0110] (1) Typical operating environment

[0111] An airborne distributed computing platform consists of three physical nodes: module A, module B, and module C. The underlying network communication uses FC, and the local file system uses an airborne high-reliability file system. The Tianmai 3-partition operating system is deployed on each physical node.

[0112] Module A deploys the network file system client, Module B deploys the network file system master file server, and Module C deploys the network file system slave file server.

[0113] (2) Configuration and generation and loading of configuration file

[0114] Module A is configured with node identification 1 and role CLIENT.

[0115] Module B is configured with node identification 2, role MASTER_SERV, and local write operation timeout time 5000 ms.

[0116] Module C is configured with node identification 3, role SLAVE_SERV, and local write operation timeout time 5000 ms.

[0117] Configuration file generation and loading: generate a configuration file efmsconfig.cfg for the three nodes and load it to the root directory of the local file system of Module A, Module B and Module C.

[0118] (3) Application effect

[0119] a. Power on Module A, Module B and Module C, respectively load the efmsconfig.cfg configuration file from the root directory of the local file system of the module, and complete system initialization.

[0120] b. Module A loads a test program and remotely writes a key file named testcons.txt, with file content being 1024 bytes of all "A" characters.

[0121] c. Module B and Module C create a log file for recording copy consistency operation.

[0122] d. As shown in Figure 5 , Module B responds to the remote file write request sent by Module A. Apply for log entry resource table item, modify log occupancy list, complete pre-write log operation. The pre-write log operation is successful, and the local write operation of the testcons.txt file is executed. The local write operation of the testcons.txt file is successful, the file block check table is modified, the log entry resource is released, the log occupancy list is modified, and the post-write log operation is completed.

[0123] e. As shown in Figure 5 , Module B sends a copy file synchronization write request to Module C.

[0124] f. As shown in Figure 5 , Module C responds to the copy file synchronization write request. Apply for log entry resource table item, modify log occupancy list, complete pre-write log operation. The pre-write log operation is successful, and the local write operation of the testcons.txt copy file is executed. During the local write operation of the testcons.txt copy file, Module C device is powered off.

[0125] g. As shown in Figure 5 Module C periodically checks the transaction log table and finds abnormal log entries. Module C starts from the location where the abnormal file block exists, acquires file blocks from module B in an incremental manner, and performs local write operations. After the testcons.txt copy file completes the local write operation, the MD5 code corresponding to each file block from the starting file block to the tail file block is recalculated, and the corrected MD5 code and the file block offset are recorded in the file block check table corresponding to testcons.txt.

[0126] h. As shown in Figure 5 Module C sends a file check request to module B. The file block check table of the testcons.txt copy file after the pre-rolling operation is compared with the file block check table of the testcons.txt file stored on module B.

[0127] Based on the same inventive concept, the embodiment of the present application also provides a system for realizing consistency of a copy of a key file in an airborne environment, as described in the following embodiment. Since the system for realizing consistency of a copy of a key file in an airborne environment solves the problem by the same principle as the method for realizing consistency of a copy of a key file in an airborne environment, the implementation of the method for realizing consistency of a copy of a key file can be referred to the implementation of the system for realizing consistency of a copy of a key file in an airborne environment, and the repeated parts will not be described herein. The term "unit" or "module" used below can be a combination of software and / or hardware that realizes a predetermined function. Although the system described in the following embodiment is preferably realized in software, hardware or a combination of software and hardware is also possible and is conceived.

[0128] As shown in Figure 6 Fig. 6 is a schematic diagram of a system 600 for realizing consistency of a copy of a key file in an airborne environment according to an embodiment of the present application, which specifically comprises:

[0129] A log file creation module 601 is configured to create a log file, and the log file is used to record copy consistency.

[0130] A first file write request module 602 is configured to receive a remote file write request by a master file server, perform a local file write operation, and record logs before and after the local file write operation.

[0131] A copy synchronization write request sending module 603 is configured to send a copy file synchronization write request to a slave file server by the master file server.

[0132] A second file write request module 604 is configured to respond to the copy file synchronization write request by the slave file server, perform a local file write operation, and record logs before and after the local file write operation.

[0133] The log cycle checking module 605 is used for the master file server and the slave file server to periodically check the transaction log table, and if there is an exception, respectively adopt the incremental transmission mode to perform the forward rolling / rollback operation on the key file / copy file.

[0134] The key file checking module 606 is used for the master file server and the slave file server to check the key file / copy after the forward rolling / rollback operation is completed.

[0135] The embodiment of the present application realizes the following technical effects:

[0136] The present application designs a method and system for realizing the consistency of key file copies in the airborne environment, solves the problem that the local write operation is abnormal due to the sudden power-off and restart of the equipment during the single node write process of the file server to the key file / copy, and causes the inconsistency of the key file copies. Meanwhile, the requirement of supporting high performance and high reliability when the file forward rolling / rollback operation is performed on the key file / copy in the airborne environment is also met. Through the method of combining the log recording and the incremental transmission, the consistency of the key file copies in the airborne environment and the performance of the file forward rolling / rollback operation can be effectively ensured.

[0137] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the embodiments of the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for achieving consistency of copies of critical files in an airborne environment, the method comprising: The application comprises: creating a log file for recording copy consistency; the master file server receives a remote file write request, performs a local file write operation, and records logs before and after the local file write operation; the master file server sends a copy file synchronous write request to the slave file server; the slave file server responds to the copy file synchronous write request, performs a local file write operation, and records logs before and after the local file write operation; the master file server and the slave file server periodically check the transaction log table, and if there is an exception, they respectively perform a forward roll / rollback operation on the key file / copy file in an incremental transmission manner; the master file server or the slave file server checks the key file / copy file after the forward roll / rollback operation is completed.

2. The method for realizing consistency of copies of key files in an airborne environment according to claim 1, characterized in that, The application further comprises: the master file server and the slave file server respectively perform a local file opening operation to open the log file during device initialization; if the log file opening is successful, the master file server and the slave file server respectively perform a local file reading operation to read out the log file and store it in the corresponding log management structure; the master file server and the slave file server respectively perform a local file writing operation to write the updated log management structure into the log file; if the log file opening fails, the master file server and the slave file server respectively perform a local file creation operation to create the log file and the log management structure, store the log file in the log management structure; the master file server and the slave file server respectively perform a local file writing operation to write the updated log management structure into the log file.

3. The method of claim 1, wherein, The master file server receives a remote file write request, performs a local file write operation, and records logs before and after the local file write operation, which comprises: after the master file server responds to the remote file write request sent by the client, it performs a local file opening operation to open the key file and obtains a first file descriptor; if the key file opening is successful, a pre-write log operation is performed, in which the master file server first performs a local file reading operation to read the log file into a first log management structure, then applies for a log entry resource table item to the log management unit of the master file server, modifies a log occupancy list, obtains the current time of the system as the write time of the key file, and records the write time and file information in the first log management structure, wherein the first log management structure is the log management structure of the master file server; the master file server performs a local file writing operation to write the first log management structure into the log file for persistent storage; if the master file server successfully performs the pre-write log operation, it performs a local file writing operation on the key file; If the key file local write operation succeeds, the local file read operation is performed to read the log file into the first log management structure, the master file server locates the file block number corresponding to the starting write position according to the offset of the key file local write operation; then, the MD5 code corresponding to each file block from the file block to the tail file block is recalculated, and the modified MD5 code and the file block offset are recorded in the file block check table corresponding to the file; then, the log entry resource is released, the log occupancy list is modified, and the local file write operation is performed to write the first log management structure into the log file for persistent storage.

4. The method for realizing consistency of copies of key files in an airborne environment according to claim 1, characterized in that, When the master file server sends the replica file synchronous write request to the slave file server, the master file server fills the preset information into the RPC request header and then sends the synchronous write request to the slave file server.

5. The method for realizing consistency of copies of key files in an airborne environment according to claim 1, characterized in that, The slave file server responds to the replica file synchronous write request and performs the local file write operation, and records the log before and after the local file write operation, including: After the slave file server responds to the synchronous write request sent by the master file server, the slave file server performs the local file opening operation on the replica file to obtain a second file descriptor; If the replica file opening succeeds, the pre-write log operation is performed; the slave file server first performs the local file read operation to read the log file into a second log management structure; then, the log entry resource table item is applied to the log management unit of the slave file server, the log occupancy list is modified, the current time of the system is obtained as the replica file write time, the replica file write time and the replica file information are recorded in the second log management structure, the local file write operation is performed to write the second log management structure into the log file for persistent storage, and the second log management structure is the log management structure of the slave file server; If the slave file server performs the pre-write log operation successfully, the slave file server performs the local file write operation on the replica file; If the slave file server performs the local file write operation on the replica file successfully, the slave file server performs the local file read operation to read the log file into the second log management structure, the master file server locates the file block number corresponding to the starting write position according to the offset of the replica file local write operation; then, the MD5 code corresponding to each file block from the file block to the tail file block is recalculated, and the modified MD5 code and the file block offset are recorded in the file block check table corresponding to the replica file; then, the log entry resource is released, the log occupancy list is modified, and the local file write operation is performed to write the second log management structure into the log file for persistent storage.

6. The method for realizing consistency of copies of key files in an airborne environment according to claim 1, characterized in that, The master file server and the slave file server periodically check the transaction log table, including: The master file server and the slave file server determine whether the local write operation of the key file at the current node is timed out according to the log entry write time; If the timeout occurs, the current node records the abnormal position and performs file forward / rollback operation, and the file blocks are obtained from the target node in incremental manner from the position where the abnormal file block exists, and the local write operation is performed; after the local write operation of the key file / the copy file is completed, the MD5 code corresponding to each file block from the start file block to the tail file block is recalculated, and the modified MD5 code and the file block offset are recorded in the file block check table corresponding to the key file / the copy file.

7. The method for realizing consistency of copies of key files in an airborne environment according to claim 6, characterized in that, The master file server and the slave file server check the key file / copy after the forward / rollback operation is completed, and the checking comprises: After the master file server or the slave file server completes the file forward / rollback operation of the abnormal file with the write operation exception, the current node initiates an RPC request for comparing the key file with the copy file; If the key file is consistent with the copy file, it proves that the file forward / rollback operation is successful; If the key file is inconsistent with the copy file, the master file server or the slave file server re-performs the forward / rollback operation on the abnormal file from the start position of the abnormal file, and then releases the log entry resource, modifies the log occupation list, and performs the local file write operation to write the log management structure corresponding to the abnormal file into the log file for persistent storage.

8. A system for realizing consistency of key file copy in an airborne environment, comprising: a log file creation module for creating a log file, wherein the log file is used for recording copy consistency; a first file write request module for receiving a remote file write request by the master file server, performing a local file write operation, and recording logs before and after the local file write operation; a copy synchronization write request sending module for sending a copy file synchronization write request to the slave file server by the master file server; a second file write request module for responding to the copy file synchronization write request by the slave file server, performing a local file write operation, and recording logs before and after the local file write operation; a log period checking module for periodically checking the transaction log table by the master file server and the slave file server respectively, and performing forward / rollback operation on the key file / copy file in incremental transmission manner if there is an abnormality; a key file checking module for checking the key file / copy after the forward / rollback operation is completed by the master file server or the slave file server.

Citation Information

Patent Citations

  • Incremental data restoration method and apparatus

    US20190227710A1

  • Snapshot format for object-based storage

    US20200167238A1