Data access method, gateway device, server and data access system

By synchronizing business data and forwarding access requests in the early stage of server upgrade, the client access failure caused by potential failure is solved, and the access success rate is improved.

CN113973117BActive Publication Date: 2024-11-22MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010709857.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-22
Publication Date
2024-11-22
Estimated Expiration
2040-07-22

AI Technical Summary

Technical Problem

In the early stage of server upgrade, the existence of potential failures may lead to client access failure.

Method used

By synchronizing the service data of the first server before the second server goes online, and forwarding the access request to the first server when the second server fails, ensuring the response of the client access request.

Benefits of technology

This improves the success rate of client accessing the server, ensures the response to access requests, and can handle client requests normally even if the second server fails.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113973117B_ABST
    Figure CN113973117B_ABST
Patent Text Reader

Abstract

The present invention provides a data access method, a gateway device, a server and a data access system, the data access method comprising: the gateway device receives a first access request sent by a client; sends the first access request to a second server to obtain the business data generated by the second server according to the first access request; when the gateway device detects that the second server fails to respond to the first access request, the first access request is sent to the first server, and the first server synchronizes the business data generated by the second server in response to the received access request after going online; and feeds back the received business data generated by the first server according to the first access request to the client. The data access method, gateway device, server and data access system provided by the present invention can solve the problem of client access failure caused by the existence of various potential faults at the beginning of server upgrade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data access method, a gateway device, a server and a data access system. Background Art

[0002] The server is a device that provides various data business services to the client. When business needs change, the server usually needs to be upgraded to adapt to the new business needs of the client. However, when a new server is first launched, there are usually various potential faults. In the process of the server processing specific business, various potential faults may gradually appear. When the server fails, it may not be able to process the client's access request normally, which will lead to the problem of client access failure. It can be seen that when the server is first launched, due to the existence of various potential faults, it is easy to cause the problem of client access failure. Summary of the invention

[0003] The embodiment of the present invention provides a data access method, a gateway device, a server and a data access system to solve the problem of client access failure caused by various potential faults at the beginning of server upgrade.

[0004] In order to solve the above technical problems, the specific implementation scheme of the present invention is as follows:

[0005] In a first aspect, an embodiment of the present invention provides a data access method, comprising:

[0006] The gateway device receives a first access request sent by the client;

[0007] Sending the first access request to the second server to obtain the business data generated by the second server according to the first access request; the second server synchronizes the first business data of the first server, where the first business data is the business data generated by the first server in response to the received access request before the second server goes online;

[0008] When the gateway device detects that the second server fails to respond to the first access request, the gateway device sends the first access request to the first server, and the first server synchronizes the service data generated by the second server in response to the received access request after the second server goes online;

[0009] The received service data generated by the first server according to the first access request is fed back to the client.

[0010] In a second aspect, an embodiment of the present invention further provides a data access method, comprising:

[0011] The second server receives a first access request sent by the gateway device, where the first access request is sent by the client and received by the gateway device;

[0012] In response to the received first access request, generate second service data;

[0013] The second service data is sent to the gateway device, and the gateway device feeds back the second service data to the client.

[0014] In a third aspect, an embodiment of the present invention further provides a gateway device, including:

[0015] A first receiving module, used for receiving a first access request sent by a client;

[0016] A first sending module is used to send the first access request to the second server to obtain the business data generated by the second server according to the first access request; the second server synchronizes the first business data of the first server, the first business data being the business data generated by the first server in response to the received access request before the second server goes online;

[0017] The second sending module is further configured to send the first access request to the first server when it is detected that the second server fails to respond to the first access request, and the first server synchronizes the service data generated by the second server in response to the received access request after going online;

[0018] The first feedback module is used to feed back the received business data generated by the first server according to the first access request to the client.

[0019] In a fourth aspect, an embodiment of the present invention further provides a second server, including:

[0020] A second receiving module, configured to receive a first access request sent by a gateway device, where the first access request is received by the gateway device from a client;

[0021] A first generating module, configured to generate second service data in response to the received first access request;

