Data storage method, load balancing server, device and storage medium

By monitoring and handling failed nodes in the main storage cluster in the load balancing server, data loss and service interruption caused by single point of failure in traditional data storage methods are solved, and high reliability and continuous availability of data storage are achieved.

CN119743491APending Publication Date: 2025-04-01CHINA LIFE INSURANCE CO LTD SHANGHAI DATA CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411824868.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

Traditional data storage methods rely on a single storage device or storage cluster, resulting in data loss or service interruption, reducing the effectiveness and reliability of data storage.

Method used

By monitoring the status of each storage node in the main storage cluster in real time in the load balancing server, and detecting and handling faulty nodes in a timely manner to avoid a single point of failure. If the primary storage cluster fails, data will be migrated to the secondary storage cluster to ensure the continuous availability of the data.

Benefits of technology

Improves the effectiveness and reliability of data storage, avoids data loss or service interruption caused by a single point of failure, and ensures continuous data availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743491A_ABST
    Figure CN119743491A_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing, and in particular to a data storage method, a load balancing server, a device and a storage medium, wherein, in response to a business data storage request sent by a business client, the cluster state of the main storage cluster is determined based on the node state of each storage node in the main storage cluster; a storage strategy for storing target business data carried by the business data storage request is determined based on the cluster state of the main storage cluster; and the target business data is stored based on the storage strategy. The above method is adopted to improve the effectiveness and reliability of data storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a data storage method, a load balancing server, a device and a storage medium. Background Art

[0002] With the rapid development of information technology, the amount of business data has exploded, and data storage has become an important technical challenge. Traditional data storage methods often rely on a single storage device or storage cluster. Once the device or cluster fails, it will cause data loss or service interruption, thereby reducing the effectiveness and reliability of data storage. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a data storage method, a load balancing server, a device and a storage medium to improve the effectiveness and reliability of data storage.

[0004] In a first aspect, an embodiment of the present application provides a data storage method, which is applied to a load balancing server, and the method includes:

[0005] In response to a business data storage request sent by a business client, determining a cluster state of the primary storage cluster based on a node state of each storage node in the primary storage cluster;

[0006] Determining a storage strategy for storing the target business data carried in the business data storage request based on the cluster state of the primary storage cluster;

[0007] The target business data is stored based on the storage policy.

[0008] Optionally, determining the cluster state of the primary storage cluster based on the node state of each storage node in the primary storage cluster includes:

[0009] Obtaining the node status of each storage node in the primary storage cluster, wherein the node status is available or unavailable;

[0010] Counting the number of unavailable nodes in the primary storage cluster whose node status is unavailable;

[0011] Determining whether the number of unavailable nodes exceeds a preset threshold;

[0012] If the number of the unavailable nodes exceeds the preset threshold, the cluster state of the primary storage cluster is determined to be unavailable.

[0013] Optionally, after determining whether the number of unavailable nodes exceeds a preset threshold, the method further includes:

[0014] If the number of the unavailable nodes does not exceed the preset threshold, the cluster state of the primary storage cluster is determined to be available.

[0015] Optionally, the determining, based on the cluster state of the primary storage cluster, a storage strategy for storing the target business data carried in the business data storage request includes:

[0016] When the cluster status of the primary storage cluster is available, determining the storage policy of the target business data as normal storage;

[0017] When the cluster status of the primary storage cluster is unavailable, the storage strategy of the target service data is determined as backup storage.

[0018] Optionally, storing the target service data based on the storage policy includes:

[0019] When the storage policy of the target business data is determined to be normal storage, the target business data is sent to the primary storage cluster for storage;

[0020] When the storage policy of the target service data is determined to be backup storage, the target service data is sent to the secondary storage cluster for storage.

[0021] Optionally, after sending the target service data to the secondary storage cluster for storage, the method further includes:

[0022] Real-time monitoring of whether the cluster status of the primary storage cluster is restored from unavailable to available;

[0023] When the cluster status of the primary storage cluster is restored from unavailable to available, the target service data is sent from the secondary storage cluster to the primary storage cluster for storage.

[0024] Optionally, the method further comprises:

[0025] Counting the duration for which the cluster status of the primary storage cluster is determined to be unavailable;

[0026] Determine whether the duration exceeds a preset duration;

