Data storage method and system based on distributed architecture

By using consistent hashing algorithms and machine learning predictions in distributed systems, combined with multi-copy and asynchronous replication mechanisms, and dynamically adjusting sharding strategies and encryption processing, the problems of data consistency and performance bottlenecks in distributed systems are solved, achieving Efficient synchronization and secure storage of data.

CN118568778AInactive Publication Date: 2024-08-30SHENZHEN YIHANG NETWORK INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411039536.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In distributed systems, data consistency issues lead to inconsistent data copies on different nodes, affecting data accuracy and reliability. Network delays and bandwidth limitations affect system performance. High-frequency data transmission may cause network congestion and load. Imbalance and data security are difficult to guarantee.

Method used

Adopt a data storage method based on distributed architecture, by dividing the system into multiple microservices, each microservice is responsible for specific data storage functions, using HBase distributed database and hybrid database architecture, combined with consistent hashing algorithm and machine learning The algorithm performs data sharding and prediction, introduces multi-copy mechanism and asynchronous replication, uses a distributed key management system and blockchain to record access behavior, achieves uniform distribution and efficient synchronization of data, and dynamically adjusts sharding strategies and encryption processing.

Benefits of technology

It achieves even distribution and efficient synchronization of data among nodes, ensures data consistency and integrity, reduces network latency, dynamically adjusts sharding strategies to ensure system load balancing, and ensures data security during transmission and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568778A
    Figure CN118568778A
Patent Text Reader

Abstract

The invention discloses a data storage method and system based on a distributed architecture, and the method is characterized in that the method comprises the steps: dividing the system into a plurality of independent micro-services; an HBase distributed database is selected; horizontal fragmentation is carried out according to characteristics of the data, the data are uniformly distributed on different nodes, a fragmentation strategy is automatically adjusted, a machine learning algorithm is introduced to predict future data growth and access modes, and fragmentation adjustment is carried out in advance; an asynchronous replication mechanism is introduced, stored data are compressed, and the data are divided into hot data and cold data according to the access frequency of the data; in the transmission and storage process, the data are encrypted, and the access of the data is controlled according to the role and authority of the user. According to the method, uniform distribution and efficient synchronization of the data among the nodes are realized, the data fragmentation strategy is dynamically adjusted according to the data access mode and the node load condition, and the load balance and efficient operation of the system are ensured. And the encryption key is dynamically managed, so that the security of the data in the transmission and storage process is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data storage, and in particular, relates to a data storage method and system based on a distributed architecture. Background Art

[0002] In a distributed system, data is stored on multiple nodes. Network latency, node failure, or partitioning may lead to data consistency issues. That is, the copies of data on different nodes may be inconsistent, affecting the accuracy and reliability of the data. It is difficult to achieve real-time consistency of data on all nodes while ensuring high performance and availability. Although short-term inconsistencies can be tolerated, eventual consistency may still lead to data reading errors in high-frequency data update scenarios.

[0003] Distributed storage systems rely on the network for data transmission and node communication. Network latency and bandwidth limitations directly affect system performance and user experience. Data transmission delays increase the response time of write and read operations. High-frequency data transmission may cause network congestion and affect the overall performance of the system. Data sharding is an important mechanism for distributed storage systems. By distributing data on different nodes, load balancing and improved storage efficiency can be achieved. However, unreasonable sharding strategies can lead to load imbalance and performance bottlenecks. Some nodes may store too much data or receive too many access requests, resulting in excessive load. As data and access volume change, dynamically adjusting sharding strategies is complex and costly. Data security and privacy protection are important challenges, especially in the process of data transmission and storage. How to prevent data leakage and unauthorized access is a key issue. Summary of the invention