[0022] The second feedback module is used to send the second service data to the gateway device, and the gateway device feeds back the second service data to the client.

[0023] In a fifth aspect, an embodiment of the present invention further provides a data access system, comprising a first server, the gateway device and the second server.

[0024] In a sixth aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned data access method when executed by the processor.

[0025] In the seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and the computer program implements the steps of the above-mentioned data access method when executed by a processor.

[0026] In an embodiment of the present invention, after the second server comes online, the second business data generated on the second server is synchronized to the first server, wherein the first server is an old server. In this way, since the first server retains the same business data as the second server, when the second server fails, the first server can respond to the client's access request, thereby ensuring that the client's access request is responded to, thereby improving the success rate of the client's access to the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0028] Figure 1 It is one of the flow charts of the data access method provided by the embodiment of the present invention;

[0029] Figure 2 is a structural diagram of a data access system provided by an embodiment of the present invention;

[0030] Figure 3 is a flowchart of a business data synchronization process in an embodiment of the present invention;

[0031] Figure 4 is a flow chart of a process of verifying the service of the second server in an embodiment of the present invention;

[0032] Figure 5 This is the second flow chart of the data access method provided by the embodiment of the present invention;

[0033] Figure 6 is a structural diagram of a gateway device provided by an embodiment of the present invention;

[0034] Figure 7 is a structural diagram of a second server provided in an embodiment of the present invention;

[0035] Figure 8 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] 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.

[0037] The embodiment of the present invention provides a data access method. Figure 1 , Figure 1 is a flow chart of a data access method provided by an embodiment of the present invention, such as Figure 1 As shown, the following steps are included:

[0038] Step 101: A gateway device receives a first access request sent by a client.

[0039] Among them, all access requests from the client can be routed through the gateway device, that is, the gateway device forwards the client's request to the corresponding server. At the same time, the gateway device can also send the feedback result generated by the server in response to the access request to the client to complete the interaction process between the client and the server.

[0040] The first access request may be any access request received by the gateway device after the second server goes online, and the first access request may be any type of service among the various types of services that can be processed by the second server.

[0041] Step 102: Send the first access request to the second server to obtain the business data generated by the second server according to the first access request; the second server synchronizes the first business data of the first server, and the first business data is the business data generated by the first server in response to the received access request before the second server goes online.

[0042] The first server may be an old server, and the second server may be a new server. Both the first server and the second server may respond to the access request of the client and generate corresponding business data.

[0043] The first business data mentioned above may refer to all business data retained by the first server during the period of providing services to the client, for example, all order information submitted by the client, user personal information, user points information, user membership information and other data related to specific business processing. Before the second server goes online, the first business data retained in the first server is synchronized to the second server so that the second server can take over the first server to respond to the access request of the upstream client.

[0044] The specific synchronization process of synchronizing the first business data to the second server may be that the first server sends the first business data to the second server, or extracts data from the first server through an intermediate medium and sends the extracted data to the second server. For example, a data warehouse may be set between the first server and the second server, and the data warehouse extracts the first business data from the first server and synchronizes the first business data to the second server.

[0045] In addition, since the first server and the second server are different data sources, and the formats of data between different data sources are usually quite different, after extracting the first business data from the first server, the data warehouse can convert the format of the first business data so that the first business data after the format conversion can be recognized by the second server.

[0046] The extraction of the first business data from the first server by the data warehouse may be performed when the first server is offline. This avoids occupying the resources of the first server in working state due to the extraction of the first business data.

[0047] Specifically, when it is determined that the second server meets the online condition, the gateway device sends the received access request to the second server, and the second server replaces the first server to respond to the client's access request. In this step, after sending the access request to the second server, the second server will generate second business data based on the received access request to respond to the client's access request.

[0048] The second business data may refer to all business data newly added on the basis of the first business data during the period of providing services to the client after the second server is online. The specific process of synchronizing the second business data from the second server to the first server is similar to the process of synchronizing the first business data from the first server to the second server, and will not be described again to avoid repetition.