[0027] If the duration exceeds the preset duration, a main cluster failure warning message is generated.

[0028] In a second aspect, an embodiment of the present application provides a load balancing server, the server comprising:

[0029] A cluster status determination module, configured to respond to a business data storage request sent by a business client and determine the cluster status of the primary storage cluster based on the node status of each storage node in the primary storage cluster;

[0030] A storage strategy determination module, configured to determine a storage strategy for storing target business data carried in the business data storage request based on the cluster state of the primary storage cluster;

[0031] The business data storage module is used to store the target business data based on the storage strategy.

[0032] Optionally, determining the cluster state of the primary storage cluster based on the node state of each storage node in the primary storage cluster includes:

[0033] Obtaining the node status of each storage node in the primary storage cluster, wherein the node status is available or unavailable;

[0034] Counting the number of unavailable nodes in the primary storage cluster whose node status is unavailable;

[0035] Determining whether the number of unavailable nodes exceeds a preset threshold;

[0036] If the number of the unavailable nodes exceeds the preset threshold, the cluster state of the primary storage cluster is determined to be unavailable.

[0037] Optionally, the cluster status determination module is further used to:

[0038] After determining whether the number of the unavailable nodes exceeds a preset threshold, if the number of the unavailable nodes does not exceed the preset threshold, the cluster state of the primary storage cluster is determined to be available.

[0039] Optionally, the determining, based on the cluster state of the primary storage cluster, a storage strategy for storing the target business data carried in the business data storage request includes:

[0040] When the cluster status of the primary storage cluster is available, determining the storage policy of the target business data as normal storage;

[0041] When the cluster status of the primary storage cluster is unavailable, the storage strategy of the target service data is determined as backup storage.

[0042] Optionally, storing the target service data based on the storage policy includes:

[0043] When the storage policy of the target business data is determined to be normal storage, the target business data is sent to the primary storage cluster for storage;

[0044] When the storage policy of the target service data is determined to be backup storage, the target service data is sent to the secondary storage cluster for storage.

[0045] Optionally, the load balancing server further includes a service data transfer module, which is used to:

[0046] After sending the target service data to the secondary storage cluster for storage, real-time monitoring is performed to determine whether the cluster status of the primary storage cluster is restored from unavailable to available;

[0047] When the cluster status of the primary storage cluster is restored from unavailable to available, the target service data is sent from the secondary storage cluster to the primary storage cluster for storage.

[0048] Optionally, the load balancing server further includes a warning information generating module, which is used to:

[0049] Counting the duration for which the cluster status of the primary storage cluster is determined to be unavailable;

[0050] Determine whether the duration exceeds a preset duration;

[0051] If the duration exceeds the preset duration, a main cluster failure warning message is generated.

[0052] In a third aspect, an embodiment of the present application provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the data storage method described in any optional implementation manner of the first aspect are performed.

[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the data storage method described in any optional implementation manner in the first aspect above are executed.

[0054] The technical solution provided by this application includes but is not limited to the following beneficial effects:

[0055] This application monitors the status of each storage node in the primary storage cluster in real time through the load balancing server, and can promptly discover and handle faulty nodes, thereby avoiding data loss or service interruption caused by single point failure. When the primary storage cluster fails, the data can be migrated to the secondary storage cluster to ensure the continuous availability of data, thereby improving the effectiveness and reliability of data storage.

[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0058] Figure 1 A flow chart of a data storage method provided by the first embodiment of the present invention is shown;

[0059] Figure 2 A schematic diagram of the structure of a data storage system provided by the first embodiment of the present invention is shown;

[0060] Figure 3 A flow chart of a cluster status determination method provided by Embodiment 1 of the present invention is shown;

[0061] Figure 4 A flow chart of a second data storage method provided by the first embodiment of the present invention is shown;

[0062] Figure 5 A flow chart of a method for generating fault warning information provided by the first embodiment of the present invention is shown;

[0063] Figure 6 A flowchart of a specific data storage method provided by the first embodiment of the present invention is shown;

[0064] Figure 7 A schematic diagram of the structure of a load balancing server provided in the second embodiment of the present invention is shown;

[0065] Figure 8 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention is shown. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0067] Embodiment 1

[0068] To facilitate understanding of this application, Figure 1 The content described in the flowchart of a data storage method provided in the first embodiment of the present invention is described in detail in the first embodiment of the present application.

