A static website hosting method, device, equipment and storage medium

By identifying and adding the Multipurpose Internet Mail Extensions attribute in a storage system that integrates S3 and NAS protocols, static website resources in file storage formats can be recognized. This solves the problem that static website resources do not support static website hosting and enables static website hosting for file users.

CN116010741BActive Publication Date: 2026-02-03JINAN INSPUR DATA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310018870.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-06
Publication Date
2026-02-03
Estimated Expiration
2043-01-06

AI Technical Summary

Technical Problem

In storage systems that integrate S3 and NAS protocols, static website resource files do not support static website hosting, resulting in the loss of object characteristics.

Method used

By determining the storage format of static website resources, if it is a file storage format, the Multipurpose Internet Mail Extensions attribute information is added to it, giving it the common attributes of a file, so that it can be recognized by the Simple Storage Service Protocol and thus achieve static hosting.

Benefits of technology

The integrated storage system supports static website hosting of user-uploaded files, ensuring the availability of object features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010741B_ABST
    Figure CN116010741B_ABST
Patent Text Reader

Abstract

The application discloses a static website hosting method and device, equipment and storage medium, and relates to the technical field of computers. The method comprises the following steps: obtaining static website resources uploaded by a target storage system cluster; the target storage system cluster is a cluster after fusion and intercommunication based on a simple storage service protocol and a network attached storage protocol; judging whether the static website resources are in a file storage format according to parameter information corresponding to the static website resources; if the static website resources are in the file storage format, adding multi-purpose Internet mail extension type attribute information to the static website resources to obtain target files after attribute addition, so as to utilize the target files for static hosting. By adding the multi-purpose Internet mail extension type attribute, the file also has the characteristics of an object, can be identified by the simple storage service protocol, the availability of the object characteristics after fusion is ensured, and the file uploaded by a file user can be supported for static website hosting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a static website hosting method, apparatus, device, and storage medium. Background Technology

[0002] Currently, users can host static websites on object storage, and visitors can access the hosted static websites through the static website domain provided by the object storage service or a bound custom domain. However, static website hosting is a feature unique to object storage. When the system is based on object storage, it supports setting up using S3 (S3 Simple Storage Service) commands and accessing the site through a custom domain in a browser. But when S3 and NAS (Network Attached Storage) protocols are integrated and interoperable, the system is based on files. In this case, static website resource files created by users of the integrated system do not support static website hosting. In other words, the S3 protocol based on object storage supports static website hosting, but the storage system with integrated S3 and NAS protocols based on files does not, resulting in the loss of object storage features. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide a static website hosting method, apparatus, device, and medium that supports static website hosting of files uploaded by file users on a file-based storage system that integrates and interoperates with S3 and NAS protocols. The specific solution is as follows:

[0004] Firstly, this application discloses a static website hosting method, including:

[0005] Obtain static website resources uploaded by the target storage system cluster; the target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol.

[0006] Based on the parameter information corresponding to the static website resource, determine whether the static website resource is a file storage format;

[0007] If the static website resource is a file storage format, then add the Multipurpose Internet Mail Extensions attribute information to the static website resource to obtain the target file with the added attribute, so as to use the target file for static hosting.

[0008] Optionally, after determining whether the static website resource is in a file storage format, the method further includes:

[0009] If the static website resource is not in file storage format, then it is determined that the static website resource is in object storage format, and the static website resource is directly used for static hosting.

[0010] Optionally, obtaining the static website resources uploaded by the target storage system cluster includes:

[0011] Obtain static website resources uploaded by the target storage system cluster from the target namespace; the target namespace is a namespace created on the basis of the target storage system cluster and supports public read and write operations.

[0012] Optionally, before adding the Multipurpose Internet Mail Extensions attribute information to the static website resource, the method further includes:

[0013] Determine whether the static website resource possesses the Multipurpose Internet Mail Extensions attribute;