[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0005] In view of the above or existing problems of data storage methods and systems based on distributed architecture, the present invention is proposed.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: In the first aspect, an embodiment of the present invention provides a data storage method based on a distributed architecture, which is characterized by comprising: dividing the system into multiple independent microservices, each microservice is responsible for a specific data storage function, and each microservice communicates through an API gateway; selecting an HBase distributed database, adopting a hybrid database architecture, and using a combination of relational databases and non-relational databases to meet different data storage requirements; performing horizontal sharding according to the characteristics of the data, using a consistent hashing algorithm to evenly distribute the data to different nodes, monitoring data access and storage in real time, automatically adjusting the sharding strategy, introducing a machine learning algorithm to predict future data growth and access patterns, and conducting in advance Sharding adjustment; adopt a multi-copy mechanism to store data on multiple nodes, introduce an asynchronous replication mechanism, and combine it with the eventual consistency model to improve the system's write performance, compress the stored data, reduce storage space occupancy, introduce a data deduplication algorithm, and divide the data into hot data and cold data according to the frequency of data access. Hot data is stored in high-performance storage devices, and cold data is stored in low-cost storage devices; during the transmission and storage process, the data is encrypted, and a distributed key management system is used to dynamically manage encryption keys to implement fine-grained access control strategies. Data access is controlled according to user roles and permissions, and a blockchain-based access record system is introduced to record each data access behavior.

[0007] As a preferred solution of the data storage method based on distributed architecture described in the present invention, the microservices include managing user information and authentication, processing order-related data, managing inventory information, and recording system logs and user operations.

[0008] As a preferred solution of the data storage method based on distributed architecture described in the present invention, the horizontal sharding is performed according to the characteristics of the data, and the consistent hashing algorithm is used to evenly distribute the data to different nodes, including: Analyze the characteristics of the data, including user ID, geographic location, and timestamp, to determine whether the characteristics are suitable for the corresponding shard; the consistent hashing algorithm is to construct a virtual hash ring, map the entire hash space to the ring, and map each node and data item to a point on the ring through a hash function. Use the hash function to map each node to a position on the hash ring, and use the same hash function to map the data item to a position on the hash ring. Store the data item at the nearest node in the clockwise direction.

[0009] As a preferred solution of the data storage method based on distributed architecture described in the present invention, the consistent hashing algorithm includes: The consistent hashing algorithm uses a hash function to map data items and nodes to a hash space. Assume that the hash function is h and the hash space is a fixed range [0,2^m-1], where m is the number of bits output by the hash function. The expression is as follows: Map each node Ni to a point on the hash ring, the expression is as follows: Each data item Dj is mapped to a point on the hash ring, and its expression is as follows: The data item is stored on the nearest node in the clockwise direction. Assuming the node set is {N1, N2, …, Nk}, the data item Dj will be stored on the node Ni that satisfies the following conditions, and its expression is as follows: If no node meets the condition, the first node N1 is selected.

[0010] As a preferred solution of the data storage method based on distributed architecture described in the present invention, wherein: the real-time monitoring of data access and storage, automatic adjustment of sharding strategy, and introduction of machine learning algorithm to predict future data growth and access mode include: using a streaming processing framework to process monitoring data and logs in real time, extracting key indicators, and calculating data access mode and load in real time, and detecting abnormal conditions in real time through a time series anomaly detection algorithm, such as a sudden increase in access volume and abnormal node load, triggering alarms and automatic adjustment strategies; performing initial sharding according to data features, evenly distributing data to each node, using a consistent hashing algorithm to ensure even data distribution, allocating multiple virtual nodes to each physical node, further balancing the load, adding or removing virtual nodes on the hash ring, adjusting data distribution, and prioritizing the migration of frequently accessed data according to data access frequency and load conditions; preprocessing monitoring data and logs, extracting features and converting formats, using a time series prediction model to predict future data growth and access patterns, and adjusting the sharding strategy according to the prediction results to avoid load imbalance and data hotspots.

[0011] As a preferred solution of the data storage method based on distributed architecture described in the present invention, the method of using a time series prediction model to predict future data growth and access patterns includes: Convert the timestamp to a time index. If the data is not stationary, perform a stationary transformation through difference or logarithmic transformation. Model the data using the ARIMA model. The AR part uses past values ​​to predict current values, the I part makes non-stationary data stationary through difference, and the MA part uses past prediction errors to predict current values. The expression of the ARIMA model is as follows: Where yt is the value at time t, c is a constant, is the autoregressive coefficient, is the moving average coefficient, is the error term, p is the autoregressive order, and q is the moving average order.