[0049] In addition, each time the second server generates a set of second business data based on an access request from the client, the second business data can be synchronized to the first server. Alternatively, at every preset time period, all second business data generated on the second server within the time period can be synchronized to the first server. There is no limitation on this.

[0050] Step 103: When the gateway device detects that the second server fails to respond to the first access request, the first access request is sent to the first server, and the first server synchronizes the business data generated by the second server in response to the received access request after going online.

[0051] Specifically, when the second server fails to respond to the first access request, the first access request that failed to respond is sent to the first server, so that the first server can respond to the second server request, thereby improving the service effect when the second server fails to respond. The first server synchronizing the business data generated by the second server in response to the received access request after going online can refer to: synchronizing the second business data to the first server.

[0052] Step 104: Feedback the received business data generated by the first server according to the first access request to the client.

[0053] When the first server receives the first access request sent by the gateway device, since the first server holds the same business data as the second server, the first server can respond to the first access request and generate business data corresponding to the first access request. After generating the business data corresponding to the first access request, the first server sends the business data to the gateway device, and then the gateway device feeds back the business data to the client, thereby completing the client's access process.

[0054] In this implementation, after the second server comes online, the second business data generated on the second server is synchronized to the first server, wherein the first server is the old server. Thus, since the first server retains the same business data as the second server, when the second server fails, the first server can respond to the client's access request, thereby ensuring that the client's access request is responded to, thereby improving the success rate of the client's access to the server.

[0055] Optionally, after the gateway device sends the first access request to the first server, the method further includes:

[0056] The gateway device receives first target data generated by the first server according to the first access request;

[0057] The first target data is sent to the second server until the second server successfully generates the first target data in response to the first access request, and the second server performs data repair on the second server based on the first access request and the first target data.

[0058] Among them, since the second server fails to respond to the first access request, in order to avoid such errors from occurring again, an error record can be generated on the second server so that the administrator can view the error data. After viewing the error data, the administrator can manually adjust the parameters to repair the cause of the error, and use the first access request as the input of the second server after the adjustment, and continue to iterate until the second server outputs the first target data, and then determine that the second server has been repaired. Of course, after the second server generates the error data, the second server can automatically call the repair program to reset the relevant parameters of the second server. For example, the restart program can be called to restart the second server. After automatically resetting the relevant parameters of the second server, the first access request can be automatically executed as the input of the second server after the adjustment, and the steps of continuously iterating until the second server outputs the first target data can be performed.

[0059] It should be understood that after obtaining the first target data, the first target data may be formatted so that the second server can recognize the first target data after the format conversion, and then the second server may be repaired based on the first access request and the first target data after the format conversion until the second server successfully responds to the first access request. The first access request may be used as input to iteratively repair the second server until the second server outputs the first target data.

[0060] It should be noted that after sending the first access request to the first server, if the gateway device receives other access requests, the other access requests received can be sent to the second server for the second server to respond to the other access requests. Of course, the other access requests can also be temporarily sent to the first server for the first server to respond to until the second server successfully responds to the first access request, and then the other access requests received subsequently are sent to the second server. Of course, during the repair of the second server, the new business data generated on the first server can be synchronized from the data warehouse to the second server.

[0061] In addition, the above repair process can also be performed by the data warehouse. Specifically, the data warehouse can extract the first target data from the first server, and then, after the gateway device sends the first access request to the second server, the data warehouse extracts the business data generated by the second server in response to the first access request. The data warehouse compares the business data generated by the second server in response to the first access request with the first target data to determine whether the second server responds to the first access request successfully. When the data warehouse determines that the second server fails to respond to the first access request, the second server continues to iteratively repair the problem until the second server responds to the first access request successfully.

[0062] Optionally, before the second server goes online, the method further includes:

[0063] When receiving the second access request, the gateway device sends the second access request to the first server and the second server respectively;

[0064] Acquire second target data and third target data, wherein the second target data is data generated by the first server in response to the second access request, and the third target data is data generated by the second server in response to the second access request;

[0065] In a case where the second target data matches the third target data, determining that the second service of the second server meets an online condition, wherein the second service is the service requested to be accessed by the second access request;