[0014] If it does not exist, then perform the operation of adding the Multipurpose Internet Mail Extensions attribute information to the static website resource.

[0015] Optionally, determining whether the static website resource is in a file storage format includes:

[0016] Identify the user who uploaded the static website resources;

[0017] The permissions corresponding to the user are matched with a pre-created permission mapping table; the permission mapping table is created based on the permission configurations corresponding to different types of users, including file users and object users;

[0018] Based on the matching results, determine whether the static website resource is a file storage format.

[0019] Optionally, determining whether the static website resource is in a file storage format includes:

[0020] The parameter information of the static website resources is matched with pre-created object characteristic rules; the object characteristic rules are created based on the object characteristics of the object storage format.

[0021] If the match fails, the static website resource is determined to be in file storage format;

[0022] If a match is found, it is determined that the static website resource is not a file storage format.

[0023] Optionally, adding the Multipurpose Internet Mail Extensions attribute information to the static website resource includes:

[0024] Add a target field representing the Multipurpose Internet Mail Extensions attribute to the file parameters corresponding to the static website resource so that the static website resource can be recognized by the Simple Storage Service Protocol.

[0025] Secondly, this application discloses a static website hosting device, comprising:

[0026] The resource acquisition module is used to acquire static website resources uploaded by the target storage system cluster; the target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol.

[0027] The judgment module is used to determine whether the static website resource is a file storage format based on the parameter information corresponding to the static website resource.

[0028] The attribute adding module is used to add Multipurpose Internet Mail Extensions attribute information to the static website resource if the static website resource is a file storage format, so as to obtain the target file after attribute addition, so as to use the target file for static hosting.

[0029] Thirdly, this application discloses an electronic device, including:

[0030] Memory, used to store computer programs;

[0031] A processor for executing the computer program to implement the aforementioned static website hosting method.

[0032] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned static website hosting method.

[0033] In this application, static website resources uploaded by a target storage system cluster are obtained. The target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol (SSSP) and Network Attached Storage Protocol (NAS). Based on the parameter information corresponding to the static website resources, it is determined whether the static website resources are in a file storage format. If the static website resources are in a file storage format, Multipurpose Internet Mail Extensions (MIL) attribute information is added to the static website resources to obtain a target file with the added attribute, which can then be used for static hosting. Therefore, for static website resources uploaded by a cluster based on the integration and interoperability of SSP and NAS, the storage format is determined. When it is determined to be a file storage format, the MIL attribute is added to the file, giving it both common file attributes and object characteristics, enabling it to be recognized by SSP and ensuring the availability of the integrated object characteristics. On a storage system based on files and integrating S3 and NAS protocols, static website hosting of files uploaded by file users is supported. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0035] Figure 1 A flowchart of a static website hosting method provided in this application;

[0036] Figure 2 A flowchart illustrating a specific static website hosting method provided in this application;

[0037] Figure 3 This application provides a schematic diagram of the structure of a static website hosting device.

[0038] Figure 4 This application provides a structural diagram of an electronic device. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0040] In existing technologies, static website hosting is a feature unique to object storage. When the system is based on object storage, it supports setting up S3 (S3 Simple Storage Service) commands and accessing it through a browser using a custom domain name. However, when S3 and NAS (Network Attached Storage) protocols are integrated and interoperable, the system becomes file-based. In this case, static website resource files created by users of the integrated system do not support static website hosting, resulting in the loss of the object storage feature. To overcome the above technical problems, this application proposes a static website hosting method for S3 and NAS protocol integration and interoperability, enabling static website hosting of files uploaded by file users on a file-based S3 and NAS protocol integrated and interoperable storage system.

[0041] This application discloses a static website hosting method. See [link to relevant documentation] Figure 1 As shown, the method may include the following steps:

[0042] Step S11: Obtain static website resources uploaded by the target storage system cluster; the target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol.

