Archive processing method and device, computer device and storage medium

By creating master-slave node backups in the target node group and employing mutually exclusive atomic operations and temporary synchronization tables, the problem of low reliability in cloud application archive file storage is solved, achieving highly reliable and flexible archive management.

CN115543919BActive Publication Date: 2026-04-21SHENZHEN CLOUDSKY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN CLOUDSKY TECH CO LTD
Filing Date
2022-11-07
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Traditional methods save users' cloud application archive files at a single point, which is not very reliable and the archive files are easily lost when the storage location is abnormal.

Method used

The files are stored on the master and slave nodes of the target node group to form multiple backups. Mutually exclusive atomic operations are used to ensure that file write and read operations do not occur simultaneously. Temporary synchronization tables are used to synchronize files during abnormal periods, and management nodes are updated and expanded in a timely manner.

Benefits of technology

It improves the reliability and flexibility of file storage, avoids file loss, and ensures the integrity and consistency of retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115543919B_ABST
    Figure CN115543919B_ABST
Patent Text Reader

Abstract

The application relates to an archive processing method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: when an archiving event occurs for a target node group, performing an archive writing operation on the target node group: storing a first archive indicated by the archiving event to a master node in the target node group, and copying the first archive from the master node to a slave node in the target node group; when a read archive event occurs for the target node group, performing an archive reading operation: selecting a target node in a normal working state from the master node and the slave node in the target node group, and reading a second archive indicated by the read archive event from the target node; wherein the archive writing operation and the archive reading operation are mutually exclusive atomic operations. The method can improve the reliability of archive storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of archival technology, and in particular to an archival processing method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the development of computer technology, cloud applications have become a reality. Cloud applications are installed and run on servers. The server communicates with local terminals, receiving remote operations from users via their local terminals, running the cloud applications, and transmitting the screens and data generated by the cloud applications back to the local terminals. Users remotely log in to the cloud applications on the server via their local terminals. During the user's use of the cloud applications, a user's cloud application archive file is generated. To provide a good user experience, this archive file needs to be saved. Typically, the user's cloud application archive file is stored in a single storage location. Each time the user logs in to the cloud application, they can retrieve the previous cloud application archive file from this storage location, allowing them to continue using the cloud application based on their previous archive file.

[0003] However, traditional methods save users' cloud application archive files at a single point, which means that the archive files will be lost when the storage location is abnormal, resulting in low storage reliability. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve storage reliability in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a method for processing archives. The method includes:

[0006] When an archive event occurs for a target node group, a file write operation is performed on the target node group for the first file indicated by the archive event; the file write operation includes: storing the first file on the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group;

[0007] When a read event occurs for the target node group, a file read operation is performed to read the second file indicated by the read event from the target node group; the file read operation includes: selecting a target node in normal working condition from the master node and slave node in the target node group, and reading the second file from the target node; wherein, the file write operation and the file read operation are mutually exclusive atomic operations.

[0008] In one embodiment, the method further includes:

[0009] Retrieve the pre-configured file type for the target node group;

[0010] Periodically query the temporary storage nodes of the temporary storage cloud application for updated files; the updated files belong to the file type and have not yet been stored by the target node group;

[0011] When the updated file is found, an archive event is triggered for the target node group.

[0012] In one embodiment, the method further includes:

[0013] When any node in the target node group malfunctions, the malfunctioning node stops working, and a first temporary synchronization table is created for the malfunctioning node.

[0014] Whenever a master node in the target node group writes a file, a record to be synchronized for the written file is added to the first temporary synchronization table in sequence until the first temporary synchronization table is deactivated.

[0015] Once the abnormal node recovers, the records to be synchronized in the first temporary synchronization table are replayed sequentially to store the files written to the master node to the recovered node. The first temporary synchronization table is then deactivated when all the records to be synchronized in the first temporary synchronization table have been replayed.

[0016] In one embodiment, the method further includes:

[0017] When the master node in the target node group malfunctions, a slave node that is in normal working condition is selected from the slave nodes in the target node group, and the selected slave node is updated to become the master node of the target node group.

[0018] In one embodiment, the method further includes:

[0019] When a slave node in the target node group becomes abnormal, the abnormal node is removed from the target node group.

[0020] Once the abnormal node recovers, the recovered node will be rejoined as a slave node in the target node group.

[0021] In one embodiment, the method further includes:

[0022] In response to a new node event for the target node group, file synchronization is performed on the new node indicated by the new node event; the file synchronization includes:

[0023] Create a full synchronization table corresponding to the target node group, and add a record of the file currently stored by the master node to the full synchronization table;

[0024] Create a second temporary synchronization table corresponding to the new node indicated by the new node event. Whenever the master node in the target node group writes a file, add a record to be synchronized for the written file to the second temporary synchronization table in turn, until the second temporary synchronization table is deactivated.

[0025] After storing the files recorded in the full synchronization table into the new node, the files to be synchronized in the second temporary synchronization table are replayed in sequence to store the files written to the master node into the new node. The second temporary synchronization table is then deactivated when the replay of the files to be synchronized in the second temporary synchronization table is completed.

[0026] In one embodiment, the method further includes:

[0027] In response to the expansion event of the target node group, a new node is added to the target node group. After synchronizing the files for the new node, the master node and slave node in the target node group are deactivated, and the new node is updated to be the master node of the target node group.

[0028] Add a new node to the target node group, synchronize the files for the newly added node, and then make the newly added node a slave node of the target node group.

[0029] Secondly, this application also provides a document processing apparatus. The apparatus includes:

[0030] The file writing module is used to perform a file writing operation on a first file indicated by the archive event in the target node group when an archive event occurs for the target node group; the file writing operation includes: storing the first file on the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group.

[0031] The file reading module is used to perform a file reading operation to read the second file indicated by the file reading event from the target node group when a file reading event occurs for the target node group; the file reading operation includes: selecting a target node in normal working state from the master node and slave node in the target node group, and reading the second file from the target node; wherein the file writing operation and the file reading operation are mutually exclusive atomic operations.

[0032] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0033] When an archive event occurs for a target node group, a file write operation is performed on the target node group for the first file indicated by the archive event; the file write operation includes: storing the first file on the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group;

[0034] When a read event occurs for the target node group, a file read operation is performed to read the second file indicated by the read event from the target node group; the file read operation includes: selecting a target node in normal working condition from the master node and slave node in the target node group, and reading the second file from the target node; wherein, the file write operation and the file read operation are mutually exclusive atomic operations.

[0035] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0036] When an archive event occurs for a target node group, a file write operation is performed on the target node group for the first file indicated by the archive event; the file write operation includes: storing the first file on the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group;

[0037] When a read event occurs for the target node group, a file read operation is performed to read the second file indicated by the read event from the target node group; the file read operation includes: selecting a target node in normal working condition from the master node and slave node in the target node group, and reading the second file from the target node; wherein, the file write operation and the file read operation are mutually exclusive atomic operations.

[0038] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0039] When an archive event occurs for a target node group, a file write operation is performed on the target node group for the first file indicated by the archive event; the file write operation includes: storing the first file on the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group;

[0040] When a read event occurs for the target node group, a file read operation is performed to read the second file indicated by the read event from the target node group; the file read operation includes: selecting a target node in normal working condition from the master node and slave node in the target node group, and reading the second file from the target node; wherein, the file write operation and the file read operation are mutually exclusive atomic operations.

[0041] The aforementioned file processing methods, devices, computer equipment, storage media, and computer program products store files on the master and slave nodes of the target node group, forming multiple file backups, resulting in high file storage reliability. Moreover, any node in the target node group that is in a normal state can act as a target node to provide file reading services, offering high flexibility. File write and file read operations in the target node group are mutually exclusive atomic operations, meaning that file write and file read operations will not occur simultaneously, avoiding incomplete file reading and improving the reliability of file storage and retrieval. Attached Figure Description

[0042] Figure 1 This is a diagram illustrating the application environment of a file processing method in one embodiment;

[0043] Figure 2 This is a flowchart illustrating a file processing method in one embodiment;

[0044] Figure 3 This is a flowchart illustrating the steps for processing abnormal nodes in a target node group in one embodiment.

[0045] Figure 4 This is a flowchart illustrating the file synchronization steps in one embodiment;

[0046] Figure 5 This is a schematic diagram illustrating the interaction relationship between the temporary storage node set and the node group set in one embodiment;

[0047] Figure 6 This is a structural block diagram of the file processing device in one embodiment;

[0048] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0050] The file processing method provided in this application embodiment can be applied to, for example, Figure 1The application environment is shown. The file processing method runs on computer device 102 and has access to at least one node group, where the target node group is one of the at least one node group. The node group can be deployed on computer device 102 or on another computer device accessible to computer device 102. A node group is a collection of at least two nodes, including a master node and at least one slave node. A node is a communication endpoint within the node group and can be a virtual program or a physical device. A node can directly store data or store data on a storage device mapped to that node. Computer device 102 communicates with temporary storage node 104 or cloud host 106 via a network. In response to an archive event triggered by temporary storage node 104, computer device 102 can instruct the master node and slave nodes to perform their respective file writing operations; in response to a read event triggered by temporary storage node 104 or cloud host 106, computer device 102 can instruct the target node selected from the master node or slave nodes to perform file reading operations.

[0051] In this context, computer device 102 can be a terminal, such as a desktop computer, laptop, smartphone, or tablet; computer device 102 can be a server, implemented using a standalone server or a server cluster composed of multiple servers; computer device 102 can also be a virtual host, virtualized through a standalone server or server cluster. Temporary storage node 104 can be a terminal, a server, or a virtual host. Cloud host 106 can be a virtual host or a server. Storage devices are various devices capable of storing information, such as disks and disk arrays.

[0052] In one embodiment, such as Figure 2 As shown, a file processing method is provided. This embodiment applies this method to... Figure 1 Taking computer device 102 as an example, the method includes the following steps:

[0053] Step 202: When an archive event occurs for the target node group, perform a file write operation on the first file indicated by the archive event in the target node group; the file write operation includes: storing the first file on the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group.