[0066] When all N services of the second server meet the online condition, it is determined that the second server meets the online condition, wherein N is greater than or equal to 1, and the N services of the second server include the second service.

[0067] Specifically, before the second server meets the online conditions, the first server can respond to the client's access request. At the same time, the functional verification of the part of the second service that has been developed can be performed based on the response result of the first server to determine whether the part of the service developed by the second server meets the online conditions. For example, after the second server completes the development of the second service, when the gateway device receives the second access request, the second access request can be sent to the first server and the second server at the same time, and the first server and the second server respond to the second access request respectively, wherein the second target data generated by the first server in response to the second access request can be returned to the requesting client as the response result of the second access request, and at the same time, the second target data can also be used as verification data to verify the third target data generated by the second server in response to the second access request, so as to realize the verification of the service developed by the second server while responding to the client request.

[0068] It should be noted that before sending the second access request to the second server, the business data retained on the first server should be synchronized to the second server to ensure that the first server and the second server retain the same business data, so as to facilitate the verification of the functions of the developed part of the second server. For example, when synchronizing the business data in the first server to the second server for the first time, the data warehouse can extract all the business data on the first server, and transfer all the extracted business data to the second server after format conversion. Subsequently, the newly added business data can be extracted from the first server in the form of incremental data and synchronized to the second server, that is, the newly added business data of the first server within the time period can be extracted and synchronized to the first server at every preset time period.

[0069] In a specific implementation, a list may be set on the second server to record all services that the second server can provide. When a service is successfully verified, an identifier may be set at the position of the corresponding service in the list to indicate that the service has met the online conditions. When all services in the list are successfully verified, a prompt message may be sent to the client to indicate that the second server has met the online conditions, so that the user can bring the second server online in time.

[0070] In addition, the second server can be gradually put online by gradually replacing the services in the first server with the services in the second server. That is, after completing the verification of a service in the second server and determining that the service has met the online conditions, the service will be put online in advance. When the subsequent gateway device receives the request corresponding to the service, it will directly send the request to the second server, and the second server will respond to the request, so as to achieve the development of a certain function and put it into use. Until all N services of the second server are online, it is determined that the second server meets the online conditions. At the same time, in this process, the second server has completed the gradual replacement of various services of the first server.

[0071] It should be noted that when the first server and the second server provide services to the client at the same time, the newly added business data on the two servers should be synchronized at regular intervals.

[0072] Optionally, after acquiring the second target data and the third target data, the method further includes:

[0073] In the case that the second target data and the third target data do not match, the second target data is sent to the second server until the second server generates third target data matching the second target data in response to the second access request.

[0074] Specifically, if the second target data and the third target data do not match, it means that the second server fails to respond to the second access request. In this case, the second server can be repaired based on the second access request and the second target data until the second server generates the third target data matching the second target data in response to the second access request. The specific repair process is similar to the process of "repairing the second server based on the first access request and the first target data until the second server successfully responds to the first access request" described in the above embodiment, and will not be described again to avoid repetition.

[0075] Optionally, after the second server is online, if the second server does not fail to respond to the access request within the preset time, it is determined that the second server can work independently. At this time, the proxy of the access request by the gateway device can be cancelled, that is, the client can directly send the access request to the second server to request access to the relevant services of the second server. At the same time, in this case, there is no need to synchronize the business data of the second server to the first server, that is, the first server can be completely offline to avoid waste of resources. Among them, the preset time can be a time period set artificially based on practical experience, for example, half a month or a month.

[0076] See also Figure 2 , is a schematic diagram of the structure of the server upgrade system established by the present application to implement the above method, wherein the gateway device is connected to the first server and the second server respectively, and the first server and the second server are connected through a data warehouse. In this way, when the gateway device receives an access request from the client, it can be forwarded to the first server and / or the second server, and the data warehouse can synchronize the business data between the first server and the second server. Please refer to Figure 3 , Figure 3 The flowchart for synchronizing the business data in the first server to the second server is shown in the figure. As can be seen from the figure, the business data in the first server is first imported into the data warehouse through offline scheduling tasks, and then the offline tasks in the data warehouse are exported to the second server, thereby completing the process of synchronizing the business data in the first server to the second server.