[0043] In this embodiment, static website resources uploaded by the target storage system cluster after the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol are first obtained. At this time, the static website resources may be objects uploaded by object users or files uploaded by file users.

[0044] In this embodiment, obtaining the static website resources uploaded by the target storage system cluster may include: obtaining the static website resources uploaded by the target storage system cluster from the target namespace; the target namespace is a namespace created on the basis of the target storage system cluster and supports public read and write operations. It is understandable that, in this embodiment, for static website resources uploaded to the storage system cluster after the integration and interoperability of Simple Storage Service Protocol (SSSP) and Network Attached Storage Protocol (NAT), attributes that can be recognized by SSSSP need to be added. Therefore, the static website resources are uploaded to the public read / write space. The process of uploading static website resources from the target storage system cluster includes: after deploying the target storage cluster in a multi-protocol interoperability environment, configuring the services of each node in the cluster; specifically, enabling the RGW service (Rados Gateway) and file NFS service (NFS, Network File System) on each node, where the RGW service is an object storage service provided by the distributed file system and its interface is compatible with S3; configuring the cluster's static website hosting domain name and adding domain name resolution locally; in the integrated interoperability environment, creating a bucket or creating a directory under the client's mount directory to create a namespace using the bucket or directory, specifying the target user, and setting the ACL (Access Control List) of the namespace. The namespace is set to public read / write; an NFS share is created in the namespace, the target user uploads static website resources to the namespace, and the access control list of the static website resources is set to public read / write so that the backend can read the uploaded static website resources and add attributes.

[0045] Step S12: Determine whether the static website resource is a file storage format based on the parameter information corresponding to the static website resource.

[0046] In this embodiment, based on the parameter information corresponding to the static website resource, it is determined whether the static website resource is in a file storage format, that is, whether the static website resource is in a file storage format or an object storage format. Since object storage formats can be directly statically hosted, file storage formats require additional attributes. The parameter information can include the parameter information of the static website resource itself, or it can include the information of the user who uploaded the static website resource.

[0047] In this embodiment, after determining whether the static website resource is a file storage format, the process may further include: if the static website resource is not a file storage format, then determining that the static website resource is an object storage format, and directly using the static website resource for static hosting. That is, if it is determined that the current static website resource is not a file storage format, it is equivalent to determining that the static website resource is an object storage format. Since the cluster based on the integration and interoperability of the Simple Storage Service Protocol and the Network Attached Storage Protocol supports static hosting based on objects, it is sufficient to directly use the static website resource for static hosting.

[0048] In this embodiment, determining whether the static website resource is in file storage format may include: identifying the user who uploaded the static website resource; matching the user's permissions with a pre-created permission mapping table; the permission mapping table is created based on the permission configurations corresponding to different types of users, including file users and object users; and determining whether the static website resource is in file storage format based on the matching result. It is understood that, within the merged cluster, file users uploading static website resources in file storage format use the Network Attached Storage Protocol (NAT), while object users uploading static website resources in object storage format use the Simple Storage Service Protocol (SSSP). Typically, file users have different permissions than object users. Therefore, a permission mapping table for rule matching can be created based on the permission configurations corresponding to different types of users. This permission mapping table is then used to determine the type of the current user, and thus the type of the current resource data. Specifically, if the current user's permissions match the permission configuration corresponding to a file user, then the current user is determined to be a file user, and thus the current static website resource is determined to be in file storage format; if the current user's permissions match the permission configuration corresponding to an object user, then the current user is determined to be an object user, and thus the current static website resource is determined to be in object storage format.

[0049] In this embodiment, determining whether the static website resource is a file storage format may include: matching the parameter information of the static website resource with pre-created object characteristic rules; the object characteristic rules are created based on the object characteristics of the object storage format; if the match fails, the static website resource is determined to be a file storage format; if the match succeeds, the static website resource is determined not to be a file storage format. It is understood that since files and objects have different characteristics, determining whether a static website resource is a file storage format can also be achieved based on file characteristics and object characteristics. Specifically, object characteristic rules can be created in advance based on the object characteristics of the object storage format (here, object characteristics refer to characteristics that distinguish it from a file), and then the parameter information of the static website resource is matched with the pre-created object characteristic rules. If the parameter information does not match the object characteristic rules, the static website resource is determined to be a file storage format; if the parameter information matches the object characteristic rules, the static website resource is determined not to be a file storage format.

