File storage method and device, computer equipment and storage medium

By identifying and determining the target storage device, the file storage process is simplified, which solves the problems of complicated file storage and high error rate in cloud computing, improves efficiency and reliability, and ensures security.

CN118550879APending Publication Date: 2024-08-27JINAN INSPUR DATA TECH CO LTD

Patent Information

Application Number
CN202410727764.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing file storage methods in the field of cloud computing have complicated storage processes and high error rates, which affect system efficiency and maintainability.

Method used

By obtaining the file storage instructions input by the user, it identifies and determines the target storage device based on the preset scheduling policy, creates file storage space, simplifies the storage process, reduces network communication and message delivery steps, and improves response speed and reliability.

Benefits of technology

It improves the efficiency and reliability of file storage, reduces the error rate, ensures the accuracy and security of the target storage device, and avoids illegal intrusion and data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550879A
    Figure CN118550879A
Patent Text Reader

Abstract

The invention relates to the technical field of file storage, in particular to a file storage method and device, computer equipment and a storage medium. Obtaining a file storage instruction input by a user; the file storage instruction comprises a to-be-stored file; identifying each storage device, and determining a target storage device from each storage device based on a preset scheduling strategy; and creating a file storage space in the target storage device, and storing the to-be-stored file in the file storage space. According to the method, file storage is completed by using simple steps, additional steps of network communication and message transmission are reduced, the response speed is increased, and occupied resources are reduced, so that the file storage efficiency and reliability are improved, and the error rate is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of file storage technology, and in particular to a file storage method, device, computer equipment and storage medium. Background Art

[0002] In the field of cloud computing, with the rapid growth of digital information, the demand for efficient and reliable file storage platforms is becoming more and more urgent. As an open source shared file storage service framework, OpenStack Manila provides users with rich functions. However, with the continuous expansion of services, its structure has become more and more complex. Users need to go through very tedious steps to complete file storage during use. As the more steps are completed, the easier it is for users to make mistakes and it is not easy to maintain.

[0003] Therefore, the file storage method in the prior art has a complicated storage process and a high error rate, which affects the efficiency and maintainability of the system. Summary of the invention

[0004] In view of this, the present invention provides a file storage method, apparatus, computer equipment and storage medium to solve the problem that the storage process is complicated and has a high error rate, which affects the efficiency and maintainability of the system.

[0005] In a first aspect, the present invention provides a file storage method, the method comprising:

[0006] Obtaining a file storage instruction input by a user; the file storage instruction includes a file to be stored;

[0007] Identify each storage device and determine a target storage device from each storage device based on a preset scheduling strategy;

[0008] Create a file storage space in the target storage device and store the files to be stored in the file storage space.

[0009] The file storage method provided by the embodiment of the present application obtains the file storage instruction input by the user; identifies each storage device, and determines the target storage device from each storage device based on the preset scheduling strategy, thereby ensuring the accuracy of the determined target storage device and meeting the requirements of the file storage instruction. Create a file storage space in the target storage device, and store the file to be stored in the file storage space. The above method uses simple steps to complete the file storage, reduces the extra steps of network communication and message transmission, improves the response speed, reduces the occupied resources, thereby improving the efficiency and reliability of file storage, and reducing the error rate.

[0010] In an optional implementation, the file storage instruction includes user identity information, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from each storage device, including:

[0011] Authenticate the user identity information in the file storage instruction;

[0012] If the user identity information is successfully authenticated, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from among the storage devices.

[0013] The file storage method provided in the embodiment of the present application authenticates the user identity information in the file storage instruction; if the user identity information is successfully verified, each storage device is identified, and based on a preset scheduling strategy, a target storage device is determined from each storage device, thereby ensuring the security of completing the file storage and avoiding illegal intrusion.

[0014] In an optional implementation, if the user identity information is successfully verified, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from each storage device, including:

[0015] If the user identity information is successfully verified, the user's access rights are verified based on the user identity information;

[0016] If the user's access authority is successfully verified, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from among the storage devices.

[0017] The file storage method provided by the embodiment of the present application, if the user identity information is successfully verified, then the user's access rights are verified based on the user identity information; if the user's access rights are successfully verified, then each storage device is identified, and based on a preset scheduling strategy, a target storage device is determined from each storage device. The security of completing the file storage task is ensured, and illegal intrusion is avoided.

[0018] In an optional implementation, verifying the user's access rights based on the user's identity information includes:

[0019] Query the user's corresponding permitted access rights based on the user's identity information;

[0020] Identify the file storage instruction and determine the content to be accessed by the user;

[0021] Check whether the content to be accessed exists within the allowed access permissions;

[0022] If the content to be accessed is within the permitted access rights, it is determined that the user's access rights have been successfully verified.

[0023] The file storage method provided in the embodiment of the present application queries the user's corresponding allowed access rights based on the user's identity information; identifies the file storage instruction to determine the content to be accessed corresponding to the user; detects whether the content to be accessed exists within the allowed access rights; if the content to be accessed exists within the allowed access rights, it is determined that the user's access rights verification is successful, thereby ensuring the accuracy of the verification of the user's access rights.

[0024] In an optional implementation, identifying each storage device and determining a target storage device from each storage device based on a preset scheduling policy includes:

[0025] Monitor each storage device to determine whether each storage device is in normal working condition;

[0026] Determine each storage device in a normal working state as a candidate storage device;

[0027] A target storage device is determined from among the candidate storage devices.

[0028] The file storage method provided by the embodiment of the present application monitors each storage device to determine whether each storage device is in a normal working state; each storage device in a normal working state is determined as a candidate storage device, and a target storage device is determined from each candidate storage device. Thus, it can be ensured that the determined target storage device is a storage device in a normal working state, and it is avoided that the determined target storage device is a storage device in an abnormal working state, which leads to the inability to complete the file storage task.

[0029] In an optional implementation, determining a target storage device from candidate storage devices includes:

[0030] Obtain the remaining capacity corresponding to each candidate storage device;

[0031] Compare the remaining capacity corresponding to each candidate storage device with a preset remaining capacity threshold;

[0032] Determine each candidate storage device whose remaining capacity is greater than a preset remaining capacity threshold as a backup storage device;

[0033] Acquire performance data corresponding to each backup storage device, the performance data including at least one of response time, network delay, and network bandwidth usage;

[0034] Determine the priority of each backup storage device according to the performance data of each backup storage device;

[0035] Compare the priorities of the backup storage devices;

[0036] A backup storage device with the highest priority is determined from among the backup storage devices as the target storage device.

[0037] The file storage method provided in the embodiment of the present application obtains the remaining capacity corresponding to each candidate storage device; compares the remaining capacity corresponding to each candidate storage device with a preset remaining capacity threshold; determines each candidate storage device whose remaining capacity is greater than the preset remaining capacity threshold as a backup storage device, thereby ensuring that the remaining capacity of the target storage device determined from the backup storage devices is large, and further ensuring that the files to be stored can be stored. Obtain the performance data corresponding to each backup storage device, the performance data includes at least one of response time, network delay, and network bandwidth usage; determine the priority corresponding to each backup storage device based on the performance data corresponding to each backup storage device, thereby ensuring the accuracy of the priority corresponding to each backup storage device. Compare the priorities corresponding to each backup storage device; determine the backup storage device with the highest priority from each backup storage device as the target storage device, thereby ensuring that the determined target storage device is not only in a normal working state, but also has a large remaining capacity and good performance.

[0038] In an optional embodiment, the method further includes:

[0039] If there is a storage device in an abnormal working state, the historical storage files in the storage device in the abnormal working state are stored in the storage device in a normal working state.

[0040] The file storage method provided in the embodiment of the present application stores historical storage files in the storage device in the abnormal working state to a storage device in a normal working state if there is a storage device in an abnormal working state, thereby avoiding loss or damage of historical storage files in the storage device in the abnormal working state and ensuring the safety of historical storage files in the storage device in the abnormal working state.

[0041] In a second aspect, the present invention provides a file storage device, the device comprising:

[0042] The acquisition module is used to acquire the file storage instruction input by the user; the file storage instruction includes the file to be stored;

[0043] A determination module, used to identify each storage device and determine a target storage device from each storage device based on a preset scheduling strategy;

[0044] The storage module is used to create a file storage space in the target storage device and store the files to be stored in the file storage space.

[0045] The file storage device provided in the embodiment of the present application obtains the file storage instruction input by the user; identifies each storage device, and determines the target storage device from each storage device based on the preset scheduling strategy, thereby ensuring the accuracy of the determined target storage device and meeting the requirements of the file storage instruction. Create a file storage space in the target storage device, and store the file to be stored in the file storage space. The above device completes the file storage using simple steps, reduces the extra steps of network communication and message transmission, improves the response speed, reduces the occupied resources, thereby improving the efficiency and reliability of file storage, and reducing the error rate.

[0046] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the file storage method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0047] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the file storage method of the first aspect or any corresponding embodiment thereof.

[0048] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the file storage method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 is a flowchart of a file storage method in a related art according to an embodiment of the present invention;

[0051] Figure 2 is a flowchart of a file storage method according to an embodiment of the present invention;

[0052] Figure 3 is a flowchart of another file storage method according to an embodiment of the present invention;

[0053] Figure 4 is a flowchart of another file storage method according to an embodiment of the present invention;

[0054] Figure 5 is a schematic diagram of the structure of a file storage system according to an embodiment of the present invention;

[0055] Figure 6 is a structural block diagram of a file storage device according to an embodiment of the present invention;

[0056] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0058] In the field of cloud computing, with the rapid growth of digital information, the demand for efficient and reliable file storage platforms is becoming more and more urgent. As an open source shared file storage service framework, OpenStack Manila provides users with rich functions. However, with the continuous expansion of services, its structure has become more and more complex. Users need to go through very tedious steps to complete file storage during use. As the more steps are completed, the easier it is for users to make mistakes and it is not easy to maintain.

[0059] Therefore, the file storage method in the prior art has a complicated storage process and a high error rate, which affects the efficiency and maintainability of the system.

[0060] For example, Figure 1 As shown in the figure, it is a timing diagram of creating a shared file based on the OpenStack Manila shared file storage service framework in the related art. Specifically, in the OpenStack community, the process of creating a file storage instance by the Manila module usually involves the following steps:

[0061] S1 user request: The user initiates a request to create shared storage through the command line interface (CLI) or the OpenStack Dashboard (Horizon).

[0062] S2 Authentication: The request is first processed by the Identity service (Keystone) to verify the user's identity and permissions.

[0063] S3API service: The request is forwarded to the API service in Manila. The API service is responsible for parsing the request and converting it into internal operations.

[0064] S4 Scheduling Service: Manila's API service sends the request to the scheduling service. The scheduler selects a suitable backend storage system to create a shared instance.

[0065] S5 message queue: The scheduling service sends operation instructions to the corresponding shared service through a message queue (such as RabbitMQ).

[0066] S6 Sharing Service: The sharing service receives messages and interacts with the backend storage to perform the actual share creation work.

[0067] S7 database updates: During the shared storage creation process, all status updates are recorded in a database (such as MySQL).

[0068] S8 Notify the user: After the creation process is completed, the user will receive a notification, which may be returned to the API service through a message queue and then fed back to the user.

[0069] S9 Resource Access: Once the shared storage instance is created and its status is updated to Available, users can mount the shared storage over the network according to the access information provided.

[0070] Based on the above problems, an embodiment of the present application provides a file storage method, which obtains a file storage instruction input by a user; identifies each storage device, and determines a target storage device from each storage device based on a preset scheduling strategy, thereby ensuring the accuracy of the determined target storage device and meeting the requirements of the file storage instruction. Create a file storage space in the target storage device, and store the file to be stored in the file storage space. The above method uses simple steps to complete file storage, reduces additional steps of network communication and message transmission, improves response speed, reduces occupied resources, thereby improving the efficiency and reliability of file storage, and reducing the error rate.

[0071] It should be noted that the execution subject of the file storage method provided in the embodiment of the present application may be a file storage device, which may be implemented as part or all of a computer device through software, hardware, or a combination of software and hardware, wherein the computer device may be a server or a terminal, wherein the server in the embodiment of the present application may be a single server or a server cluster composed of multiple servers, and the terminal in the embodiment of the present application may be a smart phone, a personal computer, a tablet computer, a wearable device, an intelligent robot, or other intelligent hardware devices. In the following method embodiments, the execution subject is an electronic device as an example for explanation.

[0072] According to an embodiment of the present invention, a file storage method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0073] In this embodiment, a file storage method is provided. Figure 2 is a flowchart of a file storage method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0074] Step S101, obtaining a file storage instruction input by a user.

[0075] The file storage instruction includes the file to be stored.

[0076] Specifically, the electronic device may receive a file storage instruction input by a user, and may also receive a file storage instruction input by a user sent by other devices.

[0077] The embodiment of the present application does not specifically limit the method of obtaining the file storage instruction input by the user.

[0078] Step S102: identifying each storage device, and determining a target storage device from among the storage devices based on a preset scheduling policy.

[0079] Specifically, the electronic device may first identify the file storage instruction to check whether the file storage instruction includes the target identification information corresponding to the specified target storage device. If the file storage instruction includes the target identification information corresponding to the specified target storage device, the electronic device may identify each storage device, determine the identification information corresponding to each storage device, compare the identification information corresponding to each storage device with the target identification information, and determine the target storage device whose identification information is consistent with the target identification information from each storage device.

[0080] This step will be described in detail below.

[0081] Step S103: create a file storage space in the target storage device, and store the file to be stored in the file storage space.

[0082] Specifically, after determining the target storage device from various storage devices, the electronic device can call the interface for creating file storage space of the target storage device through the driver function, create file storage space in the target storage device, and store the files to be stored in the file storage space.

[0083] It should be noted that the target storage device may be a storage device that supports shared storage or a device that does not support shared storage. If the target storage device supports shared storage, the file storage space may be a file storage shared space or not, and this embodiment of the application does not specifically limit this.

[0084] The file storage method provided by the embodiment of the present application obtains the file storage instruction input by the user; identifies each storage device, and determines the target storage device from each storage device based on the preset scheduling strategy, thereby ensuring the accuracy of the determined target storage device and meeting the requirements of the file storage instruction. Create a file storage space in the target storage device, and store the file to be stored in the file storage space. The above method uses simple steps to complete the file storage, reduces the extra steps of network communication and message transmission, improves the response speed, reduces the occupied resources, thereby improving the efficiency and reliability of file storage, and reducing the error rate.

[0085] In this embodiment, a file storage method is provided. Figure 3 is a flowchart of a file storage method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0086] Step S201, obtaining a file storage instruction input by a user.

[0087] The file storage instruction includes the file to be stored.

[0088] For more information about this step, see Figure 2 The introduction of step S101 is not repeated here.

[0089] Step S202: identify each storage device, and determine a target storage device from among the storage devices based on a preset scheduling policy.

[0090] Specifically, the above step S202 includes:

[0091] Step S2021, authenticate the user identity information in the file storage instruction.

[0092] Specifically, the electronic device may verify the user identity information in the file storage instruction.

[0093] The user identity information may be key information in the header information of the file storage instruction. Specifically, the electronic device may compare the key information in the header information of the file storage instruction with the key information corresponding to each user stored in the storage space, and if the key information in the header information of the file storage instruction is consistent with a key information stored in the storage space, it is determined that the identity authentication of the user identity information in the file storage instruction is successful.

[0094] Step S2022: If the user identity information is successfully authenticated, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from among the storage devices.

[0095] Optionally, if the user identity information is successfully authenticated, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from among the storage devices.

[0096] Specifically, the above step S2022 may include the following steps:

[0097] Step a1: If the user identity information is successfully verified, the user's access rights are verified based on the user identity information.

[0098] Specifically, the "verifying the user's access rights based on the user's identity information" in the above step a1 may include the following steps:

[0099] Step a11, querying the allowed access rights corresponding to the user based on the user identity information.

[0100] Specifically, the electronic device may search for the permitted access rights corresponding to the user based on the correspondence between the user identity information and the permitted access rights.

[0101] Step a12, identifying the file storage instruction and determining the content to be accessed corresponding to the user.

[0102] Specifically, the electronic device identifies the file storage instruction and determines the to-be-accessed content corresponding to the user included in the file storage instruction.

[0103] Step a13, detecting whether the content to be accessed exists within the permitted access rights.

[0104] Specifically, the electronic device compares the to-be-accessed content corresponding to the user with the permitted access rights, and detects whether the to-be-accessed content exists within the permitted access rights.

[0105] Step a14: If the content to be accessed is within the permitted access rights, it is determined that the user's access rights are successfully verified.

[0106] Specifically, if the content to be accessed exists within the permitted access rights, it is determined that the access rights verification of the user is successful.

[0107] Step a2: If the user's access rights are successfully verified, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from among the storage devices.

[0108] Specifically, if the user's access authority is successfully verified, the electronic device creates a storage record in the MySQL database to indicate that the file is currently being stored. After the file storage is completed, the storage record can be modified to a completed state, and after the file storage fails, the storage record can be modified to a storage failure state.

[0109] Then, the electronic device identifies each storage device and determines a target storage device from among the storage devices based on a preset scheduling policy.

[0110] Among them, the “identifying each storage device and determining a target storage device from each storage device based on a preset scheduling policy” will be introduced in detail below.

[0111] Step S203: create a file storage space in the target storage device, and store the file to be stored in the file storage space.

[0112] For more information about this step, see Figure 2 The introduction of step S103 is not repeated here.

[0113] The file storage method provided by the embodiment of the present application authenticates the user identity information in the file storage instruction; if the user identity information is successfully verified, the user's corresponding permitted access rights are queried based on the user identity information; the file storage instruction is identified to determine the content to be accessed corresponding to the user; it is detected whether the content to be accessed exists within the permitted access rights; if the content to be accessed exists within the permitted access rights, it is determined that the user's access rights are successfully verified, thereby ensuring the accuracy of the verification of the user's access rights. If the user's access rights are successfully verified, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from each storage device. The security of completing the file storage task is ensured, and illegal intrusion is avoided.

[0114] In this embodiment, a file storage method is provided. Figure 4 is a flowchart of a file storage method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0115] Step S301, obtaining a file storage instruction input by a user.

[0116] The file storage instruction includes the file to be stored.

[0117] For this step please see Figure 3 The introduction of step S201 is not repeated here.

[0118] Step S302: Identify each storage device and determine a target storage device from among the storage devices based on a preset scheduling policy.

[0119] Specifically, the above step S302 may include the following steps:

[0120] Step S3021, monitor each storage device to determine whether each storage device is in a normal working state.

[0121] Specifically, the electronic device can use a special monitoring tool to monitor key indicators of the storage device, such as disk usage, read and write performance, network connection, CPU and memory utilization, etc. Then, based on the monitoring results, it is determined whether each storage device is in a normal working state.

[0122] Step S3022: Determine each storage device in a normal working state as a candidate storage device.

[0123] Specifically, the electronic device may determine each storage device in a normal working state as a candidate storage device.

[0124] Step S3023: determine a target storage device from among the candidate storage devices.

[0125] Optionally, the electronic device may randomly select a candidate storage device from among the candidate storage devices to determine as the target storage device.

[0126] Specifically, the above step S3023 may include the following steps:

[0127] Step b1, obtaining the remaining capacity corresponding to each candidate storage device.

[0128] Specifically, the electronic device may monitor the remaining capacity corresponding to each candidate storage device, thereby obtaining the remaining capacity corresponding to each candidate storage device.

[0129] Step b2: comparing the remaining capacity corresponding to each candidate storage device with a preset remaining capacity threshold.

[0130] Specifically, the electronic device may receive a preset remaining capacity threshold value input by a user, or may receive a preset remaining capacity threshold value input by a user. The electronic device may also calculate the preset remaining capacity threshold value according to the remaining capacity corresponding to each candidate storage device.

[0131] Exemplarily, the average remaining capacity is calculated according to the remaining capacity corresponding to each candidate storage device, and then the average remaining capacity is multiplied by a preset coefficient to obtain a preset remaining capacity threshold.

[0132] The preset coefficient may be 1.2, 1.3, or other values, and the present application embodiment does not specifically limit the preset coefficient. The preset coefficient may be set according to a specific application scenario.

[0133] Step b3: determine each candidate storage device whose remaining capacity is greater than a preset remaining capacity threshold as a backup storage device.

[0134] Specifically, the electronic device may compare the remaining capacity corresponding to each candidate storage device with a preset remaining capacity threshold, and then determine each candidate storage device having a remaining capacity greater than the preset remaining capacity threshold as a backup storage device.

[0135] In an optional implementation of the present application, the electronic device may randomly select a spare storage device from various spare storage devices to be determined as the target storage device.

[0136] Step b4, obtaining performance data corresponding to each backup storage device.

[0137] The performance data includes at least one of response time, network delay and network bandwidth usage.

[0138] Specifically, the electronic device may monitor each backup storage device to obtain at least one of a response time, a network delay, and a network bandwidth usage status corresponding to the backup storage device.

[0139] Step b5: determining the priority level of each spare storage device according to the performance data of each spare storage device.

[0140] Specifically, the electronic device may obtain weight coefficients corresponding to the response time, network delay, and network bandwidth usage, and then multiply the response time, network delay, and network bandwidth usage by the corresponding weight coefficients, and then add them to obtain the priority corresponding to the backup storage device.

[0141] Step b6, comparing the priorities corresponding to the backup storage devices.

[0142] Specifically, the electronic device may compare the priorities corresponding to the backup storage devices.

[0143] Step b7: determining the backup storage device with the highest priority from among the backup storage devices as the target storage device.

[0144] Specifically, the electronic device may determine, according to the comparison result, the backup storage device with the highest priority from among the backup storage devices as the target storage device.

[0145] Step S3024: If there is a storage device in an abnormal working state, the historical storage files in the storage device in the abnormal working state are stored in the storage device in a normal working state.

[0146] Specifically, the electronic device monitors each storage device to determine whether each storage device is in a normal working state. If it is determined that there is a storage device in an abnormal working state, the electronic device can determine an available storage device from the storage devices in a normal working state, and then store the historical storage files in the storage device in the abnormal working state to the available storage device.

[0147] The process of the electronic device determining the available storage device from the storage devices in normal working state can refer to the process of determining the target storage device, which will not be described in detail here.

[0148] Step S303: create a file storage space in the target storage device, and store the file to be stored in the file storage space.

[0149] For more information about this step, see Figure 3 The introduction of step S203 is not repeated here.

[0150] The file storage method provided in the embodiment of the present application monitors each storage device to determine whether each storage device is in a normal working state; determines each storage device in a normal working state as a candidate storage device, and obtains the remaining capacity corresponding to each candidate storage device; compares the remaining capacity corresponding to each candidate storage device with a preset remaining capacity threshold; determines each candidate storage device whose remaining capacity is greater than the preset remaining capacity threshold as a backup storage device, thereby ensuring that the remaining capacity of the target storage device determined from the backup storage device is large, and further ensuring that the files to be stored can be stored. Obtain the performance data corresponding to each backup storage device, the performance data includes at least one of response time, network delay, and network bandwidth usage; determine the priority corresponding to each backup storage device according to the performance data corresponding to each backup storage device, and ensure the accuracy of the priority corresponding to each backup storage device determined. Compare the priorities corresponding to each backup storage device; determine the backup storage device with the highest priority from each backup storage device as the target storage device, thereby ensuring that the determined target storage device is not only in a normal working state, but also has a large remaining capacity and good performance.

[0151] In addition, if there is a storage device in an abnormal working state, the historical storage files in the storage device in the abnormal working state will be stored in the storage device in the normal working state, thereby avoiding the loss or damage of the historical storage files in the storage device in the abnormal working state and ensuring the safety of the historical storage files in the storage device in the abnormal working state.

[0152] In order to better introduce the file storage method provided by the embodiment of the present application, as shown in Figure 5 As shown, an embodiment of the present application provides a file storage system, wherein:

[0153] manila-api (api module): WSGI application, system API entry, responsible for receiving and processing client file storage instructions, performing identity authentication and access permission authentication based on the IAM module, and sending file storage instructions to the scheduling module.

[0154] manila-scheduler (scheduling module): selects the appropriate target storage device according to the preset scheduling strategy and sends the file storage instructions to the shared module.

[0155] manila-share (sharing module): The sharing service manages the back-end devices that provide a shared file system and communicates with the target storage device based on the driver interface.

[0156] MySQL (database): database, persistent storage sharing, snapshot, network and other data.

[0157] IAM (IDENTITY & ACCESS MANAGEMENT): Identity authentication and access management, a solution that provides controllable and secure access to resources. Most cloud computing vendors now support IAM to provide authorized access to resources. The names of major cloud vendors may be inconsistent, such as Alibaba calls it RAM (Resource Access Management), but the supported functions are basically the same. The keystone authentication method that comes with the original community is complex to configure and deploy, and it is only maintained and used by the open source community and cannot be connected with other cloud platform permissions.

[0158] Among them, the specific work of each module is:

[0159] Step 1: When a user initiates a file storage instruction to create a shared storage through the cloud platform interface or command line, the WEB page or client request first sends the file storage instruction to manila-api.

[0160] Step 2: After receiving the request, manila-api first sends the token information in the file storage instruction header to the IAM module for identity authentication, and then performs access permission verification. Only after the above two steps are passed can the resource be accessed, otherwise the access will be denied.

[0161] Step 3: After the IAM module successfully authenticates the identity, the manila-api module creates a storage record in the Mysql database to indicate that the file is currently being stored. After the file storage is completed, the storage record can be modified to the completed state. After the file storage fails, the storage record can be modified to the storage failure state. Then manila-api notifies the scheduling module to schedule through a function call. The original architecture is that the manila-api module publishes a message to create a shared storage to the MQ queue, waiting for the scheduling module to consume this message. Since the MQ message queue is unstable, it is easy to cause message loss, and it takes a long time to passively wait for the scheduling module to consume the request, which will synchronously block the interface.

[0162] Step 4: The manila-scheduler scheduling module finally selects a target storage device that meets the conditions according to the preset scheduling policy, and sends the request to the sharing module (manila-share) through a function call.

[0163] Step 5: After receiving the request from manila-scheduler, manila-share calls the backend storage to create a file storage interface through the driver by direct function call, and creates a shared file storage in the backend storage, completing the entire shared file storage creation request.

[0164] In this embodiment, a file storage device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0165] This embodiment provides a file storage device, such as Figure 6 As shown, including:

[0166] The acquisition module 401 is used to acquire a file storage instruction input by a user; the file storage instruction includes a file to be stored;

[0167] A determination module 402 is used to identify each storage device and determine a target storage device from each storage device based on a preset scheduling policy;

[0168] The storage module 403 is used to create a file storage space in the target storage device and store the file to be stored in the file storage space.

[0169] In some optional implementations, the determination module 402 is specifically used to authenticate the user identity information in the file storage instruction; if the user identity information is successfully verified, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from each storage device.

[0170] In some optional implementations, the determination module 402 is specifically used to verify the user's access rights based on the user identity information if the user identity information is successfully verified; if the user's access rights are successfully verified, each storage device is identified, and based on a preset scheduling policy, a target storage device is determined from each storage device.

[0171] In some optional implementations, the determination module 402 is specifically used to query the allowed access rights corresponding to the user based on the user identity information; identify the file storage instruction to determine the content to be accessed corresponding to the user; detect whether the content to be accessed exists within the allowed access rights; if the content to be accessed exists within the allowed access rights, it is determined that the user's access rights verification is successful.

[0172] In some optional implementations, the determination module 402 is specifically used to monitor each storage device to determine whether each storage device is in a normal working state; determine each storage device in a normal working state as a candidate storage device; and determine a target storage device from each candidate storage device.

[0173] In some optional implementations, the determination module 402 is specifically used to obtain the remaining capacity corresponding to each candidate storage device; compare the remaining capacity corresponding to each candidate storage device with a preset remaining capacity threshold; determine each candidate storage device whose remaining capacity is greater than the preset remaining capacity threshold as a backup storage device; obtain performance data corresponding to each backup storage device, the performance data including at least one of response time, network latency, and network bandwidth usage; determine the priority corresponding to each backup storage device based on the performance data corresponding to each backup storage device; compare the priorities corresponding to each backup storage device; and determine the backup storage device with the highest priority from among the backup storage devices as the target storage device.

[0174] In some optional implementations, the determination module 402 is further configured to store historical storage files in the storage device in the abnormal working state to the storage device in the normal working state if there is a storage device in the abnormal working state.

[0175] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0176] The file storage device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0177] The embodiment of the present invention also provides a computer device having the above Figure 6 The file storage device shown.

[0178] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0179] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0180] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0181] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0182] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0183] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0184] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0185] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0186] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0187] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A file storage method, characterized in that: The method comprises: Obtaining a file storage instruction input by a user; the file storage instruction includes a file to be stored; Identify each storage device, and determine a target storage device from each storage device based on a preset scheduling strategy; A file storage space is created in the target storage device, and the file to be stored is stored in the file storage space.

2. The method according to claim 1, characterized in that The file storage instruction includes user identity information, and the identifying of each storage device and determining a target storage device from each storage device based on a preset scheduling strategy include: authenticating the user identity information in the file storage instruction; If the user identity information is successfully authenticated, each of the storage devices is identified, and based on the preset scheduling policy, the target storage device is determined from among the storage devices.

3. The method according to claim 2, characterized in that If the user identity information is successfully verified, each of the storage devices is identified, and based on the preset scheduling policy, the target storage device is determined from the storage devices, including: If the user identity information is successfully verified, the user's access rights are verified based on the user identity information; If the access authority of the user is successfully verified, each of the storage devices is identified, and based on the preset scheduling policy, the target storage device is determined from the storage devices.

4. The method according to claim 3, characterized in that The verifying the access rights of the user based on the user identity information includes: Querying the allowed access rights corresponding to the user based on the user identity information; Identify the file storage instruction and determine the content to be accessed corresponding to the user; Detecting whether the content to be accessed exists within the permitted access rights; If the to-be-accessed content exists within the permitted access rights, it is determined that the access rights verification of the user is successful.

5. The method according to any one of claims 1 to 3, characterized in that: The identifying each storage device and determining a target storage device from each storage device based on a preset scheduling strategy includes: Monitoring each of the storage devices to determine whether each of the storage devices is in a normal working state; Determine each of the storage devices in a normal working state as a candidate storage device; The target storage device is determined from each of the candidate storage devices.

6. The method according to claim 5, characterized in that The step of determining the target storage device from the candidate storage devices includes: Obtaining the remaining capacity corresponding to each of the candidate storage devices; Comparing the remaining capacity corresponding to each of the candidate storage devices with a preset remaining capacity threshold; Determine each of the candidate storage devices whose remaining capacity is greater than the preset remaining capacity threshold as a spare storage device; Acquire performance data corresponding to each of the backup storage devices, the performance data including at least one of response time, network delay, and network bandwidth usage; Determining the priority of each of the backup storage devices according to the performance data corresponding to each of the backup storage devices; Comparing the priorities corresponding to the backup storage devices; The backup storage device with the highest priority among the backup storage devices is determined as the target storage device.

7. The method according to claim 5, characterized in that The method further comprises: If there is the storage device in an abnormal working state, the historical storage files in the storage device in the abnormal working state are stored in the storage device in a normal working state.

8. A file storage device, characterized in that: The device comprises: An acquisition module, used to acquire a file storage instruction input by a user; the file storage instruction includes a file to be stored; A determination module, used to identify each storage device and determine a target storage device from each storage device based on a preset scheduling strategy; The storage module is used to create a file storage space in the target storage device and store the file to be stored in the file storage space.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the file storage method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the file storage method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data real-time storage method, data real-time storage device and data real-time storage system in data transmission

    CN102200978A

  • Information storage method and electronic equipment

    CN107861694A

  • File operation method, device, equipment, system and computer readable storage medium

    CN110363026A

  • Information storage method, system and device and storage medium

    CN110839065A

  • Storage apparatus, storage system and storage method

    CN111198826A

Cited By

  • Computer data management method and system based on Internet

    CN119336709A

  • Internet of Things information acquisition method, device, equipment and medium

    CN119544742A

  • File transmission method and device, computer equipment, readable storage medium and program product

    CN119652882A

  • File transmission method and device, computer device, readable storage medium and program product

    CN119652882B