[0077] See also Figure 4 , is a flowchart of the verification process of the service developed in the second server before the second server goes online. The specific process is as follows: the gateway device synchronizes the received access request to the first server, and the first server generates verification data after responding to the access request. The data warehouse extracts the verification data and stores it in the second server. Then, the gateway device asynchronously sends the access request to the second server, and the second server generates data to be verified in response to the access request. By comparing the data to be verified with the verification data, it is determined whether the data to be verified is correct. If the data to be verified is correct, it is determined that the service corresponding to the access request meets the online conditions; if the data to be verified is incorrect, the data to be verified is recorded in the error list, and the second server is repaired based on the access request and the verification data until the second server responds to the access request successfully. At this time, it is determined that the service corresponding to the access request meets the online conditions.

[0078] See also Figure 5 , Figure 5 A data access method provided by an embodiment of the present invention includes:

[0079] Step 501: A second server receives a first access request sent by a gateway device, where the first access request is sent by a client and received by the gateway device;

[0080] Step 502: Generate second service data in response to the received first access request;

[0081] Step 503: Send the second service data to the gateway device, and the gateway device feeds back the second service data to the client.

[0082] Optionally, after sending the second service data, the method further includes:

[0083] Receiving a first access request sent by a gateway device;

[0084] In the case of failure in responding to the first access request, receiving first target data sent by the gateway device, wherein the first target data is data generated by the first server according to the first access request;

[0085] Repair is performed based on the first access request and the first target data until the first access request is responded to successfully.

[0086] Optionally, before the second server meets the online condition, the method further includes:

[0087] receiving a second access request sent by the gateway device;

[0088] generating third target data based on the second access request;

[0089] In a case where the third target data matches the second target data, determining that the second service of the second server meets the online condition, wherein the second target data is data generated by the first server in response to the second access request, and the second service is the service requested to be accessed by the second access request;

[0090] When all N services of the second server meet the online condition, it is determined that the second server meets the online condition, wherein N is greater than or equal to 1, and the N services of the second server include the second service.

[0091] Optionally, after generating the third target data based on the second access request, the method further includes:

[0092] In the case that the third target data does not match the second target data, repair is performed based on the second access request and the second target data until the third target data matching the second target data is generated in response to the second access request.

[0093] The data access method provided in the embodiment of the present invention can implement each process of the second server in the above embodiment, and will not be described again here to avoid repetition.

[0094] A data access method provided by an embodiment of the present invention is applied to a first server, comprising:

[0095] The second synchronization data sent by the gateway device is received.

[0096] Optionally, after receiving the second synchronization data sent by the gateway device, the method further includes:

[0097] Receiving a first access request sent by a gateway device;

[0098] First target data is generated according to the first access request.

[0099] Optionally, after receiving the second synchronization data sent by the gateway device, the method further includes:

[0100] receiving a second access request;

[0101] Generate second target data according to the second access request

[0102] The data access method provided in the embodiment of the present invention can implement each process of the first server in the above embodiment, and will not be described again here to avoid repetition.

[0103] See also Figure 6 , Figure 6 600 is a structural diagram of a gateway device 600 provided in an embodiment of the present invention. Figure 6 As shown, the gateway device 600 includes:

[0104] A first receiving module 601 is used to receive a first access request sent by a client;

[0105] A first sending module 602 is used to send the first access request to the second server to obtain the business data generated by the second server according to the first access request; the second server synchronizes the first business data of the first server, where the first business data is the business data generated by the first server in response to the received access request before the second server goes online;

[0106] The second sending module 603 is further configured to send the first access request to the first server when it is detected that the second server fails to respond to the first access request, and the first server synchronizes the service data generated by the second server in response to the received access request after going online;

[0107] The first feedback module 604 is used to feed back the received business data generated by the first server according to the first access request to the client.

[0108] Optionally, the first receiving module 601 is further configured to receive first target data generated by the first server according to the first access request;