[0050] Similarly, file characteristic rules can be created in advance based on the file characteristics of the file storage format, and these rules can be used to determine the storage format of static website resources. In this embodiment, determining whether the static website resource is a file storage format may include: matching the parameter information of the static website resource with the pre-created file characteristic rules; the file characteristic rules are created based on the file characteristics of the file storage format; if the match fails, the static website resource is determined not to be a file storage format; if the match succeeds, the static website resource is determined to be a file storage format. Here, file characteristics refer to characteristics that can distinguish objects. Then, the parameter information of the static website resource is matched with the file characteristic rules. If the parameter information does not match the file characteristic rules, the static website resource is determined to be an object storage format; if the parameter information matches the file characteristic rules, the static website resource is determined to be a file storage format.

[0051] Step S13: If the static website resource is a file storage format, add the Multipurpose Internet Mail Extensions attribute information to the static website resource to obtain the target file after attribute addition, so as to use the target file for static hosting.

[0052] In this embodiment, if it is determined that the static website resource is a file storage format, the Multipurpose Internet Mail Extensions (MIME) attribute is added to the static website resource to obtain the target file with the added attribute, so that the target file can be used for static hosting. It is understood that if the currently uploaded static website resource is detected to be in a file storage format uploaded by a file user, this file lacks the MIME attribute and is a binary file. Accessing static web hosting in this case will default to downloading. Therefore, in this embodiment, a storage format determination is performed for each newly uploaded resource data. When it is detected that an object lacks the MIME attribute, the attribute is added to the object so that it can be recognized by the Simple Storage Service Protocol (SLS).

[0053] In this embodiment, before adding the Multipurpose Internet Mail Extensions (MIL) attribute information to the static website resource, the method may further include: determining whether the static website resource possesses the MIL attribute; if not, then performing the operation of adding the MIL attribute information to the static website resource. That is, normally, resource data uploaded by file users does not contain the MIL attribute, but to avoid repeatedly adding the same attribute to resource data that already contains it, a determination can be made before adding the attribute. Alternatively, in this embodiment, the MIL attribute can also be used as a criterion for determining whether the static website resource is a file storage format. If the static website resource does not have the MIL attribute, then the step of adding the MIL attribute information to the static website resource is performed; if it exists, then static hosting is directly performed.

[0054] In this embodiment, adding the Multipurpose Internet Mail Extensions (MIL) attribute information to the static website resource may include: adding a target field representing the MIL attribute to the file parameters corresponding to the static website resource, so that the static website resource can be recognized by the Simple Storage Service Protocol (SLS). Specifically, adding the MIL attribute to the static website resource is achieved by adding a target field representing the MIL attribute to the file parameters corresponding to the static website resource.

[0055] As can be seen from the above, this embodiment acquires static website resources uploaded by the target storage system cluster. The target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol (SSSP) and Network Attached Storage Protocol (NAS). Based on the parameter information corresponding to the static website resources, it is determined whether the static website resources are in a file storage format. If the static website resources are in a file storage format, Multipurpose Internet Mail Extensions (MIL) attribute information is added to the static website resources to obtain the target file with the added attribute, so that the target file can be used for static hosting. It is evident that for static website resources uploaded by the cluster based on the integration and interoperability of SSP and NAS, the storage format is determined. When it is determined to be a file storage format, the MIL attribute is added to the file, giving it both common file attributes and object characteristics, enabling it to be recognized by SSP and ensuring the availability of the integrated object characteristics. On the file-based S3 and NAS protocol integrated and interoperable storage system, static website hosting of files uploaded by file users is supported.

