Cloud service failure handling method, device, storage medium and computer program
By constructing temporary data lines and adjusting data allocation ratios, the problem of service unreliability caused by synchronous data line failures in cloud services was solved, achieving efficient synchronization of master and slave databases and ensuring the integrity and accuracy of the service.
Patent Information
- Application Number
- CN202411386191.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-09-30
AI Technical Summary
In cloud service deployments, when the synchronization data line between two databases fails, it may lead to duplicate data conflicts and service unreliability issues.
By constructing temporary data lines, analyzing the reasons for synchronization failures, especially when lines fail, we can ensure database data synchronization between master and slave servers, adjust the data allocation ratio, and use temporary VPN entry points for data synchronization.
This effectively reduces service issues caused by synchronous data line failures, ensures the integrity and accuracy of services, and improves response speed and stability.
Smart Images

Figure CN119341891B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and in particular to a cloud service fault handling method, device, storage medium, and computer program. Background Technology
[0002] Smart home refers to a home management and control system that uses advanced information technology and Internet of Things (IoT) technology to connect traditional home devices and systems to the Internet, thereby achieving automation, intelligence, and convenience.
[0003] In some technologies, a dual-active solution is often adopted when deploying cloud services. This involves deploying a service across two cloud servers provided by different cloud service providers to alleviate the pressure on a single server. When using a dual-active solution, a database is deployed on each server, and a dedicated line is used to back up both databases.
[0004] However, when the leased line connecting the two databases fails, a request to access one server may not be able to access the data in the database on the other server correctly. If the data is created, duplicate data conflicts may occur after the leased line is restored. Summary of the Invention
[0005] This disclosure provides a cloud service fault handling method, device, storage medium, and computer program to reduce service problems caused by failure of synchronization data lines to synchronize master and slave databases in a timely manner, thereby ensuring the integrity and accuracy of the service.
[0006] In a first aspect, this disclosure provides a cloud service fault handling method applied to a cloud service system, the cloud service system including a master server with a master database and slave servers with slave databases, wherein the master server and the slave servers synchronize database data through a synchronization data line, the method including:
[0007] In response to a user request, the user request is allocated to the master server and the slave server according to a preset data allocation ratio;
[0008] In response to the user request, the master server and the slave server synchronize database data;
[0009] When a database data synchronization failure is detected, analyze the reasons for the failure.
[0010] When the data synchronization fails due to a fault in the synchronization data line, a temporary data line is constructed so that the master server and the slave server can complete database data synchronization based on the temporary data line.
[0011] In some embodiments, the method further includes:
[0012] When the reason for data synchronization failure is not a fault in the synchronization data line, determine whether the synchronization data line is in a congested state.
[0013] When the synchronization data line is congested, the data allocation ratio requested by the user is readjusted.
[0014] Based on the readjusted data allocation ratio, the user requests are redistributed to the master server and the slave server.
[0015] In some embodiments, the step of constructing a temporary data line, enabling the master server and the slave server to synchronize database data based on the temporary data line, includes:
[0016] Construct a temporary data line and determine whether the temporary data line is congested.
[0017] When the temporary data line is not congested, the master server is controlled to access the slave server through the temporary data line to complete database data synchronization.
[0018] In some embodiments, the method further includes:
[0019] When the temporary data line is congested, an identifier is attached to the user request. The identifier is used to indicate the target server that the user request is assigned when it is re-initiated. The target server is either a master server or a slave server.
[0020] Based on the identifier, the user request is assigned to the target server;
[0021] Based on the public network, the data corresponding to the user request is stored in the database of the target server, thereby completing the database data synchronization.
[0022] In some embodiments, the step of determining whether a data line is congested includes:
[0023] Obtain the values of relevant parameters characterizing the usage of the data line, and compare the values of the relevant parameters characterizing the usage of the data line with corresponding thresholds;
[0024] When the value of the relevant parameter representing the usage of the data line is greater than the corresponding threshold, it is determined that the data line is in a congested state.
[0025] In some embodiments, the step of constructing a temporary data line, enabling the master server and the slave server to synchronize database data based on the temporary data line, includes:
[0026] The temporary data line is constructed based on a temporary virtual private network;
[0027] The master server is controlled to access the slave server through the temporary data line to complete database data synchronization.
[0028] In some embodiments, the number of user requests is multiple;
[0029] Before the step of synchronizing database data between the master server and the slave server in response to the user request, the method further includes:
[0030] Based on the user identity information corresponding to the user request, determine the processing order of each user request;
[0031] According to the processing order of the user requests, each user request is responded to and assigned to a corresponding server, which is either a master server or a slave server.
[0032] In a second aspect, this disclosure provides a computer device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the foregoing aspect.
[0033] Thirdly, this disclosure provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described above.
[0034] Fourthly, this disclosure provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the methods described in the foregoing aspects.
[0035] This disclosure provides a cloud service fault handling method, device, storage medium, and computer program. In response to user requests, the method allocates user requests to a master server and a slave server according to a preset data allocation ratio. Upon receiving a user request, the master server and the slave server perform database data synchronization. When a database data synchronization failure is detected, the method analyzes the cause of the failure. If the cause of the failure is a synchronization data line failure, a temporary data line is constructed, enabling the master server and the slave server to complete database data synchronization based on the temporary data line. Thus, by analyzing the cause of the data synchronization failure and then synchronizing the database data of the master server and the slave server through a temporary data line, the method effectively reduces the occurrence of service problems caused by failure to synchronize master and slave database data in a timely manner due to synchronization data line failure, ensuring the integrity and accuracy of the service. Attached Figure Description
[0036] The present disclosure will be described in more detail below based on embodiments and with reference to the accompanying drawings:
[0037] Figure 1 A flowchart illustrating a cloud service fault handling method provided in this embodiment of the disclosure;
[0038] Figure 2 This is a structural block diagram of a cloud service fault handling device in one embodiment.
[0039] Figure 3 This is a diagram showing the internal structure of an electronic device in one embodiment.
[0040] Figure 4 This is a flowchart illustrating a cloud service fault handling method in another embodiment. Detailed Implementation
[0041] To enable those skilled in the art to better understand the technical solutions of this disclosure, and to fully understand and implement the process of how this disclosure applies technical means to solve technical problems and achieve corresponding technical effects, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. The embodiments of this disclosure and the various features within them can be combined with each other without conflict, and the resulting technical solutions are all within the protection scope of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort should fall within the protection scope of this disclosure.
[0042] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0043] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0044] Example 1
[0045] Figure 1 This is a flowchart illustrating a cloud service fault handling method provided in an embodiment of this disclosure. Figure 1 As shown, a cloud service fault handling method is applied to a cloud service system. The cloud service system includes a master server with a master database and slave servers with slave databases. The master server and the slave servers synchronize database data via a synchronization data line. When a user initiates a request, the parsed request is distributed between the master server and the slave server according to a certain ratio. If a request is assigned to the master server but requires operation on data on the slave server, and the master database on the master server has not yet synchronized this data, the data will be operated on via the synchronization data line and synchronized to both databases, continuing the subsequent process to fulfill the user's request. This synchronization data line can also be referred to as a dedicated data synchronization line.
[0046] The cloud service fault handling method includes:
[0047] Step 110: In response to the user request, the user request is allocated to the master server and the slave server according to the preset data allocation ratio.
[0048] In this embodiment, after a user initiates a request, the server responds by allocating the resolved user request to the master server and slave servers according to a preset data allocation ratio using the DNS (Domain Name System) allocation method. In some embodiments, the data allocation ratio is modified based on the allocation frequency of the master and slave servers in historical allocations, and the data allocation ratio can be obtained through training on the fluctuation range of actual requests.
[0049] Step 120: In response to the user request, the master server and the slave server synchronize database data.
[0050] In this embodiment, when a user request is assigned to the master server, but the user needs to operate on data in the slave server, and the master database has not yet synchronized the data, the user needs to synchronize the data to the master database through the synchronization data line, so as to synchronize the data of the master server and the slave server databases.
[0051] Step 130: When database data synchronization failure is detected, analyze the reasons for the data synchronization failure.
[0052] In this embodiment, when a database data synchronization failure is detected, the cause of the failure is analyzed. The causes include synchronization data line failure and high bandwidth pressure on the synchronization data line. When the cause of the data synchronization failure is a synchronization data line failure, it is impossible to synchronize the database data between the master server and the slave server via the synchronization data line. When the cause of the data synchronization failure is high bandwidth pressure on the synchronization data line, it can lead to frequent data synchronization operations or untimely data synchronization.
[0053] Step 140: When the reason for the failure of data synchronization is a failure of the synchronization data line, a temporary data line is constructed so that the master server and the slave server can complete the database data synchronization based on the temporary data line.
[0054] In this embodiment, when the data synchronization fails due to a fault in the synchronization data line, it is impossible to synchronize the database data of the master server and the slave server through the synchronization data line. In this case, a temporary data line needs to be built between the master database and the slave database. The master server accesses the slave server through the temporary data line, thereby synchronizing the database data of the master server and the slave server.
[0055] In the above embodiments, in response to user requests, the user requests are allocated to the master server and slave server according to a preset data allocation ratio. In response to user requests, the master server and slave server perform database data synchronization. When a database data synchronization failure is detected, the cause of the failure is analyzed. If the cause of the data synchronization failure is a faulty synchronization data line, a temporary data line is constructed, enabling the master server and slave server to complete database data synchronization based on the temporary data line. Thus, by analyzing the cause of data synchronization failure and then synchronizing the database data of the master server and slave server through a temporary data line, the occurrence of service problems caused by failure to synchronize master and slave database data in a timely manner due to synchronization data line failure is effectively reduced, ensuring the integrity and accuracy of the service.
[0056] In one embodiment, the method further includes:
[0057] When the reason for data synchronization failure is not a fault in the synchronization data line, determine whether the synchronization data line is in a congested state.
[0058] When the synchronization data line is congested, the data allocation ratio requested by the user is readjusted.
[0059] Based on the readjusted data allocation ratio, the user requests are redistributed to the master server and the slave server.
[0060] In one embodiment, the step of constructing a temporary data line, enabling the master server and the slave server to synchronize database data based on the temporary data line, includes:
[0061] Construct a temporary data line and determine whether the temporary data line is congested.
[0062] When the temporary data line is not congested, the master server is controlled to access the slave server through the temporary data line to complete database data synchronization.
[0063] In this embodiment, after the temporary data line is constructed, the usage of the temporary data line needs to be detected. That is, it is necessary to determine whether the temporary data line is in a congested state. When the temporary data line is not in a congested state, it indicates that the temporary data line is in normal use. Then, the master server is controlled to access the slave server through the temporary data line to complete the database data synchronization.
[0064] In one embodiment, the method further includes:
[0065] When the temporary data line is congested, an identifier is attached to the user request. The identifier is used to indicate the target server that the user request is assigned when it is re-initiated. The target server is either a master server or a slave server.
[0066] Based on the identifier, the user request is assigned to the target server;
[0067] Based on the public network, the data corresponding to the user request is stored in the database of the target server, thereby completing the database data synchronization.
[0068] In this embodiment, when the temporary data line is congested, experiencing excessive bandwidth pressure or network interruption, the user request needs to be re-initiated to prevent data from not being synchronized to the master and slave databases. In this embodiment, an identifier is attached to the user request to indicate the target server to which the re-initiated user request should be assigned. The target server can be either a master or slave server. The identifier is resolved using DNS to obtain the target server for the user request, and the user request is assigned to the target server. The target server stores the requested data in its corresponding database. Subsequently, the user request is forwarded via the public network in response to the data synchronization request, thereby achieving database data synchronization.
[0069] In one embodiment, the step of determining whether a data line is congested includes:
[0070] Obtain the values of relevant parameters characterizing the usage of the data line, and compare the values of the relevant parameters characterizing the usage of the data line with corresponding thresholds;
[0071] When the value of the relevant parameter representing the usage of the data line is greater than the corresponding threshold, it is determined that the data line is in a congested state.
[0072] In this embodiment, when the data synchronization failure is not due to a fault in the synchronization data line, it is determined whether the synchronization data line is congested. Specifically, the values of relevant parameters characterizing the usage of the synchronization data line are obtained, and these values are compared with corresponding thresholds. When the value of the relevant parameter characterizing the usage of the synchronization data line is greater than the corresponding threshold, the data allocation ratio of the user request is readjusted. Based on the readjusted data allocation ratio, the user request is redistributed to the master server and the slave server.
[0073] In this embodiment, when the data synchronization failure is not due to a fault in the synchronization data line (i.e., the cause is high bandwidth pressure on the synchronization data line), it can lead to frequent synchronization operations or untimely data synchronization. In this case, the usage of the synchronization data line needs to be monitored. Specifically, if the master server accesses the slave database via the synchronization data line at a significantly higher frequency than at other times, or vice versa, the usage of the synchronization data line is abnormal and can be considered as high bandwidth pressure. In this embodiment, the values of relevant parameters characterizing the usage of the synchronization data line are compared with corresponding thresholds. When the value of the relevant parameter characterizing the usage of the synchronization data line exceeds the corresponding threshold, the data allocation ratio of user requests (i.e., the DNS allocation ratio) is adjusted. Based on the adjusted data allocation ratio, user requests are redistributed to the master and slave servers. In some embodiments, a portion of the requests allocated to the master server is allocated to the slave server to improve the average service response speed while alleviating dedicated line pressure and ensuring service robustness.
[0074] In this embodiment, the step of constructing a temporary data line to enable database data synchronization between the master server and the slave server based on the temporary data line includes:
[0075] Construct a temporary data line, obtain the values of relevant parameters characterizing the usage of the temporary data line, and compare the values of the relevant parameters characterizing the usage of the temporary data line with corresponding thresholds;
[0076] When the value of the relevant parameter representing the usage of the temporary data line is less than the corresponding threshold, the master server is controlled to access the slave server through the temporary data line to complete the database data synchronization.
[0077] In this embodiment, after the temporary data line is constructed, the usage of the temporary data line needs to be detected. Therefore, the values of the relevant parameters representing the usage of the temporary data line are compared with the corresponding thresholds. When the values of the relevant parameters representing the usage of the temporary data line are less than the corresponding thresholds, it indicates that the temporary data line is in normal use. Then, the master server is controlled to access the slave server through the temporary data line to complete the database data synchronization.
[0078] In some embodiments, when the master server accesses the slave server through a temporary data line, the operations involved include querying or modifying. If the operation involved is a query, the value of the relevant parameter (such as bandwidth pressure) representing the usage of the temporary data line is relatively small, and the database data synchronization between the master server and the slave server is performed through the temporary data line. If the operation involved is a modification, the value of the relevant parameter (such as bandwidth pressure) representing the usage of the temporary data line is relatively large, but still less than the corresponding threshold, and the database data synchronization between the master server and the slave server is also performed through the temporary data line.
[0079] In one embodiment, the method further includes:
[0080] When the value of the relevant parameter characterizing the usage of the temporary data line is greater than or equal to the corresponding threshold, an identifier is attached to the user request. The identifier is used to indicate the target server assigned when the user request is re-initiated. The target server is either a master server or a slave server.
[0081] Based on the identifier, the user request is assigned to the target server;
[0082] Based on the public network, the data corresponding to the user request is stored in the database of the target server, thereby completing the database data synchronization.
[0083] In this embodiment, when the value of the relevant parameter characterizing the usage of the temporary data line is greater than or equal to the corresponding threshold, indicating excessive bandwidth pressure or network interruption on the temporary data line, the user request needs to be re-initiated to avoid data not being synchronized to the master and slave databases. In this embodiment, an identifier is attached to the user request to indicate the target server to be allocated to the re-initiated user request. The target server can be either a master or slave server. After resolving the identifier via DNS to obtain the target server to be allocated to the user request, the user request is assigned to the target server. The target server stores the user request data in its corresponding database. Subsequently, the user request is forwarded via the public network in response to the data synchronization request, thereby achieving database data synchronization.
[0084] In some embodiments, an identifier is attached to the user request, indicating that the target server for the re-initiated user request is a master server. The user request is then assigned to the master server via DNS. After the master server stores the user request data in the master database, it sends a data synchronization request to the public network, forwarding the user request to the slave server via the public network. The slave server then stores the user request data in its slave database, thereby achieving database data synchronization. Alternatively, in some embodiments, an identifier is attached to the user request, indicating that the target server for the re-initiated user request is a slave server. The user request is then assigned to the slave server via DNS. After the slave server stores the user request data in its slave database, it sends a data synchronization request to the public network, forwarding the user request to the master server via the public network. The master server then stores the user request data in its master database, thereby achieving database data synchronization.
[0085] In some embodiments, when an identifier is attached to a user request, the target server assigned to the re-initiated user request can be either a primary server or a secondary server, regardless of the server assigned to the most recent user request. That is, when the server assigned to the most recent user request is a primary server, when an identifier is attached to the user request, the identifier can indicate whether it is assigned to the primary server or to the secondary server.
[0086] In some embodiments, to facilitate subsequent statistics on the frequency of access to the master server and slave server, the DNS allocation ratio is modified according to the access frequency. Preferably, when the server most recently assigned to a user request is the master server, an identifier is attached to the user request. This identifier indicates that the user request should be assigned to the slave server. That is, when the server most recently assigned to a user request is the master server, the target server is the slave server. The user request is assigned to the slave server through DNS. After the slave server stores the user request data in the slave database, it sends a data synchronization request to the public network. The user request is forwarded to the master server through the public network, and then the master server stores the user request data in the master database, thereby realizing database data synchronization. Similarly, when the server most recently assigned to a user request is a slave server, an identifier is attached to the user request. This identifier indicates that the user request should be assigned to the master server. In other words, when the server most recently assigned to a user request is a slave server, the target server is the master server. The user request is assigned to the master server via DNS. After the master server stores the user request data in the master database, it sends a data synchronization request to the public network. The user request is then forwarded to the slave server via the public network, and the slave server stores the user request data in the slave database, thereby achieving database data synchronization.
[0087] In one embodiment, the step of constructing a temporary data line, enabling the master server and the slave server to synchronize database data based on the temporary data line, includes:
[0088] The temporary data line is constructed based on a temporary virtual private network;
[0089] The master server is controlled to access the slave server through the temporary data line to complete database data synchronization.
[0090] In this embodiment, a temporary VPN (Virtual Private Network) entry point is set up in the cloud service system. A temporary data line is built using the temporary VPN entry point. The master server is controlled to access the slave server through the temporary data line by means of temporary authorization in order to obtain data information from the slave database, thereby completing the database data synchronization.
[0091] In one embodiment, prior to the step of synchronizing database data between the master server and the slave server in response to the user request, the method further includes:
[0092] Based on the user identity information corresponding to the user request, determine the processing order of each user request;
[0093] According to the processing order of the user requests, each user request is responded to and assigned to a corresponding server, which is either a master server or a slave server.
[0094] In this embodiment, because the temporary data lines constructed by the temporary virtual private network are less stable than synchronous data lines, their service response speed is reduced. Therefore, it is necessary to determine the processing order of each user request based on the user identity information corresponding to the user request. That is, each user request is sorted according to priority, and the user requests are responded to according to the processing order, so as to prioritize and synchronize the user requests with higher priority and allocate the user requests to the corresponding servers. In some embodiments, when a more serious failure occurs, such as when the value of the relevant parameter characterizing the usage of the temporary data line (e.g., bandwidth pressure) is large but still less than the corresponding threshold, the temporary data line has a certain bandwidth pressure. Therefore, it is possible to prioritize and synchronize or only allow the processing and synchronization of the user requests with higher priority.
[0095] It should be understood that, although Figure 1The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0096] Example 2
[0097] In this embodiment, as Figure 4 As shown, a cloud service fault handling method is provided, including:
[0098] When a user initiates a request, the resolved request is allocated to services S1 and S2 according to a certain ratio using DNS allocation. If a request is assigned to service S1 but requires operation on data in service S2, and database D1 on service S1 has not yet synchronized this data, the data will be operated on and synchronized to both databases D1 and D2 via a synchronization data line, continuing the subsequent process to complete the user's request. The cloud service system is deployed on cloud servers S1 and S2 in a master-slave dual-active configuration. The cloud service system has a temporary VPN entry point, allowing access to the other database through temporary authorization. Database D1 of service S1 and database D2 of service S2 are connected via a synchronization data line, and data synchronization is performed after certain commands or time slices are triggered. Specifically, when the master server is S1, the slave server is S2; when the master server is S2, the slave server is S1.
[0099] In this embodiment, it is assumed that cloud service S1 is the master server and cloud service S2 is the slave server, and the databases deployed on them are also divided into master and slave databases. The faults described here all take the example of DNS resolving user requests to service S1. If DNS resolves to service S2, the same applies.
[0100] In this embodiment, when the bandwidth pressure of the synchronization data line is high, the synchronization data operation is frequent, or the data synchronization is not timely, the usage of the dedicated line is first detected. That is, if the frequency of service S1 accessing database D2 through the dedicated line is significantly higher than at other times during a certain period, or the frequency of service S1 accessing D2 is much higher than the frequency of service S2 accessing D1, it indicates that the DNS resolution allocation is unreasonable. The DNS allocation ratio is modified by the script, and some of the requests allocated to server S1 are allocated to server S2, thereby improving the average service response speed, alleviating the pressure on the dedicated line, and ensuring the robustness of the service.
[0101] In this embodiment, when the synchronization data line fails and data cannot be synchronized via the dedicated line, if service S1 detects that it cannot access the data in database D2 via the dedicated line, it can use some preset temporary encryption schemes (such as the user information initiating the request, the token, and whether the temporary VPN conditions of the service are met). Specifically, based on the user identity information corresponding to the user request, the processing order of each user request is determined, that is, each user request is sorted according to priority, and the response control of user requests is performed according to the processing order of user requests, so as to prioritize and synchronize the user requests that are sorted first (high priority). A temporary data line is built through the temporary VPN entry point to synchronize the database data of service S1 and service S2 through the temporary data line. After the synchronization data line is repaired, the temporary data line is closed. Among them, database access behavior is divided into two cases: query and modification (such as adding / deleting / modifying). If it is only a query, it does not involve changing the database content; if it is an addition / deleting / modifying, it involves modifying the database content, and the operation consumes more time than the query, putting more pressure on the dedicated line bandwidth. In addition, the authorization information of the temporary data line is persisted in the server's cache. When the authorization information of the temporary data line is persisted and the dedicated line fails, service S1 directly accesses service S2 through the temporary data line to synchronize the databases of service S1 and service S2. When the authorization information of the temporary data line is persisted and the dedicated line is normal, the temporary data line is shut down.
[0102] After establishing a temporary data line, its usage is monitored. If the temporary data line experiences excessive bandwidth pressure or network interruption, an identifier is added to the user request, and the request is re-initiated. Once the DNS resolves to the identifier, the request is redirected to the corresponding server (assuming it's assigned to S2). S2 then operates on D2, forwarding the data synchronization request to S1 via the public network. S1 then stores the requested user data in D1, thus achieving database data synchronization. It should be noted that this method does not cover system-related failures, which can be resolved through configuration restarts or similar methods.
[0103] In this embodiment, service issues caused by network outages on the dedicated line during active-active deployment of services, which prevent timely synchronization of data between the master and slave databases, can be avoided, ensuring the integrity and accuracy of the service. During the active-active deployment of cloud services, when a synchronization data line fails, the fault type of the dedicated line is analyzed using data analysis methods. Temporary data lines are built, and the DNS resolution allocation ratio is adjusted to adjust the access strategy of the slave service, enabling successful data acquisition / operation while ensuring the service's response speed and stability.
[0104] Example 3
[0105] In this embodiment, as Figure 2 As shown, a cloud service fault handling device is provided, comprising:
[0106] The request allocation module 210 is used to respond to user requests and allocate the user requests to the master server and the slave server according to a preset data allocation ratio.
[0107] Synchronization module 220 is used to synchronize database data between the master server and the slave server in response to the user request;
[0108] The fault acquisition module 230 is used to analyze the cause of the data synchronization failure when a database data synchronization failure is detected.
[0109] The control module 240 is used to construct a temporary data line when the reason for the failure of data synchronization is a failure of the synchronization data line, so that the master server and the slave server can complete the database data synchronization based on the temporary data line.
[0110] In one embodiment, the cloud service fault handling device further includes:
[0111] The dedicated line judgment module is used to determine whether the synchronization data line is in a congested state when the reason for the data synchronization failure is not a fault in the synchronization data line.
[0112] The ratio adjustment module is used to readjust the data allocation ratio requested by the user when the synchronous data line is congested.
[0113] The reallocation module is used to reallocate the user request to the master server and the slave server according to the readjusted data allocation ratio.
[0114] In one embodiment, the control module 240 includes:
[0115] The first construction unit is used to construct a temporary data line and determine whether the temporary data line is in a congested state.
[0116] The control unit is used to control the master server to access the slave server through the temporary data line to complete database data synchronization when the temporary data line is not congested.
[0117] In one embodiment, the control module 240 further includes:
[0118] The identification unit is used to attach an identifier to the user request when the temporary data line is congested. The identifier is used to indicate the target server to which the user request is assigned when it is re-initiated. The target server is either a master server or a slave server.
[0119] An allocation unit is configured to allocate the user request to the target server based on the identifier;
[0120] The storage unit is used to store the data corresponding to the user request to the database of the target server via the public network, thereby completing the database data synchronization.
[0121] In one embodiment, the cloud service fault handling device further includes:
[0122] A comparison unit is used to obtain the values of relevant parameters characterizing the usage of the data line, and compare the values of the relevant parameters characterizing the usage of the data line with corresponding thresholds;
[0123] The judgment unit is used to determine that the data line is in a congested state when the value of the relevant parameter representing the usage of the data line is greater than the corresponding threshold.
[0124] In one embodiment, the control module 240 further includes:
[0125] The second construction unit is used to construct the temporary data line based on the temporary virtual private network;
[0126] The synchronization unit is used to control the master server to access the slave server through the temporary data line to complete database data synchronization.
[0127] In one embodiment, the cloud service fault handling device further includes:
[0128] The sequence determination unit is used to determine the processing order of each user request based on the user identity information corresponding to the user request.
[0129] A response control unit is used to respond to each user request according to the processing order of the user requests, and to assign the user requests to the corresponding servers, wherein the servers are either master servers or slave servers.
[0130] Example 4
[0131] Based on the above embodiments, this embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the above embodiments.
[0132] In some embodiments of this example, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the steps of the method described in the above embodiments.
[0133] In some embodiments of this example, a computer program product is provided, including a computer program / instructions, characterized in that the computer program, when executed by a processor, implements the steps of the method described in the above embodiments.
[0134] The processor may include, but is not limited to, one or more processors or microprocessors. Each processor may be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic component, for executing the methods in the above embodiments.
[0135] Computer-readable storage media can be implemented by any type of volatile or non-volatile storage device or a combination thereof. Computer-readable storage media may include, but are not limited to, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, and computer storage media (e.g., hard disks, floppy disks, solid-state drives, removable disks, CD-ROMs, DVD-ROMs, Blu-ray discs, etc.).
[0136] Computer-readable storage media may also store at least one computer-executable program / instruction, such as computer-readable instructions. Computer-readable storage media include, but are not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Computer-readable storage media may include, for example, read-only memory (ROM), hard disk, flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions stored on the computer-readable storage medium, the various methods described above can be performed.
[0137] In addition, the computer device may include (but is not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (e.g., keyboard, mouse, speakers, etc.).
[0138] The processor can communicate with external devices via the I / O bus through wired or wireless networks.
[0139] In one embodiment, the at least one computer-executable instruction may also be compiled into or comprise a software product / computer program product, wherein one or more computer-executable instructions are executed by a processor to perform the steps of the various functions and / or methods in the embodiments described herein.
[0140] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0141] It should be noted that, in this disclosure, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element limited by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0142] While the embodiments disclosed herein are as described above, the foregoing content is merely for the purpose of facilitating understanding of this disclosure and is not intended to limit this disclosure. Any person skilled in the art to which this disclosure pertains may make any modifications and changes in form and detail of the implementation without departing from the spirit and scope of this disclosure; however, the scope of patent protection of this disclosure shall still be determined by the scope defined in the appended claims.
Claims
1. A cloud service fault handling method, applied to a cloud service system, characterized in that, The cloud service system includes a master server with a master database and slave servers with slave databases. The master server and the slave servers synchronize database data through a synchronization data line. The method includes: In response to a user request, the user request is allocated to the master server and the slave server according to a preset data allocation ratio; In response to the user request, the master server and the slave server synchronize database data; When a database data synchronization failure is detected, analyze the reasons for the failure. When the data synchronization fails due to a fault in the synchronization data line, a temporary data line is constructed so that the master server and the slave server can complete database data synchronization based on the temporary data line.
2. The cloud service fault handling method according to claim 1, characterized in that, The method further includes: When the reason for data synchronization failure is not a fault in the synchronization data line, determine whether the synchronization data line is in a congested state. When the synchronization data line is congested, the data allocation ratio requested by the user is readjusted. Based on the readjusted data allocation ratio, the user requests are redistributed to the master server and the slave server.
3. The cloud service fault handling method according to claim 1, characterized in that, The step of constructing a temporary data line, enabling the master server and the slave server to synchronize database data based on the temporary data line, includes: Construct a temporary data line and determine whether the temporary data line is congested. When the temporary data line is not congested, the master server is controlled to access the slave server through the temporary data line to complete database data synchronization.
4. The cloud service fault handling method according to claim 3, characterized in that, The method further includes: When the temporary data line is congested, an identifier is attached to the user request. The identifier is used to indicate the target server that the user request is assigned when it is re-initiated. The target server is either a master server or a slave server. Based on the identifier, the user request is assigned to the target server; Based on the public network, the data corresponding to the user request is stored in the database of the target server, thereby completing the database data synchronization.
5. The cloud service fault handling method according to any one of claims 2-4, characterized in that, The steps to determine if a data line is congested include: Obtain the values of relevant parameters characterizing the usage of the data line, and compare the values of the relevant parameters characterizing the usage of the data line with corresponding thresholds; When the value of the relevant parameter representing the usage of the data line is greater than the corresponding threshold, it is determined that the data line is in a congested state.
6. The cloud service fault handling method according to claim 1, characterized in that, The step of constructing a temporary data line, enabling the master server and the slave server to synchronize database data based on the temporary data line, includes: The temporary data line is constructed based on a temporary virtual private network; The master server is controlled to access the slave server through the temporary data line to complete database data synchronization.
7. The cloud service fault handling method according to claim 1, characterized in that, The number of user requests is multiple; Before the step of synchronizing database data between the master server and the slave server in response to the user request, the method further includes: Based on the user identity information corresponding to the user request, determine the processing order of each user request; According to the processing order of the user requests, each user request is responded to and assigned to a corresponding server, which is either a master server or a slave server.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program / instructions, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Double-link double-server voice dispatching system and redundant backup method
CN103944697A
Message processing method and device
CN110855465A