[0109] The first sending module 602 is further configured to send the first target data to the second server until the second server successfully generates the first target data in response to the first access request, and the second server performs data repair on the second server based on the first access request and the first target data.

[0110] Optionally, the gateway device 600 further includes:

[0111] a third sending module, configured to send the second access request to the first server and the second server respectively when receiving the second access request;

[0112] an acquisition module, configured to acquire second target data and third target data, wherein the second target data is data generated by the first server in response to the second access request, and the third target data is data generated by the second server in response to the second access request;

[0113] a determination module, configured to determine that a second service of the second server meets an online condition when the second target data matches the third target data, wherein the second service is a service requested to be accessed by the second access request;

[0114] The determination module is further used to determine that the second server meets the online condition when all N services of the second server meet the online condition, wherein N is greater than or equal to 1, and the N services of the second server include the second service.

[0115] Optionally, the first sending module 602 is further used to send the second target data to the second server when the second target data and the third target data do not match, until the second server responds to the second access request and generates third target data matching the second target data.

[0116] The gateway device 600 provided in the embodiment of the present invention can implement each process in the above method embodiment, and will not be described again here to avoid repetition.

[0117] The gateway device 600 provided in the embodiment of the present invention includes: a first receiving module 601, which is used to receive a first access request sent by a client; a first sending module 602, which is used to send the first access request to a second server to obtain the business data generated by the second server according to the first access request; the second server synchronizes the first business data of the first server, the first business data being the business data generated by the first server in response to the received access request before the second server goes online; the second sending module 603 is also used to send the first access request to the first server when it is detected that the second server fails to respond to the first access request, the first server synchronizes the business data generated by the second server in response to the received access request after going online; a first feedback module 604, which is used to feedback the received business data generated by the first server according to the first access request to the client. After the second server goes online, the second business data generated on the second server is synchronized to the first server, wherein the first server is an old server. In this way, since the first server retains the same business data as the second server, when the second server fails, the first server can respond to the client's access request, thereby ensuring that the client's access request is responded to, thereby improving the success rate of the client accessing the server.

[0118] See also Figure 7 , Figure 7 is a structural diagram of the second server 700 provided in an embodiment of the present invention. Figure 7 As shown, the second server 700 includes:

[0119] The second receiving module 701 is used to receive a first access request sent by a gateway device, where the first access request is sent by a client and received by the gateway device;

[0120] A first generating module 702, configured to generate second service data in response to the received first access request;

[0121] The second feedback module 703 is configured to send the second service data to the gateway device, and the gateway device feeds back the second service data to the client.

[0122] An embodiment of the present invention further provides a service upgrade system, comprising the first server, the gateway device and the second server.

[0123] See also Figure 8 , Figure 8 is a structural diagram of an electronic device provided by another embodiment of the present invention, such as Figure 8As shown, the server upgrade device includes: the service interface flow control device 800 includes: a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor, and the various components in the data sending device 800 are coupled together through a bus interface 803. When the computer program is executed by the processor 801, the following steps are implemented:

[0124] The gateway device receives a first access request sent by the client;

[0125] Sending the first access request to the second server to obtain the business data generated by the second server according to the first access request; the second server synchronizes the first business data of the first server, where the first business data is the business data generated by the first server in response to the received access request before the second server goes online;

[0126] When the gateway device detects that the second server fails to respond to the first access request, the gateway device sends the first access request to the first server, and the first server synchronizes the service data generated by the second server in response to the received access request after the second server goes online;

[0127] The received service data generated by the first server according to the first access request is fed back to the client.

[0128] Optionally, after the gateway device sends the first access request to the first server, the method further includes:

[0129] The gateway device receives first target data generated by the first server according to the first access request;

[0130] The first target data is sent to the second server until the second server successfully generates the first target data in response to the first access request, and the second server performs data repair on the second server based on the first access request and the first target data.

[0131] Optionally, before the second server goes online, the method further includes:

[0132] When receiving the second access request, the gateway device sends the second access request to the first server and the second server respectively;

[0133] Acquire second target data and third target data, wherein the second target data is data generated by the first server in response to the second access request, and the third target data is data generated by the second server in response to the second access request;