[0012] As a preferred solution of the data storage method based on distributed architecture described in the present invention, wherein: the data is encrypted and processed, and a distributed key management system is used to dynamically manage encryption keys, implement fine-grained access control strategies, and control data access according to user roles and permissions, including: the user requests access to the key, the system verifies the user's identity and permissions, distributes the key to the user through a secure channel, the user obtains the key after authorization verification, and uses the key to perform data encryption or decryption operations; different roles and corresponding permissions are defined in the system, the administrator has all permissions, including reading, writing and deleting all data, ordinary users can only read and write their own data, and visitors can only read public data; if the user has permission, the system decrypts the data and provides it to the user; if the user writes data, the system encrypts the data and stores it.

[0013] In the second aspect, an embodiment of the present invention provides a data storage system based on a distributed architecture, which includes: a database combination module, which is used to divide the system into multiple independent microservices, each microservice is responsible for a specific data storage function, and each microservice communicates through an API gateway, selects an HBase distributed database, adopts a hybrid database architecture, and uses a combination of relational databases and non-relational databases to meet different data storage requirements; a data adjustment module, which is used to perform horizontal sharding according to the characteristics of the data, uses a consistent hashing algorithm to evenly distribute the data to different nodes, monitors data access and storage in real time, automatically adjusts the sharding strategy, introduces a machine learning algorithm to predict future data growth and access patterns, and performs sharding adjustment in advance. The whole; data compression module is used to adopt a multi-copy mechanism to store data on multiple nodes, introduce an asynchronous replication mechanism, and combine it with the final consistency model to improve the system's write performance, compress the stored data, and reduce the storage space occupied. The data deduplication algorithm is introduced to divide the data into hot data and cold data according to the access frequency of the data. Hot data is stored in high-performance storage devices, and cold data is stored in low-cost storage devices; the data encryption control module is used to encrypt the data during transmission and storage. The distributed key management system is used to dynamically manage encryption keys to implement fine-grained access control strategies, control data access according to user roles and permissions, and introduce a blockchain-based access record system to record each data access behavior.

[0014] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the processor executes the computer program, any step of the above-mentioned data storage method based on a distributed architecture is implemented.

[0015] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the above-mentioned data storage method based on a distributed architecture is implemented.

[0016] The beneficial effects of the present invention are as follows: the present invention realizes uniform distribution and efficient synchronization of data among nodes through consistent hashing algorithm and data copy mechanism, and reduces the possibility of data inconsistency. Distributed transaction management and coordination mechanism are adopted to ensure data consistency and integrity in a high-concurrency environment. Through intelligent routing and local cache strategies, cross-node data transmission is reduced, data access speed is improved, and network latency is reduced. According to data access mode and node load conditions, data sharding strategy is dynamically adjusted to ensure system load balancing and efficient operation. A distributed key management system is adopted to dynamically manage encryption keys to ensure the security of data during transmission and storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them: Figure 1 A flow chart of a data storage method and system based on a distributed architecture provided in an embodiment of the present invention.

[0018] Figure 2 A structural diagram of a data storage method and system based on a distributed architecture provided in an embodiment of the present invention.

[0019] Figure 3 An internal structure diagram of a computer device of a data storage method and system based on a distributed architecture provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0023] Example 1 Reference Figure 1~Figure 3 , is an embodiment of the present invention, which provides a data storage method based on a distributed architecture, including: S1: Divide the system into multiple independent microservices. Each microservice is responsible for a specific data storage function. The microservices communicate through the API gateway.

[0024] Preferably, the microservices include managing user information and authentication, processing order-related data, managing inventory information, and recording system logs and user operations.