[0054] The target node group is the group of nodes targeted during the implementation of this method. The target node group includes master nodes and slave nodes. The master node is the primary node in the target node group. Slave nodes are subordinate nodes in the target node group. In this embodiment, the difference between the master node and slave nodes is that when an archive event is triggered in the target node group, the master node is the first node to write the archive, and the slave nodes copy the archive from the master node. Each node in the target node group is independent of the others.

[0055] A file is a record of a state created during computer software operation that needs to be stored and subsequently reproduced by reading the file. It can be a game save or an office software save. A save event is an event that stores a file. The first file is the file that needs to be stored when a save event is triggered, and it is distinct from the file that needs to be read when a read event is triggered in subsequent step 204. A file write operation is the operation of storing a file by the target node group.

[0056] In one embodiment, the computer device may obtain a file type pre-configured for a target node group, and in response to a file addition event on a temporary storage node, query the files indicated by the file addition event for a file that matches the file type pre-configured for the target node group, and trigger an archive event for the target node group when a matching file is found.

[0057] In one embodiment, a temporary storage node may, in response to a file generation event triggered by a cloud host, generate the file indicated by the file generation event, obtain the file type pre-configured for the target node group, and determine whether the generated file belongs to the file type pre-configured for the target node group. If the generated file belongs to the file type pre-configured for the target node group, and no node in the target node group provides file read or write functionality, an archive event for the target node group is triggered. The temporary storage node may communicate with the cloud host.

[0058] In one embodiment, the computer device may, in response to an archive event for a target node group, determine whether the target node group is performing a file write operation or a file read operation. If the target node group is not performing a file write operation or a file read operation, the computer device may perform a file write operation on the first file indicated by the archive event in the target node group.

[0059] In one embodiment, when there are multiple slave nodes in the target node group, the computer device can copy the first file from the master node to multiple slave nodes in the target node group simultaneously after the first file has been stored on the master node.

[0060] Step 204: When a file read event occurs for the target node group, execute the file read operation of the second file indicated by the file read event of the target node group; the file read operation includes: selecting a target node in normal working state from the master node and slave node in the target node group, and reading the second file from the target node; wherein, the file write operation and the file read operation are mutually exclusive atomic operations.

[0061] Here, a file read event refers to an event that reads a file. The second file is the file that needs to be read when the file read event is triggered, and it is distinct from the file that needs to be stored when the save event is triggered in step 202. A file read operation is an operation that reads a file from the target node group. Mutual exclusion means that file write operations and file read operations cannot be performed simultaneously. An atomic operation is an operation that cannot be interrupted by the thread scheduling mechanism. Once an atomic operation begins, it will not be interrupted and will continue to run until it ends.

[0062] In one embodiment, if neither a file write operation nor a file read operation is performed on the target node group, the temporary storage node may, in response to a file read event triggered by the cloud host for the target node group, perform a file read operation on the second file indicated by the file read event for the target node group.

[0063] In one embodiment, if neither a file write operation nor a file read operation is performed on the target node group, the cloud host may, in response to a file read event for the target node group triggered by a terminal through a remote network operation, perform a file read operation on the second file indicated by the file read event for the target node group.

[0064] In one embodiment, the computer device may, in response to a read event for a target node group, detect the working status of the master node and slave node in the target node group, determine the master node and slave node that are in normal working status, and randomly select a node from the master node and slave node that are in normal working status as the target node.

[0065] In one embodiment, a computer device can determine the storage location of a second file using index information, and then read the second file from that storage location in the target node. The index information is a record that enables quick retrieval of files; for example, it could be a record representing a file number or a record representing the storage location of a file.

[0066] In the above file processing method, files are stored on the master and slave nodes of the target node group, forming multiple file backups, resulting in high file storage reliability. Moreover, any node in the target node group that is in a normal state can act as a target node to provide file reading services, providing high flexibility. File write and file read operations in the target node group are mutually exclusive atomic operations, and file write and file read operations will not be performed simultaneously, avoiding incomplete file reading and improving the reliability of file storage and reading.

[0067] In one embodiment, the above-described file processing method further includes a step of periodically querying updated files from temporary storage nodes according to the file types pre-configured for the target node group to trigger an archiving event. This step specifically includes: obtaining the file types pre-configured for the target node group; periodically querying the temporary storage nodes of the temporary storage cloud application for updated files; the updated files belong to the file type and have not yet been stored by the target node group; and triggering an archiving event for the target node group when the updated files are found.

[0068] The archive type refers to the different categories of archives classified according to certain criteria. These criteria could be based on the geographical location of the archives or the cloud application to which they belong. A cloud application is software installed and running on a server. Temporary storage nodes are used to mount the cloud application to the cloud host when it starts and to unmount it when the cloud application is shut down. "Periodic" can refer to a preset time interval or a dynamically changing cycle.

[0069] In one embodiment, a temporary storage node can generate a quick lookup table for the stored cloud application files. This quick lookup table records the file number, file type, and archive record of the file. The archive record indicates whether the corresponding file has been archived to the node group. In this embodiment, the computer device can periodically filter files from the quick lookup table of the temporary storage node. When a file belonging to a pre-configured file type of the target node group is found and the archive record is for a file not yet archived to the node group, an archive event for the target node group is triggered.