[0134] In a case where the second target data matches the third target data, determining that the second service of the second server meets an online condition, wherein the second service is the service requested to be accessed by the second access request;

[0135] When all N services of the second server meet the online condition, it is determined that the second server meets the online condition, wherein N is greater than or equal to 1, and the N services of the second server include the second service.

[0136] Optionally, after acquiring the second target data and the third target data, the method further includes:

[0137] In the case that the second target data and the third target data do not match, the second target data is sent to the second server until the second server generates third target data matching the second target data in response to the second access request.

[0138] An embodiment of the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0139] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0140] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0141] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0142] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A data access method, characterized in that: include: The gateway device receives a first access request sent by the client; When it is determined that the second server meets the online condition, sending the first access request to the second server to obtain the business data generated by the second server according to the first access request; Before the second server goes online, the second server synchronizes first business data of the first server, where the first business data is business data generated by the first server in response to a received access request before the second server goes online; When the gateway device detects that the second server fails to respond to the first access request, the gateway device sends the first access request to the first server, and the first server synchronizes the service data generated by the second server in response to the received access request after the second server goes online; The received service data generated by the first server according to the first access request is fed back to the client.

2. The method according to claim 1, characterized in that After the gateway device sends the first access request to the first server, the method further includes: The gateway device receives first target data generated by the first server according to the first access request; The first target data is sent to the second server until the second server generates the first target data in response to the first access request.

3. The method according to claim 2, characterized in that Before the second server goes online, the method further includes: When receiving the second access request, the gateway device sends the second access request to the first server and the second server respectively; Acquire second target data and third target data, wherein the second target data is data generated by the first server in response to the second access request, and the third target data is data generated by the second server in response to the second access request; In a case where the second target data matches the third target data, determining that the second service of the second server meets an online condition, wherein the second service is the service requested to be accessed by the second access request; When all N services of the second server meet the online condition, it is determined that the second server meets the online condition, wherein N is greater than or equal to 1, and the N services of the second server include the second service.

4. The method according to claim 3, characterized in that After acquiring the second target data and the third target data, the method further includes: In the case that the second target data and the third target data do not match, the second target data is sent to the second server until the second server generates third target data matching the second target data in response to the second access request.

5. A data access method, characterized in that: include: The second server receives a first access request sent by the gateway device, the first access request is sent by the gateway device when it is received by the client, the first access request is sent when the gateway device determines that the second server meets the online condition, and before the second server goes online, the second server synchronizes the first service data of the first server, the first service data is the service data generated by the first server in response to the received access request before the second server goes online; In response to the received first access request, generate second service data; The second service data is sent to the gateway device, so that the gateway device feeds back the second service data to the client.

6. A gateway device, characterized in that: include: A first receiving module, used for receiving a first access request sent by a client; A first sending module is used to send the first access request to the second server to obtain the service data generated by the second server according to the first access request when it is determined that the second server meets the online condition; Before the second server goes online, the second server synchronizes first business data of the first server, where the first business data is business data generated by the first server in response to a received access request before the second server goes online; The second sending module is further configured to send the first access request to the first server when it is detected that the second server fails to respond to the first access request, and the first server synchronizes the service data generated by the second server in response to the received access request after going online; The first feedback module is used to feed back the received business data generated by the first server according to the first access request to the client.

7. A second server, characterized in that: include: A second receiving module is used to receive a first access request sent by a gateway device, where the first access request is sent by the gateway device and received by the client. The first access request is sent when the gateway device determines that the second server meets the online conditions. Before the second server goes online, the second server synchronizes the first business data of the first server. The first business data is the business data generated by the first server in response to the received access request before the second server goes online. A first generating module, configured to generate second service data in response to the received first access request; The second feedback module is used to send the second service data to the gateway device, and the gateway device feeds back the second service data to the client.

8. A data access system, characterized in that: It comprises a first server, the gateway device as claimed in claim 6 and the second server as claimed in claim 7.

9. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the data access method according to any one of claims 1 to 5 when executed by the processor.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data access method according to any one of claims 1 to 5 are implemented.