[0025] Furthermore, the user sends a registration request through the API gateway, and the user management service creates a user account. The user sends a login request through the API gateway, and the user management service verifies the user's identity and generates a session token.

[0026] Furthermore, the user sends a data upload request through the API gateway, the API gateway verifies the user identity and routes the request to the data storage service, the data storage service calls the key management service to obtain the encryption key, the data storage service encrypts the data, and calls the data sharding service to store the data in a distributed database after sharding.

[0027] Furthermore, the user sends a data retrieval request through the API gateway, the API gateway verifies the user's identity and routes the request to the data storage service, the data storage service retrieves the encrypted data from the distributed database and calls the key management service to obtain the decryption key, the data storage service decrypts the data and returns the decrypted data to the user.

[0028] S2: Choose HBase distributed database, adopt hybrid database architecture, and use a combination of relational database and non-relational database to meet different data storage requirements.

[0029] Preferably, the user sends a registration request through the API gateway, and the user management service stores the user information (user name, password, email address, etc.) in the MySQL user table. The user sends a login request through the API gateway, and the user management service verifies the user identity from the MySQL user table and generates a session token if successful.

[0030] The user submits an order through the API gateway, and the order management service stores the order information (user ID, product ID, order date, etc.) in the MySQL order table; the user queries the order status through the API gateway, and the order management service retrieves the order status from the MySQL order table and returns it to the user.

[0031] Furthermore, the system generates log data (timestamp, log level, log content, etc.), and the log service stores the log data in the log table of HBase. The administrator sends a log query request through the API gateway. The log service retrieves the qualified log data from the log table through the HBase API and returns it to the administrator.

[0032] Furthermore, the sensor data (sensor ID, timestamp, sensor value, etc.) collected by the sensor is stored in the sensor data table of HBase by the sensor data service. The user sends a sensor data query request through the API gateway, and the sensor data service retrieves the qualified data from the sensor data table through the HBase API and returns it to the user.

[0033] S3: Horizontally shard the data based on its characteristics, use the consistent hashing algorithm to evenly distribute the data to different nodes, monitor data access and storage in real time, automatically adjust the sharding strategy, introduce machine learning algorithms to predict future data growth and access patterns, and make sharding adjustments in advance.

[0034] Preferably, the characteristics of the data are analyzed, including user ID, geographic location, and timestamp, to determine whether the characteristics are suitable for the corresponding shard; the consistent hashing algorithm is to map the entire hash space to the ring by constructing a virtual hash ring, and each node and data item is mapped to a point on the ring through a hash function, and each node is mapped to a position on the hash ring using a hash function, and the data item is mapped to a position on the hash ring using the same hash function, and the data item is stored in the nearest node in the clockwise direction.

[0035] Furthermore, the consistent hashing algorithm uses a hash function to map data items and nodes to a hash space. Assume that the hash function is h and the hash space is a fixed range [0,2^m-1], where m is the number of bits output by the hash function. The expression is as follows: Map each node Ni to a point on the hash ring, the expression is as follows: Each data item Dj is mapped to a point on the hash ring, and its expression is as follows: The data item is stored on the nearest node in the clockwise direction. Assuming the node set is {N1, N2, …, Nk}, the data item Dj will be stored on the node Ni that satisfies the following conditions, and its expression is as follows: If no node meets the condition, the first node N1 is selected.

[0036] Further, assume that there are four nodes N1, N2, N3, and N4 in the system; Map each node to a point on the hash ring: h(N1)=H(N1) h(N2)=H(N2) h(N3)=H(N3) h(N4)=H(N4) Map data items to points on the hash ring: h(D1)=H(D1) h(D2)=H(D2) h(D3)=H(D3) h(D4)=H(D4) The data item is stored on the nearest node in the clockwise direction. If h(D2)>h(N2) and if h(D1)≤h(N2), then D1 is stored on N2; if h(D2)≤h(N3), then D2 is stored on N3; if h(D3)>h(N4), then D3 is stored on N1.