[0056] For example Figure 2 The diagram illustrates the process from building a multi-protocol interoperability cluster to adding attributes, including the following steps:

[0057] (1): Deploy a multi-protocol interoperability environment cluster, namely a storage system cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol, and ensure that the RGW service and file NFS service of each node in the cluster are enabled.

[0058] (2): The cluster has been configured with a static website hosting domain name and domain name resolution has been added locally;

[0059] (3): In an integrated and interoperable environment, create a bucket or a directory under the client's mount directory to create a namespace (space1), specify the user as nfsuser1, and set the ACL of the namespace to public read and write;

[0060] (4): space1 creates an NFS share, nfsuser1 uploads the files required for static website hosting test to space1 and sets them to public read and write permissions, then uploads object file1 and sets the ACL of object file1 to public read and write;

[0061] (5): It was detected that the currently uploaded object file1 was uploaded by file user nfsuser1. At this time, the object is missing a MIME type. Add a MIME attribute to the object so that it can be recognized by the S3 protocol.

[0062] As can be seen, by adding a judgment mechanism, when new resource data is detected in the cluster, it is determined whether the resource data was uploaded by an object or a file. If it was uploaded by an S3 user, no processing is performed on the object; if it was uploaded by a file, the attributes of the object are modified or added so that it can be recognized by the S3 protocol. Thus, on a storage system that integrates and interoperates with S3 and NAS protocols based on files, static website hosting can also be supported for static websites uploaded by file users.

[0063] Accordingly, this application also discloses a static website hosting device, see [link to relevant documentation]. Figure 3 As shown, the device includes:

[0064] Resource acquisition module 11 is used to acquire static website resources uploaded by the target storage system cluster; the target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol.

[0065] The judgment module 12 is used to determine whether the static website resource is a file storage format based on the parameter information corresponding to the static website resource.

[0066] The attribute adding module 13 is used to add multipurpose Internet Mail extension type attribute information to the static website resource if the static website resource is a file storage format, so as to obtain the target file after attribute addition, so as to use the target file for static hosting.

[0067] As can be seen from the above, this embodiment acquires static website resources uploaded by the target storage system cluster. The target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol (SSSP) and Network Attached Storage Protocol (NAS). Based on the parameter information corresponding to the static website resources, it is determined whether the static website resources are in a file storage format. If the static website resources are in a file storage format, Multipurpose Internet Mail Extensions (MIL) attribute information is added to the static website resources to obtain the target file with the added attribute, so that the target file can be used for static hosting. It is evident that for static website resources uploaded by the cluster based on the integration and interoperability of SSP and NAS, the storage format is determined. When it is determined to be a file storage format, the MIL attribute is added to the file, giving it both common file attributes and object characteristics, enabling it to be recognized by SSP and ensuring the availability of the integrated object characteristics. On the file-based S3 and NAS protocol integrated and interoperable storage system, static website hosting of files uploaded by file users is supported.

[0068] In some specific embodiments, the static website hosting device may specifically include:

[0069] The static hosting unit is used to determine that the static website resource is in object storage format if the static website resource is not in file storage format, and to directly use the static website resource for static hosting.

[0070] If it is determined that the current static website resource is not a file storage format, it is equivalent to determining that the static website resource is an object storage format. Since the cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol supports static hosting based on objects, static hosting can be performed directly using the static website resource.

[0071] In some specific embodiments, the resource acquisition module 11 may specifically include:

[0072] The static website resource acquisition unit is used to acquire static website resources uploaded by the target storage system cluster from the target namespace; the target namespace is a namespace created on the basis of the target storage system cluster and supports public read and write operations.

[0073] In some specific embodiments, the static website hosting device may specifically include:

[0074] An attribute determination unit is used to determine whether the static website resource has the Multipurpose Internet Mail Extensions attribute.

