Data storage management method, device, electronic device and storage medium
By generating and managing tenant storage configuration information, the problem that the existing technology cannot customize the storage requirements, the secure isolation and management of tenant data is achieved, and the confusion and leakage of data storage is avoided.
Patent Information
- Application Number
- CN202410740866.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-06-07
AI Technical Summary
The existing storage methods cannot be customized to meet the storage needs of different tenants, resulting in data confusion, data leakage and non-compliance in data storage.
By obtaining tenant information and business information of the tenant, the storage configuration information of the corresponding tenant is generated, including the storage path of the tenant in the object storage service. Then build a mapping relationship between the tenant information and the storage configuration information, and build multiple data tables with hierarchical relationships to manage and store the tenant's business data.
It realizes the distinction between the storage configuration of each tenant, isolates and manages the business data generated by the tenant in different sub-business systems, ensures the data security of each tenant, and avoids the confusion and leakage of data storage.
Smart Images

Figure CN118626010B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security, and in particular to a data storage management method, device, electronic equipment and storage medium. Background Art
[0002] There are many different businesses in the business system of an enterprise, such as network security management business, office equipment management business and software security management business. Various businesses in the business system will generate a large amount of business data, so the enterprise needs to save the generated business data, such as: tenant network configuration data generated by network security management business, storage peripheral access data generated by office equipment management, etc. Tenants corresponding to different businesses have different requirements for data preservation solutions, including storage requirements of different architectures, storage requirements of different regions, etc.
[0003] However, the current storage methods cannot be customized for different storage needs, which may lead to data confusion, data leakage and non-compliant data storage. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a data storage management method, device, electronic device and storage medium to solve the problem that the current storage method cannot be customized according to different storage requirements, which may cause data confusion, data leakage and non-compliant data storage.
[0005] In a first aspect, an embodiment of the present invention provides a data storage management method, the method comprising:
[0006] Obtaining a configuration request, wherein the configuration request carries tenant information of at least one tenant and business information associated with the tenant;
[0007] In response to the configuration request, generating storage configuration information corresponding to the tenant based on the tenant information and the business information, wherein the storage configuration information includes: a storage path of the tenant in the object storage service;
[0008] Constructing a mapping relationship between the tenant information and the storage configuration information, and constructing a plurality of data tables with a hierarchical relationship using the mapping relationship;
[0009] When a business data storage request is received, data storage processing is performed based on multiple data tables with a hierarchical relationship.
[0010] In a second aspect, an embodiment of the present invention provides a data storage management device, the device comprising:
[0011] An acquisition module, configured to acquire a configuration request, wherein the configuration request carries tenant information of at least one tenant and business information associated with the tenant;
[0012] A response module, configured to respond to the configuration request and generate storage configuration information corresponding to the tenant based on the tenant information and the business information, wherein the storage configuration information includes: a storage path of the tenant in the object storage service;
[0013] A generation module, used to construct a mapping relationship between the tenant information and the storage configuration information, and to construct a plurality of data tables with a hierarchical relationship using the mapping relationship;
[0014] The processing module is used to perform data storage processing based on multiple data tables with a hierarchical relationship when receiving a business data storage request.
[0015] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0017] The embodiment of the present application generates storage configuration information corresponding to the tenant based on tenant information and business information, and the storage configuration information includes the storage path of the tenant in the object storage service. In this way, the storage configuration of each tenant can be distinguished, and the business data generated by the tenant in different sub-business systems can be isolated to ensure the data security of each tenant. Then, a hierarchical relationship of multiple data tables is constructed by mapping the tenant information and the storage configuration information. In this way, the data of different tenants can be separated, and the storage path of each tenant can be managed more clearly. When a business data storage request is subsequently received from a sub-business system of the tenant, the corresponding storage path can be directly located according to the data table, so that the data of each tenant is correctly stored, avoiding confusion and leakage of data storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 is a schematic diagram of a system framework provided according to some embodiments of the present invention;
[0020] Figure 2 is a flow chart of a data storage management method according to some embodiments of the present invention;
[0021] Figure 3 is a schematic diagram of the relationship between tenants and sub-business systems according to some embodiments of the present invention;
[0022] Figure 4 is a flow chart of a data storage management method according to some embodiments of the present invention;
[0023] Figure 5 is a schematic diagram of a business data storage process according to some embodiments of the present invention;
[0024] Figure 6 is a structural block diagram of a data storage management device according to an embodiment of the present invention;
[0025] Figure 7 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0027] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0028] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
[0029] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0030] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.
[0031] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.
[0032] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.
[0033] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0034] Office security usually involves the security management of networks, identities, and terminals. By implementing private network networking, access control, terminal management in private networks, and information security protection, digital office can be made safer, more efficient, and easier to use. Security management at the network level can ensure that private networks such as office networks can operate safely and efficiently, thereby ensuring that business data can be safely transmitted and stored. Security management at the identity level can improve the efficiency and security of identity authentication for users accessing private networks. Security management at the terminal level can achieve unified management of terminal devices within the private network, data leakage prevention, and terminal threat protection, thereby ensuring the security of corporate data.
[0035] In actual applications, the security management of networks, identities, and terminals can achieve technical linkage in multiple technical branches such as networking strategies, network access and control, remote access, unified terminal management, terminal detection and response, enterprise data leakage prevention, and identity authentication management, making digital office simpler, more efficient, and easier to implement.
[0036] At present, different tenants need to meet the diverse needs of different customers for the storage solutions of various types of data. The diverse needs are mainly divided into storage needs of different architectures, storage needs of different regions, storage needs of different subsystems, and storage needs of different priorities. Tenants refer to organizations that use cloud services on cloud computing platforms. Tenants can meet their own needs by renting cloud resources. For example, tenants can be enterprises, institutions, development teams, etc.
[0037] Specifically, the storage requirements of different architectures mainly include locally deployed open source object storage, cloud object storage, and self-developed object storage. Locally deployed open source object storage requires all files to be stored in the customer's local data center, and users need to fully control the data life cycle; cloud object storage uses the elasticity of cloud storage to solve the limitations of local network and storage space; self-developed object storage usually refers to non-standard communication protocols, requiring all files to be stored in the customer's local data center, and customers have a high degree of control over the operation and maintenance of storage.
[0038] The storage requirements of different regions include data isolation based on personnel or roles. Data needs to be stored in different data centers according to the data security regulations of different countries and regions to achieve data isolation.
[0039] The storage requirements of different subsystems involve configuring different attributes, life cycles, permissions, and policy configurations for the data in each subbusiness system to ensure efficient operation and security of the system. At the same time, when supporting multi-tenant mode, each subbusiness system needs to be divided into secondary subsystems equal to the number of tenants to cope with different storage requirements of different tenants for the same subsystem.
[0040] Among the storage requirements of different priorities, it is necessary to make priority arrangements based on the configuration of global storage, tenant storage, default storage, business storage, etc. to ensure the smooth and flexible operation of the system. The configuration of storage locations such as personnel, roles, and departments also needs to be processed according to certain priority rules to meet the needs of different users.
[0041] In summary, different sub-business systems under the enterprise's business system generate various types of data, and each sub-business system has its own specific data types and data structures. For example: the network security management business will generate the tenant's network configuration data, and the network configuration information includes: the tenant's network configuration information, such as IP address, subnet mask, gateway address, etc. The data structure can be in JSON or XML format. For another example: the office equipment management business will generate access data for storage peripherals, and the access data includes peripheral access logs, such as USB flash drive access logs, mobile hard disk access logs, etc. At the same time, different tenants have different requirements for data preservation. However, the existing data storage solutions cannot meet the needs of customized configuration, which may cause data confusion. The storage requirements of different architectures require different storage solutions.
[0042] Therefore, the existing solutions cannot flexibly adapt to various needs, and there is a risk of data storage confusion. In addition, the existing data storage solutions cannot be customized according to the regulatory requirements of different regions, resulting in non-compliant data storage and the risk of leakage.
[0043] Based on the problems existing in the above solutions, this application provides a system architecture. Figure 1 The architecture includes: a server 101 and terminal devices 102 corresponding to different tenants. The server 101 is installed with a background management page of a data security management application. Based on the background management page, the administrator can configure different tenant information and business information associated with the tenant according to a preset configuration template to obtain storage configuration information corresponding to each tenant. Among them, the background management page has a preset configuration template, and the structure of the configuration template is as follows: access_key@secret_key@address@system:bucket, where access_key represents the key ID, secret_key represents the key, address represents the address of the object storage service, and system:bucket represents the mapping of the business system to the storage path. Then, a data table with a hierarchical relationship is constructed based on the tenant information and storage configuration information, and the data table is stored.
[0044] Subsequently, after receiving a data storage request from any terminal device, the server extracts the corresponding tenant information from the data storage request, and then directly obtains the storage configuration information hit by the tenant information from the corresponding data table. The storage configuration information includes the tenant's authentication information and storage path. According to the storage path, it determines which object storage service to store the business data in, and uses the authentication information (key ID and key) and the storage service address to establish a connection with the object storage service. After the connection is successful, the business data is stored in the storage space in the object storage service according to the storage path.
[0045] In this way, different tenant information and tenant-related business information can be configured by using a preset format in the background management page configuration. Different business data of tenants can be divided into different storage paths. This enables the management and isolation of each tenant's data. Through clear and explicit storage configuration, storage needs in a variety of different scenarios can be met, thereby simplifying development. Developers only need to configure according to the preset format to define and manage storage configuration without paying attention to the underlying details. This can simplify the development process and improve development efficiency.
[0046] According to an embodiment of the present invention, a data storage management method, device, electronic device and storage medium are 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.
[0047] In this embodiment, a data storage management method is provided. The method provided in the embodiment of the present application is applied to the background management page of the data security management application deployed in the above framework. Figure 2 is a flow chart of a data storage management method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0048] Step S11: obtaining a configuration request, wherein the configuration request carries tenant information of at least one tenant and service information associated with the tenant.
[0049] In the embodiments of the present application, the situations in which the administrator can trigger a configuration request on the background management page include but are not limited to the following situations: ① When a new tenant is added, the storage configuration of the tenant needs to be updated or adjusted. ② When the business needs of a tenant change, the storage configuration of the tenant needs to be adjusted. ③ When the storage path of a tenant needs to be set or modified. ④ When the business storage policy of a tenant needs to be adjusted to meet business needs.
[0050] In an embodiment of the present application, the configuration request includes tenant information and business information. The tenant information includes: tenant identification (i.e., tenant ID), type, ID corresponding to the type, etc. The tenant ID is an identifier that uniquely identifies the tenant, and the type is used to identify the type of the tenant, such as department, personnel, etc. The ID corresponding to the type can be the ID corresponding to the department and the ID corresponding to the personnel. At the same time, the business information includes: the sub-business system associated with the tenant under the target system and the storage space address of the tenant in the sub-business system, etc. The sub-business system is such as system A, system B, etc. The storage space address is the address of the storage space allocated by the object storage service to the sub-business system.
[0051] Step S12, in response to the configuration request, generating storage configuration information corresponding to the tenant based on the tenant information and the business information, wherein the storage configuration information includes: the storage path of the tenant in the object storage service.
[0052] In an embodiment of the present application, generating storage configuration information corresponding to a tenant based on tenant information and business information includes the following steps A1-A5:
[0053] Step A1, using the tenant information to obtain the authentication information corresponding to the tenant and the storage service address for accessing the object storage service.
[0054] Specifically, it is the process of obtaining authentication information and storage service addresses related to the tenant based on the specific information provided by the tenant. It includes the following steps: Tenant information refers to specific information used to identify and distinguish different tenants, usually including the tenant's unique identifier or tenant name. Authentication information: Authentication information is used to verify the tenant's identity and grant it access to system or platform resources.
[0055] The authentication information includes the key ID and the key Secret. The key ID is a unique identifier used to identify a tenant or access key, while the key Secret is a key used for identity authentication and authorization.
[0056] Different tenants have different data usage scenarios and requirements. Therefore, you can query the tenant's data usage scenarios or requirements based on the tenant information, determine the corresponding object storage service based on the data usage scenarios or requirements, and determine the storage service address of the object storage service. For example: If a tenant needs to store or back up data for a long time, the cloud object storage service can provide a reliable storage and backup solution. If a tenant needs to access and update data frequently, local open source storage can provide low-latency read and write operations, as well as better resource control and localized data processing capabilities. After determining the tenant's storage service address, the tenant can access the object storage service through the address and perform operations such as reading and writing data. The storage service address refers to the network address used to access the object storage service, usually the access URL or IP address of the object storage service.
[0057] Step A2: using the business information, obtain at least one sub-business system associated with the tenant under the target system, and the storage space address of the sub-business system associated with the tenant in the object storage service.
[0058] Specifically, business information is used to identify the relevant information of the tenant's business, and the sub-business system associated with the tenant can be determined through business information. Based on the business information provided by the tenant, one or more sub-business systems associated with the tenant are determined from the development project. For example, when the target system is an e-commerce system, the sub-business systems associated with the tenant include: commodity system, order system, and logistics system. These sub-business systems are used to process the tenant's business data.
[0059] There is a need to store data in the sub-business system associated with the tenant. The storage space address refers to the address of the space allocated to the tenant in the object storage service. Through this address, the tenant can store data in the corresponding storage space or read data from it.
[0060] It should be noted that the storage space address is the address of the actual storage space corresponding to the tenant in the sub-business system. In object storage, the files generated by the sub-business system will be stored in a specific bucket, and each bucket corresponds to an actual storage space.
[0061] Step A3: construct a correspondence between the business system identifier of the sub-business system and the storage space address.
[0062] Specifically, by associating and combining tenant information and business information, a corresponding relationship between the business system identifier (e.g., sub-business system ID) of the sub-business system and the storage space address is constructed. In this way, the corresponding storage space address can be determined through the business system identifier, and the object storage service can be accessed and data operations can be performed.
[0063] Step A4, constructing a storage path based on the corresponding relationship between the storage service address, the business system identifier and the storage space address.
[0064] Based on the correspondence between the storage service address, business system identifier and storage space address, a storage path can be constructed to store data in the correct location and to facilitate management and access of the data. For example: storage service address / business system identifier / storage space address, where the storage service address can be a unified address.
[0065] Step A5: Obtain a pre-built storage configuration template, and write the authentication information and storage path into the storage configuration template to obtain storage configuration information corresponding to the tenant.
[0066] Specifically, obtain the pre-configured storage configuration template, the storage configuration template is as follows:
[0067] access_key@secret_key@address@system:bucket. The @ symbol is used as a separator. The basic information in the storage configuration template includes: access_key: key ID, secret_key: key, address: storage service address, and system:bucket represents the mapping of the sub-business system to the storage path. The authentication information (key ID and key) and storage path obtained using the tenant information are then written into the storage configuration template, and the storage configuration information corresponding to the tenant is finally obtained. For example, the storage configuration information for the tenant ID 00000001 is as follows:
[0068] access_key@secret_key@address_1@system_1:bucket_1,system_2:bucket_2, where access_key and secret_key are key ID and key for identity verification, address_1 is the address of the object storage service, system_1:bucket_1 indicates the storage space allocated to the sub-business system system_1 associated with tenant 00000001 in the object storage service, and system_2:bucket_2 indicates the storage space allocated to another sub-business system system_2 of tenant 00000001 in the object storage service. Such a mapping relationship can help system administrators better manage the storage configuration of different tenants and ensure that each tenant can access its own storage space normally.
[0069] Through the above steps, the storage paths corresponding to different sub-business systems of different tenants can be obtained, thereby realizing the management and isolation of each tenant's data. At the same time, the administrator pre-configures the storage configuration template, and then automatically generates storage configuration information for different tenants based on the storage configuration template, and performs storage operations based on this information, which greatly simplifies the development work and improves data security and data storage efficiency.
[0070] Step S13: construct a mapping relationship between the tenant information and the storage configuration information, and use the mapping relationship to construct a plurality of data tables with a hierarchical relationship.
[0071] In the embodiments of the present application, Figure 3As shown, there are currently tenants A, tenant B and tenant C. The businesses associated with tenant A include sub-business system 1, sub-business system 2 and sub-business system 3. Taking the sub-business system as an example, the tenant types associated with sub-business system 1 include personnel, departments and roles, and personnel include personnel P100 and P200. The sub-business systems associated with tenant B include: sub-business system 3 and sub-business system 4. Among them, the tenant types associated with sub-business system 3 include personnel, departments and roles, and personnel include personnel P300 and P400. It can be seen that since the same tenant will be associated with multiple different sub-business systems, and each sub-business system will be associated with multiple different types under the tenant. The storage addresses corresponding to different tenant types under the same sub-business system may be the same or different. Therefore, the same tenant will have multiple storage configuration information corresponding to different sub-business systems. If a mapping relationship including tenant identification, tenant type, type identification and storage configuration information is directly constructed, the amount of data in the data table will be too large. Therefore, the present application constructs a data table with a hierarchical relationship through the above content, which is conducive to subsequent rapid storage configuration query.
[0072] Among them, building a mapping relationship between tenant information and storage configuration information, and using the mapping relationship to build multiple data tables with a hierarchical relationship, includes the following steps B1-B4:
[0073] Step B1, extracting the tenant identifier and type information from the tenant information and extracting the business system identifier from the business information;
[0074] Specifically, the tenant identifier (tenant ID), such as 00000001 and 00000002, and the type information are extracted from the tenant information. The type information includes: tenant type and type identifier. The tenant type is, for example, personnel, department, etc. The type identifier can be an identifier corresponding to a personnel, an identifier corresponding to a department, etc. For example, 00000001 corresponds to a personnel, 00000002 corresponds to a department, etc. The type identifier of a personnel is P100, and the type identifier of a department is P200. At the same time, the business system identifier is extracted from the business information, such as system_1 and system_3.
[0075] Step B2: construct a mapping relationship between the tenant identifier and the storage configuration information, and write the mapping relationship into the first data table to obtain a storage identifier of the mapping relationship in the first data table.
[0076] Specifically, an invalidation mapping relationship between the tenant identifier and the storage configuration information is constructed, and the relationship is written into the first data table. The construction can be performed based on the provided data. The content of the first data table is as follows:
[0077]
[0078] Table 1 - First data table
[0079] Each row in the first data table represents a record, where the primary key ID is the storage identifier, which is used to uniquely identify each record, the tenant ID represents the unique identifier of the tenant, and the storage configuration includes the key, storage service address, and business system identifier and the corresponding storage space address. Separators are used in the storage configuration to distinguish different configuration items. In this data table, the addressing relationship between the tenant and the object storage service is established through the tenant ID. Each tenant can correspond to multiple storage configuration information, indicating that the tenant can access multiple object storage services and can use different storage spaces in different sub-business systems.
[0080] Step B3: write the tenant identifier, type information and storage identifier into the second data table in an associated manner.
[0081] The tenant ID, type information and storage ID (primary key ID) are associated and written into the second data table. For example, the storage configuration ID corresponding to the person corresponding to 00000001 is 1; the storage configuration ID corresponding to the department corresponding to 00000001 is 2. In the second data table, the types of personnel, departments, etc. have corresponding object storage service configurations for storing their related information. Each entity has a primary key ID to uniquely identify it, and a tenant ID to isolate the data of different tenants. The storage configuration ID points to the primary key ID (storage ID) in the first data table to ensure that each entity is associated with its corresponding storage configuration. In the subsequent addressing process, the corresponding storage configuration is first found based on the hit relationship between the specific type (such as personnel, role, department) and the corresponding subsystem. If the corresponding storage configuration is not found, the system will go to the global general storage configuration at the next level as a backup to ensure normal storage and access of data. It should be noted that the storage configuration across tenants is invalid, and only the storage configuration information within the tenant can be accessed.
[0082] Primary Key ID Tenant ID type ID Storage Configuration ID 1 00000001 personnel 100 1 2 00000001 department 200 2 3 00000002 Role 300 3
[0083] Table 2 - Second data table
[0084] Step B4, constructing a hierarchical relationship between the first data table and the second data table, wherein the first data table is a data table of the highest level, and the second data table is a data table of a level below the first data table.
[0085] To build a hierarchical relationship between the first data table and the second data table, a hierarchical structure can be established through the primary key ID and the association relationship. That is, the first data table is the highest level, and the second data table is one level below the first data table. They are connected through the primary key ID to form a hierarchical relationship. In summary, by parsing and associating the provided data, a detailed association relationship between tenants, storage configurations, and sub-business systems can be constructed, and a hierarchical structure can be established to facilitate management and query of tenant-related information.
[0086] In the embodiment of the present application, since different tenants need to access different object storage services, in the process of configuring different object storages, after using the storage configuration information to build a mapping relationship. At the code level, different type fields are defined for each object storage, and a common interface is provided in the code base component to support these object storages by encapsulating different implementations. In this way, the upper-level code can access different object storages through a unified interface without having to worry about the specific implementation details of the underlying storage.
[0087] The specific process is as follows: First, determine the object storage types that need to be supported, and define one or more type fields for each type. These fields are used to identify and distinguish different object storages in the code. Secondly, in the code base component, configure a set of common code interfaces for interacting with object storage. Then, implement the corresponding interface for each object storage. These implementations can be encapsulated according to the specific characteristics and API of the object storage, so that the upper-level code can access different object storages through a unified interface. In this way, a common code interface and the ability to encapsulate different storage implementations are defined in the code base component, so that the upper-level application can configure different object storages according to different needs without paying attention to the underlying storage characteristics.
[0088] Step S14: when a business data storage request is received, data storage processing is performed based on multiple data tables with a hierarchical relationship.
[0089] Specifically, when a business data storage request is received, data storage processing based on multiple data tables with a hierarchical relationship includes the following steps C1-C4:
[0090] Step C1: receiving a business data storage request, wherein the business data storage request includes: business data to be stored, a target tenant identifier, and target type information.
[0091] Specifically, a business data storage request includes the following three main parts: Business data to be stored, that is, business data generated when the tenant currently uses a certain sub-business system, for example, it can be the form data submitted by the tenant on the website. A tenant refers to an independent entity in the system, which can be a specific person, department or role. The target tenant identifier is used to indicate the tenant to which the storage request belongs, and the target tenant identifier can be the tenant ID. The target type information is used to further subdivide the tenant's attributes. For example, it can be a person type (for example: ordinary user, administrator, etc.), an organization type (department or role, etc.) or other types.
[0092] Step C2: acquiring the target tenant identifier and the target storage identifier matched by the target type information from the second data table, and acquiring the target storage configuration information corresponding to the target storage identifier from the first data table.
[0093] Specifically, the target storage identifier can be obtained from the second data table according to the target tenant identifier and the target type information. Assume that the target tenant identifier is "00000001", and the target type information includes: tenant type "personnel", type identifier "100". The target storage identifier that meets the conditions can be found based on these two values. The steps for obtaining the target storage identifier hit by the target tenant identifier and the target type information from the second data table are as follows: find a row in the second data table that satisfies the tenant identifier of "00000001" and the type of "personnel". Obtain the target storage identifier from this row, that is, the "storage configuration ID" is "1", and the target storage identifier is used to obtain the storage configuration information corresponding to the tenant identifier of "00000001" from the first data table.
[0094] Next, it is necessary to obtain the target storage configuration information corresponding to the target storage identifier from the first data table. The steps for obtaining the target storage configuration information with the target storage identifier "1" from the first data table are as follows: find the primary key ID that satisfies the storage configuration ID "1" in the first data table, and then extract the target storage configuration information from the record corresponding to the primary key ID. The obtained target storage configuration information is as follows:
[0095] "access_key@secret_key@address_1@system_1:bucket_1,system_2:bucket_2".
[0096] In this way, by querying the tenant identifier and type information in the second data table, different storage configuration information can be matched according to different conditions. In this way, the storage path can be accurately located according to specific business needs, improving the flexibility of the system. By querying the target storage identifier in the second data table, specific storage configuration information can be quickly located.
[0097] It should be noted that, assuming that there are currently tenants A, B and C, the businesses associated with tenant A include sub-business system 1, sub-business system 2 and sub-business system 3. Taking sub-business system 1 as an example, the tenant types associated with sub-business system 1 include personnel, departments and roles, and personnel include personnel P100 and P200. The sub-business systems associated with tenant B include: sub-business system 3 and sub-business system 4. Among them, the tenant types associated with sub-business system 3 include personnel, departments and roles, and personnel include personnel P300 and P400. It can be seen that since the same tenant will be associated with multiple different sub-business systems, and each sub-business system may be associated with multiple different types under the tenant. It can be determined that the storage space corresponding to a tenant in different sub-business systems is different, so the same tenant can have multiple different storage configurations.
[0098] Based on the above content, when actually processing the business data storage request corresponding to the tenant, the corresponding storage identifier can be directly obtained from the second data table (each row in the second data table is associated with the storage tenant identifier, type information and storage identifier) according to the tenant identifier and type information, and then the storage identifier is used to obtain the storage configuration corresponding to the storage identifier from the first data table. Compared with directly traversing the first data table, the query time of the storage configuration is saved and the query efficiency is improved.
[0099] Step C3, obtaining the target authentication information and the target storage path carried in the target storage configuration information, the target storage path including: the target storage service address, the target business system identifier, and the target storage space address corresponding to the target business system identifier.
[0100] Specifically, the target storage configuration information is split according to the "@" symbol to obtain the following four parts: access_key: the key ID of the target storage, secret_key: the key of the target storage, address_1: the target storage service address, system:bucket: the target business system identifier and the corresponding target storage space address. The target storage service address, the target business system identifier and the corresponding target storage space address constitute the target storage path information used by the business data storage request.
[0101] Step C4, establishing a connection with the target object storage service based on the target authentication information and the target storage service address, and storing the business data in the target object storage service according to the target storage space address.
[0102] Specifically, the target authentication information includes a key ID and a key, which are credentials used to confirm the user's identity and authorize them to access the target object storage service. The key ID is a unique identifier used to identify the user's key. The key is an encrypted string used to verify the user's identity. The target storage service address is a network address or domain name that specifies the location of the object storage service, and the object storage service can be accessed through this address. For example, the FTP server address may be ftp.example.com, the SFTP server address may be sftp.example.com, and the HTTP server address may be http: / / example.com.
[0103] Use the target authentication information and the target storage service address, and use the appropriate network protocol (such as FTP, SFTP, HTTP, etc.) to establish a connection with the target object storage service. The target object storage service is the object storage service corresponding to the target storage service address. Different object storage services may support different network protocols, such as FTP, SFTP, HTTP, etc. You can select the appropriate protocol according to the requirements of the object storage service. When establishing a connection, the tenant needs to provide the target authentication information (key ID and key) for identity authentication. If the identity authentication is successful, the tenant can perform data transmission, file upload, download, and other operations with the target object storage service through the connection. The connection establishment process usually requires handshaking and exchanging necessary authentication information through the network protocol to ensure the security and reliability of the connection. After the connection is established, the API or tools provided by the object storage service can be used to operate the target storage space. Specific operations include uploading files, creating folders, deleting files, etc. The business data to be stored can be sent to the target storage space address through the connection. The object storage service will save the received data in the target storage space to ensure the integrity and accessibility of the data.
[0104] Among them, storing business data in the target object storage service according to the target storage space address includes: determining the target storage space from the target object storage service according to the target storage space address; detecting whether there is a storage file corresponding to the target tenant identifier in the target storage space; if there is no storage file corresponding to the target tenant identifier, creating an original storage file in the target storage space, and generating a target file name using the target tenant identifier and the target business system identifier; writing the business data to be stored as file content into the original storage file, and updating the original file name of the original storage file to the target file name, so as to obtain the storage file corresponding to the tenant.
[0105] It is understandable that if there is no storage file corresponding to the target tenant identifier, an original storage file needs to be created. The business data to be stored is written into the original storage file as the file content, and the business data is stored in the target storage space address. Then the target tenant identifier and the target business system identifier are used to generate the target file name. Finally, the original file name of the original storage file needs to be updated to the target file name to obtain the storage file corresponding to the tenant.
[0106] Exemplarily, the tenant identifier is "tenant1" and the business system identifier is "system_1". Secondly, constructing the target file name based on the tenant identifier and the business system identifier refers to adding the tenant identifier and the business system identifier to the file name according to specific rules to ensure the uniqueness of the file name. The tenant identifier and the business system identifier can be added to the front of the file name to obtain the target file name "tenant1 / system_1 / file.txt". Finally, updating the file name of the storage configuration file using the target file name refers to replacing the original storage configuration file name with the constructed target file name to ensure that the location of the file in the storage system is correct and meaningful. For example, the original storage configuration file name "file.txt" is updated to "tenant1 / system_1 / file.txt". Through the above process, the tenant identifier and the business system identifier can be obtained through the tenant configuration information, the target file name can be constructed, and the storage configuration file can be updated to ensure the standardization and uniqueness of file management.
[0107] It should be noted that by adding the business system identifier and tenant identifier to the file name, the file name can be made more descriptive, easy to understand and identify. This can improve the readability and maintainability of the file, and facilitate the management personnel to manage and maintain the file. Secondly, since the file names of different sub-business systems and tenants are marked, the identifier can be used to quickly find and filter files. This can simplify the management and search operations of files and improve efficiency. Furthermore, by adding the tenant identifier and business system identifier to the file name, file name conflicts can be effectively avoided and files of different tenants can be isolated. For example: the two tenants are tenant1 and tenant2, and the two sub-business systems are system_1 and system_2. Then for the file file.txt: the file name stored in system_1 under tenant1 is: tenant1 / system_1 / file. The file name stored in system_2 under txt-tenant1 is: tenant1 / system_2 / file. The file name stored in system_1 under txt-tenant2 is: tenant2 / system_1 / file. The file name stored in system_2 under txt-tenant2 is: tenant2 / system_2 / file.txt. This ensures that there will be no conflicts in file names between different tenants and different sub-business systems.
[0108] Alternatively, if there is at least one storage file corresponding to the target tenant identifier, read the file name corresponding to the storage file; traverse the file names of the storage files, and take the storage file whose file name contains the target business system identifier as the target storage file; and write the business data to be stored into the target storage file.
[0109] The embodiment of the present application generates storage configuration information corresponding to the tenant based on tenant information and business information, and the storage configuration information includes the storage path of the tenant in the object storage service. In this way, the storage configuration of each tenant can be distinguished, and the business data generated by the tenant in different sub-business systems can be isolated and managed, ensuring the data security of each tenant. Then, a hierarchical relationship of multiple data tables is constructed by mapping the tenant information and the storage configuration information. In this way, the data of different tenants can be separated, and the storage path of each tenant can be managed more clearly. When a business data storage request is subsequently received from a sub-business system of the tenant, the corresponding storage path can be directly located according to the data table, so that the data of each tenant is correctly stored, avoiding confusion and leakage of data storage.
[0110] In another embodiment of the present application, the administrator can also configure the corresponding data storage validity period for each sub-business system, and the data storage validity period can also be understood as the usage time of the storage space allocated by the sub-business system in the object storage service. Based on the data storage validity period, the first data table and the second data table can be dynamically updated, such as Figure 4 As shown, the specific update process includes the following steps:
[0111] Step S21, obtaining the data storage validity period corresponding to the sub-business system associated with each tenant.
[0112] In an embodiment of the present application, the data storage validity period corresponding to the sub-business system associated with each tenant is obtained, including: obtaining a storage validity period configuration request; responding to the storage validity period configuration request, and using business information to determine the object storage service and data usage scenario corresponding to each sub-business system associated with the tenant; obtaining the preset data storage validity period corresponding to each preset data scenario supported by the object storage service; and using the preset data storage validity period hit by the data usage scenario of each sub-business system as the data storage validity period of the sub-business system.
[0113] Specifically, the administrator triggers a storage validity period configuration request on the background management interface. According to the received storage validity period configuration request, the system determines the object storage service and data usage scenario corresponding to each sub-business system associated with the tenant by analyzing and processing the relevant business information. The system can classify and match each sub-business system according to the business information and needs of the tenant to determine the applicable object storage service and data usage scenario. Obtaining the preset data storage validity period supported by the object storage service: the system obtains the preset data storage validity period corresponding to each preset data scenario supported by the selected object storage service. These preset data scenarios can be pre-defined by the system or configured according to the business needs of the tenant, such as hot and cold data separation, backup data retention period, etc. Applying the preset data storage validity period: according to the matching of the data usage scenario of the sub-business system with the preset data storage validity period, the matching preset data storage validity period is selected as the data storage validity period of the sub-business system. According to the data usage scenario of the sub-business system, the system finds the valid period that meets the conditions from the preset data storage validity period and applies it to the data storage of the sub-business system. In this way, the system can effectively control the validity period of data storage according to different business needs to ensure data security and compliance.
[0114] In addition, the administrator can also configure the data retention time of different sub-business systems on the background management page. The configuration content is as follows:
[0115] Primary Key ID Tenant ID Storage Configuration ID Business system identification Data storage validity period 1 00000001 1 system_1 10day 2 00000001 2 system_2 15day 3 00000002 3 system_3 20day
[0116] Table 3-Data storage time configuration table
[0117] Among them, each row in the above data table represents the storage time configuration of a business subsystem. The specific fields are explained as follows: The primary key ID is the unique identifier of each row record. The storage configuration ID is the storage identifier of the tenant identifier and the business system identifier in the first data table. The data storage validity period can be understood as the usage time of the storage space allocated by the sub-business system in the object storage service. Based on this configuration table, basic lifecycle rules applicable to each object storage service are generated according to the configuration information. Taking the address, applicable path and storage time of the object storage service as an example, the following rules will eventually be generated:
[0118] For an object with the address address_1, bucket bucket_1, and applicable path 00000001 / system_1, the data storage validity period is 10 days.
[0119] For an object with the address address_2, bucket bucket_2, and applicable path 00000001 / system_3, the data storage validity period is 15 days.
[0120] For an object with the address address_3, bucket bucket_1, and applicable path 00000002 / system_1, the data storage validity period is 20 days.
[0121] Finally, the client passes the above rules to the object storage service to ensure that the data of each sub-business system is saved according to the time configured by the administrator.
[0122] Based on this, in actual application, the client can read the data storage validity period corresponding to the sub-business system associated with each tenant from the object storage service, and perform subsequent data table update processes based on the read data storage validity period.
[0123] Step S22: Detect the invalid sub-business system that has reached the data storage validity period, and obtain the invalid business system identifier corresponding to the invalid sub-business system.
[0124] Specifically, by comparing the current time with the data storage validity period of each sub-business system, the invalid sub-business systems that have reached their validity period can be detected. Then, the invalid business system identifiers corresponding to these invalid sub-business systems can be obtained.
[0125] Step S23: delete the invalidation mapping relationship associated with the invalidation business system identifier in the first data table, and obtain the invalidation storage identifier of the invalidation mapping relationship in the second data table.
[0126] Specifically, according to the obtained failed business system identifiers of the failed sub-business systems, mapping relationships associated with these identifiers can be found in the first data table. Then, these mapping relationships can be deleted from the first data table, and their storage identifiers in the second data table can be obtained.
[0127] Step S24: Delete the tenant identifier and type information associated with the failed storage identifier in the second data table.
[0128] Specifically, according to the obtained storage identifiers, the tenant identifiers and type information associated with these storage identifiers can be found in the second data table. Then, these tenant identifiers and their corresponding type information can be deleted from the second data table.
[0129] The embodiment of the present application obtains the data storage validity period corresponding to the sub-business system associated with each tenant, which can help system managers clearly understand the validity period of the data storage resources used by each tenant, and help to clean up and manage data in a timely manner. Secondly, by detecting the invalid sub-business system that has reached the data storage validity period, the invalid sub-business system can be quickly and accurately identified to avoid system performance degradation or data security problems caused by the existence of expired data. Then, the mapping relationship associated with the invalid business system identifier in the first data table is deleted, and the storage identifier in the second data table is obtained, so that invalid data can be cleaned up in time, data storage resources can be released, and the performance and efficiency of the system can be improved. The advantage of simultaneously deleting the tenant identifier and type information associated with the invalid storage identifier in the second data table is that data redundancy and confusion can be avoided, the accuracy and integrity of the data can be ensured, and the data management and maintenance efficiency of the system can be improved.
[0130] The following example is a scenario description of the above embodiment. Figure 5 As shown, taking the enterprise office data management system as an example, under the enterprise office data management system, the sub-business systems associated with tenant X include the network security management system, storage peripheral management, and project development management system. When the network security management system generates business data to be stored, tenant X will send the business data to be stored generated by the network security management system and tenant-related information to the server through the terminal device. The specific process is as follows:
[0131] Step 1: The server receives a business data storage request sent by tenant X through a terminal device.
[0132] Among them: business data to be stored, target tenant identifier (Tenant_ID_1, such as 00000001), target type information (Tenant_Type_1, such as P100 corresponding to personnel).
[0133] Step 2: The server responds to the business data storage request and obtains the target storage identifier from the second data table.
[0134] The target tenant identifier (Tenant_ID_1) and the target type information (Tenant_Type_1) are used as query conditions to search for corresponding records in the second data table. If a matching record is found, the storage configuration ID in the record is obtained (the storage configuration ID is associated with the storage identifier in the first data table, that is, the primary key ID).
[0135] Step 3: Obtain target storage configuration information from the first data table.
[0136] The storage configuration ID obtained in the above step is used as an index to search for a corresponding record in the first data table. If a matching record is found, the target storage configuration information in the record is extracted, such as:
[0137] access_key@secret_key@address_1@system_1:bucket_1,system_2:bucket_2.
[0138] Step 4: parse the target storage configuration information.
[0139] The target authentication information (such as access_key and secret_key) and the target storage path information are extracted from the target storage configuration information. The target storage path information includes: the target storage service address (such as address_1), the target business system identifier (such as system_1 and system_2), and the corresponding target storage space address (such as bucket_1 and bucket_2).
[0140] Step 5: Use the target authentication information and the storage service address to establish a connection with the object storage service. After the connection is established, store the business data according to the target storage path.
[0141] The extracted target authentication information (access_key and secret_key) and the target storage service address (address_1) are used to establish a connection with the object storage service. According to the target business system identifier (such as system_1) in the business data storage request, determine which storage space address (such as bucket_1) in the object storage service to store the business data. Send the business data to be stored (Data_to_Store) to the specified target storage space address (bucket_1) for storage.
[0142] In an embodiment of the present application, the method also includes: if the target storage identifier hit by the target tenant identifier and the target type information does not exist in the second data table, obtaining general storage configuration information, wherein the general storage configuration information includes a general storage path; and storing the business data to be stored in the storage space address specified by the general storage path.
[0143] For example: ① If a person does not have a specific storage configuration, the storage configuration template will be used as a fallback, such as a general configuration such as access_key@secret_key@address@*:bucket. ② If a role does not have a specific storage configuration, the corresponding storage configuration ID will be addressed based on the type ID, for example, if the type is department 300, the corresponding storage configuration ID is 3. ③ If a department does not have a specific storage configuration, the corresponding storage configuration ID will be addressed based on the department ID, for example, if the department ID is 200, the corresponding storage configuration ID is 2. In this way, data such as personnel, roles, and departments can be shared and used when stored.
[0144] It should be noted that if the target storage identifier hit by the target tenant identifier and type information does not exist in the second data table, that is, the specific storage configuration information cannot be obtained, the fallback strategy will be triggered, that is, the general storage configuration information will be used. This ensures that even if an abnormal situation occurs or specific configuration information is missing, the system can still operate normally and data can still be stored. On the other hand, through unified general storage configuration information, the configuration and maintenance costs of the system can be reduced. Only one general storage path needs to be maintained to provide object storage services for tenants without specific configurations. This can simplify operation and maintenance work and reduce manpower and time costs.
[0145] In the present embodiment, a data storage management device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0146] This embodiment provides a data storage management device, such as Figure 6 As shown, including:
[0147] An acquisition module 61 is used to acquire a configuration request, wherein the configuration request carries tenant information of at least one tenant and service information associated with the tenant;
[0148] A response module 62 is used to respond to the configuration request and generate storage configuration information corresponding to the tenant based on the tenant information and the business information, wherein the storage configuration information includes: a storage path of the tenant in the object storage service;
[0149] The generation module 63 is used to construct a mapping relationship between the tenant information and the storage configuration information, and to construct a plurality of data tables with a hierarchical relationship using the mapping relationship.
[0150] The processing module 64 is used to perform data storage processing based on multiple data tables with a hierarchical relationship when receiving a business data storage request.
[0151] In an embodiment of the present application, the response module 62 is used to use the tenant information to obtain the authentication information corresponding to the tenant, and the storage service address for accessing the object storage service; use the business information to obtain at least one sub-business system associated with the tenant under the target system, and the sub-business system associated with the tenant in the object storage service; build a correspondence between the business system identifier of the sub-business system and the storage space address; build a storage path based on the storage service address, the correspondence between the business system identifier and the storage space address; obtain a pre-built storage configuration template, and write the authentication information and storage path into the storage configuration template to obtain the storage configuration information corresponding to the tenant.
[0152] In an embodiment of the present application, the response module 62 is used to extract the tenant identifier and type information from the tenant information and to extract the business system identifier from the business information; to construct a mapping relationship between the tenant identifier and the storage configuration information, and to write the mapping relationship into the first data table to obtain the storage identifier of the mapping relationship in the first data table; to write the tenant identifier, type information and storage identifier into the second data table in an associated manner; and to construct a hierarchical relationship between the first data table and the second data table, wherein the first data table is a data table of the highest level and the second data table is a data table of the next level of the first data table.
[0153] In an embodiment of the present application, the device also includes: an update module, which is used to obtain the data storage validity period corresponding to the sub-business system associated with each tenant; detect the invalid sub-business system that has reached the data storage validity period, and obtain the invalid business system identifier corresponding to the invalid sub-business system; delete the invalid mapping relationship associated with the invalid business system identifier in the first data table, and obtain the invalid storage identifier of the invalid mapping relationship in the second data table; delete the tenant identifier and type information associated with the invalid storage identifier in the second data table.
[0154] In an embodiment of the present application, an update module is used to obtain a storage validity period configuration request; respond to the storage validity period configuration request, use business information to determine the object storage service and data usage scenarios corresponding to each sub-business system associated with the tenant; obtain the preset data storage validity period corresponding to each preset data scenario supported by the object storage service; and use the preset data storage validity period hit by the data usage scenario of each sub-business system as the data storage validity period of the sub-business system.
[0155] In the embodiment of the present application, the processing module 64 includes:
[0156] A receiving submodule, configured to receive a business data storage request, wherein the business data storage request includes: business data to be stored, a target tenant identifier, and target type information;
[0157] An acquisition submodule, used to acquire a target tenant identifier and a target storage identifier hit by the target type information from the second data table, and acquire target storage configuration information corresponding to the target storage identifier from the first data table;
[0158] The extraction submodule is used to obtain the target authentication information and the target storage path carried in the target storage configuration information, where the target storage path includes: the target storage service address, the target business system identifier, and the target storage space address corresponding to the target business system identifier;
[0159] The storage submodule is used to establish a connection with the target object storage service based on the target authentication information and the target storage service address, and store the business data in the target object storage service according to the target storage space address.
[0160] In an embodiment of the present application, a storage submodule is used to determine a target storage space from a target object storage service according to the target storage space address; detect whether there is a storage file corresponding to the target tenant identifier in the target storage space; if there is no storage file corresponding to the target tenant identifier, create an original storage file in the target storage space, and generate a target file name using the target tenant identifier and the target business system identifier; write the business data to be stored as file content into the original storage file, and update the original file name of the original storage file to the target file name, so as to obtain a storage file corresponding to the tenant.
[0161] In an embodiment of the present application, the storage submodule is used to read the file name corresponding to the storage file if there is at least one storage file corresponding to the target tenant identifier; traverse the file names of the storage files, and take the storage file whose file name contains the target business system identifier as the target storage file; and write the business data to be stored into the target storage file.
[0162] In an embodiment of the present application, the device also includes: a traversal module, which is used to obtain general storage configuration information if the target storage identifier hit by the target tenant identifier and the target type information does not exist in the second data table, wherein the general storage configuration information includes a general storage path; and store the business data to be stored in the storage space address specified by the general storage path.
[0163] The embodiment of the present application generates storage configuration information corresponding to the tenant based on tenant information and business information, and the storage configuration information includes the storage path of the tenant in the object storage service. In this way, the storage configuration of each tenant can be distinguished, and the business data generated by the tenant in different sub-business systems can be isolated and managed, ensuring the data security of each tenant. Then, a hierarchical relationship of multiple data tables is constructed by mapping the tenant information and the storage configuration information. In this way, the data of different tenants can be separated, and the storage path of each tenant can be managed more clearly. When a business data storage request is subsequently received from a sub-business system of the tenant, the corresponding storage path can be directly located according to the data table, so that the data of each tenant is correctly stored, avoiding confusion and leakage of data storage.
[0164] See also Figure 7 , Figure 7 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0165] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0166] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0167] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of an electronic device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0168] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0169] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0170] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0171] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data storage management method, characterized in that: The method comprises: Obtaining a configuration request, wherein the configuration request carries tenant information of at least one tenant and business information associated with the tenant; In response to the configuration request, generating storage configuration information corresponding to the tenant based on the tenant information and the business information, wherein the storage configuration information includes: a storage path of the tenant in the object storage service; Constructing a mapping relationship between the tenant information and the storage configuration information, and constructing a plurality of data tables with a hierarchical relationship using the mapping relationship; When receiving a business data storage request, data storage processing is performed based on multiple data tables with a hierarchical relationship; The method of constructing a mapping relationship between the tenant information and the storage configuration information, and using the mapping relationship to construct a plurality of data tables with a hierarchical relationship, includes: extracting a tenant identifier and type information from the tenant information and extracting a business system identifier from the business information; constructing a mapping relationship between the tenant identifier and the storage configuration information, and writing the mapping relationship into a first data table to obtain a storage identifier of the mapping relationship in the first data table; associating the tenant identifier, the type information and the storage identifier into a second data table; and constructing a hierarchical relationship between the first data table and the second data table, wherein the first data table is a data table of the highest level, and the second data table is a data table of a level below the first data table.
2. The method according to claim 1, characterized in that The generating storage configuration information corresponding to the tenant based on the tenant information and the business information includes: Using the tenant information, obtain authentication information corresponding to the tenant and a storage service address for accessing an object storage service; Using the business information, acquiring at least one sub-business system associated with the tenant under the target system, and a storage space address of the sub-business system associated with the tenant in the object storage service; Constructing a correspondence between the business system identifier of the sub-business system and the storage space address; Constructing a storage path based on the corresponding relationship between the storage service address, the business system identifier and the storage space address; A pre-built storage configuration template is obtained, and the authentication information and the storage path are written into the storage configuration template to obtain storage configuration information corresponding to the tenant.
3. The method according to claim 1, characterized in that The method further comprises: Get the data storage validity period corresponding to the sub-business system associated with each tenant; Detecting a failed sub-business system that has reached the data storage validity period, and obtaining a failed business system identifier corresponding to the failed sub-business system; Deleting the invalidation mapping relationship associated with the invalidation business system identifier in the first data table, and obtaining the invalidation storage identifier of the invalidation mapping relationship in the second data table; The tenant identifier and type information associated with the failed storage identifier in the data table are deleted.
4. The method according to claim 3, characterized in that The obtaining of the data storage validity period corresponding to the sub-business system associated with each tenant includes: Get storage validity period configuration request; In response to the storage validity period configuration request, the object storage service and data usage scenario corresponding to each sub-business system associated with the tenant are determined by using the business information; Obtaining a preset data storage validity period corresponding to each preset data scenario supported by the object storage service; The preset data storage validity period hit by the data usage scenario of each of the sub-business systems is used as the data storage validity period of the sub-business system.
5. The method according to claim 1, characterized in that When receiving a business data storage request, performing data storage processing based on multiple data tables with a hierarchical relationship includes: Receiving a business data storage request, wherein the business data storage request includes: business data to be stored, a target tenant identifier, and target type information; Acquire the target tenant identifier and the target storage identifier hit by the target type information from the second data table, and acquire the target storage configuration information corresponding to the target storage identifier from the first data table; Obtaining target authentication information and a target storage path carried in the target storage configuration information, wherein the target storage path includes: a target storage service address, a target business system identifier, and a target storage space address corresponding to the target business system identifier; A connection is established with a target object storage service based on the target authentication information and the target storage service address, and the business data is stored in the target object storage service according to the target storage space address.
6. The method according to claim 5, characterized in that Storing the business data in the target object storage service according to the target storage space address includes: Determine a target storage space from the target object storage service according to the target storage space address; Detecting whether there is a storage file corresponding to the target tenant identifier in the target storage space; If there is no storage file corresponding to the target tenant identifier, create an original storage file in the target storage space, and generate a target file name using the target tenant identifier and the target business system identifier; The business data to be stored is written into the original storage file as file content, and the original file name of the original storage file is updated to the target file name to obtain the storage file corresponding to the tenant.
7. The method according to claim 6, characterized in that The method further comprises: If there is at least one storage file corresponding to the target tenant identifier, read the file name corresponding to the storage file; Traversing the file names of the storage files, and taking the storage files having the target business system identifier in the file names as the target storage files; The business data to be stored is written into the target storage file.
8. The method according to claim 5, characterized in that The method further comprises: If the target storage identifier hit by the target tenant identifier and the target type information does not exist in the second data table, obtaining general storage configuration information, wherein the general storage configuration information includes a general storage path; The business data to be stored is stored in the storage space address specified by the general storage path.
9. A data storage management device, characterized in that: The device comprises: An acquisition module, configured to acquire a configuration request, wherein the configuration request carries tenant information of at least one tenant and business information associated with the tenant; A response module, configured to respond to the configuration request and generate storage configuration information corresponding to the tenant based on the tenant information and the business information, wherein the storage configuration information includes: a storage path of the tenant in the object storage service; A generation module, used to construct a mapping relationship between the tenant information and the storage configuration information, and to construct a plurality of data tables with a hierarchical relationship using the mapping relationship; A processing module, configured to perform data storage processing based on multiple data tables having a hierarchical relationship when receiving a business data storage request; The generation module is used to extract the tenant identifier and type information from the tenant information and to extract the business system identifier from the business information; to construct a mapping relationship between the tenant identifier and the storage configuration information, and to write the mapping relationship into a first data table to obtain a storage identifier of the mapping relationship in the first data table; to write the tenant identifier, the type information and the storage identifier into a second data table in an associated manner; and to construct a hierarchical relationship between the first data table and the second data table, wherein the first data table is a data table of the highest level and the second data table is a data table of a level below the first data table.
10. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Setting calculation cloud data management method and setting calculation system suitable for multiple tenants
CN111522869A
Construction method of service system suitable for multiple tenants, framework, equipment and medium
CN112508431A