[0037] Furthermore, a streaming processing framework is used to process monitoring data and logs in real time, extract key indicators, calculate data access patterns and load conditions in real time, and detect anomalies in real time through a time series anomaly detection algorithm, such as a sudden increase in access volume and abnormal node load, triggering alarms and automatic adjustment strategies; initial sharding is performed based on data characteristics, and the data is evenly distributed to each node. A consistent hashing algorithm is used to ensure uniform data distribution, and multiple virtual nodes are assigned to each physical node to further balance the load. Virtual nodes are added or removed from the hash ring, and data distribution is adjusted. Frequently accessed data is migrated first based on data access frequency and load conditions; monitoring data and logs are preprocessed, features are extracted and formatted, and a time series prediction model is used to predict future data growth and access patterns. Based on the prediction results, the sharding strategy is adjusted to avoid load imbalance and data hotspots.

[0038] Furthermore, the timestamp is converted to a time index. If the data is not stationary, it is transformed to a stationary state through difference or logarithmic transformation. The ARIMA model is used for modeling. The AR part uses past values ​​to predict current values, the I part makes non-stationary data stationary through difference, and the MA part uses past prediction errors to predict current values. The expression of the ARIMA model is as follows: Where yt is the value at time t, c is a constant, is the autoregressive coefficient, is the moving average coefficient, is the error term, p is the autoregressive order, and q is the moving average order.

[0039] S4: Adopt a multi-copy mechanism to store data on multiple nodes, introduce an asynchronous replication mechanism, and combine it with the final consistency model to improve the system's write performance, compress the stored data, reduce storage space occupancy, introduce a data deduplication algorithm, and divide data into hot data and cold data according to the frequency of data access. Hot data is stored in high-performance storage devices, and cold data is stored in low-cost storage devices.

[0040] Preferably, assume that there are 6 nodes N1, N2, N3, N4, N5, N6 in the system, and each data item stores 3 copies; High-performance storage devices: N1, N2, N3, equipped with SSD; Low-cost storage devices: N4, N5, N6, equipped with HDD; The client writes data D1 into the system. The primary copy of data D1 is stored on N1, and a write success is immediately returned. The primary copy N1 asynchronously replicates the data to the replica nodes N2 and N3. When writing data D1 to node N1, the LZ4 algorithm is used to compress the data. When writing data D2, the hash algorithm is used to check whether there is duplicate data. If so, it is not stored. Furthermore, the access frequency of data D1 is analyzed in real time through the monitoring system. If D1 is hot data, it is stored in N1, N2, and N3 in high-performance storage devices (such as SSD); if D1 is cold data, it is stored in N4, N5, and N6 in low-cost storage devices (such as HDD).

[0041] S5: During the transmission and storage process, the data is encrypted and a distributed key management system is used to dynamically manage encryption keys, implement fine-grained access control strategies, control data access based on user roles and permissions, and introduce a blockchain-based access record system to record each data access behavior.

[0042] Preferably, the user requests an access key, the system verifies the user's identity and authority, distributes the key to the user through a secure channel, the user obtains the key after authorization verification, and uses the key to perform data encryption or decryption operations; different roles and corresponding authorities are defined in the system, the administrator has all authorities, including reading, writing and deleting all data, ordinary users can only read and write their own data, and visitors can only read public data; if the user has authority, the system decrypts the data and provides it to the user; if the user writes data, the system encrypts the data and stores it.

[0043] Furthermore, the system configures the AES-256 encryption algorithm and DKMS, defines two roles, administrator and ordinary user, and assigns corresponding permissions; deploys the Hyperledger Fabric blockchain platform, and writes smart contracts to record access behaviors.

[0044] Furthermore, user A writes data D1, and the system uses AES-256 to encrypt the data and generate ciphertext C1. DKMS generates encryption key K1 and distributes it to authorized users and system components. Key K1 is stored in the distributed key storage system to ensure high availability and security. User B requests access to data D1, and the system verifies user B's access rights. The system checks user B's role and permissions. If user B has permission to access D1, access is allowed. The system uses key K1 in DKMS to decrypt data C1 and returns plaintext data D1 to user B. When user B accesses data D1, the system generates an access record, including access time, visitor, access data and other information.