[0070] In one embodiment, when a computer device queries an updated file from a temporary storage node, it can determine the file that has appeared in the temporary storage node since the last query, traverse the newly appeared file, determine whether the traversed file belongs to the file type and has not yet been stored by the target node group, and trigger an archive event for the target node group when the traversed file belongs to the file type and has not yet been stored by the target node group.

[0071] In this embodiment, the files in the temporary storage nodes are queried periodically to identify the updated files that need to be stored in the target node group, thereby timely storing the files as multiple backups and improving the reliability of file storage. Moreover, the target node group stores files of pre-configured file types, which can realize file distribution and avoid resource waste caused by uneven utilization of storage resources in each node group, thereby improving the reliability of file storage.

[0072] In one embodiment, such as Figure 3As shown, the above-described file processing method further includes a step of processing abnormal nodes in the target node group. Specifically, this step creates a first temporary synchronization table for any node in the target node group that experiences an anomaly, records the files written to the master node during the anomaly period, and synchronizes the files written to the master node during the anomaly period after the abnormal node recovers. In one embodiment, this step of processing abnormal nodes in the target node group specifically includes steps 302 to 306 as described below.

[0073] Step 302: When any node in the target node group experiences an anomaly, the abnormal node stops working, and a first temporary synchronization table is created for the abnormal node.

[0074] An anomaly refers to a node malfunctioning. Anomalies can be caused by power outages, network connection interruptions, storage device damage, virus infection, or other factors. A temporary synchronization table is a table that temporarily records data written to the master node's archive. The first temporary synchronization table is created for the node experiencing an anomaly, and is distinct from the second temporary synchronization table created for the newly added node when a new node event occurs in the target node group.

[0075] In one embodiment, the computer device may, in response to an archive event or read event for a target node group, detect the working status of the master and slave nodes in the target node group, and if any node in the target node group is detected to be in an abnormal working state, cause the abnormal node to stop working and create a first temporary synchronization table for the abnormal node.

[0076] In one embodiment, the first temporary synchronization table may be a memory table that stores data in the memory of a computer device. In this embodiment, when any node in the target node group malfunctions, the computer device can create a first temporary synchronization table for the malfunctioning node and allocate memory space for the first temporary synchronization table.

[0077] Step 304: Whenever a master node in the target node group writes a file, add a record to be synchronized for the written file to the first temporary synchronization table in sequence until the first temporary synchronization table is deactivated.

[0078] Among them, the records to be synchronized are the records of the archives to be synchronized in the temporary synchronization table, which can represent the archive number, the storage location of the archive, or the content recorded in the archive itself.

[0079] In one embodiment, the computer device may record the time of anomaly of an abnormal node. From the time of anomaly, whenever the master node in the target node group writes a file, starting from the first position of the expected addition of the record to be synchronized to the first temporary synchronization table, the record to be synchronized for the written file is added sequentially to consecutive positions in the first temporary synchronization table until the first temporary synchronization table is deactivated.

[0080] In one embodiment, during the period when the abnormal node is in an abnormal working state, whenever the master node in the target node group writes a file, the computer device may randomly select an empty position in the first temporary synchronization table that has not been added with a record to be synchronized, and add a record to be synchronized for the written file to the selected empty position in the first temporary synchronization table, until the first temporary synchronization table is deactivated.

[0081] In one embodiment, if the first temporary synchronization table is a memory table, the computer device may store the records to be synchronized into the memory space corresponding to the first temporary synchronization table.

[0082] Step 306: After the abnormal node recovers, the records to be synchronized in the first temporary synchronization table are replayed in sequence to store the files written to the master node to the recovered node. The first temporary synchronization table is deactivated when the replay of the records to be synchronized in the first temporary synchronization table is completed.

[0083] Playback refers to reproducing the behavior of the synchronized files recorded in the synchronization record.

[0084] In one embodiment, when the abnormal node recovers, the computer device can sequentially replay the records to be synchronized in the first temporary synchronization table. For each record to be synchronized, the file represented by the record to be synchronized is obtained from the file stored in the master node, and the obtained file is stored in the node that has recovered, until all the records to be synchronized in the first temporary synchronization table have been replayed.

[0085] In one embodiment, if the first temporary synchronization table is a memory table, the computer device can clear the record to be synchronized in the first temporary synchronization table and release the memory space occupied by the record to be synchronized when the playback of the record to be synchronized in the first temporary synchronization table is completed.

[0086] In one embodiment, if the first temporary synchronization table is a memory table, the computer device may delete the first temporary synchronization table and release the memory space allocated to the first temporary synchronization table when the playback of the synchronized records in the first temporary synchronization table is complete.

[0087] In this embodiment, a first temporary synchronization table is created for any abnormal node in the target node group to record the files written to the master node during the abnormal period. This allows the node to synchronize the files written to the master node during the abnormal period after it recovers. This ensures that after the recovered node rejoins the target node group, the files stored by the node are the same as those stored by other nodes in the target node group. This ensures the consistency of the files stored by each node in the target node group and further improves the reliability of file reading.

[0088] In one embodiment, the above-mentioned file processing method further includes the following steps: when the master node in the target node group is abnormal, select a slave node that is in normal working condition from the slave nodes in the target node group, and update the selected slave node as the master node of the target node group.

