Data maintenance method, electronic device and computer readable medium
By building a hybrid cloud storage cluster and using the collaborative work of cloud virtual devices and edge storage devices, the problems of insufficient computing power, limited storage capacity and poor reliability of NAS devices are solved, and efficient user data maintenance and reliable file access are achieved.
Patent Information
- Application Number
- CN202510840066.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-06-23
AI Technical Summary
Existing user data storage methods such as NAS devices have problems such as poor computing power, limited storage capacity and poor reliability, which are difficult to meet the needs of large-scale computing applications and data security.
Build a hybrid cloud storage cluster, including cloud virtual devices and multiple edge storage devices. By receiving and cache file metadata reporting messages, verifying abnormal situations of edge storage devices, dynamically updating file metadata tables, ensuring reliable file access and storage, and supporting capacity expansion and reduction of edge storage devices.
It improves the computing power and storage capacity of storage devices, realizes elastic expansion of storage pools, improves the reliability and security of user data, and can recover file metadata when edge storage devices are abnormal.
Smart Images

Figure CN120353408B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular, to a data maintenance method, an electronic device, and a computer-readable medium. Background Art
[0002] A common method for storing user data is to save it to the cloud, for example, by using a cloud storage service or building a custom cloud storage system based on a cloud host. For privacy and security reasons, some users choose to store their data on Network Attached Storage (NAS) devices. However, NAS devices still have issues such as poor computing power, limited storage capacity, and poor reliability.
[0003] Therefore, there is an urgent need for a better way to store user data. Summary of the Invention
[0004] The present application aims to solve one of the technical problems in the related art to a certain extent. To this end, the present application provides a data maintenance method, an electronic device and a computer-readable medium.
[0005] As a first aspect of the present application, a data maintenance method for a cloud virtual device is provided, wherein the cloud virtual device and multiple edge storage devices belong to a storage cluster, and the method includes:
[0006] Receive and cache a file metadata reporting message sent by a first edge storage device; wherein the first edge storage device is one of the multiple edge storage devices, and the file metadata reporting message is cached and sent by the first edge storage device after storing the file uploaded by the user device;
[0007] Verify, based on the current message unique identifier carried in the file metadata reporting message, whether the first edge storage device has a file metadata reporting exception;
[0008] When it is verified that there is no file metadata reporting exception on the first edge storage device, updating the locally maintained file metadata table according to the file metadata carried in the file metadata reporting message;
[0009] When it is verified that the first edge storage device has a file metadata reporting anomaly, re-obtain a file metadata reporting message from the first edge storage device, and update a locally maintained file metadata table according to the file metadata carried in the re-obtained file metadata reporting message;
[0010] Processing the file access request message sent by the user equipment according to the file metadata table.
[0011] Optionally, verifying whether the first edge storage device has a file metadata reporting exception according to the current message unique identifier carried in the file metadata reporting message includes:
[0012] Compare the current message unique identifier with the historical message unique identifier carried in the file metadata reporting message last sent by the first edge storage device;
[0013] If the current message unique identifier is continuous with the historical message unique identifier, verifying that no file metadata reporting exception occurs on the first edge storage device;
[0014] When the current message unique identifier is discontinuous with the historical message unique identifier, it is verified that a file metadata reporting exception exists in the first edge storage device.
[0015] Optionally, when verifying that the first edge storage device has a file metadata reporting exception, re-obtaining a file metadata reporting message from the first edge storage device includes:
[0016] When it is verified that the first edge storage device has a file metadata reporting exception, sending a re-reporting instruction message carrying the unique identifier of the historical message to the first edge storage device;
[0017] Receive the file metadata reporting message resent by the first edge storage device according to the re-reporting indication message; wherein, the first edge storage device also deletes the file metadata reporting message whose message unique identifier is located before the historical message unique identifier according to the re-reporting indication message.
[0018] Optionally, after receiving and caching the file metadata reporting message sent by the first edge storage device and before processing the file interaction request sent by the user device according to the file metadata table, the method further includes:
[0019] When a preset verification period is reached, sending an exception query message carrying the current message unique identifier to the first edge storage device;
[0020] Receiving a file metadata reporting message supplemented by the first edge storage device according to the abnormality reporting query message; wherein the first edge storage device further deletes the file metadata reporting message having a message unique identifier located before the current message unique identifier according to the abnormality reporting query message;
[0021] The locally maintained file metadata table is updated according to the file metadata carried in the supplementary file metadata reporting message.
[0022] Optionally, the file metadata table includes a correspondence between an edge storage device and file metadata of files stored therein, and the method further includes:
[0023] receiving a file backup request message sent by the user equipment, and obtaining a file identifier of a file to be backed up carried therein;
[0024] Querying the file metadata table according to the file identifier to determine the second edge storage device storing the file to be backed up;
[0025] Determining a third edge storage device for backup from the storage cluster;
[0026] Backing up the to-be-backed-up files stored in the second edge storage device to the third edge storage device;
[0027] Record a file backup relationship between the second edge storage device and the third edge storage device regarding the file to be backed up.
[0028] Optionally, the second edge storage device includes an edge storage device to be migrated, the edge storage device to be migrated is determined from the multiple edge storage devices based on preset migration conditions, and the files to be backed up include all files stored in the edge storage device to be migrated.
[0029] Optionally, the file metadata table includes a device identifier, file access information, file permissions, and file metadata of the edge storage device, the file metadata includes a file tag, and processing the file access request message sent by the user device according to the file metadata table includes:
[0030] receiving a file access request message sent by the user equipment, and obtaining a file tag carried therein;
[0031] Querying the file metadata table according to the file tags to determine a list of files to be accessed;
[0032] The list of files to be accessed is sent to the user device, so that the user device selects the target files to be accessed according to the list of files to be accessed and parses the target file access information, and downloads the target files to be accessed from the corresponding edge storage device according to the target file access information.
[0033] As a second aspect of the present application, a data maintenance method for a user equipment is provided, wherein the method includes:
[0034] Upload a file to a first edge storage device; wherein the cloud virtual device and multiple edge storage devices belong to a storage cluster, and the first edge storage device is one of the multiple edge storage devices; after storing the file, the first edge storage device caches and sends a file metadata reporting message to the cloud virtual device; the cloud virtual device verifies whether there is a file metadata reporting exception on the first edge storage device based on the current message unique identifier carried in the file metadata reporting message; if it is verified that there is no file metadata reporting exception on the first edge storage device, the locally maintained file metadata table is updated based on the file metadata carried in the file metadata reporting message; if it is verified that there is a file metadata reporting exception on the first edge storage device, the file metadata reporting message is re-obtained from the first edge storage device and the locally maintained file metadata table is updated based on the file metadata carried in the re-obtained file metadata reporting message;
[0035] A file access request is sent to the cloud virtual device, so that the cloud virtual device processes the file access request message according to the file metadata table.
[0036] As a third aspect of the present application, an electronic device is provided, wherein the electronic device includes:
[0037] one or more processors;
[0038] A memory having one or more computer programs stored thereon, which, when executed by the one or more processors, causes the one or more processors to implement any of the following:
[0039] The data maintenance method for cloud virtual devices provided in the first aspect of this application;
[0040] The second aspect of the present application provides a data maintenance method for user equipment.
[0041] As a fourth aspect of the present application, a computer-readable medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, any of the following is implemented:
[0042] The data maintenance method for cloud virtual devices provided in the first aspect of this application;
[0043] The second aspect of the present application provides a data maintenance method for user equipment.
[0044] By using the data maintenance method for cloud virtual devices provided by the embodiment of the present application, a storage cluster including cloud virtual devices and multiple edge storage devices is constructed to maintain user data, which can significantly improve the computing power of the storage device and is beneficial to the maintenance of user data. By adding and deleting edge storage devices, dynamic expansion capability can be obtained, and elastic expansion and reduction of the storage pool can be achieved, which is beneficial to the reasonable setting of storage capacity. After storing the file uploaded by the user device, the first edge storage device caches and sends a file metadata reporting message to the cloud virtual device. The cloud virtual device verifies whether there is a file metadata reporting anomaly on the first edge storage device based on the current message unique identifier carried in the file metadata reporting message, and then updates the locally maintained file metadata table based on the verification result, ensuring the reliable storage of file metadata of all edge storage devices in the cluster and the reliable processing of file access request messages sent by user devices. In addition, in the case of logical damage scenarios such as abnormal power failure or abnormal crash of the edge storage device, the file metadata of the cloud virtual device can be used to restore the file metadata of the edge storage device, which can further improve the reliability of user data. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The present application will be further described below with reference to the accompanying drawings:
[0046] Figure 1 This is a flowchart of an implementation method of a data maintenance method for a cloud virtual device provided in an embodiment of the present application;
[0047] Figure 2 This is a flowchart of an implementation method for verifying whether a file metadata reporting exception exists in a first edge storage device provided by an embodiment of the present application;
[0048] Figure 3 This is a flowchart of an implementation method of re-obtaining a file metadata reporting message from a first edge storage device provided in an embodiment of the present application;
[0049] Figure 4 This is a flowchart of another implementation of the data maintenance method for cloud virtual devices provided in an embodiment of the present application;
[0050] Figure 5 This is a flowchart of another embodiment of the data maintenance method for cloud virtual devices provided in the embodiment of the present application;
[0051] Figure 6 This is a flowchart of another implementation of the data maintenance method for cloud virtual devices provided in an embodiment of the present application;
[0052] Figure 7This is a flowchart of an implementation method of a data maintenance method for a cloud virtual device provided in an embodiment of the present application;
[0053] Figure 8 This is a flowchart of an implementation method for processing a file access request message sent by a user device provided in an embodiment of the present application;
[0054] Figure 9 This is a module diagram of an implementation of an electronic device provided in an embodiment of the present application;
[0055] Figure 10 It is a schematic diagram of the computer-readable medium provided in an embodiment of the present application.
[0056] Description of Reference Numerals
[0057] 101: Processor 102: Memory
[0058] 103: I / O interface 104: bus DETAILED DESCRIPTION
[0059] The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described in the embodiments are intended to be used to explain the present application and are not to be construed as limiting the present application.
[0060] References in this specification to "one embodiment," "an example," or "an example" mean that a particular feature, structure, or characteristic described in connection with the embodiment itself can be included in at least one embodiment disclosed herein. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment.
[0061] A common method of storing user data is to save it to the cloud, such as directly using a network disk service or building a custom cloud disk based on a cloud host. For reasons of data privacy and security, some users choose to save their data on NAS devices. However, NAS devices still have at least three problems:
[0062] Poor computing power. As an embedded device designed for network storage and data sharing, NAS has poor computing power and cannot handle computationally intensive applications such as large language models (LLMs), hindering user data maintenance. Storage capacity is limited, and NAS devices lack dynamic expansion capabilities. When storage capacity is insufficient, data can only be exported to a large-capacity hard drive or a new NAS deployed and manually copied. Reliability is poor. NAS devices are generally unreliable and lack cross-device data backup capabilities. If a NAS device is damaged, data will be lost. In light of this, the applicant of this application proposes a method for maintaining user data based on a hybrid cloud storage cluster.
[0063] As a first aspect of an embodiment of the present application, a data maintenance method for a cloud virtual device is provided, wherein the cloud virtual device and multiple edge storage devices belong to a storage cluster, such as Figure 1 As shown, the method may include:
[0064] Step S110: Receive and cache a file metadata reporting message sent by a first edge storage device; wherein the first edge storage device is one of the multiple edge storage devices, and the file metadata reporting message is cached and sent by the first edge storage device after storing the file uploaded by the user device;
[0065] Step S120: Verify whether there is a file metadata reporting exception on the first edge storage device based on the current message unique identifier carried in the file metadata reporting message;
[0066] Step S130: When it is verified that there is no file metadata reporting exception on the first edge storage device, the locally maintained file metadata table is updated according to the file metadata carried in the file metadata reporting message;
[0067] Step S140: When it is verified that the first edge storage device has a file metadata reporting anomaly, reacquire a file metadata reporting message from the first edge storage device, and update a locally maintained file metadata table based on the file metadata carried in the reacquired file metadata reporting message.
[0068] Step S150: Processing the file access request message sent by the user equipment according to the file metadata table.
[0069] In this embodiment, a storage cluster is pre-built. Specifically, a cloud virtual device is first created in the cloud as the master device of the storage cluster. Then, a user device is bound to an edge storage device, and then the user device adds the edge storage device to the storage cluster. Both the cloud virtual device and the edge storage device belong to the storage cluster, which can also be called a hybrid cloud storage cluster.
[0070] In the embodiments of the present application, it is understood that the data maintenance method provided in the embodiments of the present application can be executed on each edge storage device in the storage cluster. The embodiments of the present application use a first edge storage device (any edge storage device in the storage cluster) as an example to illustrate the data maintenance method. It is understood that data maintenance includes multiple operations within the data lifecycle, such as data storage, updating, deletion, backup, and recovery.
[0071] After the user device is bound to the first edge storage device, the first edge storage device is added to the storage cluster. The user device then uploads files (i.e., user data) to the first edge storage device. After storing the files uploaded by the user device and their file metadata, the first edge storage device sends and caches the file metadata reporting message to the cloud virtual device.
[0072] After receiving the file metadata reporting message, the cloud virtual device first verifies whether there is a file metadata reporting anomaly on the first edge storage device based on the current message unique identifier carried in the file metadata reporting message, and then updates the locally maintained file metadata table based on the verification result to ensure reliable storage of file metadata of all edge storage devices in the cluster and reliable processing of file access request messages sent by user devices. In addition, in the event of logical damage such as abnormal power failure or abnormal crash of the edge storage device, the file metadata of the cloud virtual device can be used to restore the file metadata of the edge storage device, which can further improve the reliability of user data.
[0073] Furthermore, because the computing power of the hybrid cloud storage cluster serves complex distributed "storage + computing" scenarios, while the computing power of NAS devices serves only basic storage functions, the computing power of cloud virtual devices and edge storage devices is significantly higher than that of NAS devices. They can handle computationally intensive applications such as large language models, which facilitates user data maintenance. The distributed architecture of the hybrid cloud storage cluster supports horizontal expansion. By adding and removing edge storage devices, dynamic expansion capabilities are achieved, enabling elastic expansion and reduction of the storage pool, facilitating the optimal configuration of storage capacity.
[0074] By using the data maintenance method for cloud virtual devices provided by the embodiment of the present application, a storage cluster including cloud virtual devices and multiple edge storage devices is constructed to maintain user data, which can significantly improve the computing power of the storage device and is beneficial to the maintenance of user data. By adding and deleting edge storage devices, dynamic expansion capability can be obtained, and elastic expansion and reduction of the storage pool can be achieved, which is beneficial to the reasonable setting of storage capacity. After storing the file uploaded by the user device, the first edge storage device caches and sends a file metadata reporting message to the cloud virtual device. The cloud virtual device verifies whether there is a file metadata reporting anomaly on the first edge storage device based on the current message unique identifier carried in the file metadata reporting message, and then updates the locally maintained file metadata table based on the verification result, ensuring the reliable storage of file metadata of all edge storage devices in the cluster and the reliable processing of file access request messages sent by user devices. In addition, in the case of logical damage scenarios such as abnormal power failure or abnormal crash of the edge storage device, the file metadata of the cloud virtual device can be used to restore the file metadata of the edge storage device, which can further improve the reliability of user data.
[0075] The applicant of this application further proposes to set a file metadata reporting message to carry a message unique identifier, and when the edge storage device sends a file metadata reporting message, the message unique identifier is accumulated in sequence. Whenever a file metadata reporting message is received, the cloud virtual device determines whether the message unique identifier is continuous, thereby identifying whether there is a file metadata reporting anomaly on the edge storage device. Accordingly, in some embodiments, such as Figure 2 As shown, the verifying whether the first edge storage device has a file metadata reporting exception (i.e., involved in step S120) based on the current message unique identifier carried in the file metadata reporting message may include:
[0076] Step S210: Compare the current message unique identifier with the historical message unique identifier carried in the file metadata reporting message last sent by the first edge storage device;
[0077] Step S220: When the current message unique identifier is continuous with the historical message unique identifier, verify that there is no file metadata reporting exception on the first edge storage device;
[0078] Step S230 : When the current message unique identifier is discontinuous with the historical message unique identifier, it is verified that a file metadata reporting anomaly exists in the first edge storage device.
[0079] In an embodiment of the present application, each file metadata reporting message carries a message unique identifier. When a network anomaly or other situation occurs, the message unique identifier will jump. The cloud virtual device will determine that the current message unique identifier is discontinuous with the historical message unique identifier. At this time, the cloud virtual device will re-obtain the file metadata reporting message from the first edge storage device to ensure that all file metadata of the first edge storage device are reliably stored.
[0080] In the embodiments of the present application, the data structure of the file metadata reporting message is not particularly limited. For example, the following code and its annotations may define an implementation of the data structure of the file metadata reporting message:
[0081] / / Define the MetadataPayload structure to represent the metadata payload
[0082] type MetadataPayload struct{
[0083] Opstring `json:"op"` / / Operation type, the corresponding key name in JSON serialization is "op"
[0084] Metadata []byte `json:"metadata"` / / Metadata content, stored as byte slices, the corresponding key name when serialized in JSON is "metadata"
[0085] }
[0086] / / Define the MetadataMsg structure to represent a message containing metadata payload
[0087] type MetadataMsg struct{
[0088] MsgIDuint64`json:"msg_id"` / / The unique identifier of the message, the type is an unsigned 64-bit integer, the corresponding key name when serializing JSON is "msg_id"
[0089] Payload MetadataPayload `json:"payload"` / / The metadata payload carried by the message, the type is MetadataPayload, and the corresponding key name when serialized in JSON is "payload"
[0090] }.
[0091] In some embodiments, as Figure 3As shown, when it is verified that the first edge storage device has a file metadata reporting exception, re-obtaining the file metadata reporting message from the first edge storage device (ie, involved in step S140) includes:
[0092] Step S310: When it is verified that the first edge storage device has a file metadata reporting exception, a re-reporting instruction message carrying the unique identifier of the historical message is sent to the first edge storage device;
[0093] Step S320: Receive the file metadata reporting message resent by the first edge storage device according to the re-reporting indication message; wherein, the first edge storage device also deletes the file metadata reporting message whose message unique identifier is located before the historical message unique identifier according to the re-reporting indication message.
[0094] In the embodiment of the present application, it can be understood that when the edge storage device sends a file metadata reporting message, the message unique identifiers are accumulated sequentially, and one message unique identifier is located before another message unique identifier, which means that the file metadata reporting message carrying the former is generated first.
[0095] In an embodiment of the present application, after receiving a re-report indication message carrying a unique identifier of a historical message, the first edge storage device deletes the cached file metadata reporting message whose message unique identifier is located before the unique identifier of the historical message (because the cloud virtual device has received these messages continuously), and then resends the file metadata reporting message to the cloud virtual device starting from the file metadata reporting message carrying the unique identifier of the historical message.
[0096] The applicant of this application further proposes that, in addition to identifying whether an edge storage device has a file metadata reporting anomaly upon receiving a file metadata reporting message sent by an edge storage device, the cloud virtual device can also periodically poll all edge storage devices in the storage cluster to identify whether an edge storage device has a file metadata reporting anomaly. Accordingly, in some embodiments, after receiving and caching the file metadata reporting message sent by the first edge storage device (i.e., step S110 involved), and before processing the file interaction request sent by the user device according to the file metadata table (i.e., step S150 involved), as shown in FIG. Figure 4 As shown, the method may further include:
[0097] Step S410: When a preset verification period is reached, sending an exception query message carrying the unique identifier of the current message to the first edge storage device;
[0098] Step S420: Receive a file metadata reporting message supplemented by the first edge storage device according to the abnormality reporting query message; wherein the first edge storage device further deletes the file metadata reporting message having a message unique identifier located before the current message unique identifier according to the abnormality reporting query message;
[0099] Step S430: updating the locally maintained file metadata table according to the file metadata carried in the supplementary file metadata reporting message.
[0100] In an embodiment of the present application, if a preset verification period has expired, the current message unique identifier carried in the most recently received file metadata reporting message becomes the latest message unique identifier, and the cloud virtual device instructs the first edge storage device to query whether any file metadata has not been reported since then. After receiving the report exception query message, the first edge storage device deletes the cached file metadata reporting messages whose message unique identifiers are located before the current message unique identifier (because the cloud virtual device has already received these messages consecutively), and then sends additional file metadata reporting messages to the cloud virtual device, starting with the file metadata reporting message carrying the current message unique identifier.
[0101] The applicant of this application further proposes that the storage cluster can also perform multiple backups of files uploaded by user devices to further improve the reliability of user data. Accordingly, in some embodiments, the file metadata table includes the corresponding relationship between the edge storage device and the file metadata of the files stored therein, such as Figure 5 As shown, the method may further include:
[0102] Step S510: receiving a file backup request message sent by the user device, and obtaining the file identifier of the file to be backed up carried therein;
[0103] Step S520: querying the file metadata table according to the file identifier to determine the second edge storage device storing the file to be backed up;
[0104] Step S530: determining a third edge storage device for backup from the storage cluster;
[0105] Step S540: backing up the to-be-backed-up files stored in the second edge storage device to the third edge storage device;
[0106] Step S550: Record the file backup relationship between the second edge storage device and the third edge storage device regarding the file to be backed up.
[0107] In the embodiment of the present application, there is no special limitation on the number of backups, that is, there is no special limitation on the number of the determined third edge storage devices, which can be one or more, and can be specified by the user device or pre-set, as long as it does not exceed the total number of edge storage devices in the storage cluster.
[0108] In the embodiments of this application, the terms "first," "second," and "third" are used solely to distinguish the different roles played by the edge storage devices and do not necessarily mean that the second and third edge storage devices are different from the first edge storage device. That is, the second edge storage device can be the same as the first edge storage device, in which case the files to be backed up on the first edge storage device are backed up to the third edge storage device; or the third edge storage device can be the same as the first edge storage device, in which case the files to be backed up on the second edge storage device are backed up to the first edge storage device.
[0109] In addition, the applicant of this application also found that after a certain edge storage device has been working for a period of time, the actual storage capacity may be about to reach the upper limit of the capacity, the service life may be insufficient, or the storage medium may be insufficiently healthy. At this time, how to migrate the data on the edge storage device to other edge storage devices is a very important issue. For traditional NAS devices, it is the most difficult problem to solve. Traditional NAS devices can only export the data on the edge storage device to the PC side first, and then import the data from the PC side to other edge storage devices. This migration method is not only highly complex, but also extremely inefficient and unfriendly in terms of ensuring the integrity and security of the data. In this regard, the applicant of this application further proposed that based on the above-mentioned backup mechanism, this problem can be solved cleverly and effectively.
[0110] Accordingly, in some embodiments, the second edge storage device includes an edge storage device to be migrated, the edge storage device to be migrated is determined from the multiple edge storage devices based on preset migration conditions, and the files to be backed up include all files stored in the edge storage device to be migrated.
[0111] Among them, the embodiments of the present application do not make specific limitations on the preset migration conditions. For example, it may include that the available storage capacity of the edge storage device is lower than the preset capacity threshold, or the usage time of the edge storage device exceeds the preset time threshold, or the health of the edge storage device is lower than the preset health threshold, etc.
[0112] Among them, the user device can determine the edge storage device to be migrated from multiple edge storage devices in the storage cluster based on preset migration conditions, and then the user device can mark all files stored in the determined edge storage device to be migrated as files to be backed up, and initiate the backup of these files to be backed up to the cloud virtual device to actually complete the migration of these files.
[0113] Among them, it can be understood that in cases where the service life is insufficient or the storage medium is not healthy enough, after the backup is completed, that is, the migration is completed, the user device can unbind the edge storage device to be migrated from the cloud virtual device, thereby releasing the affiliation between the edge storage device to be migrated and the storage cluster.
[0114] As described above, after the user device is bound to the edge storage device, the edge storage device is added to the storage cluster. Accordingly, in some embodiments, before receiving and caching the file metadata reporting message sent by the first edge storage device (i.e., step S110), Figure 6 As shown, the method may further include:
[0115] Step S610: Receive an edge storage device record message sent by the user device; wherein the edge device add message is sent after the user device is bound to the first edge storage device, and the edge device add message carries a device certificate and a device serial number of the first edge storage device;
[0116] Step S620: receiving a bidirectional authentication request message and a device status notification message sent by the first edge storage device after receiving the reliability verification indication message sent by the user device; wherein the device status notification message includes a device serial number and a device serial number signature of the first edge storage device;
[0117] Step S630: Verify the reliability of the first edge storage device according to the edge storage device record message, the two-way authentication request message, and the device status notification message;
[0118] Step S640: If the reliability verification passes, reversely call the first edge storage device to join the storage cluster, and record the affiliation relationship between the first edge storage device and the storage cluster.
[0119] In an embodiment of the present application, a user device requests binding with a first edge storage device through a local area network; after completing the binding initialization, the first edge storage device notifies the user device that the local area network binding is completed; the user device obtains a device certificate from the first edge storage device, sends an edge device add message carrying the device certificate and device serial number of the first edge storage device to the cloud virtual device, and sends a reliability verification indication message to the first edge storage device to trigger the first edge storage device to join the storage cluster; the first edge storage device also sends a two-way authentication request message and a device status notification message carrying the device certificate and device serial number of the first edge storage device to the cloud virtual device; the cloud virtual device performs reliability verification on the first edge storage device. After the reliability verification passes, the cloud virtual device reversely calls the first edge storage device to join the storage cluster, and records the affiliation relationship between the first edge storage device and the storage cluster.
[0120] In this embodiment, there are no specific restrictions on how to perform bidirectional authentication between the edge storage device and the cloud virtual device. For example, bidirectional authentication based on the lightweight message transmission protocol (Message Queuing Telemetry Transport (MQTT)) and the encryption and authentication protocol (Transport Layer Security (TLS)) can be established. Subsequently, the edge storage device can send file metadata reporting messages to the cloud virtual device via the MQTT channel.
[0121] The applicant of this application further proposes that the user device can access all files stored in the storage cluster through the cloud virtual device (provided that it has access rights), and only access the edge storage device when it needs to download a specified file. Accordingly, in some embodiments, the file metadata table includes the device identification of the edge storage device, file access information, file permissions, and file metadata. The file metadata includes file tags, such as Figure 7 As shown, processing the file access request message sent by the user equipment according to the file metadata table (ie, involved in step S150) may include:
[0122] Step S710: receiving a file access request message sent by the user device and obtaining a file tag carried therein;
[0123] Step S720: query the file metadata table according to the file tag to determine a list of files to be accessed;
[0124] Step S730, sending the list of files to be accessed to the user device, so that the user device selects the target file to be accessed according to the list of files to be accessed and parses the target file access information, and downloads the target file to be accessed from the corresponding edge storage device according to the target file access information.
[0125] In this embodiment of the present application, the file metadata table includes the device identifier of the edge storage device (indicating which cloud virtual device or edge storage device the corresponding file metadata belongs to), file access information (which allows access to the corresponding file), file permissions (indicating which user devices can access the corresponding file), and file metadata. It will be understood that there is a corresponding relationship between the file metadata and the device identifier, file access information, and file permissions of the corresponding edge storage device.
[0126] As a second aspect of the embodiment of the present application, a data maintenance method for a user device is provided, such as Figure 8 As shown, the method may include:
[0127] Step S810, uploading the file to the first edge storage device; wherein the cloud virtual device and multiple edge storage devices belong to a storage cluster, and the first edge storage device is one of the multiple edge storage devices; after storing the file, the first edge storage device caches and sends a file metadata reporting message to the cloud virtual device; the cloud virtual device verifies whether there is a file metadata reporting exception on the first edge storage device based on the current message unique identifier carried in the file metadata reporting message; if it is verified that there is no file metadata reporting exception on the first edge storage device, the locally maintained file metadata table is updated based on the file metadata carried in the file metadata reporting message; if it is verified that there is a file metadata reporting exception on the first edge storage device, the file metadata reporting message is re-obtained from the first edge storage device and the locally maintained file metadata table is updated based on the file metadata carried in the re-obtained file metadata reporting message;
[0128] Step S820: Send a file access request to the cloud virtual device, so that the cloud virtual device processes the file access request message according to the file metadata table.
[0129] When describing the data maintenance method performed on the cloud virtual device side, the data maintenance method performed on the user device side and the edge storage device side has been described above, so it will not be repeated here.
[0130] Through the data maintenance method for cloud virtual devices provided by the embodiment of the present application, a storage cluster including cloud virtual devices and multiple edge storage devices is constructed to maintain user data, which can significantly improve the computing power of the storage device and is beneficial to the maintenance of user data. Dynamic expansion capability can be obtained by adding and deleting edge storage devices, realizing elastic expansion and reduction of the storage pool, which is beneficial to the reasonable setting of storage capacity. The user device uploads a file to the first edge storage device. After storing the file, the first edge storage device caches and sends a file metadata reporting message to the cloud virtual device. The cloud virtual device verifies whether there is a file metadata reporting anomaly on the first edge storage device based on the current message unique identifier carried in the file metadata reporting message, and then updates the locally maintained file metadata table based on the verification result, ensuring reliable storage of file metadata of all edge storage devices in the cluster and reliable processing of file access request messages sent by user devices. In addition, in the case of logical damage scenarios such as abnormal power failure or abnormal crash of the edge storage device, the file metadata of the cloud virtual device can be used to restore the file metadata of the edge storage device, which can further improve the reliability of user data.
[0131] As a third aspect of the embodiments of the present application, an electronic device is provided, wherein, Figure 9 As shown, the electronic device includes:
[0132] One or more processors 101;
[0133] The memory 102 stores one or more computer programs. When the one or more computer programs are executed by the one or more processors 101, the one or more processors 101 implement any of the following:
[0134] The first aspect of the embodiment of the present application provides a data maintenance method for cloud virtual devices;
[0135] The second aspect of an embodiment of the present application provides a data maintenance method for a user device.
[0136] The electronic device may further include one or more I / O interfaces 103 connected between the processor 101 and the memory 102 and configured to implement information exchange between the processor 101 and the memory 102 .
[0137] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, and can realize information exchange between the processor and the memory, including but not limited to a data bus (Bus), etc.
[0138] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.
[0139] As a fourth aspect of the embodiment of the present application, Figure 10 As shown, a computer readable medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, any of the following is implemented:
[0140] The first aspect of the embodiment of the present application provides a data maintenance method for cloud virtual devices;
[0141] The second aspect of an embodiment of the present application provides a data maintenance method for a user device.
[0142] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and when the computer program is executed, it can implement the method of any of the above-mentioned embodiments. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the embodiments of the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0143] The above are only specific embodiments of the present application, but the scope of protection of the present application is not limited thereto. Those skilled in the art should understand that the present application includes but is not limited to the contents described in the drawings and the above specific embodiments. Any modifications that do not deviate from the functional and structural principles of the present application are included within the scope of the claims.
Claims
1. A data maintenance method for cloud virtual devices, characterized in that: The cloud virtual device and the plurality of edge storage devices belong to a storage cluster, and the method includes: Receive and cache a file metadata reporting message sent by a first edge storage device; wherein the first edge storage device is one of the multiple edge storage devices, and the file metadata reporting message is cached and sent by the first edge storage device after storing the file uploaded by the user device; Verify, based on the current message unique identifier carried in the file metadata reporting message, whether the first edge storage device has a file metadata reporting exception; When it is verified that there is no file metadata reporting exception on the first edge storage device, updating the locally maintained file metadata table according to the file metadata carried in the file metadata reporting message; When it is verified that the first edge storage device has a file metadata reporting anomaly, re-obtain a file metadata reporting message from the first edge storage device, and update a locally maintained file metadata table according to the file metadata carried in the re-obtained file metadata reporting message; Processing the file access request message sent by the user equipment according to the file metadata table.
2. The method according to claim 1, characterized in that The verifying, based on the current message unique identifier carried in the file metadata reporting message, whether the first edge storage device has a file metadata reporting exception includes: Compare the current message unique identifier with the historical message unique identifier carried in the file metadata reporting message last sent by the first edge storage device; If the current message unique identifier is continuous with the historical message unique identifier, verifying that no file metadata reporting exception occurs on the first edge storage device; When the current message unique identifier is discontinuous with the historical message unique identifier, it is verified that a file metadata reporting exception exists in the first edge storage device.
3. The method according to claim 2, characterized in that The step of re-obtaining the file metadata reporting message from the first edge storage device when verifying that the first edge storage device has a file metadata reporting exception includes: When it is verified that the first edge storage device has a file metadata reporting exception, sending a re-reporting instruction message carrying the unique identifier of the historical message to the first edge storage device; Receive the file metadata reporting message resent by the first edge storage device according to the re-reporting indication message; wherein, the first edge storage device also deletes the file metadata reporting message whose message unique identifier is located before the historical message unique identifier according to the re-reporting indication message.
4. The method according to claim 1, wherein After receiving and caching the file metadata reporting message sent by the first edge storage device and before processing the file interaction request sent by the user device according to the file metadata table, the method further includes: When a preset verification period is reached, sending an exception query message carrying the current message unique identifier to the first edge storage device; Receiving a file metadata reporting message supplemented by the first edge storage device according to the abnormality reporting query message; wherein the first edge storage device further deletes the file metadata reporting message having a message unique identifier located before the current message unique identifier according to the abnormality reporting query message; The locally maintained file metadata table is updated according to the file metadata carried in the supplementary file metadata reporting message.
5. The method according to claim 1, wherein The file metadata table includes a correspondence between the edge storage device and the file metadata of the files stored therein, and the method further includes: receiving a file backup request message sent by the user equipment, and obtaining a file identifier of a file to be backed up carried therein; Querying the file metadata table according to the file identifier to determine the second edge storage device storing the file to be backed up; Determining a third edge storage device for backup from the storage cluster; Backing up the to-be-backed-up files stored in the second edge storage device to the third edge storage device; Record a file backup relationship between the second edge storage device and the third edge storage device regarding the file to be backed up.
6. The method according to claim 5, characterized in that The second edge storage device includes an edge storage device to be migrated, which is determined from the multiple edge storage devices based on preset migration conditions. The files to be backed up include all files stored in the edge storage device to be migrated.
7. The method according to any one of claims 1 to 6, characterized in that The file metadata table includes a device identifier of the edge storage device, file access information, file permissions, and file metadata, and the file metadata includes a file tag. Processing the file access request message sent by the user device according to the file metadata table includes: receiving a file access request message sent by the user equipment, and obtaining a file tag carried therein; Querying the file metadata table according to the file tags to determine a list of files to be accessed; The list of files to be accessed is sent to the user device, so that the user device selects the target files to be accessed according to the list of files to be accessed and parses the target file access information, and downloads the target files to be accessed from the corresponding edge storage device according to the target file access information.
8. A data maintenance method for user equipment, characterized in that: The method comprises: Upload a file to a first edge storage device; wherein, the cloud virtual device and multiple edge storage devices belong to a storage cluster, and the first edge storage device is one of the multiple edge storage devices; after storing the file, the first edge storage device caches and sends a file metadata reporting message to the cloud virtual device; the cloud virtual device verifies whether there is a file metadata reporting exception on the first edge storage device based on the current message unique identifier carried in the file metadata reporting message; if it is verified that there is no file metadata reporting exception on the first edge storage device, the locally maintained file metadata table is updated based on the file metadata carried in the file metadata reporting message; if it is verified that there is a file metadata reporting exception on the first edge storage device, the file metadata reporting message is re-obtained from the first edge storage device and the locally maintained file metadata table is updated based on the file metadata carried in the re-obtained file metadata reporting message; A file access request message is sent to the cloud virtual device, so that the cloud virtual device processes the file access request message according to the file metadata table.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory having one or more computer programs stored thereon, wherein when the one or more computer programs are executed by the one or more processors, the one or more processors implement any of the following: The data maintenance method for cloud virtual devices according to any one of claims 1 to 7; The data maintenance method for user equipment according to claim 8.
10. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements any of the following: The data maintenance method for cloud virtual devices according to any one of claims 1 to 7; The data maintenance method for user equipment according to claim 8.
Citation Information
Patent Citations
Image processing apparatus, image processing system and filter setting method
CN101098468A
Computer system accessing object storage system
CN106168884A