[0045] The present invention uses a consistent hashing algorithm and a data copy mechanism to achieve uniform distribution and efficient synchronization of data among nodes, reducing the possibility of data inconsistency. A distributed transaction management and coordination mechanism is adopted to ensure data consistency and integrity in a high-concurrency environment. Through intelligent routing and local cache strategies, cross-node data transmission is reduced, data access speed is improved, and network latency is reduced. According to the data access mode and node load, the data sharding strategy is dynamically adjusted to ensure system load balancing and efficient operation. A distributed key management system is adopted to dynamically manage encryption keys to ensure the security of data during transmission and storage.

[0046] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A data storage method based on distributed architecture, It is characterized in that include: Divide the system into multiple independent microservices, each of which is responsible for a specific data storage function, and each microservice communicates through an API gateway; Choose HBase distributed database, adopt hybrid database architecture, and use a combination of relational database and non-relational database to meet different data storage requirements; Perform horizontal sharding based on data characteristics, use consistent hashing algorithms to evenly distribute data to different nodes, monitor data access and storage in real time, automatically adjust sharding strategies, introduce machine learning algorithms to predict future data growth and access patterns, and make sharding adjustments in advance; Adopt a multi-copy mechanism to store data on multiple nodes, introduce an asynchronous replication mechanism, and combine it with the final consistency model to improve the system's write performance, compress the stored data, reduce storage space usage, introduce a data deduplication algorithm, and divide data into hot data and cold data according to the frequency of data access. Hot data is stored in high-performance storage devices, and cold data is stored in low-cost storage devices; During the transmission and storage process, the data is encrypted and a distributed key management system is used to dynamically manage encryption keys, implement fine-grained access control strategies, control data access based on user roles and permissions, and introduce a blockchain-based access record system to record each data access behavior.

2. The data storage method based on distributed architecture as claimed in claim 1, It is characterized in that The microservices include managing user information and authentication, processing order-related data, managing inventory information, and recording system logs and user operations.

3. The data storage method based on distributed architecture as claimed in claim 1, It is characterized in that The horizontal sharding is performed according to the characteristics of the data, and the consistent hashing algorithm is used to evenly distribute the data to different nodes, including: Analyze the characteristics of the data, including user ID, geographic location, and timestamp, to determine whether the characteristics are suitable for the corresponding shard; the consistent hashing algorithm is to construct a virtual hash ring, map the entire hash space to the ring, and map each node and data item to a point on the ring through a hash function. Use the hash function to map each node to a position on the hash ring, and use the same hash function to map the data item to a position on the hash ring. Store the data item at the nearest node in the clockwise direction.

4. The data storage method based on distributed architecture as claimed in claim 1 or 3, It is characterized in that The consistent hashing algorithm includes: The consistent hashing algorithm uses a hash function to map data items and nodes to a hash space. Assume that the hash function is h and the hash space is a fixed range [0,2^m-1], where m is the number of bits output by the hash function. The expression is as follows: Map each node Ni to a point on the hash ring, the expression is as follows: Each data item Dj is mapped to a point on the hash ring, and its expression is as follows: The data item is stored on the nearest node in the clockwise direction. Assuming the node set is {N1, N2, …, Nk}, the data item Dj will be stored on the node Ni that satisfies the following conditions, and its expression is as follows: If no node meets the condition, the first node N1 is selected.