[0089] In this context, "update" refers to changing the role of a node.

[0090] In one embodiment, when the target node group includes at least two slave nodes that are in normal working condition, when the computer device detects an anomaly in the master node of the target node group, it removes the anomaly master node from the target node group, sorts the slave nodes in the target node group that are in normal working condition according to a pre-configured sorting rule, and updates the master node of the target node group with the slave node at the top of the list. The sorting rule can be random sorting or a pre-configured order for each slave node.

[0091] In this embodiment, a new master node is selected when the master node fails, so that the target node group always includes a master node, thereby creating conditions for performing file write operations in the target node group and improving the reliability of file storage.

[0092] In one embodiment, the above-mentioned file processing method further includes the following steps: when a slave node in the target node group becomes abnormal, the abnormal node is removed from the target node group; when the abnormal node recovers, the recovered node is re-added to the target node group as a slave node.

[0093] "Removal" means that abnormal nodes are no longer included in the target node group to provide file writing or file reading services. "Restoration" means that the abnormality of the node has been resolved and it can be added to the target node group to provide file writing or file reading services.

[0094] In one embodiment, when an abnormal node in the target node group recovers to normal, the recovered node can send a recovery signal to the computer device. After receiving the recovery signal, the computer device will re-add the recovered node to the target node group as a slave node.

[0095] In one embodiment, the computer device can periodically detect whether an abnormal node in the target node group has recovered from the time of the abnormality. If the abnormal node is detected to have recovered, the recovered node is re-added to the target node group as a slave node.

[0096] In this embodiment, when a slave node in the target node group malfunctions, the malfunctioning node is removed from the target node group to prevent errors when the target node group provides services due to the malfunctioning node's inability to provide services. Furthermore, the restored node is re-added to the target node group as a slave node, enabling the restored node to resume providing services and making full use of node resources.

[0097] In one embodiment, the file processing method further includes a step of synchronizing files for the newly added node indicated by the newly added node event in response to a newly added node event for the target node group, wherein the newly added node event is an event that adds a new node to the target node group. The newly added node event can be a manually triggered operation or an automatically triggered event. A manually triggered operation is such as clicking the newly added node function key for the target node group. An automatically triggered event can be when an abnormal node in the target node group has been in an abnormal state for more than a preset duration, or when the number of nodes in the target node group in a normal state is less than or equal to a preset number, or when a newly connected storage device is detected, or when a capacity expansion event occurs for the target node group.

[0098] In one embodiment, such as Figure 4 As shown, file synchronization specifically includes the following steps 402 to 406.

[0099] Step 402: Create a full synchronization table corresponding to the target node group, and add a record of the file currently stored by the master node to the full synchronization table.

[0100] The full synchronization table records the files stored on the master node before the occurrence of a new node event.

[0101] In one embodiment, the computer device can determine the files currently stored on the master node and add a record of the determined files to the full synchronization table.

[0102] In one embodiment, the computer device can determine the time when the new node event occurs, obtain the index information of the files stored by the master node before the time of the new node event, and add a record representing the obtained index information to the full synchronization table.

[0103] In other embodiments, the computer device can determine the time when the new node event occurs, obtain the index information of the files stored by the master node before the time when the new node event occurs, and determine the identifier of the files stored by the master node based on the index information, thereby recording the identifier of the files in the full synchronization table.

[0104] Step 404: Create a second temporary synchronization table corresponding to the new node indicated by the new node event. Whenever the master node in the target node group writes a file, add the record to be synchronized for the written file to the second temporary synchronization table in turn, until the second temporary synchronization table is deactivated.

[0105] The second temporary synchronization table is a temporary synchronization table corresponding to the newly added node indicated by the new node event, and is distinct from the first temporary synchronization table created for the abnormal node when the above-mentioned node is abnormal.

[0106] In one embodiment, the computer device may record the time of occurrence of a new node event. From the time of occurrence of the event, whenever the master node in the target node group writes a file, starting from the first position of the expected addition of the record to be synchronized to the second temporary synchronization table, the record to be synchronized for the written file is added sequentially to consecutive positions in the second temporary synchronization table until the second temporary synchronization table is deactivated.

[0107] In one embodiment, after a new node event occurs for the target node group, whenever the master node in the target node group writes a file, the computer device may randomly select an empty position in the second temporary synchronization table that has not been added with a record to be synchronized, and add a record to be synchronized for the written file to the selected empty position in the second temporary synchronization table, until the second temporary synchronization table is deactivated.

[0108] In one embodiment, if the second temporary synchronization table is a memory table, the computer device may allocate memory space for the second temporary synchronization table when creating the second temporary synchronization table, and store the records to be synchronized in the memory space corresponding to the second temporary synchronization table.

[0109] Step 406: After storing the files recorded in the full synchronization table to the new node, the files to be synchronized in the second temporary synchronization table are replayed in sequence to store the files written to the master node to the new node. The second temporary synchronization table is then deactivated when the replay of the files to be synchronized in the second temporary synchronization table is completed.

[0110] In one embodiment, a computer device may retrieve all files represented by records in a full synchronization table from a master node, and store the retrieved files in a newly added node.

