Response method and device and electronic equipment
By using polling strategies to forward operation requests in parallel asynchronously to multiple data centers in the response method of the server, the problem of data consistency and low response efficiency of distributed object storage systems during disaster recovery in multiple sites is solved, and strong consistency and efficient response of data are achieved.
Patent Information
- Application Number
- CN202411849514.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-13
AI Technical Summary
When a distributed object storage system is disaster recovery in multiple sites, it cannot achieve strong data consistency, resulting in low response efficiency and possible data loss.
By implementing a response method on the server, it receives the client's operation request, sends it to the first data center, and forwards it to other data centers in parallel asynchronously according to the polling policy, obtains the response information of each data center, and feedbacks it to the client based on the response results of at least one data center.
Real-time consistency of data between multiple sites is achieved, the server response efficiency is improved, and the data integrity and availability are ensured.
Smart Images

Figure CN119814867A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a response method, device and electronic equipment. Background Art
[0002] With the development of distributed object storage systems, data synchronization between multiple sites has been supported. Objects uploaded at one site are automatically synchronized to other sites in the background, and disaster recovery between clusters has been realized. Multi-site synchronization mainly includes metadata synchronization of users and buckets, and object data synchronization.
[0003] At present, multi-site disaster recovery of distributed object storage systems is performed asynchronously in the background, that is, data can only be read at one site after the background of other sites pulls data from the server. Strong data consistency cannot be achieved, and once a site fails, data may be lost. This makes it difficult to meet the market's demand for strong data consistency, thereby reducing the response efficiency of the distributed object storage system to operation requests. Summary of the invention
[0004] The present invention provides a response method, device and electronic device, which can solve the problem of low response efficiency of a distributed object storage system to an operation request.
[0005] In a first aspect, the present invention provides a response method, which is applied to a server, and the method comprises:
[0006] Receive an operation request sent by a client; the operation request is used to request a target data stored in a data center to be operated;
[0007] Sending the operation request to the first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request to other data centers among the data centers except the first data center in parallel according to a polling strategy;
[0008] Obtaining response information corresponding to each data center; the response information is used to indicate the execution status of the data center on the operation request;
[0009] According to the response information of at least one data center, the execution result corresponding to the operation request is fed back to the client.
[0010] Optionally, before sending the operation request to the first data center, the method further includes:
[0011] Determine the target node corresponding to each data center according to the node identification information stored in each data center;
[0012] The sending the operation request to the first data center includes:
[0013] Sending the operation request to a target node corresponding to the first data center to trigger the target node to asynchronously forward the operation request in parallel to target nodes in other data centers among the data centers except the first data center according to a polling strategy;
[0014] The obtaining of response information corresponding to each data center includes:
[0015] For each data center, determining a target node in the data center that receives the operation request as a first target node;
[0016] Obtaining first response information of the first target node;
[0017] If the first response information indicates that the first target node fails to respond, reacquire the first response information corresponding to the first target node until the first response information indicating successful execution is acquired, then stop acquiring; or
[0018] When the number of retries is greater than or equal to a preset threshold, it is determined that the execution of the first target node has failed, and the acquisition is stopped. The operation request is sent to any target node in the data center except the first target node, and the target node is determined as the new first target node. The first response information of the new first target node continues to be acquired, and the acquired first response information is analyzed.
[0019] Optionally, sending the operation request to the first data center includes:
[0020] Sending the operation request to the first data center;
[0021] Invoke a request parallel asynchronous forwarding management module to parallel and asynchronously forward the operation request to other data centers among the data centers except the first data center;
[0022] Wherein, the operation request includes at least one of a metadata operation request and a data operation request;
[0023] The metadata operation request is used to request to perform at least one of an add metadata operation, a delete metadata operation, and a modify metadata operation on target metadata stored in the data center;
[0024] The data operation request is used to request at least one of an upload processing operation, a delete processing operation, and a modification processing operation to target data stored in the data center.
[0025] Optionally, feeding back to the client an execution result corresponding to the operation request according to response information of at least one data center includes:
[0026] When the response information corresponding to each data center indicates successful execution, the execution result corresponding to the operation request is returned to the client.
[0027] Optionally, feeding back to the client an execution result corresponding to the operation request according to response information of at least one data center includes:
[0028] When the response information of at least one data center indicates that the execution is successful, returning the execution result corresponding to the operation request to the client;
[0029] Data synchronization is performed on other data centers based on the execution results of the successfully executed data center.
[0030] Optionally, determining the target node corresponding to each data center according to the node identification information stored in each data center includes:
[0031] For each data center, according to the node identification information stored in the data center, determining a service node in the data center that matches the node identification information as a target node;
[0032] Poll the target nodes that meet the requirements in each data center in turn until the last data center is polled, then start the next round of queries and continue to poll the target nodes that meet the requirements in each data center.
[0033] Optionally, sending the operation request to a target node corresponding to the first data center includes:
[0034] According to the type corresponding to the operation request, assembling a message structure corresponding to the operation request;
[0035] Send the message structure to the target node.
[0036] Optionally, feeding back to the client an execution result corresponding to the operation request according to response information of at least one data center includes:
[0037] When the first response information of the first target node indicates that the first target node responds successfully, the execution result of the first target node for the operation request is fed back to the client.
[0038] In a second aspect, the present invention provides a response method, which is applied to a distributed storage system, wherein the distributed storage system includes a server, a client, and a data center, and the method includes:
[0039] The client sends an operation request to the server;
[0040] The server receives an operation request sent by a client; the operation request is used to request target data stored in the data center; the operation request is sent to a first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request in parallel to other data centers among the data centers except the first data center according to a polling strategy;
[0041] The data center, based on the polling strategy, asynchronously forwards the operation request to other data centers in parallel; the other data centers receive the operation request and perform response processing based on the operation request;
[0042] The server obtains response information corresponding to each data center; the response information is used to indicate the execution status of the operation request by the data center; when the execution status of each data center indicates successful execution, the execution result of each data center is returned to the client;
[0043] The client receives the execution result returned by the server.
[0044] In a third aspect, the present invention provides a server, comprising a response method as described in any one of the first aspects.
[0045] In a fourth aspect, the present invention provides an electronic device, the electronic device comprising:
[0046] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the response method as described in the second aspect when executing the program.
[0047] In a fifth aspect, the present invention provides a readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the response method described in the second aspect.
[0048] In a sixth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the response method described in the second aspect.
[0049] The response method provided by the embodiment of the present invention is applied to the server, and the method includes: receiving an operation request sent by a client; the operation request is used to request the target data stored in the data center to perform an operation; sending the operation request to the first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request to other data centers in each data center except the first data center according to the polling strategy; obtaining the response information corresponding to each data center; the response information is used to indicate the execution of the operation request by the data center; according to the response information of at least one data center, the execution result corresponding to the operation request is fed back to the client. In the embodiment of the present invention, after receiving the operation request from the client, the server first sends the operation request to the first data center, and at the same time, the first data center asynchronously forwards the operation request to each data center according to the polling strategy based on the operation request, thereby ensuring the consistency of the data of each data center, and finally the server can obtain the response information of each data center respectively, and according to the response information of at least one data center, the execution result corresponding to the operation request is fed back to the client, thereby solving the problem that the data of each data center cannot be synchronized in time, and improving the response efficiency of the server to the operation request. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 This is a step flow of a response method provided by an embodiment of the present invention. Figure 1 ;
[0052] Figure 2 This is a step flow of a response method provided by an embodiment of the present invention. Figure 2 ;
[0053] Figure 3 This is a step flow of a response method provided by an embodiment of the present invention. Figure 3 ;
[0054] Figure 4 This is a step flow of a response method provided by an embodiment of the present invention. Figure 4 ;
[0055] Figure 5 This is a step flow of a response method provided by an embodiment of the present invention. Figure 5 ;
[0056] Figure 6This is a flow chart of the steps of site service IP load balancing management provided by an embodiment of the present invention;
[0057] Figure 7 This is a schematic diagram of parallel asynchronous forwarding of requests provided by an embodiment of the present invention;
[0058] Figure 8 It is a timing diagram of request parallel asynchronous forwarding provided by an embodiment of the present invention;
[0059] Fig. 9 This is a flowchart of a step of requesting parallel asynchronous forwarding provided by an embodiment of the present invention;
[0060] Fig.10 is a flowchart of steps of an operation scheduling process provided by an embodiment of the present invention;
[0061] Fig.11 is a schematic diagram of the architecture of a distributed storage system provided by an embodiment of the present invention;
[0062] Fig.12 is a schematic diagram of a response device provided by an embodiment of the present invention;
[0063] Fig.13 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] Method Embodiment
[0066] The response method provided in the embodiment of the present invention can be applied to the server as described above, referring to Figure 1 , showing the steps of a response method provided by an embodiment of the present invention Figure 1 , the method may include steps S101 to S104:
[0067] Step S101: receiving an operation request sent by a client; the operation request is used to request an operation to be performed on target data stored in a data center.
[0068] In the embodiment of the present invention, during the response process of the server, the server first receives an operation request sent by the client; wherein the operation request is used to request the target data stored in the data center to be operated.
[0069] It should be noted that the data mentioned in this application is processed after authorization by the user or the data-owning platform.
[0070] Exemplarily, the operation request may be used to request target data stored in a data center, that is, the operation request is used to access the target data.
[0071] Exemplarily, the operation request may include a data synchronization request; specifically, data between multiple sites needs to be synchronized in quasi-real time to ensure data consistency and integrity. This usually involves copying data from one site to another, while ensuring the accuracy and integrity of the data during the copying process; synchronization progress query: users or administrators may need to query the progress of data synchronization to understand the synchronization status of data between different sites. This helps monitor system performance and promptly discover potential problems.
[0072] Exemplarily, the operation request may also include a data write request; specifically, in a distributed object storage system, a data write request may involve multiple sites. The system needs to ensure that the data remains consistent during the writing process, even between multiple sites. This is usually achieved by adopting a strong consistency protocol (such as Raft); some write requests may need to ensure atomicity, that is, all write operations are either all successful or all failed. This helps to ensure the consistency and integrity of the data.
[0073] For example, an operation request may also include a data read request. In a multi-site environment, a user may need to read consistent data. The system needs to provide the semantics of consistent reads to ensure that the data read by the user is the latest and consistent; distributed consistent snapshot reads allow users to read data snapshots before a certain point in time. This helps ensure that when data changes, users can still access the previous data state.
[0074] Exemplarily, an operation request may also include a data deletion request. Specifically, a distributed deletion is similar to a write request, and a data deletion request may also involve multiple sites. The system needs to ensure that the data remains consistent during the deletion process to avoid data loss or inconsistency; conditional deletion means that some deletion requests may need to meet specific conditions to be executed. For example, a key is deleted only when it does not exist, or a record is deleted only when it is a specific version.
[0075] Exemplarily, the operation request may also include a disaster recovery switching request, specifically, fault detection and switching, that is, in a multi-site disaster recovery environment, the system needs to be able to detect a failure at a site and automatically switch to other normal sites to continue to provide services. This usually involves a fault detection mechanism, a switching strategy, and a fault recovery process.
[0076] Exemplarily, the operation request may also include data verification and recovery, specifically, after switching to another site, the system needs to verify the data to ensure the integrity and consistency of the data. If a problem is found, the system needs to be able to automatically or manually recover the data.
[0077] Exemplarily, the operation request may also include a management request, specifically, site management, that is, the administrator may need to add, delete or modify site configuration, including setting the storage category, access rights, synchronization policy, etc. of the site.
[0078] Exemplarily, the operation request may also include monitoring and alarming. Specifically, the system needs to provide monitoring and alarming functions so that the administrator can monitor the performance and status of the system in real time and receive alarm notifications in time when problems occur.
[0079] Multi-site disaster recovery with strong data consistency in a distributed object storage system involves multiple operation requests that work together to ensure data consistency and availability across different sites, while providing disaster recovery capabilities to cope with possible site failures.
[0080] For example, a data center can be a storage system, also known as a storage cluster, with corresponding storage gateways and storage pools. A data center can have multiple object storage gateway instances.
[0081] Exemplarily, multiple object storage gateway instances refer to entities or copies of multiple object storage gateways deployed in a distributed storage system or cloud computing environment. These instances work together to provide efficient, reliable and scalable object storage services.
[0082] For example, an object storage gateway is a storage network device that connects multiple storage nodes and manages and coordinates data storage and access. Multiple object storage gateway instances mean that there are multiple such gateway devices or software copies in the system, which jointly process storage requests and provide data access services. These instances usually support multiple storage protocols and can flexibly configure storage nodes to adapt to different storage needs.
[0083] Multiple object storage gateway instances play an important role in various application scenarios, including but not limited to: cloud computing environment, that is, in a cloud computing environment, multiple object storage gateway instances can provide efficient data storage and management services, support the management and coordination of different storage nodes, and improve the reliability and performance of the system. Big data processing, that is, for big data processing tasks, multiple object storage gateway instances can optimize storage performance and network bandwidth, and improve data processing efficiency and accuracy. Distributed storage system, that is, in a distributed storage system, multiple object storage gateway instances can support centralized management and sharing of data, and support multiple storage protocols and access control mechanisms to ensure data security and confidentiality.
[0084] Multiple object storage gateway instances can back up and fault-tolerant each other to improve system availability. By processing storage requests together, multiple instances can achieve load balancing and improve system throughput and response speed. As storage needs grow, more object storage gateway instances can be easily added to expand the system's storage capacity.
[0085] Maintaining data consistency between multiple instances is a challenge, which requires the adoption of appropriate data synchronization and consistency protocols. When an instance fails, it is necessary to quickly switch to other normal instances and ensure data integrity and consistency. The resource usage of multiple instances needs to be effectively managed to avoid resource waste and performance bottlenecks.
[0086] Exemplarily, the target data may be data stored in a data center, may be multiple object storage gateway instances, etc., which is not limited in the embodiments of the present invention.
[0087] Furthermore, in an embodiment of the present invention, before sending the operation request to the first data center, the server may also determine the target node corresponding to each data center according to the node identification information stored in each data center.
[0088] The node identification information may be an acquired serviceable service address identification, which may further indicate that the node may respond to the service request.
[0089] Exemplarily, determining the target node corresponding to each data center may be determining a serviceable target node from each data center according to node identification information.
[0090] Furthermore, in an embodiment of the present invention, when the server determines the target node corresponding to each data center based on the node identification information stored in each data center, it can also call the load balancing management module to poll the target nodes that meet the requirements in each data center in turn until the last data center is polled, and then start the next round of queries and continue to poll the target nodes that meet the requirements in each data center.
[0091] For example, the load balancing management module can be responsible for the load balancing management of the internal nodes of each site. According to the site information recorded in each data center, the Internet Protocol (IP) for receiving services at each site is selected for use in forwarding service requests. By default, all nodes in the site are load balanced using a polling strategy.
[0092] For example, in the process of determining the target node, the server needs to call the load balancing management module to poll the serviceable target nodes in each data center in turn, and then when receiving an operation request, it can quickly determine the serviceable target node, thereby improving the response efficiency.
[0093] Exemplarily, the target node that meets the requirements may be a node that can respond to the operation request.
[0094] Exemplarily, the server may call the load balancing management module to traverse the entire data center, that is, it needs to round-robin to the last data center.
[0095] For example, after the server polls the last data center, the server may continue with the next round of queries.
[0096] For example, in a new round of query process, the server needs to continue to poll the serviceable target nodes in each data center.
[0097] Exemplarily, the target node that meets the requirements in each data center is the target node that can provide services.
[0098] Furthermore, in an embodiment of the present invention, when the server determines the target node corresponding to each data center based on the node identification information stored in each data center, it can also, for each data center, determine the service node in the data center that matches the node identification information as the target node based on the node identification information stored in the data center.
[0099] Exemplarily, the node identification information stored in the data center may be a service identification that identifies whether the node can serve the operation request.
[0100] Exemplarily, the service node in the data center that matches the node identification information may be a service node that contains the node identification information and is determined from the data center.
[0101] Exemplarily, the target node may be a node that provides business services.
[0102] Step S102: Send the operation request to the first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request in parallel to other data centers in the data centers except the first data center according to the polling strategy.
[0103] In an embodiment of the present invention, after receiving the operation request sent by the client, the server will send the operation request to the first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request in parallel to other data centers in each data center except the first data center according to the polling strategy.
[0104] Exemplarily, the first data center may be any data center among the data centers, which is not limited in the embodiments of the present invention.
[0105] Exemplarily, the polling strategy may be used to instruct the target nodes in each data center to perform load balancing.
[0106] Exemplarily, the parallel asynchronous forwarding may be that upon receiving an operation request, the data center first asynchronously processes the operation request locally, and then asynchronously forwards the operation request in parallel to other data centers except the first data center.
[0107] Exemplarily, each data center may be any data center among data centers, which is not limited in the embodiments of the present invention.
[0108] Exemplarily, the other data center may be any data center in the data center, which is not limited in the embodiments of the present invention.
[0109] Furthermore, in an embodiment of the present invention, when sending an operation request to the first data center, the server may send the operation request to a target node corresponding to the first data center; the operation request is used to instruct the target node to asynchronously forward the operation request in parallel to target nodes in other data centers except the first data center according to a polling strategy.
[0110] There may be one or more target nodes corresponding to the first data center, which is not limited in the embodiments of the present invention.
[0111] Exemplarily, when the response information of the target node corresponding to the first data center indicates successful execution, the target node corresponding to the first data center may be one; when the response information of the target node corresponding to the first data center indicates failed execution, it is necessary to search for multiple serviceable target nodes corresponding to the first data center, which is not limited in the embodiments of the present invention.
[0112] Exemplarily, the target node of other data centers may be a serviceable target node in other data centers.
[0113] Further, in an embodiment of the present invention, when sending an operation request to the first data center, the server may send the operation request to the first data center; call the request parallel asynchronous forwarding management module to forward the operation request in parallel and asynchronously to other data centers in each data center except the first data center; wherein the operation request includes at least one of a metadata operation request and a data operation request; the metadata operation request is used to request to perform at least one of an add metadata operation, a delete metadata operation, and a modify metadata operation on the target metadata stored in the data center; the data operation request is used to request to perform at least one of an upload processing operation, a delete processing operation, and a modify processing operation on the target data stored in the data center.
[0114] Exemplarily, the request parallel asynchronous forwarding management module can be responsible for scheduling the parallel asynchronous forwarding of operation requests between sites. After receiving the operation request, the site service IP load balancing management module is called to select the IP node for receiving services at each site, and a communication link is created with the selected service IP of each site. Then the request is processed asynchronously locally first, and then the operation request is forwarded asynchronously to other site service IP nodes in parallel. In order to improve performance, all requests use asynchronous calls to avoid the performance impact caused by synchronization. After all requests from all sites return responses, the final response result is returned to the client. If all sites are executed successfully, success is returned. If a site fails to execute, the next IP node is selected for retry. If it still fails after 5 retries, failure is returned, and the operation is rolled back for the site that has executed successfully.
[0115] Exemplarily, the number of data centers other than the first data center may be one or more, which is not limited in the embodiments of the present invention.
[0116] For example, the metadata operation request may be to call the parallel asynchronous forwarding management module to ensure metadata consistency when performing metadata operations such as adding, deleting, and modifying users and buckets at a node at a site.
[0117] Exemplarily, the data operation request may be to call a parallel asynchronous forwarding management module to ensure the consistency of the object data when performing an upload, deletion, or object metadata modification operation on a node of a station.
[0118] For example, when performing a metadata add operation on a bucket, a new bucket can be created in the object storage service to store objects. When creating a bucket, you need to specify the bucket's name, location (region), access permissions, and other attributes. Some services also allow you to set advanced features such as bucket policies and lifecycle rules.
[0119] For example, when performing a bucket delete metadata operation on metadata, a bucket and all objects contained in it can be removed. Deleting a bucket is a sensitive operation because once deleted, all data in the bucket will be lost. Therefore, before deleting a bucket, it is usually necessary to confirm that the bucket is empty or that important data has been backed up.
[0120] For example, when performing a modify metadata operation on a bucket, you can update bucket properties such as access permissions, storage categories, lifecycle rules, etc. When modifying a bucket, you need to ensure that these changes do not violate existing data protection policies or cause data loss.
[0121] Exemplarily, the execution object may be object metadata, which is not limited in the embodiments of the present invention.
[0122] Exemplarily, the upload processing operation may be to call the request parallel asynchronous forwarding management module to write the data in parallel to each site when receiving the client upload request.
[0123] Exemplarily, the deletion processing operation may be to call the parallel asynchronous forwarding management module to write data to each site in parallel upon receiving a deletion request from the client.
[0124] Exemplarily, the modification processing operation may be to call the request parallel asynchronous forwarding management module to write data to each site in parallel upon receiving a modification request from the client.
[0125] Exemplarily, when receiving different operation requests, the server can assemble corresponding message structures according to different request types, and call the request parallel asynchronous forwarding management module to forward the requests in parallel to other data centers.
[0126] Furthermore, in an embodiment of the present invention, when sending an operation request to a target node corresponding to the first data center, the server may also assemble a message structure corresponding to the operation request according to the type corresponding to the operation request; and send the message structure to the target node.
[0127] Exemplarily, the message structure may include an operation request and a message, which is not limited in the embodiments of the present application.
[0128] Step S103: Obtain response information corresponding to each data center; the response information is used to indicate the execution status of the data center for the operation request.
[0129] In the embodiment of the present invention, after sending the operation request to the first data center, the server can obtain the response information corresponding to each data center; the response information is used to indicate the execution status of the operation request by the data center.
[0130] Exemplarily, the execution status of the operation request may include successful execution, failed execution, and non-execution, etc., which is not limited in the embodiment of the present invention.
[0131] Further, in an embodiment of the present invention, when obtaining response information corresponding to each data center, the server may, for each data center, determine the target node that receives the operation request in the data center as the first target node; obtain the first response information of the first target node; when the first response information indicates that the first target node has failed to respond, re-obtain the first response information corresponding to the first target node until the first response information indicating successful execution is obtained, and then stop obtaining; or, when the number of retries is greater than or equal to a preset threshold, determine that the execution of the first target node has failed, stop obtaining, send an operation request to any target node in the data center except the first target node, determine the target node as a new first target node, continue to obtain the first response information of the new first target node, and analyze the obtained first response information.
[0132] Exemplarily, the target node that receives the operation request may be a node that responds to the operation request, that is, a serviceable target node.
[0133] Exemplarily, the first target node may be any target node in a data center that receives an operation request, which is not limited in the embodiments of the present invention.
[0134] Exemplarily, the first response information may be response information corresponding to the first target node, or may be response information corresponding to a new first target node, that is, response information determined by the first target node according to the operation request.
[0135] Exemplarily, the first target node does not respond to the operation request, that is, the response information obtained according to the operation request indicates that the first target node fails to respond.
[0136] Exemplarily, when the first target node fails to respond, the server needs to re-acquire the first response information corresponding to the first target node until the acquired first response information indicates successful execution, and then stops acquiring the first response information.
[0137] Exemplarily, when the first target node successfully executes the operation request, first response information of successful execution may be obtained.
[0138] Exemplarily, when first response information indicating successful execution is obtained, the server may stop obtaining the first response information.
[0139] Exemplarily, the number of retries may be the number of times the server re-acquires the response information at the first target node, and the number of retries may be any integer greater than or equal to zero. Specifically, the number of retries may be 1, 2, etc., which is not limited in the embodiments of the present invention.
[0140] Exemplarily, the preset threshold may be the number of times the server is allowed to reacquire response information at the first target node. The preset threshold may be any integer greater than or equal to zero. Specifically, the preset threshold may be 5 times, 6 times, etc., which is not limited in the embodiments of the present invention.
[0141] Exemplarily, when the number of retries of the server on the first target node reaches a threshold and the response information obtained is all response failure, it can be determined that the execution of the first target node has failed.
[0142] Exemplarily, any target node may be a serviceable target node in a data center.
[0143] Exemplarily, when the execution of the first target node fails, the server stops acquiring and sends an operation request to any target node in the data center except the first target node to determine the target node as a new first target node.
[0144] Exemplarily, the first response information of the new first target node may be response information determined by the new first target node according to the operation request.
[0145] Exemplarily, the first response information of the new first target node may be execution success, or execution failure, or non-execution, etc., which is not limited in the embodiments of the present invention.
[0146] Exemplarily, the first response information obtained is analyzed. If the response information obtained from each target node indicates successful execution, the server can return response information indicating successful execution to the client, which is not limited in the embodiments of the present application.
[0147] Furthermore, in an embodiment of the present invention, when the server obtains the response information corresponding to each data center, it can also obtain the response information corresponding to each data center; when the response information corresponding to each data center indicates successful execution, the execution result corresponding to the operation request is returned to the client.
[0148] Exemplarily, the response information corresponding to each data center may be the corresponding response information determined from each data center. Specifically, the response information corresponding to each data center may all be response information of successful execution, or all be response information of failed execution, or may include both response information of successful execution and response information of failed execution, which is not limited in the embodiments of the present invention.
[0149] Exemplarily, when the response information corresponding to each data center indicates successful execution, the server will return a response information indicating successful execution to the client.
[0150] Furthermore, in an embodiment of the present invention, when the server obtains the response information corresponding to each data center, it can also obtain the response information corresponding to each data center; when the response information of at least one data center indicates successful execution, the execution result corresponding to the operation request is returned to the client; and data synchronization processing is performed on other data centers based on the execution result of the successfully executed data center.
[0151] For example, after the server returns the execution result corresponding to the operation request to the client, it will also synchronize data with other data centers based on the execution result of the successfully executed data center to ensure data consistency, thereby improving the efficiency of the server's response to the operation request.
[0152] For example, data synchronization can add, delete, and modify user or bucket metadata for one site, which will take effect immediately at other sites. Objects uploaded at one site can be immediately accessed at another site, truly achieving real-time consistency of data between sites, thereby ensuring strong consistency of metadata and object data at each site.
[0153] Step S104: Feedback the execution result corresponding to the operation request to the client according to the response information of at least one data center.
[0154] In the embodiment of the present invention, after obtaining the response information corresponding to each data center, the server can feed back the execution result corresponding to the operation request to the client according to the response information of at least one data center.
[0155] For example, when the execution of the operation request by each data center is successful, the server can roll back the operation of the data center where the operation was successfully executed to ensure data consistency.
[0156] Exemplarily, the execution result of each data center may be execution success, execution failure, or non-execution, etc., which is not limited in the embodiments of the present invention.
[0157] Exemplarily, a client refers to a program corresponding to a server that provides local services to clients. Specifically, it generally refers to a software application installed on a user's computer or other intelligent terminal device for accessing a server, acquiring or sending data.
[0158] Furthermore, in an embodiment of the present invention, when the execution result corresponding to the operation request is fed back to the client based on the response information of at least one data center, the server may also feed back the execution result of the first target node for the operation request to the client when the first response information of the first target node indicates that the first target node has responded successfully.
[0159] In summary, the response method provided by the embodiment of the present invention is applied to the server, and the method includes: receiving an operation request sent by the client; the operation request is used to request the target data stored in the data center to operate; sending the operation request to the first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request in parallel to other data centers in each data center except the first data center according to the polling strategy; obtaining the response information corresponding to each data center; the response information is used to indicate the execution status of the data center on the operation request; according to the response information of at least one data center, the execution result corresponding to the operation request is fed back to the client. In the embodiment of the present invention, after the server receives the operation request from the client, it first sends the operation request to the first data center, and at the same time, the first data center asynchronously forwards the operation request to each data center based on the operation request according to the polling strategy, thereby ensuring the consistency of the data of each data center. Finally, the server can feedback the execution result corresponding to the operation request to the client according to the response information of at least one data center, thereby solving the problem that the data of each data center cannot be synchronized in time and improving the response efficiency of the server to the operation request.
[0160] The response method provided in the embodiment of the present invention can be applied to the server as described above, referring to Figure 2 , showing the steps of a response method provided by an embodiment of the present invention Figure 2 , the method may include steps S201 to S208:
[0161] Step S201: receiving an operation request sent by a client; the operation request is used to request an operation to be performed on target data stored in a data center.
[0162] In the embodiment of the present invention, during the response process of the server, the server first receives an operation request sent by the client; wherein the operation request is used to request the target data stored in the data center to be operated.
[0163] Exemplarily, the operation request may be used to request target data stored in a data center, that is, the operation request is used to access the target data.
[0164] Exemplarily, the operation request may include a data synchronization request; specifically, data between multiple sites needs to be synchronized in quasi-real time to ensure data consistency and integrity. This usually involves copying data from one site to another, while ensuring the accuracy and integrity of the data during the copying process; synchronization progress query: users or administrators may need to query the progress of data synchronization to understand the synchronization status of data between different sites. This helps monitor system performance and promptly discover potential problems.
[0165] Exemplarily, the operation request may also include a data write request; specifically, in a distributed object storage system, a data write request may involve multiple sites. The system needs to ensure that the data remains consistent during the writing process, even between multiple sites. This is usually achieved by adopting a strong consistency protocol (such as Raft); some write requests may need to ensure atomicity, that is, all write operations are either all successful or all failed. This helps to ensure the consistency and integrity of the data.
[0166] For example, an operation request may also include a data read request. In a multi-site environment, a user may need to read consistent data. The system needs to provide the semantics of consistent reads to ensure that the data read by the user is the latest and consistent; distributed consistent snapshot reads allow users to read data snapshots before a certain point in time. This helps ensure that when data changes, users can still access the previous data state.
[0167] Exemplarily, an operation request may also include a data deletion request. Specifically, a distributed deletion is similar to a write request, and a data deletion request may also involve multiple sites. The system needs to ensure that the data remains consistent during the deletion process to avoid data loss or inconsistency; conditional deletion means that some deletion requests may need to meet specific conditions to be executed. For example, a key is deleted only when it does not exist, or a record is deleted only when it is a specific version.
[0168] Exemplarily, the operation request may also include a disaster recovery switching request, specifically, fault detection and switching, that is, in a multi-site disaster recovery environment, the system needs to be able to detect a failure at a site and automatically switch to other normal sites to continue to provide services. This usually involves a fault detection mechanism, a switching strategy, and a fault recovery process.
[0169] Exemplarily, the operation request may also include data verification and recovery, specifically, after switching to another site, the system needs to verify the data to ensure the integrity and consistency of the data. If a problem is found, the system needs to be able to automatically or manually recover the data.
[0170] Exemplarily, the operation request may also include a management request, specifically, site management, that is, the administrator may need to add, delete or modify site configuration, including setting the storage category, access rights, synchronization policy, etc. of the site.
[0171] Exemplarily, the operation request may also include monitoring and alarming. Specifically, the system needs to provide monitoring and alarming functions so that the administrator can monitor the performance and status of the system in real time and receive alarm notifications in time when problems occur.
[0172] Multi-site disaster recovery with strong data consistency in a distributed object storage system involves multiple operation requests that work together to ensure data consistency and availability across different sites, while providing disaster recovery capabilities to cope with possible site failures.
[0173] For example, a data center can be a storage system, also known as a storage cluster, with corresponding storage gateways and storage pools. A data center can have multiple object storage gateway instances.
[0174] Exemplarily, multiple object storage gateway instances refer to entities or copies of multiple object storage gateways deployed in a distributed storage system or cloud computing environment. These instances work together to provide efficient, reliable and scalable object storage services.
[0175] For example, an object storage gateway is a storage network device that connects multiple storage nodes and manages and coordinates data storage and access. Multiple object storage gateway instances mean that there are multiple such gateway devices or software copies in the system, which jointly process storage requests and provide data access services. These instances usually support multiple storage protocols and can flexibly configure storage nodes to adapt to different storage needs.
[0176] Multiple object storage gateway instances play an important role in various application scenarios, including but not limited to: cloud computing environment, that is, in a cloud computing environment, multiple object storage gateway instances can provide efficient data storage and management services, support the management and coordination of different storage nodes, and improve the reliability and performance of the system. Big data processing, that is, for big data processing tasks, multiple object storage gateway instances can optimize storage performance and network bandwidth, and improve data processing efficiency and accuracy. Distributed storage system, that is, in a distributed storage system, multiple object storage gateway instances can support centralized management and sharing of data, and support multiple storage protocols and access control mechanisms to ensure data security and confidentiality.
[0177] Multiple object storage gateway instances can back up and fault-tolerant each other to improve system availability. By processing storage requests together, multiple instances can achieve load balancing and improve system throughput and response speed. As storage needs grow, more object storage gateway instances can be easily added to expand the system's storage capacity.
[0178] Maintaining data consistency between multiple instances is a challenge, which requires the adoption of appropriate data synchronization and consistency protocols. When an instance fails, it is necessary to quickly switch to other normal instances and ensure data integrity and consistency. The resource usage of multiple instances needs to be effectively managed to avoid resource waste and performance bottlenecks.
[0179] Exemplarily, the target data may be data stored in a data center, may be multiple object storage gateway instances, etc., which is not limited in the embodiments of the present invention.
[0180] Step S202: for each data center, according to the node identification information stored in the data center, determine the service node in the data center that matches the node identification information as the target node.
[0181] In the embodiment of the present invention, after receiving the operation request sent by the client, the server will determine the service node matching the node identification information in the data center as the target node for each data center according to the node identification information stored in the data center.
[0182] Exemplarily, the node identification information stored in the data center may be a service identification that identifies whether the node can serve the operation request.
[0183] Exemplarily, the service node in the data center that matches the node identification information may be a service node that contains the node identification information and is determined from the data center.
[0184] Exemplarily, the target node may be a node that provides business services.
[0185] Step S203: poll the target nodes that meet the requirements in each data center in turn until the last data center is polled, then start the next round of query and continue to poll the target nodes that meet the requirements in each data center.
[0186] In an embodiment of the present invention, for each data center, after determining the service node in the data center that matches the node identification information as the target node based on the node identification information stored in the data center, the server can sequentially poll the target nodes that meet the requirements in each data center until the last data center is polled, and then start the next round of queries and continue to poll the target nodes that meet the requirements in each data center.
[0187] For example, the load balancing management module can be responsible for the load balancing management of nodes within each site. According to the site information recorded in each data center, the IP address of each site receiving services is selected for service request forwarding. By default, all nodes within the site are load balanced using a polling strategy.
[0188] For example, in the process of determining the target node, the server needs to call the load balancing management module to poll the serviceable target nodes in each data center in turn, and then when receiving an operation request, it can quickly determine the serviceable target node, thereby improving the response efficiency.
[0189] Exemplarily, the target node that meets the requirements may be a node that can respond to the operation request.
[0190] Exemplarily, the server may call the load balancing management module to traverse the entire data center, that is, it needs to round-robin to the last data center.
[0191] For example, after the server polls the last data center, the server may continue with the next round of queries.
[0192] For example, in a new round of query process, the server needs to continue to poll the serviceable target nodes in each data center.
[0193] Exemplarily, the target node that meets the requirements in each data center is the target node that can provide services.
[0194] Step S204: Send the operation request to the first data center.
[0195] In an embodiment of the present invention, when the load balancing management module is called, the target nodes that meet the requirements in each data center are polled in turn until the last data center is polled, and then the next round of queries is started. After continuing to poll the target nodes that meet the requirements in each data center, the server can send the operation request to the first data center.
[0196] Exemplarily, the first data center may be any data center among the data centers, which is not limited in the embodiments of the present invention.
[0197] Exemplarily, the polling strategy may be used to instruct the target nodes in each data center to perform load balancing.
[0198] Exemplarily, the parallel asynchronous forwarding may be that upon receiving an operation request, the data center first asynchronously processes the operation request locally, and then asynchronously forwards the operation request in parallel to other data centers except the first data center.
[0199] Exemplarily, each data center may be any data center among data centers, which is not limited in the embodiments of the present invention.
[0200] Exemplarily, the other data center may be any data center in the data center, which is not limited in the embodiments of the present invention.
[0201] Step S205: forward the operation request in parallel and asynchronously to other data centers in the data centers except the first data center.
[0202] In the embodiment of the present invention, after sending the operation request to the first data center, the server may asynchronously forward the operation request to other data centers in parallel except the first data center.
[0203] Exemplarily, the request parallel asynchronous forwarding management module can be responsible for scheduling the parallel asynchronous forwarding of operation requests between sites. After receiving the operation request, the site service IP load balancing management module is called to select the IP node for receiving services at each site, and a communication link is created with the selected service IP of each site. Then the request is processed asynchronously locally first, and then the operation request is forwarded asynchronously to other site service IP nodes in parallel. In order to improve performance, all requests use asynchronous calls to avoid the performance impact caused by synchronization. After all requests from all sites return responses, the final response result is returned to the client. If all sites are executed successfully, success is returned. If a site fails to execute, the next IP node is selected for retry. If it still fails after 5 retries, failure is returned, and the operation is rolled back for the site that has executed successfully.
[0204] Exemplarily, the number of data centers other than the first data center may be one or more, which is not limited in the embodiments of the present invention.
[0205] For example, the metadata operation request may be to call the parallel asynchronous forwarding management module to ensure metadata consistency when performing metadata operations such as adding, deleting, and modifying users and buckets at a node at a site.
[0206] Exemplarily, the data operation request may be to call a parallel asynchronous forwarding management module to ensure the consistency of the object data when performing an upload, deletion, or object metadata modification operation on a node of a station.
[0207] For example, when performing a metadata add operation on a bucket, a new bucket can be created in the object storage service to store objects. When creating a bucket, you need to specify the bucket's name, location (region), access permissions, and other attributes. Some services also allow you to set advanced features such as bucket policies and lifecycle rules.
[0208] For example, when performing a bucket delete metadata operation on metadata, a bucket and all objects contained in it can be removed. Deleting a bucket is a sensitive operation because once deleted, all data in the bucket will be lost. Therefore, before deleting a bucket, it is usually necessary to confirm that the bucket is empty or that important data has been backed up.
[0209] Exemplarily, when performing a modify metadata operation on a bucket, the properties of the bucket are updated, such as access permissions, storage categories, lifecycle rules, etc. When modifying a bucket, it is necessary to ensure that these changes do not violate existing data protection policies or cause data loss.
[0210] Exemplarily, the execution object may be object metadata, which is not limited in the embodiments of the present invention.
[0211] Exemplarily, the upload processing operation may be to call the request parallel asynchronous forwarding management module to write the data in parallel to each site when receiving the client upload request.
[0212] Exemplarily, the deletion processing operation may be to call the parallel asynchronous forwarding management module to write data to each site in parallel upon receiving a deletion request from the client.
[0213] Exemplarily, the modification processing operation may be to call the request parallel asynchronous forwarding management module to write data to each site in parallel upon receiving a modification request from the client.
[0214] Step S206: For each data center, determine the target node that receives the operation request in the data center as the first target node.
[0215] In an embodiment of the present invention, after calling the request parallel asynchronous forwarding management module and forwarding the operation request in parallel and asynchronously to other data centers in each data center except the first data center, the server can determine the target node that receives the operation request in the data center as the first target node for each data center.
[0216] Exemplarily, the target node that receives the operation request may be a node that responds to the operation request, that is, a serviceable target node.
[0217] Exemplarily, the first target node may be any target node in a data center that receives an operation request, which is not limited in the embodiments of the present invention.
[0218] Step S207: Obtain first response information of the first target node.
[0219] In the embodiment of the present invention, after determining the target node receiving the operation request in each data center as the first target node, the service end may obtain the first response information of the first target node.
[0220] Exemplarily, the first response information may be response information corresponding to the first target node, or may be response information corresponding to a new first target node, that is, response information determined by the first target node according to the operation request.
[0221] Step S208: When the first response information indicates that the first target node fails to respond, re-acquire the first response information corresponding to the first target node until the first response information indicating successful execution is obtained, and then stop acquiring.
[0222] In an embodiment of the present invention, after obtaining the first response information of the first target node, the server may, if the first response information indicates that the first target node fails to respond, re-obtain the first response information corresponding to the first target node, and stop obtaining until the first response information indicating successful execution is obtained.
[0223] Exemplarily, the first target node does not respond to the operation request, that is, the response information obtained according to the operation request indicates that the first target node fails to respond.
[0224] Exemplarily, when the first target node fails to respond, the server needs to re-acquire the first response information corresponding to the first target node until the acquired first response information indicates successful execution, and then stops acquiring the first response information.
[0225] Exemplarily, when the first target node successfully executes the operation request, first response information of successful execution may be obtained.
[0226] Exemplarily, when first response information indicating successful execution is obtained, the server may stop obtaining the first response information.
[0227] Reference Figure 3 , showing the steps of a response method provided by an embodiment of the present invention Figure 3 The method may further include steps S209 to S210:
[0228] Step S209: when the first response information indicates that the first target node fails to respond, re-acquire the first response information corresponding to the first target node, and determine whether the number of retries is greater than or equal to a preset threshold.
[0229] In the embodiment of the present invention, after the first response information indicates that the first target node fails to respond and the first response information corresponding to the first target node is re-acquired, it is determined whether the number of retries is greater than or equal to a preset threshold.
[0230] Exemplarily, the number of retries may be the number of times the server re-acquires the response information at the first target node, and the number of retries may be any integer greater than or equal to zero. Specifically, the number of retries may be 1, 2, etc., which is not limited in the embodiments of the present invention.
[0231] Exemplarily, the preset threshold may be the number of times the server is allowed to reacquire response information at the first target node. The preset threshold may be any integer greater than or equal to zero. Specifically, the preset threshold may be 5 times, 6 times, etc., which is not limited in the embodiments of the present invention.
[0232] In the embodiment of the present invention, if the conditions are met, step S210 is executed, otherwise step S208 is executed.
[0233] Step S210, determine that the execution of the first target node fails, stop acquiring, send an operation request to any target node in the data center except the first target node, determine the target node as the new first target node, continue to acquire the first response information of the new first target node, and analyze the acquired first response information.
[0234] In an embodiment of the present invention, when the number of retries is greater than or equal to a preset threshold, the server may determine that the execution of the first target node has failed, stop acquiring, send an operation request to any target node in the data center except the first target node, determine the target node as the new first target node, continue to acquire the first response information of the new first target node, and analyze the acquired first response information.
[0235] Exemplarily, when the number of retries of the server on the first target node reaches a threshold and the response information obtained is all response failure, it can be determined that the execution of the first target node has failed.
[0236] Exemplarily, any target node may be a serviceable target node in a data center.
[0237] Exemplarily, when the execution of the first target node fails, the server stops acquiring and sends an operation request to any target node in the data center except the first target node to determine the target node as a new first target node.
[0238] Exemplarily, the first response information of the new first target node may be response information determined by the new first target node according to the operation request.
[0239] Exemplarily, the first response information of the new first target node may be execution success, or execution failure, or non-execution, etc., which is not limited in the embodiments of the present invention.
[0240] Exemplarily, the first response information obtained is analyzed. If the response information obtained from each target node indicates successful execution, the server can return response information indicating successful execution to the client, which is not limited in the embodiments of the present application.
[0241] Reference Figure 4 , showing the steps of a response method provided by an embodiment of the present invention Figure 4 The method may further include steps S211 to S212:
[0242] Step S211: Obtain response information corresponding to each data center.
[0243] In the embodiment of the present invention, after sending the operation request to the first data center, the server can also obtain the response information corresponding to each data center.
[0244] Exemplarily, the response information corresponding to each data center may be the corresponding response information determined from each data center. Specifically, the response information corresponding to each data center may all be response information of successful execution, or all be response information of failed execution, or may include both response information of successful execution and response information of failed execution, which is not limited in the embodiments of the present invention.
[0245] Step S212: When the response information corresponding to each data center indicates successful execution, the execution result corresponding to the operation request is returned to the client.
[0246] In the embodiment of the present invention, after the response information corresponding to each data center is obtained, when the response information corresponding to each data center indicates successful execution, the execution result corresponding to the operation request is returned to the client.
[0247] Exemplarily, when the response information corresponding to each data center indicates successful execution, the server will return a response information indicating successful execution to the client.
[0248] Reference Figure 5 , showing the steps of a response method provided by an embodiment of the present invention Figure 5 The method may further include steps S213 to S214:
[0249] Step S213: When the response information of at least one data center indicates that the execution is successful, the execution result corresponding to the operation request is returned to the client.
[0250] In an embodiment of the present invention, after obtaining the response information corresponding to each data center, the server may also return the execution result corresponding to the operation request to the client if the response information of at least one data center indicates successful execution.
[0251] For example, after the server returns the execution result corresponding to the operation request to the client, it will also synchronize data with other data centers based on the execution result of the successfully executed data center to ensure data consistency, thereby improving the efficiency of the server's response to the operation request.
[0252] Step S214: perform data synchronization processing on other data centers according to the execution result of the successfully executed data center.
[0253] In an embodiment of the present invention, the response information of at least one data center indicates successful execution. After returning the execution result corresponding to the operation request to the client, the server can also perform data synchronization processing on other data centers based on the execution result of the successfully executed data center.
[0254] For example, data synchronization can add, delete, and modify user or bucket metadata for one site, which will take effect immediately at other sites. Objects uploaded at one site can be immediately accessed at another site, truly achieving real-time consistency of data between sites, thereby ensuring strong consistency of metadata and object data at each site.
[0255] In some embodiments, the site service IP load balancing management module is responsible for the load balancing management of nodes within each site. According to the site information recorded in the zone group zonegroup, the IP address of each site receiving services is selected for service request forwarding. By default, all nodes within the site are load balanced using a polling strategy.
[0256] Reference Figure 6 , shows a flow chart of the steps of site service IP load balancing management provided by an embodiment of the present invention, the method may also include steps S301 to S303:
[0257] When the service starts, get the business IP of each site from the zonegroup information, and use the first one as the current address curl_ip, and save this information in memory;
[0258] Step S301: Receive a request for querying a site service IP.
[0259] Step S302, the site service IP load balancing management module starts to cycle through each site, obtains the curl_ip of each site, and updates the curl_ip to the next service IP. If it reaches the last one, it cycles to the first one.
[0260] Step S303: Return the query result to the query module.
[0261] The request parallel asynchronous forwarding management module is responsible for scheduling the parallel asynchronous forwarding of operation requests between sites. After receiving the operation request, the site business IP load balancing management module is called to select the IP node for receiving the service at each site, and create a communication link with the selected business IP of each site. Then the request is processed asynchronously locally first, and then the operation request is forwarded asynchronously to the business IP nodes of other sites in parallel. In order to improve performance, all requests use asynchronous calls to avoid the performance impact caused by synchronization. After all requests from all sites return responses, the final response result is returned to the client. If all sites are executed successfully, success is returned. If a site fails to execute, the next IP node is selected for retry. If it still fails after 5 retries, failure is returned and the operation is rolled back for the site that has executed successfully.
[0262] Reference Figure 7 , shows a schematic diagram of parallel asynchronous forwarding of requests provided by an embodiment of the present invention, as shown in the figure:
[0263] The client sends an operation request to site 1; site 1 asynchronously processes the request locally and asynchronously forwards the operation request to sites 2 and 3; sites 2 and 3 return the response information corresponding to the operation request to site 1; site 1 waits for all sites to return responses, processes the responses, obtains the final response, and returns the final response to the client;
[0264] Reference Figure 8 , shows a request parallel asynchronous forwarding timing diagram provided by an embodiment of the present invention, as shown in the figure:
[0265] The client sends the operation request to site 1, which can process the request asynchronously locally. At the same time, site 1 can asynchronously forward the operation request to sites 2 and 3. After receiving the asynchronous forwarding request, sites 2 and 3 will return the response results corresponding to the asynchronous forwarding request to site 1. Site 1 will centrally process all returned response results, and wait until all sites return responses, process the responses, obtain the final response, and return the final response to the client.
[0266] Reference Fig. 9 , shows a flowchart of a step of requesting parallel asynchronous forwarding provided by an embodiment of the present invention, the method may further include steps S501 to S513:
[0267] Step S501: receiving an operation request;
[0268] Step S502: Call the site service IP load balancing management module to select the service IP of each site;
[0269] Step S503: Create a link with each site service IP;
[0270] Step S504: calling the asynchronous interface to process the service request of the node;
[0271] Step S505: forward the request to the service IP nodes of each site in parallel and asynchronously through the created links;
[0272] Step S506: cyclically query whether each forwarding node has returned a response, and process the returned result;
[0273] Step S507: Check whether the node reached by the loop has responded.
[0274] If so, execute step S508; otherwise, execute step S506.
[0275] Step S508: Determine whether the returned result is successful;
[0276] If so, execute step S510; otherwise, execute step S509.
[0277] Step S509, determine whether the number of retries exceeds 5 times;
[0278] If so, execute step S512; otherwise, execute step S513.
[0279] Step S510: Whether all sites have returned responses;
[0280] If so, execute step S511; otherwise, execute step S512.
[0281] Step S511, returning a response to the client;
[0282] Step S512: Roll back the operations on other sites, and the final response is failure;
[0283] Step S513: Get the next service node IP of the site and re-forward the request.
[0284] When receiving metadata or data operation requests, the business operation scheduling module assembles the corresponding message structure according to different request types, calls the request parallel asynchronous forwarding management module to forward the requests in parallel to other sites, and returns the execution results.
[0285] When the operation request is a metadata operation, when performing metadata operations such as adding, deleting, and modifying users and buckets at a certain node in a certain site, the request parallel asynchronous forwarding management module is called to ensure the consistency of the metadata.
[0286] When the operation request is a data operation, when performing object upload, deletion, and object metadata modification operations at a certain node of a certain station, the request parallel asynchronous forwarding management module is called to ensure the consistency of the object data. Taking object upload as an example, when receiving the client upload request, the request parallel asynchronous forwarding management module is called to write the data in parallel to each station. After all the station data are written successfully, the success is returned to the customer.
[0287] Reference Fig.10 , shows a flowchart of steps of an operation scheduling process provided by an embodiment of the present invention, the method may also include steps S601 to S604:
[0288] Step S601: receiving a client operation request;
[0289] Step S602: Assemble the corresponding message structure according to the operation type;
[0290] Step S603: calling the request parallel asynchronous forwarding management module to forward the request in parallel to other sites;
[0291] Step S604: After the request parallel asynchronous forwarding management module returns a response, a response is returned to the client;
[0292] In summary, the present invention proposes a multi-site disaster recovery implementation scheme with strong consistency of distributed object storage system data, which can achieve strong consistency of metadata and object data at each site. When a site adds, deletes, or modifies the metadata of a user or bucket, it will take effect immediately at other sites; objects uploaded at one site can be immediately accessed at another site, truly achieving real-time consistency of data between sites. In addition, when a site fails, the fault recovery RPO=0 is achieved, ensuring that data is not lost and improving the disaster recovery capability of multiple sites, which not only brings a good user experience to customers, but also enriches the functions of object storage and improves the market competitiveness of distributed object products.
[0293] In the embodiment of the present invention, a method for managing site service IP load balancing is proposed to achieve load balancing of services within each site and improve service processing capabilities;
[0294] In the embodiment of the present invention, a method for strong consistency of data between sites is proposed: after receiving an operation request, the request can be asynchronously forwarded to the service IP nodes of other sites in parallel, which not only does not affect the overall performance, but also achieves strong consistency of element data and object data between sites. The operation of one site takes effect immediately at another site, truly achieving real-time consistency of data between sites. In addition, when a site fails, the fault recovery RPO=0 is achieved, ensuring that data is not lost and improving the disaster recovery capability of multiple sites.
[0295] In the embodiment of the present invention, a method for uniformly scheduling and forwarding metadata and data operations is proposed, which simplifies the operation processing flow.
[0296] Reference Fig.11 , shows a schematic diagram of the architecture of a distributed storage system provided by an embodiment of the present invention, such as Fig.11 As shown, the distributed storage system 600 includes a server 601 , a client 602 and a data center 603 .
[0297] The client sends an operation request to the server;
[0298] The server is used to receive an operation request sent by a client; the operation request is used to request target data stored in the data center; the operation request is sent to the first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request in parallel to other data centers among the data centers except the first data center according to a polling strategy;
[0299] The data center is used to asynchronously forward the operation request to other data centers in parallel based on the polling strategy; the other data centers receive the operation request and perform response processing based on the operation request;
[0300] The server is used to obtain response information corresponding to each data center; the response information is used to indicate the execution status of the operation request by the data center; when the execution status of each data center indicates successful execution, the execution result of each data center is returned to the client;
[0301] The client is used to receive the execution result returned by the server.
[0302] Optionally, the server is further configured to perform the following steps:
[0303] Determine the target node corresponding to each data center according to the node identification information stored in each data center;
[0304] The sending the operation request to the first data center includes:
[0305] Sending the operation request to a target node corresponding to the first data center to trigger the target node to asynchronously forward the operation request in parallel to target nodes in other data centers among the data centers except the first data center according to a polling strategy;
[0306] The obtaining of response information corresponding to each data center includes:
[0307] For each data center, determining a target node in the data center that receives the operation request as a first target node;
[0308] Obtaining first response information of the first target node;
[0309] If the first response information indicates that the first target node fails to respond, reacquire the first response information corresponding to the first target node until the first response information indicating successful execution is acquired, then stop acquiring; or
[0310] When the number of retries is greater than or equal to a preset threshold, it is determined that the execution of the first target node has failed, and the acquisition is stopped. The operation request is sent to any target node in the data center except the first target node, and the target node is determined as the new first target node. The first response information of the new first target node continues to be acquired, and the acquired first response information is analyzed.
[0311] Optionally, the server is further configured to perform the following steps:
[0312] Sending the operation request to the first data center;
[0313] Invoke a request parallel asynchronous forwarding management module to parallel and asynchronously forward the operation request to other data centers among the data centers except the first data center;
[0314] Wherein, the operation request includes at least one of a metadata operation request and a data operation request;
[0315] The metadata operation request is used to request to perform at least one of an add metadata operation, a delete metadata operation, and a modify metadata operation on target metadata stored in the data center;
[0316] The data operation request is used to request at least one of an upload processing operation, a delete processing operation, and a modification processing operation to target data stored in the data center.
[0317] Optionally, the server is further configured to perform the following steps:
[0318] Get the corresponding response information of each data center;
[0319] When the response information corresponding to each data center indicates successful execution, the execution result corresponding to the operation request is returned to the client.
[0320] Optionally, the server is further configured to perform the following steps:
[0321] Get the corresponding response information of each data center;
[0322] When the response information of at least one data center indicates that the execution is successful, returning the execution result corresponding to the operation request to the client;
[0323] Data synchronization is performed on other data centers based on the execution results of the successfully executed data center.
[0324] Optionally, the server is further configured to perform the following steps:
[0325] The load balancing management module is called to poll the target nodes that meet the requirements in each data center in turn until the last data center is polled. Then, the next round of query is started to continue polling the target nodes that meet the requirements in each data center.
[0326] Optionally, the server is further configured to perform the following steps:
[0327] For each data center, according to the node identification information stored in the data center, a service node in the data center that matches the node identification information is determined as a target node.
[0328] Reference Fig.12 , shows a schematic diagram of a response device provided by an embodiment of the present invention, the response device 800 includes:
[0329] The first receiving unit 801 is used to receive an operation request sent by a client; the operation request is used to request the target data stored in the data center to be operated;
[0330] The first sending unit 802 is used to send the operation request to the first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request to other data centers in each data center except the first data center in parallel according to the polling strategy;
[0331] The acquisition unit 803 is used to acquire the response information corresponding to each data center; the response information is used to indicate the execution status of the data center for the operation request;
[0332] The returning unit 804 is used to feed back the execution result corresponding to the operation request to the client according to the response information of at least one data center.
[0333] Optionally, determining a target node corresponding to each data center according to the node identification information stored in each data center;
[0334] Optionally, the operation request is sent to a target node corresponding to the first data center; the operation request is used to instruct the target node to asynchronously forward the operation request in parallel to target nodes in other data centers in each data center except the first data center according to a polling strategy;
[0335] Optionally, for each data center, the target node that receives the operation request in the data center is determined as the first target node; the first response information of the first target node is obtained; when the first response information indicates that the first target node has failed to respond, the first response information corresponding to the first target node is re-obtained until the first response information indicating successful execution is obtained, and the acquisition is stopped; or, when the number of retries is greater than or equal to a preset threshold, it is determined that the execution of the first target node has failed, the acquisition is stopped, and an operation request is sent to any target node in the data center except the first target node, and the target node is determined as the new first target node, and the first response information of the new first target node continues to be obtained, and the obtained first response information is analyzed.
[0336] Optionally, an operation request is sent to the first data center; a request parallel asynchronous forwarding management module is called to forward the operation request in parallel and asynchronously to other data centers in each data center except the first data center; wherein the operation request includes at least one of a metadata operation request and a data operation request; the metadata operation request is used to request to perform at least one of an add metadata operation, a delete metadata operation, and a modify metadata operation on target metadata stored in the data center; the data operation request is used to request to perform at least one of an upload processing operation, a delete processing operation, and a modify processing operation on target data stored in the data center.
[0337] Optionally, when the response information corresponding to each data center indicates successful execution, the execution result corresponding to the operation request is returned to the client.
[0338] Optionally, when the response information of at least one data center indicates successful execution, the execution result corresponding to the operation request is returned to the client; and data synchronization processing is performed on other data centers based on the execution result of the successfully executed data center.
[0339] Optionally, for each data center, based on the node identification information stored in the data center, a service node in the data center that matches the node identification information is determined as a target node; the target nodes that meet the requirements in each data center are polled in turn until the last data center is polled, and then the next round of queries is started to continue polling the target nodes that meet the requirements in each data center.
[0340] Optionally, according to the type corresponding to the operation request, a message structure corresponding to the operation request is assembled; and the message structure is sent to the target node.
[0341] Optionally, when the first response information of the first target node indicates that the first target node responds successfully, the execution result of the first target node for the operation request is fed back to the client.
[0342] The present invention also provides a computer program product, including a computer program / instruction, which implements the response method of the above embodiment when the computer program / instruction is executed by a processor.
[0343] The present invention also provides an electronic device 900, see Fig.13 , including: a processor 901, a memory 902, and a computer program 9021 stored in the memory and executable on the processor, wherein the processor implements the response method of the aforementioned embodiment when executing the program.
[0344] The present invention also provides a readable storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the response method of the aforementioned embodiment.
[0345] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0346] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
Claims
1. A response method, characterized in that: Applied to the server, the method includes: Receive an operation request sent by a client; the operation request is used to request a target data stored in a data center to be operated; Sending the operation request to the first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request to other data centers among the data centers except the first data center in parallel according to a polling strategy; Obtaining response information corresponding to each data center; the response information is used to indicate the execution status of the data center on the operation request; According to the response information of at least one data center, the execution result corresponding to the operation request is fed back to the client.
2. The method according to claim 1, characterized in that The sending the operation request to the first data center includes: Sending the operation request to the first data center; forwarding the operation request in parallel and asynchronously to other data centers among the data centers except the first data center; Wherein, the operation request includes at least one of a metadata operation request and a data operation request; The metadata operation request is used to request to perform at least one of an add metadata operation, a delete metadata operation, and a modify metadata operation on target metadata stored in the data center; The data operation request is used to request at least one of an upload processing operation, a delete processing operation, and a modification processing operation to target data stored in the data center.
3. The method according to claim 1, characterized in that Feedback of the execution result corresponding to the operation request to the client according to the response information of at least one data center includes: When the response information corresponding to each data center indicates successful execution, the execution result corresponding to the operation request is returned to the client.
4. The method according to claim 1, characterized in that: Feedback of the execution result corresponding to the operation request to the client according to the response information of at least one data center includes: When the response information of at least one data center indicates that the execution is successful, returning the execution result corresponding to the operation request to the client; Data synchronization is performed on other data centers based on the execution results of the successfully executed data center.
5. The method according to claim 1, characterized in that Before sending the operation request to the first data center, the method further includes: Determine the target node corresponding to each data center according to the node identification information stored in each data center; The sending the operation request to the first data center includes: Sending the operation request to a target node corresponding to the first data center to trigger the target node to asynchronously forward the operation request in parallel to target nodes in other data centers among the data centers except the first data center according to a polling strategy; The obtaining of response information corresponding to each data center includes: For each data center, determining a target node in the data center that receives the operation request as a first target node; Obtaining first response information of the first target node; If the first response information indicates that the first target node fails to respond, reacquire the first response information corresponding to the first target node until the first response information indicating successful execution is acquired, then stop acquiring; or When the number of retries is greater than or equal to a preset threshold, it is determined that the execution of the first target node has failed, and the acquisition is stopped. The operation request is sent to any target node in the data center except the first target node, and the target node is determined as the new first target node. The first response information of the new first target node continues to be acquired, and the acquired first response information is analyzed.
6. The method according to claim 5, characterized in that The step of determining the target node corresponding to each data center according to the node identification information stored in each data center includes: For each data center, according to the node identification information stored in the data center, determining a service node in the data center that matches the node identification information as a target node; Poll the target nodes that meet the requirements in each data center in turn until the last data center is polled, then start the next round of queries and continue to poll the target nodes that meet the requirements in each data center.
7. The method according to claim 5, characterized in that The sending the operation request to a target node corresponding to the first data center includes: According to the type corresponding to the operation request, assembling a message structure corresponding to the operation request; Send the message structure to the target node.
8. The method according to any one of claims 5 to 7, characterized in that: Feedback of the execution result corresponding to the operation request to the client according to the response information of at least one data center includes: When the first response information of the first target node indicates that the first target node responds successfully, the execution result of the first target node for the operation request is fed back to the client.
9. A response method, characterized in that: Applied to a distributed storage system, the distributed storage system includes a server, a client, and a data center, and the method includes: The client sends an operation request to the server; The server receives an operation request sent by a client; the operation request is used to request target data stored in the data center; the operation request is sent to a first data center; the operation request is used to instruct the first data center to asynchronously forward the operation request in parallel to other data centers among the data centers except the first data center according to a polling strategy; The data center, based on the polling strategy, asynchronously forwards the operation request to other data centers in parallel; the other data centers receive the operation request and perform response processing based on the operation request; The server obtains response information corresponding to each data center; the response information is used to indicate the execution status of the operation request by the data center; when the execution status of each data center indicates successful execution, the execution result of each data center is returned to the client; The client receives the execution result returned by the server.
10. An electronic device, characterized in that: The electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to execute the response method according to any one of claims 1 to 9 by one or more processors.
Citation Information
Patent Citations
Disaster tolerant method and system of configuration file management system
CN107729176A
Request processing method, device, equipment and system for multiple data centers
CN117240924A
Datacenter synchronization
US20100235431A1
Distributed database systems including callback techniques for cache of same
US20210344772A1