[0069] See also Figure 1 As shown, Figure 1 A flowchart of a data storage method provided by a first embodiment of the present invention is shown, wherein the method is applied to a load balancing server and comprises steps S101 to S103:

[0070] S101: In response to a service data storage request sent by a service client, a cluster state of the primary storage cluster is determined based on a node state of each storage node in the primary storage cluster.

[0071] For details, see Figure 2 As shown, Figure 2 A structural schematic diagram of a data storage system provided by the first embodiment of the present invention is shown, wherein a load balancing server is configured in the data storage system, the data storage system also includes a primary storage cluster and a secondary storage cluster, and the load balancing server, the primary storage cluster (configured in the primary site) and the secondary storage cluster (configured in the secondary site) are all able to communicate. The primary storage cluster and the secondary storage cluster are storage clusters that can provide services independently, and data is synchronized in real time between the primary site and the secondary site. Under normal circumstances, the primary site provides services for the business, and the data of the primary and secondary sites are kept synchronized.

[0072] After receiving the business data storage request from the business client, the load balancing server determines the overall status of the cluster based on the real-time status information of each storage node in the main storage cluster. This information includes key indicators such as CPU usage, memory usage, disk remaining space, and network bandwidth usage, which can fully reflect the performance and load of the storage node.

[0073] S102: Determine a storage strategy for storing the target business data carried in the business data storage request based on the cluster state of the primary storage cluster.

[0074] Specifically, after obtaining the cluster status, the load balancing server will formulate a storage strategy based on this information. This step is crucial because it determines how to store business data in the primary storage cluster to ensure data reliability and efficiency. The formulation of the storage strategy will take into account multiple factors, such as the access frequency, size, importance of the data, and the performance and load of the storage node.

[0075] S103: Storing the target business data based on the storage strategy.

[0076] Specifically, the load balancing server stores the business data in the appropriate location in the main storage cluster according to the formulated storage strategy. This step ensures that the data can be stored and managed in a predetermined manner, thereby improving storage efficiency and data reliability.

[0077] In an alternative embodiment, see Figure 3 As shown, Figure 3 A flow chart of a cluster status determination method provided in the first embodiment of the present invention is shown, wherein the cluster status of the primary storage cluster is determined based on the node status of each storage node in the primary storage cluster, including steps S301 to S304:

[0078] S301: Obtain the node status of each storage node in the primary storage cluster, where the node status is available or unavailable.

[0079] Specifically, the current status of each storage node in the main storage cluster is obtained. These statuses are classified as "available" or "unavailable". The "available" status means that the storage node is working normally and can process data read and write requests. The "unavailable" status means that the storage node is faulty and cannot work normally.

[0080] Obtaining the node status of each storage node in the main storage cluster includes: detecting through a TCP port or HTTP URL every five seconds; if it is connected within three times, the node is judged to be "available"; if it is still not connected after three times, the node is judged to be "unavailable".

[0081] Based on the information collected in the above steps, the load balancing processor will update the status information of each storage node in the main storage cluster, including maintaining a node status table or database so that subsequent data routing, load balancing and failover operations can be performed based on the latest node status.

[0082] S302: Count the number of unavailable nodes in the primary storage cluster whose node status is unavailable.

[0083] Specifically, after determining the status of each node, the system needs to count the number of all nodes in the "unavailable" state. This number will be used in subsequent judgment steps to determine the status of the entire primary storage cluster.

[0084] S303: Determine whether the number of unavailable nodes exceeds a preset threshold.

[0085] Specifically, the number of unavailable nodes obtained by counting is compared with a preset threshold. The preset threshold is set in advance based on factors such as the redundancy design of the storage cluster and data security requirements. If the number of unavailable nodes exceeds this threshold, it can be considered that the overall performance or reliability of the cluster is seriously affected.

[0086] S304: If the number of the unavailable nodes exceeds the preset threshold, determine the cluster status of the primary storage cluster as unavailable.

[0087] Specifically, if the number of unavailable nodes is found to exceed the preset threshold after comparison, the status of the primary storage cluster will be marked as "unavailable", indicating that the entire storage cluster may not be able to provide normal data read and write services, or the quality of the service provided has dropped to an unacceptable level. In this case, further measures may need to be taken, such as starting the backup cluster, notifying the administrator for maintenance, etc.