[0111] In one embodiment, after storing the files recorded in the full synchronization table to the new node, the computer device can sequentially replay the records to be synchronized in the second temporary synchronization table. For each record to be synchronized that is replayed, the file represented by the replayed record to be synchronized is obtained from the files stored in the master node, and the obtained file is stored in the new node. The second temporary synchronization table is deactivated when the replay of the records to be synchronized in the second temporary synchronization table is completed.

[0112] In one embodiment, if the second temporary synchronization table is a memory table, the computer device can clear the record to be synchronized in the second temporary synchronization table and release the memory space occupied by the record to be synchronized when the playback of the record to be synchronized in the second temporary synchronization table is completed.

[0113] In one embodiment, if the second temporary synchronization table is a memory table, the computer device can delete the second temporary synchronization table and release the memory space allocated to the second temporary synchronization table when the playback of the synchronized records in the second temporary synchronization table is complete.

[0114] In this embodiment, when a new node is added to the target node group, the files currently stored by the master node are stored in the new node through a full synchronization table, so that the new node stores the files stored by other nodes in the target node group before the time of addition; and, the files written to the master node from the time of addition to the end of the file synchronization of the new node are recorded through a second temporary synchronization table, so that the files stored by the new node are the same as the files stored by other nodes in the target node group when the file synchronization ends, ensuring the consistency of the files stored by each node in the target node group, thereby improving the reliability of file reading.

[0115] In one embodiment, the above-mentioned file processing method further includes the step of updating the newly added node to the target node group after file synchronization in response to an expansion event for the target node group, and adding another node to add a slave node. This step specifically includes: in response to an expansion event for the target node group, adding a node to the target node group; after synchronizing the file for the newly added node, deactivating the master node and slave node in the target node group, and updating the newly added node to the master node of the target node group; adding another node to the target node group; after synchronizing the file for the newly added node, making the newly added node a slave node of the target node group.

[0116] Among them, the expansion event is an event that increases the storage capacity of the target node group. The expansion event can be a manually triggered operation or an automatically triggered event. A manual triggering operation can be clicking the expansion function key for the target node group. An automatically triggered event can be when the target node group meets preset conditions. These preset conditions can be that the percentage of stored data on any node in the target node group reaches a preset percentage, or that the amount of stored data on any node in the target node group reaches a preset amount.

[0117] To expand capacity, new nodes are added to the target node group. These can be nodes from newly connected storage devices or nodes that have been deactivated from an existing node group. The storage devices corresponding to deactivated nodes can be formatted and then reused.

[0118] In one embodiment, the computer device may perform steps 402 to 406 on the newly added node, add the newly added node to the target node group, remove the master node and slave node in the target node group from the target node group, and update the newly added node as the master node of the target node group.

[0119] In this embodiment, by adding a new node to the target node group and storing the files currently stored in the target node group to the new node, a node with a larger storage capacity can be added to the target node group. The files stored by the original master node and slave node in the target node group are fully synchronized in the new node, ensuring that the files are not lost. The new node is used as the new master node in the target node group. Then, new nodes are added to add new slave nodes. After the new slave nodes are added to the target node group, the target node group can be expanded, avoiding the problem of insufficient storage space in the target node group causing the inability to store files, thereby improving the reliability of file storage.

[0120] In one embodiment, a specific application scenario of the file processing method is provided, such as... Figure 5 The diagram illustrates the interaction between the temporary storage node set and the node group set. Temporary storage nodes belong to the temporary storage node set, and the target node group belongs to the node group set. Each temporary storage node in the temporary storage node set can communicate with each node group in the node group set. The node group set can be deployed on a computer device, and temporary storage nodes can communicate with each node group in the node group set through the computer device. Temporary storage nodes can be mounted on a cloud host to store cloud game files. The cloud host can run cloud games, and users can remotely operate the cloud host through a terminal and log in to the cloud game on the cloud host using their game account. The cloud host can also communicate with each node group in the node group set through the computer device.

[0121] The cloud server can respond to a user's login operation to a cloud game on the cloud server using a game account, triggering a read event for the target node group, mounting a temporary storage node to the cloud server, and selecting a target node in normal working condition from the master and slave nodes in the target node group that stores the cloud game's files, and reading the files corresponding to the game account and the cloud game from the target node.

[0122] The cloud server can respond to users storing cloud game files on the cloud server through their game accounts, storing the game files of the game account during the current login to the cloud game in the temporary storage node; when the game account logs out of the cloud game, the temporary storage node is unmounted to the cloud server.

[0123] The computer device can periodically filter the cloud game's files from a quick lookup table of temporary storage nodes; when a file belonging to the cloud game that has not yet been stored by the target node group is found, an save event for the target node group is triggered. In response to the save event for the target node group, the computer device can store the cloud game's file indicated by the save event to the master node in the target node group, and then simultaneously replicate it from the master node to multiple slave nodes in the target node group.

[0124] When a read or save event occurs for a target node group, the computer device can detect the working status of the master and slave nodes in the target node group. If an abnormality is detected in the master node of the target node group, the abnormal master node stops working, is removed from the target node group, and a slave node in normal working condition is selected from the slave nodes of the target node group and updated as the master node of the target node group; if an abnormality is detected in the slave node of the target node group, the abnormal slave node stops working, and is removed from the target node group.