[0075] An execution unit is configured to perform the operation of adding multipurpose Internet Mail extension type attribute information to the static website resource if the resource does not exist.

[0076] To avoid repeatedly adding the same attribute to resource data that already contains it, a check can be performed before adding the attribute. Alternatively, in this embodiment, the Multipurpose Internet Mail Extensions (MIL) attribute can be used to determine whether a static website resource is a file storage format. If the static website resource does not have the MIL attribute, the step of adding the MIL attribute information to the static website resource is executed; if it exists, static hosting is performed directly.

[0077] In some specific embodiments, the determination module 12 may specifically include:

[0078] The user determination unit is used to determine the user who uploaded the static website resources.

[0079] The permission matching unit is used to match the permissions corresponding to the user with a pre-created permission mapping table; the permission mapping table is created based on the permission configurations corresponding to different types of users, including file users and object users;

[0080] The judgment unit is used to determine whether the static website resource is a file storage format based on the matching result.

[0081] In this way, within the merged cluster, users who upload static website resources in file storage format use the Network Attached Storage Protocol (NAT) to upload files, while users who upload static website resources in object storage format use the Simple Storage Service Protocol (SSSP). Since file users typically have different permissions than object users, a permission mapping table can be created based on the permission configurations corresponding to different types of users for rule matching. This permission mapping table can then be used to determine the type of the current user and thus the type of the current resource data.

[0082] In some specific embodiments, the determination module 12 may specifically include:

[0083] The object rule matching unit is used to match the parameter information of the static website resources with pre-created object characteristic rules; the object characteristic rules are created based on the object characteristics of the object storage format.

[0084] The file storage format determination unit is used to determine that the static website resource is a file storage format if the matching fails.

[0085] The non-file storage format determination unit is used to determine that the static website resource is not a file storage format if a match is successful.

[0086] Since files and objects have different characteristics, it is possible to determine whether a static website resource is stored in a file format by judging based on file characteristics and object characteristics. Here, object characteristics refer to characteristics that can be distinguished from files.

[0087] In some specific embodiments, the determination module 12 may specifically include:

[0088] The file rule matching unit is used to match the parameter information of the static website resources with pre-created file characteristic rules; the file characteristic rules are created based on the file characteristics of the file storage format.

[0089] The non-file storage format determination unit is used to determine that the static website resource is not a file storage format if the matching fails.

[0090] The file storage format determination unit is used to determine that the static website resource is a file storage format if a match is successful.

[0091] Here, document characteristics refer to the features that distinguish it from an object.

[0092] In some specific embodiments, the attribute adding module 13 may specifically include:

[0093] An attribute adding unit is used to add a target field representing the Multipurpose Internet Mail Extensions attribute to the file parameters corresponding to the static website resource, so that the static website resource can be recognized by the Simple Storage Service Protocol.

[0094] Furthermore, this application also discloses an electronic device, see [link to relevant documentation]. Figure 4 As shown, the content in the figure should not be considered as any limitation on the scope of use of this application.

[0095] Figure 4 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the static website hosting method disclosed in any of the foregoing embodiments.

[0096] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0097] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223 including static website resources, etc. The storage method can be temporary storage or permanent storage.

[0098] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. In addition to including computer programs capable of performing the static website hosting method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0099] Furthermore, this application also discloses a computer storage medium storing computer-executable instructions. When these instructions are loaded and executed by a processor, they acquire static website resources uploaded by a target storage system cluster. The target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol (LSSP) and Network Attached Storage Protocol (NAT). Based on the parameter information corresponding to the static website resources, it is determined whether the static website resources are in a file storage format. If the static website resources are in a file storage format, Multipurpose Internet Mail Extensions (MIL) attribute information is added to the static website resources to obtain a target file with the added attributes, which is then used for static hosting. This also includes the static website hosting method steps disclosed in any of the foregoing embodiments.