[0088] In an optional implementation, after determining whether the number of unavailable nodes exceeds a preset threshold, the method further includes:

[0089] If the number of the unavailable nodes does not exceed the preset threshold, the cluster state of the primary storage cluster is determined to be available.

[0090] Specifically, if the number of unavailable nodes does not exceed this threshold, it means that the primary storage cluster still has sufficient redundancy and reliability to maintain normal operation. Therefore, the status of the primary storage cluster is marked as "available", indicating that the cluster can continue to provide data access and other related services.

[0091] In an optional implementation manner, determining a storage strategy for storing target business data carried in the business data storage request based on the cluster state of the primary storage cluster includes:

[0092] When the cluster status of the primary storage cluster is available, the storage policy of the target service data is determined as normal storage.

[0093] Specifically, when the cluster status of the primary storage cluster is determined to be "available", it means that most or all storage nodes in the cluster are working normally and can provide stable data storage services. In this case, the storage policy of the target business data is determined to be "normal storage". This means that the data will be directly stored in the primary storage cluster according to the established method and process for daily business operations and data processing.

[0094] When the cluster status of the primary storage cluster is unavailable, the storage strategy of the target service data is determined as backup storage.

[0095] Specifically, if the cluster status of the primary storage cluster is determined to be "unavailable", this usually means that a serious failure or problem has occurred in the cluster, resulting in the inability to provide data storage services normally. In this case, switching the storage policy of the target business data to "backup storage" means that the data will no longer be stored in the primary storage cluster, but will be redirected to the backup storage system or device.

[0096] These backup storage systems may be physical storage devices, cloud storage services, or other types of data storage solutions. The purpose of backup storage is to ensure that during a primary storage cluster failure, the target business data can still be safely stored and accessed, thereby minimizing the impact on business operations.

[0097] In an optional implementation manner, storing the target business data based on the storage policy includes:

[0098] When the storage policy of the target service data is determined to be normal storage, the target service data is sent to the primary storage cluster for storage.

[0099] Specifically, once the storage policy is determined to be "normal storage", the system will send the target business data to the primary storage cluster for storage. This usually involves writing the data to one or more storage nodes in the primary storage cluster and ensuring the integrity and consistency of the data.

[0100] When the storage policy of the target service data is determined to be backup storage, the target service data is sent to the secondary storage cluster for storage.

[0101] Specifically, if the storage policy is determined to be "backup storage", the system will send the target business data to the secondary storage cluster for storage. The secondary storage cluster is an independent storage system where data is stored securely so that it can be quickly restored when the primary storage cluster fails or is needed.

[0102] In an alternative embodiment, see Figure 4 As shown, Figure 4 A flow chart of a second data storage method provided in the first embodiment of the present invention is shown, wherein after the target service data is sent to the secondary storage cluster for storage, the method further includes steps S401 to S402:

[0103] S401: Monitor in real time whether the cluster status of the primary storage cluster is restored from unavailable to available.

[0104] Specifically, the cluster status of the primary storage cluster is continuously or periodically monitored to see whether it is restored from unavailable to available.

[0105] S402: When the cluster status of the primary storage cluster is restored from unavailable to available, the target service data is sent from the secondary storage cluster to the primary storage cluster for storage.

[0106] Specifically, once it is determined that the primary storage cluster has been restored to an available state, a data migration task is triggered to migrate the target service data from the secondary storage cluster back to the primary storage cluster.

[0107] In an alternative embodiment, see Figure 5 As shown, Figure 5 A flowchart of a method for generating fault warning information provided by the first embodiment of the present invention is shown, wherein the method further includes steps S501 to S503:

[0108] S501: Counting the duration for which the cluster status of the primary storage cluster is determined to be unavailable.

[0109] Specifically, the cluster status of the primary storage cluster is continuously monitored, and the start time and end time of each cluster status being determined to be unavailable are recorded. The difference between the end time and the start time of each unavailable status is calculated, and the total duration of the primary storage cluster being determined to be unavailable within a period of time (such as one day, one week, or one month) is calculated.

[0110] S502: Determine whether the duration exceeds a preset duration.