[0125] When any node in the target node group, whether a master or slave, experiences an anomaly, the computer device creates a first temporary synchronization table for the anomaly node. Whenever a master node in the target node group writes a file, a record to be synchronized for the written file is added to the first temporary synchronization table in sequence until the first temporary synchronization table is deactivated. When the anomaly node recovers, the records to be synchronized in the first temporary synchronization table are replayed in sequence to store the file written to the master node to the recovered node. This process continues until all records to be synchronized in the first temporary synchronization table have been replayed. At this point, the first temporary synchronization table is deactivated, and the recovered node is rejoined as a slave node in the target node group.

[0126] The computer device can respond to a new node event for a target node group and perform file synchronization on the new node indicated by the new node event. File synchronization includes: creating a full synchronization table corresponding to the target node group, adding records of the files currently stored by the master node to the full synchronization table; creating a second temporary synchronization table corresponding to the new node indicated by the new node event, and whenever the master node in the target node group writes a file, sequentially adding records to be synchronized for the written file to the second temporary synchronization table until the second temporary synchronization table is deactivated; after storing the files recorded in the full synchronization table to the new node, sequentially replaying the records to be synchronized in the second temporary synchronization table to store the files written to the master node to the new node, until the records to be synchronized in the second temporary synchronization table have been replayed, and then deactivating the second temporary synchronization table.

[0127] The computer device can respond to an expansion event for a target node group by adding a new node to the target node group, synchronizing the files of the new node, disabling the master and slave nodes in the target node group, and updating the new node to the master node of the target node group; if a new node is added to the target node group again, synchronizing the files of the newly added node, and then making the newly added node a slave node of the target node group.

[0128] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0129] Based on the same inventive concept, this application also provides an archive processing apparatus for implementing the archive processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more archive processing apparatus embodiments provided below can be found in the limitations of the archive processing method described above, and will not be repeated here.

[0130] In one embodiment, such as Figure 6 As shown, a file processing device 600 is provided, including: a file writing module 610 and a file reading module 620, wherein:

[0131] The file writing module 610 is used to perform a file writing operation on the first file indicated by the archive event in the target node group when an archive event occurs for the target node group; the file writing operation includes: storing the first file in the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group.

[0132] The file reading module 620 is used to perform a file reading operation on the second file indicated by the file reading event for the target node group when a file reading event for the target node group occurs. The file reading operation includes: selecting a target node in normal working condition from the master node and slave nodes in the target node group, and reading the second file from the target node. The file writing operation and the file reading operation are mutually exclusive atomic operations.

[0133] In one embodiment, the file writing module 610 is further configured to obtain the file type pre-configured for the target node group; periodically query the temporary storage nodes of the temporary storage cloud application for updated files; the updated file belongs to the file type and has not yet been stored by the target node group; when the updated file is found, an archive event is triggered for the target node group.

[0134] In one embodiment, the file processing device 600 further includes an abnormal node recovery module. The abnormal node recovery module is used to create a first temporary synchronization table for abnormal nodes when any node in the target node group becomes abnormal and stops working. Whenever a master node in the target node group writes a file, it sequentially adds a record to be synchronized for the written file to the first temporary synchronization table until the first temporary synchronization table is deactivated. When the abnormal node recovers, it sequentially replays the records to be synchronized in the first temporary synchronization table to store the file written to the master node to the recovered node until the records to be synchronized in the first temporary synchronization table have been replayed, and then deactivates the first temporary synchronization table.

[0135] In one embodiment, the abnormal node recovery module is further configured to, when the master node in the target node group becomes abnormal, select a slave node that is in normal working condition from the slave nodes in the target node group and update the selected slave node as the master node of the target node group.

[0136] In one embodiment, the abnormal node recovery module is further configured to remove the abnormal node from the target node group when an abnormal slave node in the target node group becomes abnormal; and to re-add the normal node as a slave node to the target node group after the abnormal node recovers.

[0137] In one embodiment, the file processing device 600 further includes a node addition module, which is used to synchronize files for the newly added node indicated by the newly added node event in response to a newly added node event for a target node group. The file synchronization includes: creating a full synchronization table corresponding to the target node group, adding records of files currently stored by the master node to the full synchronization table; creating a second temporary synchronization table corresponding to the newly added node indicated by the newly added node event, and whenever a file is written to the master node in the target node group, adding records to be synchronized for the written file to the second temporary synchronization table in sequence until the second temporary synchronization table is deactivated; after storing the files recorded in the full synchronization table to the newly added node, replaying the records to be synchronized in the second temporary synchronization table in sequence to store the files written to the master node to the newly added node, until the records to be synchronized in the second temporary synchronization table are replayed, and then deactivating the second temporary synchronization table.

[0138] In one embodiment, the node addition module is further configured to respond to an expansion event for the target node group by adding a node to the target node group, synchronizing the files of the added node, disabling the master and slave nodes in the target node group, and updating the added node as the master node of the target node group; and adding another node to the target node group, synchronizing the files of the newly added node, and making the newly added node a slave node of the target node group.

