A service data processing method and apparatus
By receiving requests from business systems, determining the storage service mode, and calling the storage cluster API interface, automatic synchronization of storage cluster failover and failover of heterogeneous storage clusters are realized. This solves the problems of low efficiency and poor user experience in existing technologies and improves the fault tolerance and high availability of the database system.
Patent Information
- Application Number
- CN202210715756.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-06-23
AI Technical Summary
Existing business data processing methods cannot automatically synchronize to the recovered storage cluster when the storage cluster fails, cannot access business data that has not yet been synchronized, and do not support failover between heterogeneous storage clusters, resulting in low processing efficiency and poor user experience.
By receiving requests from business systems, the storage service mode is determined, and the API interfaces of the primary and secondary storage clusters are called to process business data, including storage and read operations. Data is synchronized asynchronously to ensure high availability and fault tolerance, and rapid failover and switching are supported for single points of failure.
It improved the efficiency of business data processing, enhanced the fault tolerance and robustness of the database system, supported rapid failover and switching for single points of failure, expanded application scenarios, and improved user experience.
Smart Images

Figure CN117312440B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a business data processing method and apparatus. Background Technology
[0002] As the demand for accessing business data in information systems becomes more frequent and complex, the handling of single-point failure transfer and recovery of data storage clusters has become increasingly important. How to handle single-point failure transfer and recovery of storage clusters in information systems has become an urgent problem to be solved.
[0003] The existing technology has at least the following problems:
[0004] In existing business data processing methods, when a storage cluster fails and failover is initiated, business data cannot be automatically synchronized from the storage cluster to the recovered storage cluster. At the same time, it is impossible to access business data that has not yet been synchronized during failover, and failover between heterogeneous storage clusters is not supported. This results in low efficiency of business data processing, narrow application scenarios, and poor user experience. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a business data processing method and apparatus that can adjust the storage service mode according to the functional status of the storage cluster, call the API interface of the storage cluster in the storage service mode to perform business data processing, improve the efficiency of business data processing, support rapid transfer and switching of single point of failure, expand the application scenarios of business data processing, and enhance the user experience.
[0006] To achieve the above objectives, according to one aspect of the present invention, a business data processing method is provided, comprising:
[0007] Receive business data processing requests sent by the business system and determine the storage service mode of the database system; wherein the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request;
[0008] If the storage service mode is a multi-storage service mode, at least one of business data storage processing and business data reading processing shall be performed according to the business data processing request; wherein, performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data reading processing includes: according to the business data number indicated by the business data reading request, calling the API interface of the primary storage cluster to read the corresponding business data;
[0009] Send the business data processing results to the business system.
[0010] Furthermore, prior to the step of determining the storage service schema of the database system, the method also includes:
[0011] Access the storage clusters in the database system to determine whether the storage functions of multiple storage clusters are available;
[0012] The storage service model is determined based on the assessment results.
[0013] Furthermore, the step of storing business data objects in the primary storage cluster also includes:
[0014] If a storage failure is received when storing business data objects to the main storage cluster;
[0015] Store the business data object in any one of the secondary storage clusters, and after successful storage, asynchronously store the business data object in other secondary storage clusters.
[0016] Furthermore, the method also includes:
[0017] Periodically access the primary storage cluster to determine whether the primary storage cluster has restored its storage function;
[0018] If so, asynchronously store the business data objects stored in the secondary storage cluster to the primary storage cluster.
[0019] Furthermore, the step of calling the API interface of the main storage cluster to read the corresponding business data based on the business data number indicated by the business data read request also includes:
[0020] If a read failure is received when calling the API interface of the main storage cluster to read the corresponding business data;
[0021] Call the API interface of any storage cluster to read the corresponding business data until a successful read response or a complete read failure response is received.
[0022] Furthermore, if the storage service mode is a single storage service mode, the method also includes:
[0023] Determine the target storage cluster corresponding to the single storage service mode;
[0024] Based on the business data object indicated in the business data storage request, call the API interface of the target storage cluster to store the business data object in the target storage cluster; and / or
[0025] Based on the business data number indicated by the business data read request, call the API interface of the target storage cluster to read the corresponding business data.
[0026] Furthermore, when the storage service model is adjusted to a multi-storage service model, the method also includes:
[0027] Business data objects stored in the target storage cluster are asynchronously stored in other storage clusters of the database system.
[0028] According to another aspect of the present invention, a business data processing apparatus is provided, comprising:
[0029] The storage service mode determination module is used to receive business data processing requests sent by the business system and determine the storage service mode of the database system; wherein, the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request;
[0030] The business data processing module is used to: if the storage service mode is a multi-storage service mode, perform at least one of business data storage processing and business data reading processing according to the business data processing request; wherein, performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data reading processing includes: according to the business data number indicated by the business data reading request, calling the API interface of the primary storage cluster to read the corresponding business data;
[0031] The sending module is used to send business data processing results to the business system.
[0032] According to another aspect of the present invention, an electronic device for processing business data is provided, comprising:
[0033] One or more processors;
[0034] Storage device for storing one or more programs.
[0035] When one or more programs are executed by one or more processors, the one or more processors implement any of the business data processing methods described above.
[0036] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements any of the business data processing methods described above.
[0037] One embodiment of the above invention has the following advantages or beneficial effects: Because it uses a business data processing request sent by a business system to determine the storage service mode of the database system; wherein the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request; if the storage service mode is a multi-storage service mode, at least one of business data storage processing and business data read processing is performed according to the business data processing request; wherein performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data read processing includes: according to the business data number indicated by the business data read request, calling the API interface of the primary storage cluster to read... The corresponding business data; the technical means of sending business data processing results to the business system, thus overcoming the technical problems of existing business data processing methods, such as the inability to automatically synchronize business data from the storage cluster to the recovered storage cluster after initiating failover, the inability to access business data that has not yet been synchronized during failover, and the lack of support for failover between heterogeneous storage clusters. These problems result in poor fault tolerance and robustness of the database system in business data processing, low business data processing efficiency, narrow application scenarios, and poor user experience. The solution achieves the ability to adjust the storage service mode according to the functional status of the storage cluster, call the API interface of the storage cluster in storage service mode to execute business data processing, improve business data processing efficiency, enhance the fault tolerance and robustness of the database system, support rapid failover switching for single points of failure, improve the high availability of system storage, expand the application scenarios of business data processing, and enhance the user experience.
[0038] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0039] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0040] Figure 1 This is a schematic diagram of the main flow of a business data processing method provided according to an embodiment of the present invention;
[0041] Figure 2a This is a schematic diagram of the main flow of a business data processing method under a dual storage service mode provided according to another embodiment of the present invention;
[0042] Figure 2bThis is a schematic diagram of the main flow of a business data processing method under a single storage service mode according to yet another embodiment of the present invention;
[0043] Figure 3 This is a schematic diagram of the main modules of a business data processing apparatus provided according to an embodiment of the present invention;
[0044] Figure 4 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0045] Figure 5 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0046] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0047] Figure 1 This is a schematic diagram of the main flow of a business data processing method provided according to an embodiment of the present invention; as shown below. Figure 1 As shown, the business data processing method provided in this embodiment of the invention mainly includes:
[0048] Step S101: Receive a business data processing request sent by the business system and determine the storage service mode of the database system; wherein, the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request.
[0049] Furthermore, according to an embodiment of the present invention, before the step of determining the storage service mode of the database system, the method further includes:
[0050] Access the storage clusters in the database system to determine whether the storage functions of multiple storage clusters are available;
[0051] The storage service model is determined based on the assessment results.
[0052] Among them, the single storage service mode, including the single master storage service mode and the single slave storage service mode, refers to the storage service in the database storage system that is used by only a single master storage cluster or a single slave storage cluster to execute business data.
[0053] Multi-storage service mode refers to a database storage system where multiple (two or more) storage clusters exist to perform storage business data execution.
[0054] According to a specific embodiment of the present invention, after receiving a business processing request, the storage cluster in the database system can be accessed, and the storage service mode can be determined based on the judgment result. Alternatively, the storage cluster in the database system can be accessed periodically, and the storage service mode can be determined based on the judgment result. For example, for a database system with dual storage clusters, if all storage clusters in the database storage system are found to be available after access, the storage service mode is determined to be a multi-storage service mode. If any storage cluster is found to be completely unavailable, the storage service mode is adjusted to a single-storage service mode after waiting for a period of time (e.g., twice the data synchronization time, to ensure that data recently stored in the failed storage cluster is synchronized from its corresponding memory synchronization queue to other storage clusters; this time can be adjusted according to actual conditions). Through the above settings, combining the access results (determining availability) of all storage clusters in the database system to determine the storage service mode avoids single-point-of-failure problems caused by the failure of a single storage cluster, thus improving the efficiency of business data processing.
[0055] Step S102: If the storage service mode is a multi-storage service mode, perform at least one of business data storage processing and business data reading processing according to the business data processing request; wherein, performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data reading processing includes: according to the business data number indicated by the business data reading request, calling the API interface of the primary storage cluster to read the corresponding business data.
[0056] According to an embodiment of the present invention, in a multi-storage service mode, for business data storage requests, the API interface of the primary storage cluster is preferentially invoked to execute the write operation of the business data object. In a specific implementation of the present invention, a synchronization progress table can also be created in the primary storage cluster, and the business data keywords and business types are written into this synchronization progress table. After the business data object is written to the primary storage cluster, the synchronization progress table is fed back to the information system, so that the information system can utilize the batch write function of business data to realize the asynchronous write operation of the secondary storage cluster. On the other hand, in a multi-storage service mode, for business read requests, the primary storage cluster can be accessed directly according to the business data number to realize the business data read operation. After the storage cluster has completed the above steps, it sends storage result feedback / read result feedback to the database system; if the storage result feedback / read result feedback is successful, it indicates that the current business data processing has been completed; if the feedback is a failure, a storage cluster switch is performed, and the API interface of another storage cluster is invoked to continue executing the corresponding business processing.
[0057] Furthermore, according to an embodiment of the present invention, the step of storing the business data object in the main storage cluster further includes:
[0058] If a storage failure is received when storing business data objects to the main storage cluster;
[0059] Store the business data object in any one of the secondary storage clusters, and after successful storage, asynchronously store the business data object in other secondary storage clusters.
[0060] According to an embodiment of the present invention, in the multi-storage service mode, when the primary storage cluster fails to write, the service is switched directly, and any secondary storage cluster is called to write the corresponding business data object. After the storage is completed, the business data object is asynchronously stored in other secondary storage clusters.
[0061] Preferably, the above method further includes:
[0062] Periodically access the primary storage cluster to determine whether the primary storage cluster has restored its storage function;
[0063] If so, asynchronously store the business data objects stored in the secondary storage cluster to the primary storage cluster.
[0064] Through the above settings, after the primary storage cluster recovers its storage function following a previous failure, the business data objects stored in the secondary storage cluster are asynchronously stored back to the primary storage cluster, ensuring data consistency across all storage clusters in the database system. According to a specific embodiment of the present invention, if a storage failure is detected in the primary storage cluster, the multi-storage service mode is switched to a single-storage service mode. After confirming that the primary storage cluster has recovered its storage function and completed the synchronization of the corresponding business data objects, the single-storage service mode must be restored to the multi-storage service mode. These settings improve the fault tolerance and robustness of the database system and enhance the high availability of system storage.
[0065] Furthermore, according to an embodiment of the present invention, the step of calling the API interface of the main storage cluster to read the corresponding business data based on the business data number indicated by the business data read request further includes:
[0066] If a read failure is received when calling the API interface of the main storage cluster to read the corresponding business data;
[0067] Call the API interface of any storage cluster to read the corresponding business data until a successful read response or a complete read failure response is received.
[0068] According to an embodiment of the present invention, in a multi-storage service mode, for a business read request, if the primary storage cluster reports a read failure, the API interface of any secondary storage cluster can be called to read the corresponding business data until a read success feedback or a complete read failure feedback is received. Furthermore, according to a specific implementation of the present invention, if the first complete read failure feedback is received, a second read can be performed.
[0069] Preferably, according to an embodiment of the present invention, if the storage service mode is a single storage service mode, the above method further includes:
[0070] Determine the target storage cluster corresponding to the single storage service mode;
[0071] Based on the business data object indicated in the business data storage request, call the API interface of the target storage cluster to store the business data object in the target storage cluster; and / or
[0072] Based on the business data number indicated by the business data read request, call the API interface of the target storage cluster to read the corresponding business data.
[0073] According to an embodiment of the present invention, if the storage service mode is a single storage service mode, then in the current mode there is only one storage cluster used for business data access (storage, read) operations. The corresponding target storage cluster can be directly determined, and the API interface of the target storage cluster can be called to perform the corresponding business data processing.
[0074] Furthermore, according to embodiments of the present invention, when the storage service mode is adjusted from a single storage service mode to a multi-storage service mode, the above method further includes:
[0075] Business data objects stored in the target storage cluster are asynchronously stored in other storage clusters of the database system.
[0076] According to an embodiment of the present invention, once the database system has determined that the access functions of all storage clusters are normal, the storage service mode will be adjusted to a multi-storage service mode. This setting helps to ensure data consistency among multiple storage clusters in the database system.
[0077] Step S103: Send the business data processing result to the business system.
[0078] If storage or retrieval is successful, a successful business data processing result is sent to the business system; if storage or all retrievals fail, a failed business data processing result is sent to the business system.
[0079] According to the technical solution of the present invention, the storage service mode of the database system is determined by receiving a business data processing request sent by the business system; wherein, the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request; if the storage service mode is a multi-storage service mode, at least one of business data storage processing and business data read processing is performed according to the business data processing request; wherein, performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data read processing includes: according to the business data number indicated by the business data read request, calling the API interface of the primary storage cluster to read the corresponding business data. This technology, which involves sending business data processing results to the business system, overcomes the limitations of existing business data processing methods. These methods fail to automatically synchronize business data from the storage cluster to the recovered cluster after failover, hinder access to business data not yet synchronized during failover, and do not support failover between heterogeneous storage clusters. This results in poor fault tolerance and robustness, low efficiency, limited application scenarios, and a poor user experience for the database system. The new technology allows for adjusting the storage service mode based on the functional status of the storage cluster, calling the API interface of the storage cluster under storage service mode to execute business data processing. This improves business data processing efficiency, enhances the fault tolerance and robustness of the database system, supports rapid failover for single points of failure, increases the high availability of system storage, expands the application scenarios of business data processing, and enhances the user experience.
[0080] Figure 2a and Figure 2b This is a schematic diagram of the main flow of a business data processing method provided according to yet another embodiment of the present invention; as shown below. Figure 2a and Figure 2b As shown, the business data processing method provided in this embodiment of the invention is applicable to database systems with dual storage clusters:
[0081] Figure 2a This illustrates a business data processing method under a dual storage service model, mainly including steps S201-S209, which primarily include:
[0082] Step S201: Receive a business data processing request sent by the business system and access the storage cluster in the database system. The business data processing request includes at least one of a business data storage request and a business data read request. In this embodiment of the invention, the database system includes a primary storage cluster and a secondary storage cluster.
[0083] According to a specific embodiment of the present invention, after receiving a business processing request, the storage cluster in the database system can be accessed, and the storage service mode can be determined based on the access feedback result. Alternatively, the storage cluster in the database system can be accessed periodically, and the storage service mode can be determined based on the judgment result.
[0084] Step S202: Determine the storage service mode based on the access feedback results. If the access feedback results for both storage clusters are both in an available state, then it is determined to be a dual storage service mode; if the access feedback result for either storage cluster is in an unavailable state, then it is determined to be a single storage service mode.
[0085] For example, in a database system with dual storage clusters, if accessing both storage clusters in the database storage system returns that they are all available, then the storage service mode is determined to be dual storage service mode. If either storage cluster returns a completely unavailable status, then after waiting for a period of time (e.g., twice the data synchronization time, to ensure that data recently stored in the failed storage cluster is synchronized from its corresponding memory synchronization queue to the other storage clusters; this time can be adjusted according to the actual situation), the storage service mode is adjusted to single storage service mode. By combining the above settings with the access results of all storage clusters in the database system (determining availability) to determine the storage service mode, the single point of failure caused by the failure of a certain storage cluster is avoided, thus improving the efficiency of business data processing.
[0086] Step S203: Based on the business data object indicated by the business data storage request, call the API interface of the main storage cluster to store the business data object in the main storage cluster, and then asynchronously store the business data object stored in the main storage cluster to the secondary storage cluster.
[0087] According to an embodiment of the present invention, in a dual storage service mode, for business data storage requests, the API interface of the primary storage cluster is invoked first to perform the write operation of the business data object. In a specific implementation of the present invention, a synchronization progress table can also be created in the primary storage cluster, and the business data keywords and business types are written into this synchronization progress table. After the business data object is written to the primary storage cluster, the synchronization progress table is fed back to the information system, so that the information system can utilize the batch write function of business data to implement asynchronous write operations on the secondary storage cluster.
[0088] Step S204: If a storage failure feedback is received when storing the business data object in the primary storage cluster, the business data object is stored in the secondary storage cluster.
[0089] According to an embodiment of the present invention, in a multi-storage service mode, when the primary storage cluster fails to write, the service is switched directly, and the secondary storage cluster is called to write the corresponding business data object.
[0090] Step S205: Periodically access the primary storage cluster to determine whether the primary storage cluster has restored its storage function; if so, asynchronously store the business data objects stored in the secondary storage cluster to the primary storage cluster.
[0091] With the above settings, after the primary storage cluster that had previously failed recovers its storage function, the business data objects stored in the secondary storage cluster are asynchronously stored in the primary storage cluster, ensuring data consistency across all storage clusters in the database system.
[0092] Step S206: Send the storage processing result of the business data to the business system.
[0093] Step S207: Based on the business data number indicated by the business data read request, call the API interface of the main storage cluster to read the corresponding business data.
[0094] According to an embodiment of the present invention, in the dual storage service mode, for a business read request, the main storage cluster can be accessed directly according to the business data number to realize the business data read operation.
[0095] Step S208: If a read failure feedback is received when calling the API interface of the primary storage cluster to read the corresponding business data, the API interface of the secondary storage cluster is called to read the corresponding business data.
[0096] According to an embodiment of the present invention, in the dual storage service mode, when the primary storage cluster fails to write, the service is switched directly, and the secondary storage cluster is called to write the corresponding service data object.
[0097] Step S209: Send the reading and processing results of the business data to the business system.
[0098] Figure 2b This illustrates a business data processing method under a single storage service model, mainly including steps S201 and S210-S211, which primarily include:
[0099] Step S210: Based on the access feedback results, determine that the storage service mode is a single storage service mode, and determine the target storage cluster corresponding to the single storage service mode.
[0100] According to an embodiment of the present invention, if any storage cluster reports a completely unavailable state, the storage service mode will be adjusted to a single storage service mode after waiting for a period of time (e.g., twice the data synchronization time to ensure that the data just stored in the faulty storage cluster is synchronized from its corresponding memory synchronization queue to other storage clusters; this time can be adjusted according to the actual situation).
[0101] Step S211: Based on the business data object indicated by the business data storage request, call the API interface of the target storage cluster to store the business data object in the target storage cluster.
[0102] Step S212: Send the storage processing result of the business data to the business system.
[0103] Step S213: Based on the business data number indicated by the business data read request, call the API interface of the target storage cluster to read the corresponding business data.
[0104] According to a specific embodiment of the present invention, if the storage service mode is a single storage service mode, then in the current mode there is only one storage cluster used for business data access (storage, read) operations. The corresponding target storage cluster can be directly determined, and the API interface of the target storage cluster can be called to perform the corresponding business data processing.
[0105] Step S214: When the storage service mode is adjusted to the multi-storage service mode, the business data objects stored in the target storage cluster are asynchronously stored in other storage clusters of the database system.
[0106] The above settings help ensure data consistency among multiple storage clusters in the database system.
[0107] Step S215: Send the reading and processing results of the business data to the business system.
[0108] According to the technical solution of the present invention, the storage service mode of the database system is determined by receiving a business data processing request sent by the business system; wherein, the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request; if the storage service mode is a multi-storage service mode, at least one of business data storage processing and business data read processing is performed according to the business data processing request; wherein, performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data read processing includes: according to the business data number indicated by the business data read request, calling the API interface of the primary storage cluster to read the corresponding business data. This technology, which involves sending business data processing results to the business system, overcomes the limitations of existing business data processing methods. These methods fail to automatically synchronize business data from the storage cluster to the recovered cluster after failover, hinder access to business data not yet synchronized during failover, and do not support failover between heterogeneous storage clusters. This results in poor fault tolerance and robustness, low efficiency, limited application scenarios, and a poor user experience for the database system. The new technology allows for adjusting the storage service mode based on the functional status of the storage cluster, calling the API interface of the storage cluster under storage service mode to execute business data processing. This improves business data processing efficiency, enhances the fault tolerance and robustness of the database system, supports rapid failover for single points of failure, increases the high availability of system storage, expands the application scenarios of business data processing, and enhances the user experience.
[0109] Figure 3 This is a schematic diagram of the main modules of a business data processing apparatus provided according to an embodiment of the present invention; as shown. Figure 3 As shown, the business data processing device 300 provided in this embodiment of the invention mainly includes:
[0110] The storage service mode determination module 301 is used to receive business data processing requests sent by the business system and determine the storage service mode of the database system; wherein the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request.
[0111] Furthermore, according to an embodiment of the present invention, the above-described storage service mode determination module 301 is also used for:
[0112] Access the storage clusters in the database system to determine whether the storage functions of multiple storage clusters are available;
[0113] The storage service model is determined based on the assessment results.
[0114] According to a specific embodiment of the present invention, after receiving a business processing request, the storage cluster in the database system can be accessed, and the storage service mode can be determined based on the judgment result. Alternatively, the storage cluster in the database system can be accessed periodically, and the storage service mode can be determined based on the judgment result. For example, for a database system with dual storage clusters, if all storage clusters in the database storage system are found to be available after access, the storage service mode is determined to be a multi-storage service mode. If any storage cluster is found to be completely unavailable, the storage service mode is adjusted to a single-storage service mode after waiting for a period of time (e.g., twice the data synchronization time, to ensure that data recently stored in the failed storage cluster is synchronized from its corresponding memory synchronization queue to other storage clusters; this time can be adjusted according to actual conditions). Through the above settings, combining the access results (determining availability) of all storage clusters in the database system to determine the storage service mode avoids single-point-of-failure problems caused by the failure of a single storage cluster, thus improving the efficiency of business data processing.
[0115] The business data processing module 302 is used to: if the storage service mode is a multi-storage service mode, perform at least one of business data storage processing and business data reading processing according to the business data processing request; wherein, performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data reading processing includes: according to the business data number indicated by the business data reading request, calling the API interface of the primary storage cluster to read the corresponding business data.
[0116] According to an embodiment of the present invention, in a multi-storage service mode, for business data storage requests, the API interface of the primary storage cluster is invoked first to perform the write operation of the business data object. In a specific implementation of the present invention, a synchronization progress table can also be created in the primary storage cluster, and the business data keywords and business types are written into this synchronization progress table. After the business data object is written to the primary storage cluster, the synchronization progress table is fed back to the information system, enabling the information system to utilize the batch write function of business data to implement asynchronous write operations on the secondary storage cluster. On the other hand, in a multi-storage service mode, for business read requests, the primary storage cluster can be accessed directly based on the business data number to perform the business data read operation.
[0117] Furthermore, according to an embodiment of the present invention, the above-mentioned business data processing module 302 is also used for:
[0118] If a storage failure is received when storing business data objects to the main storage cluster;
[0119] Store the business data object in any one of the secondary storage clusters, and after successful storage, asynchronously store the business data object in other secondary storage clusters.
[0120] According to an embodiment of the present invention, in the multi-storage service mode, when the primary storage cluster fails to write, the service is switched directly, and any secondary storage cluster is called to write the corresponding business data object. After the storage is completed, the business data object is asynchronously stored in other secondary storage clusters.
[0121] Preferably, the above-mentioned business data processing module 302 is further used for:
[0122] Periodically access the primary storage cluster to determine whether the primary storage cluster has restored its storage function;
[0123] If so, asynchronously store the business data objects stored in the secondary storage cluster to the primary storage cluster.
[0124] With the above settings, after the primary storage cluster that had previously failed recovers its storage function, the business data objects stored in the secondary storage cluster are asynchronously stored in the primary storage cluster, ensuring data consistency across all storage clusters in the database system.
[0125] Furthermore, according to an embodiment of the present invention, the above-mentioned business data processing module 302 is also used for:
[0126] If a read failure is received when calling the API interface of the main storage cluster to read the corresponding business data;
[0127] Call the API interface of any storage cluster to read the corresponding business data until a successful read response or a complete read failure response is received.
[0128] According to an embodiment of the present invention, in a multi-storage service mode, for a business read request, if the primary storage cluster reports a read failure, the API interface of any secondary storage cluster can be called to read the corresponding business data until a read success feedback or a complete read failure feedback is received. Furthermore, according to a specific implementation of the present invention, if the first complete read failure feedback is received, a second read can be performed.
[0129] Preferably, according to an embodiment of the present invention, if the storage service mode is a single storage service mode, the above-mentioned business data processing module 302 is further used for:
[0130] Determine the target storage cluster corresponding to the single storage service mode;
[0131] Based on the business data object indicated in the business data storage request, call the API interface of the target storage cluster to store the business data object in the target storage cluster; and / or
[0132] Based on the business data number indicated by the business data read request, call the API interface of the target storage cluster to read the corresponding business data.
[0133] According to an embodiment of the present invention, if the storage service mode is a single storage service mode, then in the current mode there is only one storage cluster used for business data access (storage, read) operations. The corresponding target storage cluster can be directly determined, and the API interface of the target storage cluster can be called to perform the corresponding business data processing.
[0134] Furthermore, according to an embodiment of the present invention, when the storage service mode is adjusted from a single storage service mode to a multi-storage service mode, the above-mentioned business data processing module 302 is further used for:
[0135] Business data objects stored in the target storage cluster are asynchronously stored in other storage clusters of the database system.
[0136] The above settings help ensure data consistency among multiple storage clusters in the database system.
[0137] The sending module 303 is used to send the business data processing results to the business system.
[0138] According to the technical solution of the present invention, the storage service mode of the database system is determined by receiving a business data processing request sent by the business system; wherein, the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request; if the storage service mode is a multi-storage service mode, at least one of business data storage processing and business data read processing is performed according to the business data processing request; wherein, performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data read processing includes: according to the business data number indicated by the business data read request, calling the API interface of the primary storage cluster to read the corresponding business data. This technology, which involves sending business data processing results to the business system, overcomes the limitations of existing business data processing methods. These methods fail to automatically synchronize business data from the storage cluster to the recovered cluster after failover, hinder access to business data not yet synchronized during failover, and do not support failover between heterogeneous storage clusters. This results in poor fault tolerance and robustness, low efficiency, limited application scenarios, and a poor user experience for the database system. The new technology allows for adjusting the storage service mode based on the functional status of the storage cluster, calling the API interface of the storage cluster under storage service mode to execute business data processing. This improves business data processing efficiency, enhances the fault tolerance and robustness of the database system, supports rapid failover for single points of failure, increases the high availability of system storage, expands the application scenarios of business data processing, and enhances the user experience.
[0139] Figure 4 An exemplary system architecture 400 is shown that can be applied to the business data processing method or business data processing apparatus of the present invention.
[0140] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, and 403, network 404, and server 405 (this architecture is merely an example; the components included in a specific architecture may be adjusted according to the specific application). Network 404 serves as the medium for providing a communication link between terminal devices 401, 402, and 403 and server 405. Network 404 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0141] Users can use terminal devices 401, 402, and 403 to interact with server 405 via network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, and 403, such as business data processing applications, web browser applications, search applications, data processing tools, email clients, social media platform software, etc. (for example only).
[0142] Terminal devices 401, 402, and 403 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0143] Server 405 can be a server that provides various services, such as a server that processes business data / performs data processing for users using terminal devices 401, 402, and 403 (for example only). This server can analyze and process received business data processing requests and other data, and feed back the processing results (such as business data processing result feedback information - for example only) to the terminal devices.
[0144] It should be noted that the business data processing method provided in the embodiments of the present invention is generally executed by server 405, and correspondingly, the business data processing device is generally located in server 405.
[0145] It should be understood that Figure 4 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0146] The following is for reference. Figure 5 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing terminal devices or servers of the present invention. Figure 5 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0147] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0148] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.
[0149] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined above in the system of this invention.
[0150] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0151] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0152] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including a storage service mode determination module, a business data processing module, and a sending module. The names of these modules do not necessarily limit the module itself; for example, the storage service mode determination module can also be described as "a module for receiving business data processing requests sent by a business system and determining the storage service mode of a database system."
[0153] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: receiving a business data processing request sent by a business system; determining a storage service mode of a database system; wherein the database system includes a primary storage cluster and at least one secondary storage cluster; the business data processing request includes at least one of a business data storage request and a business data read request; if the storage service mode is a multi-storage service mode, performing at least one of business data storage processing and business data read processing according to the business data processing request; wherein performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object in the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data read processing includes: according to the business data number indicated by the business data read request, calling the API interface of the primary storage cluster to read the corresponding business data; and sending the business data processing result to the business system.
[0154] According to the technical solution of the present invention, the storage service mode of the database system is determined by receiving a business data processing request sent by the business system; wherein, the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request; if the storage service mode is a multi-storage service mode, at least one of business data storage processing and business data read processing is performed according to the business data processing request; wherein, performing business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data read processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to at least one secondary storage cluster; performing business data read processing includes: according to the business data read request indicated by the business data read request... This approach, which uses business data numbering to call the API interface of the primary storage cluster to read the corresponding business data and sends the business data processing results to the business system, overcomes the technical problems of existing business data processing methods. These problems include the inability to automatically synchronize business data from the primary storage cluster to the recovered storage cluster after failover, the inability to access business data that has not yet been synchronized during failover, and the lack of support for failover between heterogeneous storage clusters. This results in low business data processing efficiency, narrow application scenarios, and poor user experience. The new approach allows for adjusting the storage service mode based on the functional status of the storage cluster, calling the API interface of the storage cluster in storage service mode to execute business data processing, improving business data processing efficiency, supporting rapid failover for single points of failure, expanding the application scenarios of business data processing, and enhancing the user experience.
[0155] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A business data processing method, characterized in that, include: The system receives business data processing requests from business systems and determines the storage service mode of the database system; wherein the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request. If the storage service mode is a multi-storage service mode, at least one of business data storage processing and business data reading processing is performed according to the business data processing request; wherein, performing the business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to the at least one secondary storage cluster; performing the business data reading processing includes: according to the business data number indicated by the business data reading request, calling the API interface of the primary storage cluster to read the corresponding business data; Send the business data processing results to the business system; If the storage service mode is a single storage service mode, the method further includes: Determine the target storage cluster corresponding to the single storage service mode; Based on the business data object indicated by the business data storage request, the API interface of the target storage cluster is invoked to store the business data object in the target storage cluster; and / or Based on the business data number indicated by the business data read request, the API interface of the target storage cluster is invoked to read the corresponding business data.
2. The business data processing method according to claim 1, characterized in that, Prior to the step of determining the storage service model of the database system, the method further includes: Access the storage clusters in the database system to determine whether the storage functions of multiple storage clusters are available; The storage service mode is determined based on the judgment result.
3. The business data processing method according to claim 1, characterized in that, The step of storing the business data object to the main storage cluster further includes: If a storage failure feedback is received when the business data object is stored in the main storage cluster; The business data object is stored in any one of the secondary storage clusters, and after successful storage, the business data object is asynchronously stored in other secondary storage clusters.
4. The business data processing method according to claim 3, characterized in that, The method further includes: Periodically access the primary storage cluster to determine whether the primary storage cluster has restored its storage function; If so, the business data object stored in the secondary storage cluster is asynchronously stored in the primary storage cluster.
5. The business data processing method according to claim 1, characterized in that, The step of calling the API interface of the main storage cluster to read the corresponding business data according to the business data number indicated by the business data read request further includes: If a read failure feedback is received when calling the API interface of the main storage cluster to read the corresponding business data; Call the API interface of any of the aforementioned storage clusters to read the corresponding business data until a successful read response or a complete read failure response is received.
6. The business data processing method according to claim 1, characterized in that, When the storage service mode is adjusted to a multi-storage service mode, the method further includes: The business data objects stored in the target storage cluster are asynchronously stored in other storage clusters of the database system.
7. A business data processing device, characterized in that, include: The storage service mode determination module is used to receive business data processing requests sent by the business system and determine the storage service mode of the database system; wherein, the database system includes a primary storage cluster and at least one secondary storage cluster, and the business data processing request includes at least one of a business data storage request and a business data read request; The business data processing module is configured to: if the storage service mode is a multi-storage service mode, perform at least one of business data storage processing and business data reading processing according to the business data processing request; wherein, performing the business data storage processing includes: according to the business data object indicated by the business data storage request, calling the API interface of the primary storage cluster to store the business data object to the primary storage cluster, and then asynchronously storing the business data object stored in the primary storage cluster to the at least one secondary storage cluster; performing the business data reading processing includes: according to the business data number indicated by the business data reading request, calling the API interface of the primary storage cluster to read the corresponding business data; The sending module is used to send the business data processing results to the business system; The business data processing module is also used for: If the storage service mode is a single storage service mode, determine the target storage cluster corresponding to the single storage service mode; Based on the business data object indicated by the business data storage request, the API interface of the target storage cluster is invoked to store the business data object in the target storage cluster; and / or Based on the business data number indicated by the business data read request, the API interface of the target storage cluster is invoked to read the corresponding business data.
8. An electronic device for processing business data, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.
9. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Multi-cluster data synchronization method of distributed storage system and related device
CN110795503A
Re-aligning data replication configuration of primary and secondary data serving entities of a cross-site storage solution after a failover event
US11360867B1