[0111] Specifically, the unavailability duration obtained by statistics is compared with a preset duration threshold. This preset duration threshold is usually set according to business requirements and performance indicators of the storage cluster to determine whether the cluster unavailability state has reached a level that requires attention.

[0112] S503: If the duration exceeds the preset duration, a main cluster failure warning message is generated.

[0113] Specifically, if the duration of the unavailability of the primary storage cluster exceeds the preset duration threshold, a primary cluster fault warning message is generated. This warning message may include the duration of the cluster's unavailability, the time range of the unavailability, possible causes of the failure, and recommended solutions. The warning message is sent to relevant operation and maintenance personnel or management personnel in a variety of ways, such as sending emails, SMS notifications, and displaying warning messages on the monitoring interface.

[0114] Here is an example to better illustrate the data storage method provided by this application. Here is an example, see Figure 6 As shown, Figure 6A flowchart of a specific data storage method provided by the first embodiment of the present invention is shown, wherein a primary storage cluster (Cluster A) and a secondary storage cluster (Cluster B) are configured in the data system. When the load balancing server receives a service request sent by a service client, it determines whether the number of faulty nodes in Cluster A is greater than 2. If so, all nodes in Cluster B are added to the server forwarding target pool, and Cluster B provides services at this time. Real-time monitoring is performed to determine whether the number of faulty nodes in Cluster A is greater than 2. If so, continue to send to Cluster B; if not, it means that Cluster A has recovered, and all nodes in Cluster B are kicked out of the forwarding target pool, and Cluster A provides services again. If the number of faulty nodes in Cluster A is less than or equal to 2 and the storage is normal, F5 forwards the request to Cluster A.

[0115] Embodiment 2

[0116] Embodiment 2 of the present invention provides a load balancing server, see Figure 7 As shown, Figure 7 A schematic diagram of the structure of a load balancing server provided in Embodiment 2 of the present invention is shown, wherein the device comprises:

[0117] A cluster status determination module 701 is used to determine the cluster status of the primary storage cluster based on the node status of each storage node in the primary storage cluster in response to a business data storage request sent by a business client;

[0118] A storage policy determination module 702, configured to determine a storage policy for storing the target business data carried in the business data storage request based on the cluster state of the primary storage cluster;

[0119] The business data storage module 703 is used to store the target business data based on the storage strategy.

[0120] In an optional implementation manner, determining the cluster state of the primary storage cluster based on the node state of each storage node in the primary storage cluster includes:

[0121] Obtaining the node status of each storage node in the primary storage cluster, wherein the node status is available or unavailable;

[0122] Counting the number of unavailable nodes in the primary storage cluster whose node status is unavailable;

[0123] Determining whether the number of unavailable nodes exceeds a preset threshold;

[0124] If the number of the unavailable nodes exceeds the preset threshold, the cluster state of the primary storage cluster is determined to be unavailable.

[0125] In an optional implementation manner, the cluster state determination module is further used to:

[0126] After determining whether the number of the unavailable nodes exceeds a preset threshold, if the number of the unavailable nodes does not exceed the preset threshold, the cluster state of the primary storage cluster is determined to be available.

[0127] In an optional implementation manner, determining a storage strategy for storing target business data carried in the business data storage request based on the cluster state of the primary storage cluster includes:

[0128] When the cluster status of the primary storage cluster is available, determining the storage policy of the target business data as normal storage;

[0129] When the cluster status of the primary storage cluster is unavailable, the storage strategy of the target service data is determined as backup storage.

[0130] In an optional implementation manner, storing the target business data based on the storage policy includes:

[0131] When the storage policy of the target business data is determined to be normal storage, the target business data is sent to the primary storage cluster for storage;

[0132] When the storage policy of the target service data is determined to be backup storage, the target service data is sent to the secondary storage cluster for storage.

[0133] In an optional implementation, the load balancing server further includes a service data transfer module, which is used to:

[0134] After sending the target service data to the secondary storage cluster for storage, real-time monitoring is performed to determine whether the cluster status of the primary storage cluster is restored from unavailable to available;

[0135] When the cluster status of the primary storage cluster is restored from unavailable to available, the target service data is sent from the secondary storage cluster to the primary storage cluster for storage.

[0136] In an optional implementation, the load balancing server further includes a warning information generating module, which is used to:

[0137] Counting the duration for which the cluster status of the primary storage cluster is determined to be unavailable;