[0100] Furthermore, this application also discloses a computer program product that, when running, acquires static website resources uploaded by a target storage system cluster; the target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol; determines whether the static website resource is a file storage format based on the parameter information corresponding to the static website resource; if the static website resource is a file storage format, adds Multipurpose Internet Mail Extensions attribute information to the static website resource to obtain a target file with added attributes, so as to use the target file for static hosting, and the steps of the static website hosting method disclosed in any of the foregoing embodiments.

[0101] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0102] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0103] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0104] The foregoing has provided a detailed description of a static website hosting method, apparatus, device, and medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A static website hosting method, characterized in that, include: Retrieve static website resources uploaded by the target storage system cluster; The target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol. Based on the parameter information corresponding to the static website resource, determine whether the static website resource is a file storage format; If the static website resource is a file storage format, then add the Multipurpose Internet Mail Extensions attribute information to the static website resource to obtain the target file after attribute addition, so as to use the target file for static hosting; If the static website resource is not a file storage format, then it is determined that the static website resource is an object storage format, and the static website resource is directly used for static hosting. The step of adding multipurpose Internet Mail extension type attribute information to the static website resource includes: Add a target field representing the Multipurpose Internet Mail Extensions attribute to the file parameters corresponding to the static website resource so that the static website resource can be recognized by the Simple Storage Service Protocol. Before adding the Multipurpose Internet Mail Extensions attribute information to the static website resource, the method further includes: Determine whether the static website resource possesses the Multipurpose Internet Mail Extensions attribute; If it does not exist, then perform the operation of adding the Multipurpose Internet Mail Extensions attribute information to the static website resource.

2. The static website hosting method according to claim 1, characterized in that, The acquisition of static website resources uploaded by the target storage system cluster includes: Obtain static website resources uploaded by the target storage system cluster from the target namespace; the target namespace is a namespace created on the basis of the target storage system cluster and supports public read and write operations.

3. The static website hosting method according to claim 1, characterized in that, The step of determining whether the static website resource is a file storage format includes: Identify the user who uploaded the static website resources; The permissions corresponding to the user are matched with a pre-created permission mapping table; the permission mapping table is created based on the permission configurations corresponding to different types of users, including file users and object users; Based on the matching results, determine whether the static website resource is a file storage format.

4. The static website hosting method according to claim 1, characterized in that, The step of determining whether the static website resource is a file storage format includes: The parameter information of the static website resources is matched with pre-created object characteristic rules; the object characteristic rules are created based on the object characteristics of the object storage format. If the match fails, the static website resource is determined to be in file storage format; If a match is found, it is determined that the static website resource is not a file storage format.

5. A static website hosting device, characterized in that, include: The resource acquisition module is used to acquire static website resources uploaded by the target storage system cluster; The target storage system cluster is a cluster based on the integration and interoperability of Simple Storage Service Protocol and Network Attached Storage Protocol. The judgment module is used to determine whether the static website resource is a file storage format based on the parameter information corresponding to the static website resource. The attribute adding module is used to add Multipurpose Internet Mail Extensions attribute information to the static website resource if the static website resource is a file storage format, so as to obtain the target file after attribute addition, so as to use the target file for static hosting. A static hosting unit is used to determine that the static website resource is an object storage format if the static website resource is not a file storage format, and to directly use the static website resource for static hosting. The attribute adding module is used to add a target field representing the Multipurpose Internet Mail Extensions attribute to the file parameters corresponding to the static website resource, so that the static website resource can be recognized by the Simple Storage Service Protocol. The static website hosting device is further configured to determine whether the static website resource has the multipurpose Internet Mail extension type attribute before adding the multipurpose Internet Mail extension type attribute information to the static website resource; if it does not exist, the operation of adding the multipurpose Internet Mail extension type attribute information to the static website resource is performed.

6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the static website hosting method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, Used for storing computer programs; wherein the computer programs, when executed by a processor, implement the static website hosting method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Mass storage distributed system black and white list control method and device

    CN114615008A