5. The data storage method based on distributed architecture as claimed in claim 1, It is characterized in that The real-time monitoring of data access and storage, automatic adjustment of sharding strategies, and introduction of machine learning algorithms to predict future data growth and access patterns include: Use the streaming processing framework to process monitoring data and logs in real time, extract key indicators, calculate data access patterns and load conditions in real time, and use the time series anomaly detection algorithm to detect anomalies in real time, such as sudden increases in access volume and abnormal node loads, trigger alarms and automatically adjust strategies; perform initial sharding based on data characteristics, evenly distribute data to each node, use the consistent hashing algorithm to ensure even data distribution, assign multiple virtual nodes to each physical node to further balance the load, add or remove virtual nodes on the hash ring, adjust data distribution, and prioritize the migration of frequently accessed data based on data access frequency and load conditions; preprocess monitoring data and logs, extract features and convert formats, use time series prediction models to predict future data growth and access patterns, and adjust sharding strategies based on prediction results to avoid load imbalance and data hotspots.

6. The data storage method based on distributed architecture as claimed in claim 5, It is characterized in that The use of time series forecasting models to predict future data growth and access patterns includes: Convert the timestamp to a time index. If the data is not stationary, perform a stationary transformation through difference or logarithmic transformation. Model the data using the ARIMA model. The AR part uses past values ​​to predict current values, the I part makes non-stationary data stationary through difference, and the MA part uses past prediction errors to predict current values. The expression of the ARIMA model is as follows: Where yt is the value at time t, c is a constant, is the autoregressive coefficient, is the moving average coefficient, is the error term, p is the autoregressive order, and q is the moving average order.

7. The data storage method based on distributed architecture as claimed in claim 1, It is characterized in that The data is encrypted and a distributed key management system is used to dynamically manage encryption keys, implement fine-grained access control strategies, and control data access based on user roles and permissions, including: The user requests access to the key, the system verifies the user's identity and permissions, distributes the key to the user through a secure channel, and the user obtains the key after authorization verification, and uses the key to encrypt or decrypt data; different roles and corresponding permissions are defined in the system, the administrator has all permissions, including reading, writing and deleting all data, ordinary users can only read and write their own data, and visitors can only read public data; if the user has permission, the system decrypts the data and provides it to the user; if the user writes data, the system encrypts the data and stores it.

8. A data storage system based on a distributed architecture, It is characterized in that include: The database combination module is used to divide the system into multiple independent microservices. Each microservice is responsible for a specific data storage function. Each microservice communicates through the API gateway. The HBase distributed database is selected, and a hybrid database architecture is adopted. A combination of relational databases and non-relational databases is used to meet different data storage requirements. The data adjustment module is used to perform horizontal sharding according to the characteristics of the data. It uses the consistent hashing algorithm to evenly distribute the data to different nodes, monitors data access and storage in real time, automatically adjusts the sharding strategy, and introduces machine learning algorithms to predict future data growth and access patterns, and adjusts sharding in advance. The data compression module is used to adopt a multi-copy mechanism to store data on multiple nodes. It introduces an asynchronous replication mechanism and combines it with the final consistency model to improve the system's write performance, compress the stored data, and reduce the storage space occupied. It introduces a data deduplication algorithm to divide data into hot data and cold data according to the access frequency of the data. Hot data is stored in high-performance storage devices, and cold data is stored in low-cost storage devices. The data encryption control module is used to encrypt data during transmission and storage. It uses a distributed key management system to dynamically manage encryption keys, implement fine-grained access control strategies, control data access based on user roles and permissions, and introduce a blockchain-based access record system to record each data access behavior.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the data storage method based on a distributed architecture are implemented in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the data storage method based on a distributed architecture described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Distributed real-time database data hierarchical indexing method

    CN103020078A

  • Industrial internet identifier analysis system based on micro-service architecture

    CN112765117A

  • Intelligent safety emergency management data identification system

    CN118211188A

  • User-friendly encrypted storage system and method for distributed file system

    CN118260264A

  • Distributed storage design implementation method based on artificial intelligence

    CN118394269A

Cited By

  • Monitoring data storage method and system based on time sequence database

    CN118838900A

  • Distributed multi-tenant data security isolation system and method

    CN119402233A

  • Cross-platform live broadcast visitor data fusion and routing load balancing method and system

    CN119420696A

  • Digital country data storage system based on cloud computing

    CN119576224A

  • Electric energy meter data distributed storage method based on improved PoS consensus

    CN119902721A