CN113973117A - Data access method, gateway device, server and data access system - Google Patents
Data access method, gateway device, server and data access system Download PDFInfo
- Publication number
- CN113973117A CN113973117A CN202010709857.6A CN202010709857A CN113973117A CN 113973117 A CN113973117 A CN 113973117A CN 202010709857 A CN202010709857 A CN 202010709857A CN 113973117 A CN113973117 A CN 113973117A
- Authority
- CN
- China
- Prior art keywords
- server
- access request
- data
- service
- target data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 76
- 230000004044 response Effects 0.000 claims abstract description 35
- 238000012544 monitoring process Methods 0.000 claims abstract description 5
- 238000004590 computer program Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 description 23
- 230000001360 synchronised effect Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 9
- 230000008439 repair process Effects 0.000 description 8
- 238000012795 verification Methods 0.000 description 6
- 239000000284 extract Substances 0.000 description 5
- 238000006243 chemical reaction Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000011144 upstream manufacturing Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Hardware Redundancy (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a data access method, gateway equipment, a server and a data access system, wherein the data access method comprises the following steps: the method comprises the steps that gateway equipment receives a first access request sent by a client; sending the first access request to a second server to acquire service data generated by the second server according to the first access request; when monitoring that the second server fails to respond to the first access request, the gateway equipment sends the first access request to the first server, and the first server synchronizes service data generated by the second server after the second server is online in response to the received access request; and feeding back the received service data generated by the first server according to the first access request to the client. By the data access method, the gateway equipment, the server and the data access system, the problem of client access failure caused by various potential faults at the beginning of server upgrading can be solved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a data access method, gateway equipment, a server and a data access system.
Background
The server is a device for providing various data service for the client, and when the service requirement changes, the server is generally required to be upgraded to adapt to the new service requirement of the client. However, at the beginning of bringing a new server online, there are often various potential failures that may gradually show up in the course of the server processing a particular service. When a server fails, the access request of the client may not be processed normally, thereby causing a problem of failed access of the client. Therefore, at the beginning of the on-line of the server, the problem of client access failure is easily caused due to the existence of various potential faults.
Disclosure of Invention
Embodiments of the present invention provide a data access method, a gateway device, a server, and a data access system, so as to solve a problem of a client access failure caused by various potential failures at the beginning of server upgrade.
In order to solve the technical problems, the specific implementation scheme of the invention is as follows:
in a first aspect, an embodiment of the present invention provides a data access method, including:
the method comprises the steps that gateway equipment receives a first access request sent by a client;
sending the first access request to a second server to acquire service data generated by the second server according to the first access request; the second server synchronizes first service data of the first server, wherein the first service data is generated by the first server in response to the received access request before the second server is on line;
when monitoring that the second server fails to respond to the first access request, the gateway equipment sends the first access request to the first server, and the first server synchronizes service data generated by the second server after the second server is online in response to the received access request;
and feeding back the received service data generated by the first server according to the first access request to a client.
In a second aspect, an embodiment of the present invention further provides a data access method, including:
a second server receives a first access request sent by gateway equipment, wherein the first access request is sent by a gateway equipment receiving client;
responding to the received first access request, and generating second service data;
and sending the second service data to the gateway equipment, and feeding the second service data back to the client by the gateway equipment.
In a third aspect, an embodiment of the present invention further provides a gateway device, including:
the first receiving module is used for receiving a first access request sent by a client;
the first sending module is used for sending the first access request to a second server so as to acquire service data generated by the second server according to the first access request; the second server synchronizes first service data of the first server, wherein the first service data is generated by the first server in response to the received access request before the second server is on line;
the second sending module is further configured to send the first access request to the first server when it is monitored that the second server fails to respond to the first access request, and the first server synchronizes service data, generated by the second server after the second server is online and in response to the received access request;
and the first feedback module is used for feeding back the received service data generated by the first server according to the first access request to the client.
In a fourth aspect, an embodiment of the present invention further provides a second server, including:
the second receiving module is used for receiving a first access request sent by gateway equipment, wherein the first access request is sent by a receiving client of the gateway equipment;
the first generation module is used for responding to the received first access request and generating second service data;
and the second feedback module is used for sending the second service data to the gateway equipment, and the gateway equipment feeds the second service data back to the client.
In a fifth aspect, an embodiment of the present invention further provides a data access system, including a first server, the gateway device, and the second server.
In a sixth aspect, an embodiment of the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the data access method.
In a seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the data access method.
In the embodiment of the invention, after the second server is on line, the second service data generated on the second server is synchronized to the first server, wherein the first server is an old server, so that the first server can respond to the access request of the client when the second server fails because the first server keeps the same service data as the second server, thereby ensuring that the access request of the client is responded, and further improving the success rate of the client accessing the server.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a flow chart of a data access method provided by an embodiment of the invention;
FIG. 2 is a schematic structural diagram of a data access system provided by an embodiment of the present invention;
FIG. 3 is a flow chart illustrating a service data synchronization process according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a process of verifying a service of a second server according to an embodiment of the present invention;
FIG. 5 is a second flowchart of a data access method provided by the embodiment of the invention;
fig. 6 is a structural diagram of a gateway device provided in an embodiment of the present invention;
fig. 7 is a structural diagram of a second server provided in the embodiment of the present invention;
fig. 8 is a block diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a data access method. Referring to fig. 1, fig. 1 is a flowchart of a data access method according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
All access requests of the client can be routed through the gateway device, that is, the gateway device forwards the request of the client to the corresponding server. Meanwhile, the gateway device may also send a feedback result generated by the server in response to the access request to the client, so as to complete an interaction process between the client and the server.
The first access request may be any one of access requests received by the gateway device after the second server is online, and the first access request may be any one of various services that the second server may process.
102, sending the first access request to a second server to acquire service data generated by the second server according to the first access request; and the second server synchronizes first service data of the first server, wherein the first service data is generated by the first server in response to the received access request before the second server is on line.
The first server may be an old server, the second server may be a new server, and both the first server and the second server may respond to an access request from a client to generate corresponding service data.
The first business data may refer to all business data held by the first server during the service provided to the client, and may include all data related to a specific business process, such as all order information submitted by the client, personal information of the user, user point information, user member information, and the like, for example. Before the second server is on-line, the first service data held 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.
The specific synchronization process for synchronizing the first service data to the second server may be that the first server sends the first service data to the second server, or that data is extracted from the first server through an intermediate medium and the extracted data is sent to the second server. For example, a data warehouse may be disposed between the first server and the second server, the data warehouse extracts the first business data from the first server, and synchronizes the first business data to the second server.
In addition, since the first server and the second server are different data sources, there is usually a large difference in the format of data between the different data sources. Therefore, after the data warehouse extracts the first service data from the first server, the data warehouse may perform format conversion on the first service data, so that the format-converted first service data can be identified by the second server.
The aforementioned extracting, by the data warehouse, the first service data from the first server may be performed by the data warehouse when the first server is in an offline state, so that resources of the first server in a working state may be prevented from being occupied by the extracting of the first service data.
Specifically, the received access request may be sent to the second server by the gateway device in the case that it is determined that the second server meets the online condition, and the second server responds to the access request of the client instead of the first server. In this step, after sending the access request to the second server, the second server will generate second service data based on the received access request, so as to respond to the access request of the client.
The second service data may refer to all service data newly added on the basis of the first service data during the period of providing the service to the client after the second server is online. The specific process of synchronizing the second service data from the second server to the first server is similar to the process of synchronizing the first service data from the first server to the second server, and is not repeated here to avoid repetition.
In addition, after the second server generates a set of second service data based on the access request of the client each time, the second service data may be synchronized to the first server, or all the second service data generated on the second server in the time period may be synchronized to the first server at intervals of a preset time period, which is not limited herein.
Specifically, when the second server fails to respond to the first access request, the first access request which fails to respond is sent to the first server, so that the first server responds to the second server request, and the service effect under the condition that the second server fails to respond is improved. The synchronizing, by the first server, the service data generated by the second server in response to the received access request after the second server comes online may be: and synchronizing the second service data to the first server.
And step 104, feeding back the received service data generated by the first server according to the first access request to a client.
When the first server receives the first access request sent by the gateway device, the first server holds the same service data as the second server, and therefore the first server can respond to the first access request and generate the service data corresponding to the first access request. After generating the service data corresponding to the first access request, the first server sends the service data to the gateway device, and then the gateway device feeds the service data back to the client, so that the access process of the client is completed.
In this embodiment, after the second server comes online, the second service data generated on the second server is synchronized to the first server, where the first server is an old server, so that, because the first server holds the same service data as the second server, when the second server fails, the first server can respond to the access request of the client, thereby ensuring that the access request of the client is responded, and further improving the success rate of the client accessing the server.
Optionally, after the gateway device sends the first access request to the first server, the method further includes:
the gateway equipment receives first target data generated by the first server according to the first access request;
and sending 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 performing data repair on the second server by the second server based on the first access request and the first target data.
In order to avoid the recurrence of such errors, an error record may be generated on the second server, so that a manager may view the error data. After checking error data, a manager can manually adjust parameters to repair the reason of the error, and continuously iterate by taking the first access request as the input of the second server after parameter adjustment until the second server outputs the first target data, so that the second server is determined to be repaired. Of course, after the second server generates the error data, the second server may automatically invoke a repair program to reset the relevant parameters of the second server, for example, a restart program may be invoked to restart the second server, and after the relevant parameters of the second server are automatically reset, the step of taking the first access request as the input of the second server after parameter adjustment may be automatically performed, and iteration is continuously performed until the second server outputs the first target data.
It should be understood that after the first target data is acquired, the first target data may be format-converted so that the second server may identify the first target data after format conversion, and then repair the second server based on the first access request and the first target data after format conversion until the second server succeeds in responding to the first access request. The second server may be iteratively repaired with the first access request as an input until the second server outputs the first target data.
It should be noted that after the first access request is sent to the first server, if the gateway device receives another access request, the gateway device may send the received another access request to the second server and the second server responds to the another access request, or of course, may temporarily send another access request to the first server, and the first server responds, and then sends another subsequently received access request to the second server after the second server responds to the first access request successfully, and of course, during the repair of the second server, the new service data generated in the first server may be synchronized to the second server by the data repository.
In addition, the above-mentioned repair process may also be performed by the data warehouse, specifically, the data warehouse may extract the first target data from the first server, and then, after the gateway device sends the first access request to the second server, extract, by the data warehouse, the business data generated by the second server in response to the first access request. Comparing, by the data warehouse, 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 is successful in responding to the first access request, and when the data warehouse determines that the second server fails in responding to the first access request, continuing, by the second server, iterative repairing of the problem until the second server is successful in responding to the first access request.
Optionally, before the second server comes online, the method further includes:
the gateway equipment sends a second access request to the first server and the second server respectively under the condition of receiving the second access request;
acquiring second target data and third target data, wherein the second target data is data generated by the first server responding to the second access request, and the third target data is data generated by the second server responding to the second access request;
determining that a second service of the second server meets an online condition under the condition that the second target data is matched with the third target data, wherein the second service is a service requested to be accessed by the second access request;
and under the condition that N services of the second server all meet an online condition, determining 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 comprise the second service.
Specifically, the first server may respond to the client's access request before the second server meets the online condition. Meanwhile, the function of the part of the service developed by the second server can be checked based on the response result of the first server, so as to determine whether the part of the service developed by the second server meets the on-line condition. For example, after the second server completes development of the second service, when the gateway device receives a second access request, the second access request may be simultaneously sent to the first server and the second server, and the first server and the second server respectively respond to the second access request, where second target data generated by the first server in response to the second access request may be returned to the requesting client as a response result of the second access request, and meanwhile, the second target data may also be used as verification data to verify third target data generated by the second server in response to the second access request, so as to verify the service developed by the second server while responding to the client request.
It should be noted that, before sending the second access request to the second server, the service data held on the first server should be synchronized to the second server to ensure that the first server and the second server hold the same service data, so as to facilitate checking the functions of the developed part of the second server. For example, when the service data in the first server is synchronized to the second server for the first time, all the service data on the first server may be extracted by the data warehouse, and the extracted all the service data is subjected to format conversion and then transmitted to the second server, and then the newly added service data may be extracted from the first server in the form of incremental data and synchronized to the second server, that is, the newly added service data of the first server in the time period may be extracted and synchronized to the first server at intervals of a preset time period.
In specific implementation, a list may be set on the second server to record all services that the second server may provide, and when a certain service is successfully verified, an identifier may be set at a location in the list corresponding to the service to identify that the service has met the online condition. When all the services in the list are successfully verified, a prompt message can be sent to the client to prompt that the second server meets the online condition, so that the user can conveniently online the second server in time.
In addition, gradual online of the second server can be realized by gradually replacing various services in the first server with various services in the second server. After the check of one service in the second server is completed and the service is determined to meet the online condition, the service is online in advance, when the subsequent gateway equipment receives a request corresponding to the service, the request is directly sent to the second server, and the second server responds to the request, so that the development of a certain function is completed, namely the service is put into use. And determining that the second server meets the online condition until all the N services of the second server are online, and meanwhile, gradually replacing the services of the first server by the second server in the process.
It should be noted that, when the first server and the second server provide services for the client at the same time, the newly added service data on the two servers should be synchronized at intervals.
Optionally, after the second target data and the third target data are obtained, the method further includes:
and under the condition that the second target data and the third target data are not matched, sending the second target data to the second server until the second server responds to the second access request to generate third target data matched with the second target data.
Specifically, in a case that the second target data and the third target data do not match, it indicates that the second server fails to respond to the second access request, in this case, the second server may be repaired based on the second access request and the second target data until the second server generates 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 is not repeated here in order to avoid repetition.
Optionally, after the second server is online, if the second server fails to respond to the access request within a preset time period, it is determined that the second server can work independently, and at this time, the proxy of the gateway device for the access request may be cancelled, that is, the client may directly send the access request to the second server to request for accessing the related service of the second server. Meanwhile, under the condition, the service data of the second server does not need to be synchronized to the first server, namely, the first server can be completely offline, so that the waste of resources is avoided. The preset time period may be a time period manually set based on practical experience, for example, half a month or a month.
Please refer to fig. 2, which is a schematic structural diagram of a server upgrade system established to implement the method in the present application, wherein the gateway devices are respectively connected to the first server and the second server, 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 of the client, the access request can be forwarded to the first server and/or the second server, and the data warehouse can realize the synchronization of the business data between the first server and the second server. Referring to fig. 3, fig. 3 is a schematic flow chart illustrating a process of synchronizing the service data in the first server to the second server, and it can be seen from the diagram that the service data in the first server is firstly imported into the data warehouse by the offline scheduling task, and then the offline task in the data warehouse is exported to the second server, so that the process of synchronizing the service data in the first server to the second server is completed.
Fig. 4 is a schematic flow chart illustrating a process of verifying the developed service in the second server before the second server is online. The specific process is as follows: the gateway equipment synchronizes the received access request to a first server, the first server generates verification data after responding to the access request, a data warehouse extracts the verification data and stores the verification data in a second server, then the gateway equipment asynchronously sends the access request to the second server, the second server responds to the access request to generate data to be verified, whether the data to be verified is correct or not is determined by comparing the data to be verified with the verification data, and under the condition that the data to be verified is correct, the service corresponding to the access request is determined to be in line with the condition; and under the condition that the data to be verified is incorrect, recording the data to be verified to an error list, repairing a second server based on the access request and the verification data until the second server successfully responds to the access request, and at the moment, determining that the service corresponding to the access request meets an online condition.
Referring to fig. 5, fig. 5 is a data access method according to an embodiment of the present invention, including:
Optionally, after the sending of the second service data, the method further includes:
receiving a first access request sent by gateway equipment;
under the condition that the first access request fails to be responded, first target data sent by gateway equipment are received, wherein the first target data are data generated by a first server according to the first access request;
and repairing based on the first access request and the first target data until the first access request is responded successfully.
Optionally, before the second server meets an online condition, the method further includes:
receiving a second access request sent by the gateway equipment;
generating third target data based on the second access request;
determining that a second service of a second server meets an online condition under the condition that the third target data is matched with second target data, wherein the second target data is data generated by the first server in response to the second access request, and the second service is a service requested to be accessed by the second access request;
and under the condition that N services of the second server all meet an online condition, determining 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 comprise the second service.
Optionally, after generating the third target data based on the second access request, the method further includes:
and under the condition that the third target data is not matched with the second target data, repairing based on the second access request and the second target data until third target data matched with the second target data is generated in response to the second access request.
The data access method provided by the embodiment of the present invention can implement each process of the second server in the above embodiments, and is not described here again to avoid repetition.
The data access method provided by the embodiment of the invention is applied to a first server and comprises the following steps:
and receiving second synchronous data sent by the gateway equipment.
Optionally, after receiving the second synchronization data sent by the gateway device, the method further includes:
receiving a first access request sent by gateway equipment;
and generating first target data according to the first access request.
Optionally, after receiving the second synchronization data sent by the gateway device, the method further includes:
receiving a second access request;
generating second target data according to the second access request
The data access method provided by the embodiment of the present invention can implement each process of the first server in the above embodiments, and is not described herein again to avoid repetition.
Referring to fig. 6, fig. 6 is a structural diagram of a gateway device 600 according to an embodiment of the present invention. As shown in fig. 6, the gateway apparatus 600 includes:
a first receiving module 601, configured to receive a first access request sent by a client;
a first sending module 602, configured to send the first access request to a second server, so as to obtain service data generated by the second server according to the first access request; the second server synchronizes first service data of the first server, wherein the first service data is generated by the first server in response to the received access request before the second server is on line;
a second sending module 603, configured to send the first access request to the first server when it is monitored that the second server fails to respond to the first access request, where the first server synchronizes service data, generated by the second server after the second server is online and in response to the received access request;
a first feedback module 604, configured to feed back the received service data generated by the first server according to the first access request to the client.
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;
the first sending module 602 is further configured to send the first target data to the second server until the second server succeeds in generating the first target data in response to the first access request, and the second server performs data recovery on the second server based on the first access request and the first target data.
Optionally, the gateway device 600 further includes:
a third sending module, configured to send a second access request to the first server and the second server respectively when the second access request is received;
an obtaining module, configured to obtain second target data and third target data, where 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;
a determining module, configured to determine that a second service of the second server meets an online condition when the second target data is matched with the third target data, where the second service is a service requested to be accessed by the second access request;
the determining module is further configured to determine that the second server meets an online condition when all N services of the second server meet the online condition, where N is greater than or equal to 1, and the N services of the second server include the second service.
Optionally, the first sending module 602 is further configured to, in a case that the second target data and the third target data do not match, send the second target data to the second server until the second server generates third target data matching the second target data in response to the second access request.
The gateway device 600 provided in the embodiment of the present invention can implement each process in the foregoing method embodiments, and is not described here again to avoid repetition.
The gateway device 600 provided by the embodiment of the present invention includes a first receiving module 601, configured to receive a first access request sent by a client; a first sending module 602, configured to send the first access request to a second server, so as to obtain service data generated by the second server according to the first access request; the second server synchronizes first service data of the first server, wherein the first service data is generated by the first server in response to the received access request before the second server is on line; a second sending module 603, configured to send the first access request to the first server when it is monitored that the second server fails to respond to the first access request, where the first server synchronizes service data, generated by the second server after the second server is online and in response to the received access request; a first feedback module 604, configured to feed back the received service data generated by the first server according to the first access request to the client. After the second server is online, second service data generated on the second server is synchronized to the first server, wherein the first server is an old server, and thus, the first server maintains the same service data as the second server, so that when the second server fails, the first server can respond to the access request of the client, the access request of the client is ensured to be responded, and the success rate of the client accessing the server is further improved.
Referring to fig. 7, fig. 7 is a structural diagram of a second server 700 according to an embodiment of the present invention. As shown in fig. 7, the second server 700 includes:
a second receiving module 701, configured to receive a first access request sent by a gateway device, where the first access request is sent by a client received by the gateway device;
a first generating module 702, configured to generate second service data in response to the received first access request;
a second feedback module 703, configured to send the second service data to the gateway device, where the gateway device feeds the second service data back to the client.
The embodiment of the invention also provides a service upgrading system which comprises the first server, the gateway equipment and the second server.
Referring to fig. 8, fig. 8 is a structural diagram of an electronic device according to another embodiment of the present invention, and as shown in fig. 8, a server upgrading apparatus includes: the service interface flow control apparatus 800 includes: a processor 801, a memory 802 and a computer program stored on the memory 802 and operable on the processor, the various components in the data transmission device 800 being coupled together by a bus interface 803, the computer program when executed by the processor 801 implementing the steps of:
the method comprises the steps that gateway equipment receives a first access request sent by a client;
sending the first access request to a second server to acquire service data generated by the second server according to the first access request; the second server synchronizes first service data of the first server, wherein the first service data is generated by the first server in response to the received access request before the second server is on line;
when monitoring that the second server fails to respond to the first access request, the gateway equipment sends the first access request to the first server, and the first server synchronizes service data generated by the second server after the second server is online in response to the received access request;
and feeding back the received service data generated by the first server according to the first access request to a client.
Optionally, after the gateway device sends the first access request to the first server, the method further includes:
the gateway equipment receives first target data generated by the first server according to the first access request;
and sending 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 performing data repair on the second server by the second server based on the first access request and the first target data.
Optionally, before the second server comes online, the method further includes:
the gateway equipment sends a second access request to the first server and the second server respectively under the condition of receiving the second access request;
acquiring second target data and third target data, wherein the second target data is data generated by the first server responding to the second access request, and the third target data is data generated by the second server responding to the second access request;
determining that a second service of the second server meets an online condition under the condition that the second target data is matched with the third target data, wherein the second service is a service requested to be accessed by the second access request;
and under the condition that N services of the second server all meet an online condition, determining 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 comprise the second service.
Optionally, after the second target data and the third target data are obtained, the method further includes:
and under the condition that the second target data and the third target data are not matched, sending the second target data to the second server until the second server responds to the second access request to generate third target data matched with the second target data.
An embodiment of the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements the processes of the foregoing method embodiments, and can achieve the same technical effects, and details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the processes of the method embodiments, and can achieve the same technical effects, and in order to avoid repetition, the details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
1. A method of data access, comprising:
the method comprises the steps that gateway equipment receives a first access request sent by a client;
sending the first access request to a second server to acquire service data generated by the second server according to the first access request; the second server synchronizes first service data of the first server, wherein the first service data is generated by the first server in response to the received access request before the second server is on line;
when monitoring that the second server fails to respond to the first access request, the gateway equipment sends the first access request to the first server, and the first server synchronizes service data generated by the second server after the second server is online in response to the received access request;
and feeding back the received service data generated by the first server according to the first access request to a client.
2. The method of claim 1, wherein after the gateway device sends the first access request to the first server, the method further comprises:
the gateway equipment receives first target data generated by the first server according to the first access request;
and sending the first target data to the second server until the second server responds to the first access request to generate the first target data.
3. The method of claim 2, wherein before the second server comes online, the method further comprises:
the gateway equipment sends a second access request to the first server and the second server respectively under the condition of receiving the second access request;
acquiring second target data and third target data, wherein the second target data is data generated by the first server responding to the second access request, and the third target data is data generated by the second server responding to the second access request;
determining that a second service of the second server meets an online condition under the condition that the second target data is matched with the third target data, wherein the second service is a service requested to be accessed by the second access request;
and under the condition that N services of the second server all meet an online condition, determining 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 comprise the second service.
4. The method of claim 3, wherein after the obtaining the second target data and the third target data, the method further comprises:
and under the condition that the second target data and the third target data are not matched, sending the second target data to the second server until the second server responds to the second access request to generate third target data matched with the second target data.
5. A method of data access, comprising:
a second server receives a first access request sent by gateway equipment, wherein the first access request is sent by a gateway equipment receiving client;
responding to the received first access request, and generating second service data;
and sending the second service data to the gateway equipment so that the gateway equipment feeds the second service data back to the client.
6. A gateway device, comprising:
the first receiving module is used for receiving a first access request sent by a client;
the first sending module is used for sending the first access request to a second server so as to acquire service data generated by the second server according to the first access request; the second server synchronizes first service data of the first server, wherein the first service data is generated by the first server in response to the received access request before the second server is on line;
the second sending module is further configured to send the first access request to the first server when it is monitored that the second server fails to respond to the first access request, and the first server synchronizes service data, generated by the second server after the second server is online and in response to the received access request;
and the first feedback module is used for feeding back the received service data generated by the first server according to the first access request to the client.
7. A second server, comprising:
the second receiving module is used for receiving a first access request sent by gateway equipment, wherein the first access request is sent by a receiving client of the gateway equipment;
the first generation module is used for responding to the received first access request and generating second service data;
and the second feedback module is used for sending the second service data to the gateway equipment, and the gateway equipment feeds the second service data back to the client.
8. A data access system comprising a first server, a gateway device according to claim 6 and a second server according to claim 7.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the data access method of any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the data access method according to claims 1 to 5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010709857.6A CN113973117B (en) | 2020-07-22 | 2020-07-22 | Data access method, gateway device, server and data access system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010709857.6A CN113973117B (en) | 2020-07-22 | 2020-07-22 | Data access method, gateway device, server and data access system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113973117A true CN113973117A (en) | 2022-01-25 |
| CN113973117B CN113973117B (en) | 2024-11-22 |
Family
ID=79584817
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010709857.6A Active CN113973117B (en) | 2020-07-22 | 2020-07-22 | Data access method, gateway device, server and data access system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113973117B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116506229A (en) * | 2023-06-28 | 2023-07-28 | 北京域信科技有限公司 | Data access method and device and electronic equipment |
Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2012146000A1 (en) * | 2011-04-29 | 2012-11-01 | 中兴通讯股份有限公司 | Data transmission method and system |
| US20130219006A1 (en) * | 2012-02-21 | 2013-08-22 | Sony Corporation | Multiple media devices through a gateway server or services to access cloud computing service storage |
| CN105306605A (en) * | 2015-12-09 | 2016-02-03 | 北京中电普华信息技术有限公司 | Double host server system |
| CN107592199A (en) * | 2017-08-30 | 2018-01-16 | 北京奇艺世纪科技有限公司 | A kind of method and system of data syn-chronization |
| CN107872824A (en) * | 2017-11-22 | 2018-04-03 | 深圳市信锐网科技术有限公司 | A kind of wireless service processing method, device, equipment and storage medium |
| CN107911238A (en) * | 2017-11-13 | 2018-04-13 | 郑州云海信息技术有限公司 | One kind is based on IPSAN servers two unit standby method and system |
| CN108390781A (en) * | 2018-02-12 | 2018-08-10 | 王磊 | A kind of method and system of the automatic Hot Spare of host |
| CN109189854A (en) * | 2018-08-14 | 2019-01-11 | 新华三技术有限公司成都分公司 | The method and node device of sustained traffic are provided |
| CN110768848A (en) * | 2019-10-31 | 2020-02-07 | 杭州迪普科技股份有限公司 | Method and device for switching main server and standby server |
| CN111405599A (en) * | 2020-03-16 | 2020-07-10 | 成都西加云杉科技有限公司 | Wireless controller fault switching method, system, electronic equipment and storage medium |
| CN111427728A (en) * | 2019-12-31 | 2020-07-17 | 杭州海康威视数字技术股份有限公司 | State management method, main/standby switching method and electronic equipment |
-
2020
- 2020-07-22 CN CN202010709857.6A patent/CN113973117B/en active Active
Patent Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2012146000A1 (en) * | 2011-04-29 | 2012-11-01 | 中兴通讯股份有限公司 | Data transmission method and system |
| US20130219006A1 (en) * | 2012-02-21 | 2013-08-22 | Sony Corporation | Multiple media devices through a gateway server or services to access cloud computing service storage |
| CN105306605A (en) * | 2015-12-09 | 2016-02-03 | 北京中电普华信息技术有限公司 | Double host server system |
| CN107592199A (en) * | 2017-08-30 | 2018-01-16 | 北京奇艺世纪科技有限公司 | A kind of method and system of data syn-chronization |
| CN107911238A (en) * | 2017-11-13 | 2018-04-13 | 郑州云海信息技术有限公司 | One kind is based on IPSAN servers two unit standby method and system |
| CN107872824A (en) * | 2017-11-22 | 2018-04-03 | 深圳市信锐网科技术有限公司 | A kind of wireless service processing method, device, equipment and storage medium |
| CN108390781A (en) * | 2018-02-12 | 2018-08-10 | 王磊 | A kind of method and system of the automatic Hot Spare of host |
| CN109189854A (en) * | 2018-08-14 | 2019-01-11 | 新华三技术有限公司成都分公司 | The method and node device of sustained traffic are provided |
| CN110768848A (en) * | 2019-10-31 | 2020-02-07 | 杭州迪普科技股份有限公司 | Method and device for switching main server and standby server |
| CN111427728A (en) * | 2019-12-31 | 2020-07-17 | 杭州海康威视数字技术股份有限公司 | State management method, main/standby switching method and electronic equipment |
| CN111405599A (en) * | 2020-03-16 | 2020-07-10 | 成都西加云杉科技有限公司 | Wireless controller fault switching method, system, electronic equipment and storage medium |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116506229A (en) * | 2023-06-28 | 2023-07-28 | 北京域信科技有限公司 | Data access method and device and electronic equipment |
| CN116506229B (en) * | 2023-06-28 | 2023-09-12 | 北京域信科技有限公司 | Data access method and device and electronic equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113973117B (en) | 2024-11-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10592402B2 (en) | Automated integration testing with mock microservices | |
| US8589909B2 (en) | Techniques for reducing down time in updating applications with metadata | |
| CN106027644B (en) | Service verification method and system | |
| CN113687858B (en) | Configuration file checking method and device, electronic equipment and storage medium | |
| CN110727575A (en) | Information processing method, system, device and storage medium | |
| CN105262608A (en) | Monitoring method and monitoring device for network service | |
| CN112631908A (en) | Browser page testing method and device, computer equipment and storage medium | |
| CN112948195A (en) | Interface testing method and device, electronic equipment and storage medium | |
| CN105791249A (en) | Third-party application processing method, device and system | |
| CN112650689A (en) | Test method, test device, electronic equipment and storage medium | |
| CN110737548B (en) | Data request method and server | |
| CN113973117B (en) | Data access method, gateway device, server and data access system | |
| CN118921216B (en) | Method for non-national-density browser to access national-density website and national-density website access system | |
| CN113094281A (en) | Hybrid App testing method and device | |
| WO2024169385A1 (en) | Cluster deployment method and apparatus, and device, medium and product | |
| CN112925544B (en) | Method and device for updating application program, electronic equipment and computer storage medium | |
| CN111857679A (en) | Method and device for generating script program and script program processing system | |
| CN115390861A (en) | Resource deployment method, device and equipment and storage medium | |
| CN108170557B (en) | Method and apparatus for outputting information | |
| CN114065159A (en) | Server and application login method | |
| CN113098936A (en) | Method, device and equipment for pushing message to mobile terminal | |
| CN118827486B (en) | Session message protocol verification method and device, storage medium and computer equipment | |
| CN117075871A (en) | Method, device, equipment and storage medium for generating calling code of application program interface | |
| CN116132276B (en) | Operating system replacement method, device, electronic device and readable storage medium | |
| CN119201265B (en) | Module loading method, device, electronic device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |