File data processing method and device
By adopting different encryption methods for each file storage system in the cloud file storage system, and utilizing segmented encryption and third-party key management systems, the problems of low efficiency and security in file data processing are solved and high efficiency is achieved. encryption and decryption processing.
Patent Information
- Application Number
- CN202010162436.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-10
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-03-10
AI Technical Summary
Existing file data processing methods have low processing efficiency and security during encryption processing, especially for large files, and the block encryption method will affect writing performance and the organization and management of file data.
In the cloud file storage system, each file storage system uses different encryption methods. By obtaining the user ID and file system ID in the write or read request, the required encryption information is determined and the user data is encrypted or decrypted. Process and store or return the encrypted or decrypted data. Use segmented encryption to improve processing efficiency, and use third-party key management systems or locally cached encryption keys to ensure data security.
It improves the security and efficiency of encryption processing of file data, reduces the system consumption of the file system, and solves the problem of low processing efficiency and security.
Smart Images

Figure CN113382029B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a file data processing method and device. Background Art
[0002] Based on the consideration of data storage security, the file storage system on the cloud server can separate the management and use of keys. First, in terms of key management, third-party key management systems such as KMS can be introduced to ensure security, and the file storage itself only stores ciphertext keys; secondly, when encrypting file content, a variety of encryption schemes can be used: one is the overall encryption method. Traditional file encryption is mostly implemented by encrypting the entire file. Although this encryption method is simple to implement, the entire file content needs to be encrypted and decrypted each time the file is read and written. Therefore, it is only suitable for small file encryption scenarios (for example, documents, pictures, etc.). The encryption method has very poor processing efficiency for large files (for example, videos, installation packages, etc.); the other is block encryption, but this block encryption method will bring great challenges to writing performance and the organization and management of file data.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a file data processing method and device to at least solve the technical problem of low processing efficiency and security when encrypting file data in the existing file data processing method.
[0005] According to one aspect of an embodiment of the present application, a file data processing method is provided, which is applied to a file storage system in the cloud, each file storage system adopts a different encryption method, and the method includes: obtaining a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of the file storage system to be accessed; determining encryption information to be used based on the user identifier and the file system identifier; using the encryption information to encrypt the user data currently being written to obtain encrypted data; and storing the encrypted data to a target location corresponding to the write request.
[0006] According to another aspect of an embodiment of the present application, a file data processing method is also provided. The method is applied to a cloud-based file storage system, and each file storage system adopts a different encryption method. The method includes: obtaining a read request, wherein the information carried in the read request includes: a user identifier, a file system identifier of the file storage system to be accessed, and a data range to be read; determining encryption information to be used based on the user identifier and the file system identifier; decrypting multiple data segments within the data range to be read according to the encryption information to obtain decrypted data; and returning the decrypted data to the client.
[0007] According to another aspect of an embodiment of the present application, a file data processing device is also provided. The device is applied to a file storage system in the cloud, and each file storage system adopts a different encryption method. The device includes: an acquisition module, used to obtain a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of the file storage system to be accessed; a determination module, used to determine the encryption information to be used based on the user identifier and the file system identifier; an encryption module, used to use the encryption information to encrypt the user data currently being written to obtain encrypted data; and a storage module, used to store the encrypted data to a target location corresponding to the write request.
[0008] According to another aspect of an embodiment of the present application, a file data processing device is also provided. The device is applied to a file storage system in the cloud, and each file storage system adopts a different encryption method. The device includes: an acquisition unit, used to obtain a read request, wherein the information carried in the read request includes: a user identifier, a file system identifier of the file storage system to be accessed, and a data range to be read; a determination unit, used to determine the encryption information to be used based on the user identifier and the file system identifier; a decryption unit, used to decrypt multiple data segments within the data range to be read according to the encryption information to obtain decrypted data; and a return unit, used to return the decrypted data to the client.
[0009] According to another aspect of an embodiment of the present application, a storage medium is further provided, wherein the storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute any one of the file data processing methods described above.
[0010] According to another aspect of an embodiment of the present application, a computer device is further provided, including a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes any one of the above-mentioned file data processing methods when running.
[0011] According to another aspect of an embodiment of the present application, a file data processing system is also provided, including: a processor; and a memory, connected to the above-mentioned processor, for providing the above-mentioned processor with instructions for processing the following processing steps: obtaining a write request, wherein the information carried in the above-mentioned write request includes: a user identifier and a file system identifier of a file storage system to be accessed; determining encryption information to be used based on the above-mentioned user identifier and the above-mentioned file system identifier; using the above-mentioned encryption information to encrypt the user data currently being written to obtain encrypted data; and storing the above-mentioned encrypted data to a target location corresponding to the above-mentioned write request.
[0012] In an embodiment of the present application, a write request is obtained, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed; encryption information to be used is determined based on the user identifier and the file system identifier; the user data currently being written is encrypted using the encryption information to obtain encrypted data; and the encrypted data is stored in a target location corresponding to the write request.
[0013] It is easy to notice that the embodiment of the present application determines the encryption information used to encrypt the currently written user data based on the user identifier carried in the acquired write request and the file system identifier of the file storage system to be accessed, and uses the encryption information to encrypt the user data, thereby obtaining the corresponding encrypted data and storing the encrypted data in the target location corresponding to the acquired write request.
[0014] Therefore, the embodiments of the present application achieve the purpose of improving the data security and data processing efficiency of encrypting file data, thereby achieving the technical effect of reducing the system consumption of the file system, and further solving the technical problem of low processing efficiency and security when encrypting file data in the existing file data processing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a file data processing method according to an embodiment of the present application;
[0017] Figure 2 is a flow chart of a file data processing method according to an embodiment of the present application;
[0018] Figure 3is a flowchart of an optional file data processing method according to an embodiment of the present application;
[0019] Figure 4 is a flowchart of another file data processing method according to an embodiment of the present application;
[0020] Figure 5 is a flowchart of another optional file data processing method according to an embodiment of the present application;
[0021] Figure 6 is a structural schematic diagram of a file data processing device according to an embodiment of the present invention;
[0022] Figure 7 is a schematic structural diagram of another file data processing device according to an embodiment of the present invention;
[0023] Figure 8 It is a structural block diagram of a computer terminal according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0027] KMS: Key Management Service (KMS) is a secure and easy-to-use management service.
[0028] AES: Advanced Encryption Standard (AES) in cryptography.
[0029] Meta: It is an auxiliary tag in the head area of HTML language, located in the head of the document, and does not contain any content. The attributes of the tag define the name / value pairs associated with the document.
[0030] Example 1
[0031] According to an embodiment of the present application, an embodiment of a file data processing method is also 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.
[0032] The method embodiment provided in Embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a file data processing method. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0033] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0034] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the file data processing method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned file data processing method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 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.
[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0037] In this technical field, when guiding the upload of user data to the cloud server, since some user data requires higher security, it is necessary to provide an encryption function for the user data, and encrypt the user data based on the user-set or automatically generated password and then store it persistently; and, it can also be combined with the transmission encryption method (encrypting the data during transmission and decrypting it when the user client receives the data) to provide full-link data encryption capabilities for the user data.
[0038] Under the above operating environment, this application provides Figure 2 A file data processing method is shown, Figure 2 is a flowchart of a file data processing method according to an embodiment of the present application, such as Figure 2 As shown, the above file data processing method can be applied to a cloud file storage system, each file storage system adopts a different encryption method, and includes the following method steps:
[0039] Step S202, obtaining a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed;
[0040] Step S204, determining the encryption information to be used based on the user identifier and the file system identifier;
[0041] Step S206, using the encryption information to encrypt the currently written user data to obtain encrypted data;
[0042] Step S208: storing the encrypted data to a target location corresponding to the write request.
[0043] In an embodiment of the present application, a write request is obtained, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed; encryption information to be used is determined based on the user identifier and the file system identifier; the user data currently being written is encrypted using the encryption information to obtain encrypted data; and the encrypted data is stored in a target location corresponding to the write request.
[0044] It is easy to notice that the embodiment of the present application determines the encryption information used to encrypt the currently written user data based on the user identifier carried in the acquired write request and the file system identifier of the file storage system to be accessed, and uses the encryption information to encrypt the user data, thereby obtaining the corresponding encrypted data and storing the encrypted data in the target location corresponding to the acquired write request.
[0045] Therefore, the embodiments of the present application achieve the purpose of improving the data security and data processing efficiency of encrypting file data, thereby achieving the technical effect of reducing the system consumption of the file system, and further solving the technical problem of low processing efficiency and security when encrypting file data in the existing file data processing method.
[0046] Optionally, the above-mentioned write request may be but is not limited to a request to write user data to the cloud server, and the information carried in the write request may be but is not limited to including: a user identifier and a file system identifier of the file storage system to be accessed, and the user identifier and the file system identifier of the file storage system to be accessed can be used to determine the encryption information to be used; optionally, the above-mentioned encryption information includes at least one of the following: an encryption algorithm to be used, an encryption key.
[0047] Optionally, in an embodiment of the present application, the encryption algorithm to be used can be selected according to user settings, and it is also possible but not limited to adopting a segmented encryption method. After the currently written user data is segmented, the segmented user data is encrypted in parallel using the above-mentioned encryption information to obtain encrypted data, and the encrypted data is stored in the target location corresponding to the write request, thereby achieving the purpose of improving the data security and data processing efficiency of the encrypted processing of the user data, and achieving the technical effect of reducing the system consumption of the file system.
[0048] In an optional embodiment, the encryption information at least includes: an encryption algorithm to be used, and the encryption information is determined based on the user identifier and the file system identifier, including:
[0049] Step S302, obtaining metadata information of the file system based on the user identifier and the file system identifier;
[0050] Step S304: determining the encryption algorithm from the metadata information.
[0051] Optionally, the above encryption algorithm can be but is not limited to an AES symmetric encryption algorithm, for example, an AES128 encryption algorithm, an AES192 encryption algorithm, and an AES256 encryption algorithm. The encryption algorithm can split the plaintext user data into several plaintext blocks, and fill the last plaintext block according to the selected filling method. Each plaintext block is encrypted into a ciphertext block using an AES encryptor and a key, and all the ciphertext blocks are concatenated to obtain encrypted data.
[0052] In the above optional embodiment, after obtaining the user identifier carried in the write request and the file system identifier of the file storage system to be accessed, the metadata information of the file system can be obtained based on the above user identifier and the above file system identifier; since the metadata information of the file system stores information such as the ciphertext key and the encryption algorithm, the encryption algorithm to be used for encrypting the user data can be determined from the metadata information of the file system.
[0053] Optionally, since the setting levels of the file systems are different, different encryption algorithms and encryption keys may be set for each file system.
[0054] In an optional embodiment, the encryption information further includes: an encryption key, and the encryption information is determined based on the user identifier and the file system identifier to include:
[0055] Step S402: obtaining the encryption key from the local cache of the file system based on the user identifier and the file system identifier; or, if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, obtaining the encryption key from a third-party key management system, wherein the encryption key is a plaintext key obtained by decrypting the ciphertext key locally stored in the file system through the third-party key management system.
[0056] Optionally, the encryption key may be, but is not limited to, a plaintext key, i.e., a plaintext key obtained by decrypting the ciphertext key stored locally in the file system through the third-party key management system. The third-party key management system may be a KMS key management service system, which, as a trusted external key management system, may use the HTTPS protocol to ensure that the managed encryption key is secure and reliable during storage and transmission.
[0057] As an optional embodiment, on the one hand, in order to reduce system consumption and latency, the file system only stores ciphertext keys locally and does not persistently store plaintext keys of user data; on the other hand, in order to avoid frequent requests for the KMS key management service of a third-party key management system, the file system can cache the plaintext keys in a local cache.
[0058] In the embodiment of the present application, since the file system does not persistently store the plaintext key of the user data, the data security of the user data can be guaranteed. Even if the file system is hacked by an attacker, the attacker can only obtain the encrypted user data and the ciphertext key, but cannot decrypt the plaintext key and the plaintext user data.
[0059] Therefore, in the case where the encryption information in the embodiment of the present application also includes an encryption key, the encryption key can be obtained from the local cache of the file system based on the user identifier and the file system identifier; or, if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, that is, the encryption key does not exist in the local cache of the file system, the encryption key is obtained from a third-party key management system.
[0060] In an optional embodiment, the encryption information further includes: an encryption key, and the encryption information is determined based on the user identifier and the file system identifier to include:
[0061] Step S502: Based on the user identifier and the file system identifier, the encryption key generated locally in the file system in advance and encrypted and stored locally in the file system is obtained.
[0062] In an optional embodiment of the present application, the file system can request the KMS key management service of a third-party key management system (for example, a KMS key management service system), but in fact, in order to avoid frequent requests for the KMS key management service of a third-party key management system, or in the absence of the KMS key management service, the encryption key generated and stored locally in the file system can also be used to perform encryption and decryption operations on file data. After obtaining the user identifier carried in the write request and the file system identifier of the file storage system to be accessed, the encryption key generated and encrypted and stored locally in the file system in advance can be obtained based on the above user identifier and the above file system identifier.
[0063] Optionally, in an embodiment of the present application, based on the design requirements for security, the file system can obtain the encryption key by decrypting the ciphertext key stored locally in the above file system with the help of a third-party key management system. Or in the absence of a third-party key management system to provide KMS key management services, the file system can encrypt the local plaintext key of the file system according to a preset encryption algorithm and store it locally; it can also obtain the data key uploaded by the user in the preset communication interface (for example, HTTPS interface) provided by the client for the user, and encrypt the data key locally in the file system to obtain the encryption key and store it locally.
[0064] It should be noted that, in the embodiment of the present application, in order to reduce the system overhead of the file system, the encryption and decryption algorithm can be implemented using dedicated encryption and decryption hardware.
[0065] In an optional embodiment, the encryption information further includes: an encryption key, and the encryption information is determined based on the user identifier and the file system identifier to include:
[0066] Step S602: based on the user identifier and the file system identifier, the encryption key pre-uploaded by the client to the file system through a preset communication interface and encrypted and stored locally in the file system is obtained.
[0067] Optionally, the above-mentioned preset communication interface can be but is not limited to an HTTPS interface. It should be noted that the HTTPS hypertext transfer protocol is a secure HTTP channel, that is, a network transmission protocol that adds encrypted transmission and identity authentication on the basis of the HTTP protocol.
[0068] In an embodiment of the present application, based on the design requirements of security, in the absence of a third-party key management system to provide KMS key management services, the file system can obtain the data key uploaded by the user in the preset communication interface provided by the client for the user, and encrypt the data key locally in the file system to obtain the encryption key and store it locally.
[0069] In an optional embodiment, the user data is encrypted using the encryption information to obtain the encrypted data, which includes:
[0070] Step S702, dividing the user data into multiple data segments according to a preset length;
[0071] Step S704: Use the encryption information to perform parallel encryption processing on the multiple data segments to obtain the encrypted data.
[0072] Optionally, since the method of encrypting and decrypting the entire file content when modifying and reading user data is only applicable to small files, and results in high performance loss of the file system and waste of CPU resources; therefore, in an embodiment of the present application, a method of segmented encryption of user data is adopted, the above-mentioned user data is divided into multiple data segments according to a preset length, and the above-mentioned encryption information is used to perform parallel encryption processing on the above-mentioned multiple data segments to obtain the above-mentioned encrypted data.
[0073] In the embodiment of the present application, the method of encrypting user data in segments is adopted, which can effectively reduce the performance loss of the file system when encrypting user data and improve the data reading and writing efficiency of the file system.
[0074] In an optional embodiment, storing the encrypted data to the target location includes:
[0075] Step S802, checking whether there is a first portion of data in the encrypted data that does not comply with the data alignment rule corresponding to the target position;
[0076] Step S804, if it exists, merge the above-mentioned first part of data to obtain merged data, and store the above-mentioned merged data and the second part of data in the above-mentioned encrypted data except the above-mentioned first part of data to the above-mentioned target location; if it does not exist, directly store the above-mentioned encrypted data to the above-mentioned target location.
[0077] As an optional embodiment, since the file system processes encrypted data randomly by reading and writing, when writing the encrypted data to the target location, if the written encrypted data contains the first part of data that does not comply with the data alignment rule corresponding to the target location, there may be system performance problems. Therefore, in the embodiment of the present application, the unaligned first part of data can be merged, and the obtained merged data and the second part of data in the above-mentioned encrypted data except the above-mentioned first part of data can be stored in the above-mentioned target location.
[0078] Since in the embodiment of the present application, only the first part of the misaligned data needs to be merged and the entire data block does not need to be merged, the range of data that needs to be merged can be minimized, thereby reducing the system overhead and write latency of the file system.
[0079] The following is an optional embodiment to illustrate the file processing method embodiment provided by the present application. Figure 3 is a flowchart of an optional file data processing method according to an embodiment of the present application. Figure 3 As shown, the above optional file data processing method can be applied to a cloud file storage system, each file storage system adopts a different encryption method, and is implemented in the following method steps:
[0080] Step S902, obtaining a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed;
[0081] Step S904, determining the encryption information to be used based on the user identifier and the file system identifier;
[0082] Step S906, dividing the user data into multiple data segments according to a preset length;
[0083] Step S908, using the encryption information to perform parallel encryption processing on the multiple data segments to obtain the encrypted data;
[0084] Step S910, checking whether there is a first portion of data in the encrypted data that does not comply with the data alignment rule corresponding to the target position;
[0085] Among them, in the above step S910, if the inspection result indicates existence, step S912 is executed, and if the inspection result indicates non-existence, step S914 is executed.
[0086] Step S912, merging the first part of data to obtain merged data, and storing the merged data and the second part of data in the encrypted data except the first part of data to the target location.
[0087] Step S914, directly storing the encrypted data to the target location.
[0088] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0089] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0090] Example 2
[0091] According to an embodiment of the present application, an embodiment of a file data processing method is also 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.
[0092] Under the same or similar operating environment as in Example 1, the present application provides the following Figure 4 Another file data processing method shown in FIG. Figure 4 is a flowchart of another file data processing method according to an embodiment of the present application. Figure 4 As shown, the above file data processing method can be applied to a cloud file storage system, each file storage system adopts a different encryption method, and includes the following method steps:
[0093] Step S1002, obtaining a read request, wherein the information carried in the read request includes: a user identifier, a file system identifier of a file storage system to be accessed, and a data range to be read;
[0094] Step S1004, determining the encryption information to be used based on the user identifier and the file system identifier;
[0095] Step S1006, decrypting the multiple data segments within the data range to be read according to the encryption information to obtain decrypted data;
[0096] Step S1008: Return the decrypted data to the client.
[0097] In an embodiment of the present application, a read request is obtained, wherein the information carried in the read request includes: a user identifier, a file system identifier of a file storage system to be accessed, and a data range to be read; encryption information to be used is determined based on the user identifier and the file system identifier; multiple data segments within the data range to be read are decrypted using the encryption information to obtain decrypted data; and the decrypted data is returned to the client.
[0098] It is easy to notice that the embodiment of the present application determines the encryption information used to decrypt the user data based on the user identifier carried in the obtained read request and the file system identifier of the file storage system to be accessed, and uses the encryption information to decrypt multiple data segments within the above-mentioned data range to be read, thereby obtaining the corresponding decrypted data and returning the decrypted data to the client.
[0099] Therefore, the embodiments of the present application achieve the purpose of improving the data security and data processing efficiency of decrypting encrypted data, thereby achieving the technical effect of reducing the system consumption of the file system, and further solving the technical problem of low processing efficiency and security when decrypting encrypted data in the existing file data processing method.
[0100] Optionally, the above-mentioned read request may be but is not limited to a request for reading file data being written to the cloud server. The information carried in the read request may be but is not limited to including: user identification, file system identification of the file storage system to be accessed, and data range to be read. The user identification and the file system identification of the file storage system to be accessed can be used to determine the encryption information to be used.
[0101] Optionally, the above encryption information includes at least one of the following: an encryption algorithm used during encryption, and an encryption key used during encryption.
[0102] Optionally, in an embodiment of the present application, when encrypting user data, the encryption algorithm to be used can be selected according to user settings, and it is also possible but not limited to using a segmented encryption method. After the currently written user data is segmented, the segmented user data is encrypted in parallel using the above-mentioned encryption information to obtain encrypted data, and the encrypted data is stored in the target location corresponding to the write request.
[0103] Therefore, when decrypting the encrypted data, multiple data segments within the data range to be read can be decrypted according to the encryption information determined based on the user identifier and the file system identifier to obtain decrypted data, and then the decrypted data can be returned to the client. This can achieve the purpose of improving the data security and data processing efficiency of decrypting the encrypted data, and can also achieve the technical effect of reducing the system consumption of the file system.
[0104] In an optional embodiment, the encryption information at least includes: an encryption algorithm to be used, and the encryption information is determined based on the user identifier and the file system identifier, including:
[0105] Step S1102, obtaining metadata information of the file system based on the user identifier and the file system identifier;
[0106] Step S1104, determining the encryption algorithm from the metadata information.
[0107] Optionally, the above encryption algorithm can be but is not limited to an AES symmetric encryption algorithm, for example, an AES128 encryption algorithm, an AES192 encryption algorithm, and an AES256 encryption algorithm. The encryption algorithm can split the plaintext user data into several plaintext blocks, and fill the last plaintext block according to the selected filling method. Each plaintext block is encrypted into a ciphertext block using an AES encryptor and a key, and all the ciphertext blocks are concatenated to obtain encrypted data.
[0108] In the above optional embodiment, after obtaining the user identifier carried in the write request and the file system identifier of the file storage system to be accessed, the metadata information of the file system can be obtained based on the above user identifier and the above file system identifier; since the metadata information of the file system stores information such as the ciphertext key and the encryption algorithm, the encryption algorithm to be used for encrypting the user data can be determined from the metadata information of the file system.
[0109] Optionally, since the setting levels of the file systems are different, different encryption algorithms and encryption keys may be set for each file system.
[0110] In an optional embodiment, the encryption information further includes: an encryption key, and the encryption information is determined based on the user identifier and the file system identifier to include:
[0111] Step S1202: obtaining the encryption key from the local cache of the file system based on the user identifier and the file system identifier; or, if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, obtaining the encryption key from a third-party key management system, wherein the encryption key is a plaintext key obtained by decrypting the ciphertext key locally stored in the file system through the third-party key management system.
[0112] Optionally, the encryption key may be, but is not limited to, a plaintext key, i.e., a plaintext key obtained by decrypting the ciphertext key stored locally in the file system through the third-party key management system. The third-party key management system may be a KMS key management service system, which, as a trusted external key management system, may use the HTTPS protocol to ensure that the managed encryption key is secure and reliable during storage and transmission.
[0113] As an optional embodiment, on the one hand, in order to reduce system consumption and latency, the file system only stores ciphertext keys locally and does not persistently store plaintext keys of user data; on the other hand, in order to avoid frequent requests for the KMS key management service of a third-party key management system, the file system can cache the plaintext keys in a local cache.
[0114] In the embodiment of the present application, since the file system does not persistently store the plaintext key of the user data, the data security of the user data can be guaranteed. Even if the file system is hacked by an attacker, the attacker can only obtain the encrypted user data and the ciphertext key, but cannot decrypt the plaintext key and the plaintext user data.
[0115] Therefore, in the case where the encryption information in the embodiment of the present application also includes an encryption key, the encryption key can be obtained from the local cache of the file system based on the user identifier and the file system identifier; or, if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, that is, the encryption key does not exist in the local cache of the file system, the encryption key is obtained from a third-party key management system.
[0116] In an optional embodiment, the encryption information further includes: an encryption key, and the encryption information is determined based on the user identifier and the file system identifier to include:
[0117] Step S1302: Based on the user identifier and the file system identifier, the encryption key that is pre-generated locally in the file system and encrypted and stored locally in the file system is obtained.
[0118] In an optional embodiment of the present application, the file system can request the KMS key management service of a third-party key management system (for example, a KMS key management service system), but in fact, in order to avoid frequent requests for the KMS key management service of a third-party key management system, or in the absence of the KMS key management service, the encryption key generated and stored locally in the file system can also be used to perform encryption and decryption operations on file data. After obtaining the user identifier carried in the write request and the file system identifier of the file storage system to be accessed, the encryption key generated and encrypted and stored locally in the file system in advance can be obtained based on the above user identifier and the above file system identifier.
[0119] Optionally, in an embodiment of the present application, based on the design requirements for security, the file system can obtain the encryption key by decrypting the ciphertext key stored locally in the above file system with the help of a third-party key management system. Or in the absence of a third-party key management system to provide KMS key management services, the file system can encrypt the local plaintext key of the file system according to a preset encryption algorithm and store it locally; it can also obtain the data key uploaded by the user in the preset communication interface (for example, HTTPS interface) provided by the client for the user, and encrypt the data key locally in the file system to obtain the encryption key and store it locally.
[0120] It should be noted that, in the embodiment of the present application, in order to reduce the system overhead of the file system, the encryption and decryption algorithm can be implemented using dedicated encryption and decryption hardware.
[0121] In an optional embodiment, the encryption information further includes: an encryption key, and the encryption information is determined based on the user identifier and the file system identifier to include:
[0122] Step S1402: based on the user identifier and the file system identifier, the encryption key pre-uploaded by the client to the file system through a preset communication interface and encrypted and stored locally in the file system is obtained.
[0123] Optionally, the above-mentioned preset communication interface can be but is not limited to an HTTPS interface. It should be noted that the HTTPS hypertext transfer protocol is a secure HTTP channel, which adds encrypted transmission and identity authentication to the HTTP protocol.
[0124] In an embodiment of the present application, based on the design requirements of security, in the absence of a third-party key management system to provide KMS key management services, the file system can obtain the data key uploaded by the user in the preset communication interface provided by the client for the user, and encrypt the data key locally in the file system to obtain the encryption key and store it locally.
[0125] In an optional embodiment, Figure 5 is a flowchart of another optional file data processing method according to an embodiment of the present application. Figure 5 As shown, the above-mentioned multiple data segments are decrypted according to the above-mentioned encryption information, and the above-mentioned decrypted data includes:
[0126] Step S1502, obtaining decryption information corresponding to the above encryption information;
[0127] Step S1504: Use the decryption information to perform parallel decryption processing on the multiple data segments to obtain the decrypted data.
[0128] Optionally, since the method of encrypting and decrypting the entire file content when modifying and reading the user data is only applicable to small files, and results in high performance loss of the file system and waste of CPU resources; therefore, in the embodiment of the present application, a method of segmented encryption of the user data is adopted, the user data is divided into multiple data segments according to a preset length, and the multiple data segments are encrypted in parallel using the encryption information to obtain the encrypted data. Therefore, when the multiple data segments are decrypted according to the encryption information, the decryption information corresponding to the encryption information can be obtained, and the multiple data segments are decrypted in parallel using the decryption information to obtain the decrypted data.
[0129] In the embodiment of the present application, the method of encrypting and decrypting user data in segments is adopted, which can effectively reduce the performance loss of the file system when encrypting and decrypting user data, and improve the data reading and writing efficiency of the file system.
[0130] In addition, it is still necessary to explain that the optional or preferred implementation of this embodiment can refer to the relevant description in Example 1, which will not be repeated here.
[0131] Example 3
[0132] According to an embodiment of the present application, a device embodiment for implementing the above-mentioned file data processing method is also provided. The file data processing device can be applied to a file storage system in the cloud, and each file storage system adopts a different encryption method. Figure 6 is a schematic diagram of the structure of a file data processing device according to an embodiment of the present invention. Figure 6 As shown, the device 600 includes: an acquisition module 602, a determination module 604, an encryption module 606 and a storage module 608, wherein:
[0133] An acquisition module 602 is used to obtain a write request, wherein the information carried in the above write request includes: a user identifier and a file system identifier of a file storage system to be accessed; a determination module 604 is used to determine encryption information to be used based on the above user identifier and the above file system identifier; an encryption module 606 is used to use the above encryption information to encrypt the currently written user data to obtain encrypted data; a storage module 608 is used to store the above encrypted data to a target location corresponding to the above write request.
[0134] It should be noted that the acquisition module 602, the determination module 604, the encryption module 606 and the storage module 608 correspond to steps S202 to S208 in Example 1, and the four modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.
[0135] In addition, it is still necessary to explain that the optional or preferred implementation modes of this embodiment can refer to the relevant descriptions in Examples 1 and 2, which will not be repeated here.
[0136] Example 4
[0137] According to an embodiment of the present application, another device embodiment for implementing the above-mentioned file data processing method is also provided. The file data processing device can be applied to a cloud file storage system, and each file storage system adopts a different encryption method. Figure 7 is a schematic diagram of the structure of another file data processing device according to an embodiment of the present invention. Figure 7 As shown, the device 700 includes: an acquisition unit 702, a determination unit 704, a decryption unit 706 and a return unit 708, wherein:
[0138] An acquisition unit 702 is used to acquire a read request, wherein the information carried in the above read request includes: a user identifier, a file system identifier of the file storage system to be accessed, and a data range to be read; a determination unit 704 is used to determine the encryption information to be used based on the above user identifier and the above file system identifier; a decryption unit 706 is used to decrypt multiple data segments within the above data range to be read according to the above encryption information to obtain decrypted data; and a return unit 708 is used to return the above decrypted data to the client.
[0139] It should be noted that the acquisition unit 702, the determination unit 704, the decryption unit 706 and the return unit 708 correspond to steps S1002 to S1006 in Embodiment 2, and the examples and application scenarios implemented by the four units and the corresponding steps are the same, but are not limited to the contents disclosed in the above Embodiment 2. It should be noted that the above modules as part of the device can be run in the computer terminal 10 provided in Embodiment 1.
[0140] In addition, it is still necessary to explain that the optional or preferred implementation modes of this embodiment can refer to the relevant descriptions in Examples 1 and 2, which will not be repeated here.
[0141] Example 5
[0142] According to an embodiment of the present application, an embodiment of a file data processing system is also provided. The system can be used to execute any optional file data processing method in embodiment 1 or 2, and can also be used to execute any optional file data processing device in embodiment 3 or 4. The system includes:
[0143] A processor; and a memory, connected to the processor, for providing the processor with instructions for processing the following processing steps: obtaining a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed; determining encryption information to be used based on the user identifier and the file system identifier; encrypting the user data currently being written using the encryption information to obtain encrypted data; and storing the encrypted data in a target location corresponding to the write request.
[0144] In an embodiment of the present application, a write request is obtained, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed; encryption information to be used is determined based on the user identifier and the file system identifier; the user data currently being written is encrypted using the encryption information to obtain encrypted data; and the encrypted data is stored in a target location corresponding to the write request.
[0145] It is easy to notice that the embodiment of the present application determines the encryption information used to encrypt the currently written user data based on the user identifier carried in the acquired write request and the file system identifier of the file storage system to be accessed, and uses the encryption information to encrypt the user data, thereby obtaining the corresponding encrypted data and storing the encrypted data in the target location corresponding to the acquired write request.
[0146] Therefore, the embodiments of the present application achieve the purpose of improving the data security and data processing efficiency of encrypting file data, thereby achieving the technical effect of reducing the system consumption of the file system, and further solving the technical problem of low processing efficiency and security when encrypting file data in the existing file data processing method.
[0147] In addition, it is still necessary to explain that the optional or preferred implementation modes of this embodiment can refer to the relevant descriptions in Examples 1 and 2, which will not be repeated here.
[0148] Example 6
[0149] According to an embodiment of the present application, an embodiment of a computer terminal is also provided, and the computer terminal can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above-mentioned computer terminal can also be replaced by a terminal device such as a mobile terminal.
[0150] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.
[0151] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the file data processing method of the application: obtaining a write request, wherein the information carried in the above-mentioned write request includes: a user identifier and a file system identifier of the file storage system to be accessed; determining the encryption information to be used based on the above-mentioned user identifier and the above-mentioned file system identifier; using the above-mentioned encryption information to encrypt the user data currently being written to obtain encrypted data; and storing the above-mentioned encrypted data to the target location corresponding to the above-mentioned write request.
[0152] Optionally, Figure 8 is a structural block diagram of a computer terminal according to an embodiment of the present application, such as Figure 8 As shown, the computer terminal 800 may include: one or more (only one is shown in the figure) processors 802 , a memory 804 , and a peripheral interface 806 .
[0153] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the file data processing method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned file data processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 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.
[0154] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain a write request, wherein the information carried in the above write request includes: a user identifier and a file system identifier of the file storage system to be accessed; determine the encryption information to be used based on the above user identifier and the above file system identifier; use the above encryption information to encrypt the user data currently being written to obtain encrypted data; and store the above encrypted data to a target location corresponding to the above write request.
[0155] Optionally, the processor may also execute program codes of the following steps: obtaining metadata information of the file system based on the user identifier and the file system identifier; and determining the encryption algorithm from the metadata information.
[0156] Optionally, the processor may also execute program code of the following steps: obtaining the encryption key from the local cache of the file system based on the user identifier and the file system identifier; or, if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, obtaining the encryption key from a third-party key management system, wherein the encryption key is a plaintext key obtained by decrypting the ciphertext key stored locally in the file system through the third-party key management system.
[0157] Optionally, the processor may also execute a program code of the following steps: based on the user identifier and the file system identifier, obtaining the encryption key that is pre-generated locally in the file system and encrypted and stored locally in the file system.
[0158] Optionally, the processor may also execute the program code of the following steps: based on the user identifier and the file system identifier, obtaining the encryption key that is pre-uploaded to the file system by the client through a preset communication interface and encrypted and stored locally in the file system.
[0159] Optionally, the processor may also execute program codes of the following steps: dividing the user data into a plurality of data segments according to a preset length; and performing parallel encryption processing on the plurality of data segments using the encryption information to obtain the encrypted data.
[0160] Optionally, the processor may also execute the program code of the following steps: checking whether there is a first part of data in the encrypted data that does not comply with the data alignment rules corresponding to the target position; if so, merging the first part of data to obtain merged data, and storing the merged data and the second part of data in the encrypted data except the first part of data to the target position; if not, directly storing the encrypted data to the target position.
[0161] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain a read request, wherein the information carried in the above read request includes: a user identifier, a file system identifier of the file storage system to be accessed, and a data range to be read; determine the encryption information to be used based on the above user identifier and the above file system identifier; decrypt multiple data segments within the above data range to be read according to the above encryption information to obtain decrypted data; and return the above decrypted data to the client.
[0162] Optionally, the processor may also execute program codes of the following steps: obtaining metadata information of the file system based on the user identifier and the file system identifier; and determining the encryption algorithm from the metadata information.
[0163] Optionally, the processor may also execute program code of the following steps: obtaining the encryption key from the local cache of the file system based on the user identifier and the file system identifier; or, if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, obtaining the encryption key from a third-party key management system, wherein the encryption key is a plaintext key obtained by decrypting the ciphertext key stored locally in the file system through the third-party key management system.
[0164] Optionally, the processor may also execute a program code of the following steps: based on the user identifier and the file system identifier, obtaining the encryption key that is pre-generated locally in the file system and encrypted and stored locally in the file system.
[0165] Optionally, the processor may also execute the program code of the following steps: based on the user identifier and the file system identifier, obtaining the encryption key that is pre-uploaded to the file system by the client through a preset communication interface and encrypted and stored locally in the file system.
[0166] Optionally, the processor may also execute program codes of the following steps: obtaining decryption information corresponding to the encryption information; and performing parallel decryption processing on the multiple data segments using the decryption information to obtain the decrypted data.
[0167] By adopting the embodiment of the present application, a solution for file data processing is provided. By obtaining a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed; determining encryption information to be used based on the user identifier and the file system identifier; encrypting the currently written user data using the encryption information to obtain encrypted data; and storing the encrypted data in a target location corresponding to the write request.
[0168] Therefore, the embodiments of the present application achieve the purpose of improving the data security and data processing efficiency of encrypting file data, thereby achieving the technical effect of reducing the system consumption of the file system, and further solving the technical problem of low processing efficiency and security when encrypting file data in the existing file data processing method.
[0169] It can be understood by those skilled in the art that Figure 8 The structure shown is for illustration only, and the computer terminal may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 8 The structure of the electronic device is not limited. For example, the computer terminal 800 may also include Figure 8 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 8 Different configurations are shown.
[0170] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0171] Example 7
[0172] According to an embodiment of the present application, an embodiment of a storage medium is also provided. Optionally, in this embodiment, the above-mentioned storage medium can be used to store the program code executed by the file data processing method provided in the above-mentioned embodiment 1 or 2.
[0173] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0174] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining a write request, wherein the information carried in the above write request includes: a user identifier and a file system identifier of a file storage system to be accessed; determining encryption information to be used based on the above user identifier and the above file system identifier; using the above encryption information to encrypt the user data currently being written to obtain encrypted data; and storing the above encrypted data to a target location corresponding to the above write request.
[0175] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: obtaining metadata information of the file system based on the user identifier and the file system identifier; and determining the encryption algorithm from the metadata information.
[0176] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining the encryption key from the local cache of the file system based on the user identifier and the file system identifier, or obtaining the encryption key from a third-party key management system if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, wherein the encryption key is a plaintext key obtained by decrypting the ciphertext key stored locally in the file system through the third-party key management system.
[0177] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: based on the user identifier and the file system identifier, obtaining the encryption key that is pre-generated locally in the file system and encrypted and stored locally in the file system.
[0178] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: based on the user identifier and the file system identifier, obtaining the encryption key that is pre-uploaded by the client to the file system through a preset communication interface and encrypted and stored locally in the file system.
[0179] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: dividing the above user data into multiple data segments according to preset lengths; and performing parallel encryption processing on the above multiple data segments using the above encryption information to obtain the above encrypted data.
[0180] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: checking whether there is a first part of data in the above-mentioned encrypted data that does not comply with the data alignment rules corresponding to the above-mentioned target position; if so, merging the above-mentioned first part of data to obtain merged data, and storing the above-mentioned merged data and the second part of data in the above-mentioned encrypted data except the above-mentioned first part of data to the above-mentioned target position; if not, directly storing the above-mentioned encrypted data to the above-mentioned target position.
[0181] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining a read request, wherein the information carried in the read request includes: a user identifier, a file system identifier of a file storage system to be accessed, and a data range to be read; determining encryption information to be used based on the user identifier and the file system identifier; decrypting multiple data segments within the data range to be read according to the encryption information to obtain decrypted data; and returning the decrypted data to the client.
[0182] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: obtaining metadata information of the file system based on the user identifier and the file system identifier; and determining the encryption algorithm from the metadata information.
[0183] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining the encryption key from the local cache of the file system based on the user identifier and the file system identifier, or obtaining the encryption key from a third-party key management system if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, wherein the encryption key is a plaintext key obtained by decrypting the ciphertext key stored locally in the file system through the third-party key management system.
[0184] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: based on the user identifier and the file system identifier, obtaining the encryption key that is pre-generated locally in the file system and encrypted and stored locally in the file system.
[0185] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: based on the user identifier and the file system identifier, obtaining the encryption key that is pre-uploaded by the client to the file system through a preset communication interface and encrypted and stored locally in the file system.
[0186] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: obtaining decryption information corresponding to the above-mentioned encryption information; and performing parallel decryption processing on the above-mentioned multiple data segments using the above-mentioned decryption information to obtain the above-mentioned decrypted data.
[0187] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0188] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0189] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0190] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0191] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0192] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0193] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A file data processing method, the method is applied to a file storage system in the cloud, different file storage systems are respectively provided with different encryption information, the method comprising: Obtaining a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed; Determining encryption information to be used based on the user identifier and the file system identifier, wherein the encryption information includes an encryption algorithm and an encryption key to be used, the encryption key includes a plaintext key, and the plaintext key is pre-cached locally in the file storage system; The encryption information is used to encrypt the currently written user data to obtain encrypted data; The encrypted data is stored in a target location corresponding to the write request.
2. The method according to claim 1, characterized in that: Determining the encryption information based on the user identifier and the file system identifier includes: Acquire metadata information of the file system based on the user identifier and the file system identifier; The encryption algorithm is determined from the metadata information.
3. The method according to claim 2, characterized in that Determining the encryption information based on the user identifier and the file system identifier includes: The encryption key is obtained from a local cache of the file system based on the user identifier and the file system identifier, or if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, the encryption key is obtained from a third-party key management system, wherein the encryption key is a plaintext key obtained by decrypting a ciphertext key locally stored in the file system through the third-party key management system.
4. The method according to claim 2, characterized in that: Determining the encryption information based on the user identifier and the file system identifier includes: The encryption key that is pre-generated locally in the file system and encrypted and stored locally in the file system is acquired based on the user identifier and the file system identifier.
5. The method according to claim 2, characterized in that: Determining the encryption information based on the user identifier and the file system identifier includes: The encryption key that is pre-uploaded to the file system by the client through a preset communication interface and is encrypted and stored locally in the file system is obtained based on the user identifier and the file system identifier.
6. The method according to claim 1, characterized in that The user data is encrypted using the encryption information to obtain the encrypted data, including: Dividing the user data into multiple data segments according to preset lengths; The encryption information is used to perform parallel encryption processing on the multiple data segments to obtain the encrypted data.
7. The method according to claim 1, characterized in that Storing the encrypted data in the target location includes: Checking whether there is a first portion of data in the encrypted data that does not comply with a data alignment rule corresponding to the target position; If it exists, the first part of the data is merged to obtain merged data, and the merged data and the second part of the encrypted data except the first part of the data are stored in the target location; if it does not exist, the encrypted data is directly stored in the target location.
8. A file data processing method, the method is applied to a file storage system in the cloud, different file storage systems are respectively provided with different encryption information, the method comprising: Obtaining a read request, wherein the information carried in the read request includes: a user identifier, a file system identifier of a file storage system to be accessed, and a data range to be read; Determining encryption information to be used based on the user identifier and the file system identifier, wherein the encryption information includes an encryption algorithm and an encryption key to be used, the encryption key includes a plaintext key, and the plaintext key is pre-cached locally in the file storage system; Decrypting multiple data segments within the data range to be read according to the encryption information to obtain decrypted data; The decrypted data is returned to the client.
9. The method according to claim 8, characterized in that Determining the encryption information based on the user identifier and the file system identifier includes: Acquire metadata information of the file system based on the user identifier and the file system identifier; The encryption algorithm is determined from the metadata information.
10. The method according to claim 9, characterized in that Determining the encryption information based on the user identifier and the file system identifier includes: The encryption key is obtained from a local cache of the file system based on the user identifier and the file system identifier, or if the encryption key is not obtained from the local cache of the file system based on the user identifier and the file system identifier, the encryption key is obtained from a third-party key management system, wherein the encryption key is a plaintext key obtained by decrypting a ciphertext key locally stored in the file system through the third-party key management system.
11. The method according to claim 9, characterized in that Determining the encryption information based on the user identifier and the file system identifier includes: The encryption key that is pre-generated locally in the file system and encrypted and stored locally in the file system is acquired based on the user identifier and the file system identifier.
12. The method according to claim 9, characterized in that Determining the encryption information based on the user identifier and the file system identifier includes: The encryption key that is pre-uploaded to the file system by the client through a preset communication interface and is encrypted and stored locally in the file system is obtained based on the user identifier and the file system identifier.
13. The method according to claim 8, characterized in that Decrypting the multiple data segments according to the encryption information to obtain the decrypted data includes: Obtaining decryption information corresponding to the encrypted information; The decryption information is used to perform parallel decryption processing on the multiple data segments to obtain the decrypted data.
14. A file data processing device, characterized in that: The device is applied to a file storage system in the cloud, and different file storage systems are respectively provided with different encryption information. The device comprises: An acquisition module, used for acquiring a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed; a determination module, configured to determine encryption information to be used based on the user identifier and the file system identifier, wherein the encryption information includes an encryption algorithm and an encryption key to be used, the encryption key includes a plaintext key, and the plaintext key is pre-cached locally in the file storage system; An encryption module, used to encrypt the currently written user data using the encryption information to obtain encrypted data; A storage module is used to store the encrypted data to a target location corresponding to the write request.
15. A file data processing device, characterized in that: The device is applied to a file storage system in the cloud, and different file storage systems use different encryption information. The device includes: An acquisition unit, configured to acquire a read request, wherein the information carried in the read request includes: a user identifier, a file system identifier of a file storage system to be accessed, and a data range to be read; a determining unit, configured to determine encryption information to be used based on the user identifier and the file system identifier, wherein the encryption information includes an encryption algorithm and an encryption key to be used, the encryption key includes a plaintext key, and the plaintext key is pre-cached locally in the file storage system; A decryption unit, configured to decrypt a plurality of data segments within the data range to be read according to the encryption information to obtain decrypted data; The returning unit is used to return the decrypted data to the client.
16. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the file data processing method according to any one of claims 1 to 13.
17. A computer device comprising a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein: When the program is run, the file data processing method according to any one of claims 1 to 13 is executed.
18. A file data processing system, characterized in that: include: processor; as well as A memory is connected to the processor and is used to provide the processor with instructions for processing the following processing steps: obtaining a write request, wherein the information carried in the write request includes: a user identifier and a file system identifier of a file storage system to be accessed; determining encryption information to be used based on the user identifier and the file system identifier, wherein the encryption information includes an encryption algorithm and an encryption key to be used, and the encryption key includes a plaintext key, and the plaintext key is pre-cached locally in the file storage system; using the encryption information to encrypt the user data currently being written to obtain encrypted data; and storing the encrypted data in a target location corresponding to the write request.