[0138] Determine whether the duration exceeds a preset duration;

[0139] If the duration exceeds the preset duration, a main cluster failure warning message is generated.

[0140] Embodiment 3

[0141] Based on the same application concept, see Figure 8 As shown, Figure 8 FIG. 4 shows a schematic diagram of the structure of a computer device provided by Embodiment 3 of the present invention, wherein: Figure 8 As shown, a computer device 800 provided in Embodiment 3 of the present application includes:

[0142] A processor 801, a memory 802 and a bus 803, wherein the memory 802 stores machine-readable instructions executable by the processor 801. When the computer device 800 is running, the processor 801 communicates with the memory 802 via the bus 803, and the machine-readable instructions are executed by the processor 801 when it is running to perform the steps of the data storage method shown in the first embodiment.

[0143] Embodiment 4

[0144] Based on the same application concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data storage method described in any one of the above embodiments are executed.

[0145] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0146] The computer program product for data storage provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.

[0147] The load balancing server provided in the embodiment of the present invention can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the load balancing server provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the load balancing server embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.

[0148] In the embodiments provided by the present invention, it should be understood that the disclosed load balancing server and method can be implemented in other ways. The load balancing server embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some communication interface, device or unit, which can be electrical, mechanical or other forms.

[0149] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0150] In addition, each functional unit in the embodiment provided by the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0151] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0152] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0153] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A data storage method, characterized in that: Applied to a load balancing server, the method comprises: In response to a business data storage request sent by a business client, determining a cluster state of the primary storage cluster based on a node state of each storage node in the primary storage cluster; Determining a storage strategy for storing the target business data carried in the business data storage request based on the cluster state of the primary storage cluster; The target business data is stored based on the storage policy.

2. The method according to claim 1, characterized in that The determining the cluster state of the primary storage cluster based on the node state of each storage node in the primary storage cluster includes: Obtaining the node status of each storage node in the primary storage cluster, wherein the node status is available or unavailable; Counting the number of unavailable nodes in the primary storage cluster whose node status is unavailable; Determining whether the number of unavailable nodes exceeds a preset threshold; If the number of the unavailable nodes exceeds the preset threshold, the cluster state of the primary storage cluster is determined to be unavailable.

3. The method according to claim 2, characterized in that After determining whether the number of unavailable nodes exceeds a preset threshold, the method further includes: If the number of the unavailable nodes does not exceed the preset threshold, the cluster state of the primary storage cluster is determined to be available.

4. The method according to claim 3, characterized in that The determining, based on the cluster state of the primary storage cluster, of a storage strategy for storing the target business data carried in the business data storage request comprises: When the cluster status of the primary storage cluster is available, determining the storage policy of the target business data as normal storage; When the cluster status of the primary storage cluster is unavailable, the storage strategy of the target service data is determined as backup storage.

5. The method according to claim 4, characterized in that The storing the target business data based on the storage strategy includes: When the storage policy of the target business data is determined to be normal storage, the target business data is sent to the primary storage cluster for storage; When the storage policy of the target service data is determined to be backup storage, the target service data is sent to the secondary storage cluster for storage.

6. The method according to claim 5, characterized in that After sending the target service data to the secondary storage cluster for storage, the method further includes: Real-time monitoring of whether the cluster status of the primary storage cluster is restored from unavailable to available; When the cluster status of the primary storage cluster is restored from unavailable to available, the target service data is sent from the secondary storage cluster to the primary storage cluster for storage.

7. The method according to claim 2, characterized in that The method further comprises: Counting the duration for which the cluster status of the primary storage cluster is determined to be unavailable; Determine whether the duration exceeds a preset duration; If the duration exceeds the preset duration, a main cluster failure warning message is generated.

8. A load balancing server, characterized in that: The server comprises: A cluster status determination module, configured to respond to a business data storage request sent by a business client and determine the cluster status of the primary storage cluster based on the node status of each storage node in the primary storage cluster; A storage strategy determination module, configured to determine a storage strategy for storing target business data carried in the business data storage request based on the cluster state of the primary storage cluster; The business data storage module is used to store the target business data based on the storage strategy.

9. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the data storage method as described in any one of claims 1 to 7 are performed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the data storage method according to any one of claims 1 to 7.