[0139] The aforementioned file processing device stores files on the master and slave nodes of the target node group, forming multiple file backups, resulting in high file storage reliability. Furthermore, any node in the target node group that is in a normal state can act as a target node to provide file reading services, offering high flexibility. File write and file read operations in the target node group are mutually exclusive atomic operations, meaning that file write and file read operations will not occur simultaneously, preventing incomplete file readings and improving the reliability of file storage and retrieval.

[0140] Each module in the aforementioned file processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0141] In one embodiment, a computer device is provided, which may be a terminal, a server, or a virtual host, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores files required for executing the file processing method. The I / O interfaces allow the processor to exchange information with external devices. The communication interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a file processing method.

[0142] Those skilled in the art will understand that Figure 7The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0143] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0144] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0145] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0147] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0148] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0149] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for processing archives, characterized in that, The method includes: When an archive event occurs for a target node group, a file write operation is performed on the target node group for the first file indicated by the archive event; the file write operation includes: storing the first file on the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group; When a read event occurs for the target node group, a file read operation is performed to read the second file indicated by the read event from the target node group; the file read operation includes: selecting a target node in normal working condition from the master node and slave node in the target node group, and reading the second file from the target node; wherein, the file write operation and the file read operation are mutually exclusive atomic operations; When any node in the target node group malfunctions, the malfunctioning node stops working, and a first temporary synchronization table is created for the malfunctioning node. Whenever a master node in the target node group writes a file, a record to be synchronized for the written file is added to the first temporary synchronization table in sequence until the first temporary synchronization table is deactivated. Once the abnormal node recovers, the records to be synchronized in the first temporary synchronization table are replayed sequentially to store the files written to the master node to the recovered node. The first temporary synchronization table is then deactivated when all the records to be synchronized in the first temporary synchronization table have been replayed.

2. The method according to claim 1, characterized in that, The method further includes: Retrieve the pre-configured file type for the target node group; Periodically query the temporary storage nodes of the temporary storage cloud application for updated files; the updated files belong to the file type and have not yet been stored by the target node group; When the updated file is found, an archive event is triggered for the target node group.

3. The method according to claim 1, characterized in that, The method further includes: When the master node in the target node group malfunctions, a slave node that is in normal working condition is selected from the slave nodes in the target node group, and the selected slave node is updated to become the master node of the target node group.

4. The method according to claim 1, characterized in that, The method further includes: When a slave node in the target node group becomes abnormal, the abnormal node is removed from the target node group. Once the abnormal node recovers, the recovered node will be rejoined as a slave node in the target node group.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: In response to a new node event for the target node group, file synchronization is performed on the new node indicated by the new node event; the file synchronization includes: Create a full synchronization table corresponding to the target node group, and add a record of the file currently stored by the master node to the full synchronization table; Create a second temporary synchronization table corresponding to the new node indicated by the new node event. Whenever the master node in the target node group writes a file, add a record to be synchronized for the written file to the second temporary synchronization table in turn, until the second temporary synchronization table is deactivated. After storing the files recorded in the full synchronization table into the new node, the files to be synchronized in the second temporary synchronization table are replayed in sequence to store the files written to the master node into the new node. The second temporary synchronization table is then deactivated when the replay of the files to be synchronized in the second temporary synchronization table is completed.

6. The method according to claim 5, characterized in that, The method further includes: In response to the expansion event of the target node group, a new node is added to the target node group. After synchronizing the files for the new node, the master node and slave node in the target node group are deactivated, and the new node is updated to be the master node of the target node group. Add a new node to the target node group, synchronize the files for the newly added node, and then make the newly added node a slave node of the target node group.

7. A file processing device, characterized in that, The device includes: The file writing module is used to perform a file writing operation on a first file indicated by the archive event in the target node group when an archive event occurs for the target node group; the file writing operation includes: storing the first file on the master node in the target node group, and then copying the first file from the master node to the slave node in the target node group. The file reading module is used to perform a file reading operation to read the second file indicated by the file reading event from the target node group when a file reading event occurs for the target node group; the file reading operation includes: selecting a target node in normal working condition from the master node and slave nodes in the target node group, and reading the second file from the target node; wherein the file writing operation and the file reading operation are mutually exclusive atomic operations; The abnormal node recovery module is used to create a first temporary synchronization table for any abnormal node in the target node group when the abnormal node stops working; whenever the master node in the target node group writes a file, it sequentially adds a record to be synchronized for the written file to the first temporary synchronization table until the first temporary synchronization table is deactivated; when the abnormal node recovers, it sequentially replays the records to be synchronized in the first temporary synchronization table to store the file written to the master node to the recovered node, until the records to be synchronized in the first temporary synchronization table have been replayed, and then deactivates the first temporary synchronization table.

8. The apparatus according to claim 7, characterized in that, The file writing module is also used to obtain the file type pre-configured for the target node group; periodically query the temporary storage nodes of the temporary storage cloud application for updated files; the updated files belong to the file type and have not yet been stored by the target node group; When the updated file is found, an archive event is triggered for the target node group.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for managing and switching high availability multi-machine backup routing table

    CN102938705A

  • Method and device for processing transaction in block chain

    CN112199204A