Data backup and recovery method, device, equipment and medium

Through the data backup and recovery mechanism of the intermediate proxy server, the problem of complex response failure processing in data exchange between multiple servers is solved, automatic backup and rapid business recovery are realized, development tasks are simplified, and the reliability of data transmission is improved.

CN114138556BActive Publication Date: 2024-09-06BEIJING CHESHANGHUI SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111414106.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2024-09-06
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

When the existing technology handles data exchange between multiple servers, the response result failure processing is complicated, causing developers to spend a lot of time in abnormal request processing and backup recovery, and the business processing results are prone to errors.

Method used

Through the intermediate proxy server, the request and response results are backed up and restored according to business needs. The routing configuration information and message queue mechanism are used to realize automatic backup and restoration of data.

Benefits of technology

It simplifies the development tasks of exception handling and data recovery, improves the reliability of data transmission and rapid business recovery capabilities, and saves development resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114138556B
    Figure CN114138556B
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for data backup and recovery, the method comprising the steps of: obtaining a proxy data service between a first server and a user, and storing routing configuration information in a first database; obtaining a first message queue of a user proxy data service request, searching a second server, and obtaining a second message queue of a response result of the second server; obtaining backup data of the first message queue and the second message queue backed up to a second database based on the first message queue and the second message queue; obtaining the restored backup data of the second database based on the backup data of the second database and the failure type of the user proxy data service request. The present application utilizes proxy technology to back up request and response results through an intermediate server, and can promptly restore the business when the business needs it, thereby saving the development tasks of exception handling and data recovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a method, device, electronic equipment and storage medium for data backup and recovery. Background Art

[0002] In Internet data services, there are more and more cross-server data calls, which requires the transmission and exchange of various data to interact frequently between multiple servers. In the prior art, the data exchange between multiple servers is mainly processed by the Hypertext Transfer Protocol for data transmission. This protocol leads to two types of response failures: one is that the execution is successful but the caller thinks it is a failure due to network reasons, and the other is that the execution is really failed; in order to handle these failure scenarios, developers spend a lot of time processing these abnormal requests; in addition, there is another type where although the request gets a correct response, the business processing result is wrong due to vulnerabilities caused by various reasons. These all require developers to spend a lot of time and energy on backup and recovery solutions.

[0003] Therefore, there is a need for a method that can automatically back up the response results obtained from the request through an intermediate server according to different business needs, and restore the backup data according to business needs. Summary of the invention

[0004] To this end, the present invention provides a method, device, electronic device and storage medium for data backup and recovery, in an effort to solve or at least alleviate at least one of the above problems.

[0005] According to one aspect of the present invention, a method for data backup and recovery is provided. The method backs up request and response results by means of an intermediate proxy server, and recovers the backup data according to business needs. The method comprises the steps of:

[0006] According to the routing configuration information between the user and the first server, the proxy data service between the first server and the user is obtained, and the routing configuration information is stored in the first database, the first server is an intermediate proxy server, the first database is a relational database, and the routing configuration information includes a routing key; according to the proxy data service between the first server and the user, the first message queue of the user proxy data service request is obtained, the second server is searched, and the second message queue of the second server response result is obtained, and the second server is the target server; according to the first message queue and the second message queue, the backup data of the first message queue and the second message queue is obtained by the third server to back up the data to the second database, and the third server is an offline server; according to the backup data of the second database and the failure type of the user proxy data service request, the restored backup data of the second database is obtained.

[0007] Optionally, the step of obtaining a proxy data service between the first server and the user based on the routing configuration information between the user and the first server, and storing the routing configuration information in the first database includes: the user completes the routing configuration information between the user and the first server through a routing information configuration page; based on the completed routing configuration information between the user and the first server, obtaining routing configuration data of the routing configuration information stored in the first database; and constructing a proxy data service between the first server and the user based on the routing configuration data of the routing configuration information stored in the first database.

[0008] Optionally, the step of obtaining a first message queue of a user proxy data service request based on a proxy data service between the first server and the user, searching a second server, and obtaining a second message queue of a response result of the second server includes: obtaining a user proxy data service request sent by the user to the first server based on the proxy data service between the first server and the user; obtaining proxy service information generated by the first server based on the user proxy data service request based on the user proxy data service request sent by the user to the first server, the proxy service information including a request serial number generated by the first server based on the user proxy data service request, and a request message body and a routing key contained in the user proxy data service request; obtaining information of adding the proxy service information to the first message queue based on the proxy service information; adding the proxy service information to the first message queue information based on the proxy service information, obtaining the second server pointed to by the user proxy data service request through the first database search; obtaining a response code and a response result of the second server based on the user proxy data service request through the first database search, and adding the response code and the response result of the second server and the request serial number to the second message queue.

[0009] Optionally, obtaining the restored backup data of the second database based on the backup data of the second database and the failure type of the user agent data service request includes: based on the failure information of the third server extracting the backup data from the second database, the third server automatically recovers the user agent data service request to obtain data from the second server; based on the failure information of the user agent data service request to obtain the backup data of the second database, requesting to manually obtain a response result from the second server through the first server; based on the user request, initiating recovery of the response result of the second server to the user agent data service request of the user through the first server.

[0010] Optionally, based on the failure information of the third server extracting backup data from the second database, the step of the third server automatically restoring the user agent data service request to obtain data from the second server includes: obtaining the failure information of the third server extracting specified backup data from the second database; based on the failure information of the third server extracting the specified backup data from the second database, obtaining the second server pointed to by the routing key of the user agent data service request in the first message queue; based on the second server pointed to by the routing key of the user agent data service request in the first message queue, obtaining the response code and response result of the second server; based on the response code and response result of the second server, obtaining the third server to write the response code and response result of the second server into the second database.

[0011] Optionally, the step of requesting to manually obtain a response result from the second server through the first server based on the failure information of obtaining the backup data of the second database by the user proxy data service request includes: obtaining the failure information of the user's local terminal extracting the backup data from the second database; obtaining the response result information of the user sending to the first server to recover the extraction of the second server pointed to by the user proxy data service request based on the failure information of the user's local terminal extracting the backup data from the second database; obtaining the second server pointed to by the routing key of the user proxy data service request in the first database based on the response result information of the user sending to the first server to recover the extraction of the second server pointed to by the user proxy data service request; obtaining the second server pointed to by the routing key of the user proxy data service request in the first database based on the first server, and obtaining the response code and response result sent by the second server.

[0012] Optionally, based on a user request, the step of recovering a response result of a second server initiating a user proxy data service request to the user through the first server includes: obtaining the proxy data service between the first server and the user, obtaining historical data of the user proxy data service request and the response code and response result thereof pointed to by the second server; based on the user proxy data service request and the response code and response result thereof pointed to by the second server, obtaining the request information of the user to obtain the historical data again; based on the request information of the user to obtain the historical data again, obtaining information of the first server obtaining the second database data through the third server based on the routing key.

[0013] According to another aspect of the present invention, a data backup and recovery device is disclosed, which backs up request and response results by means of an intermediate proxy server, and recovers the backup data according to business needs, the device comprising: a routing configuration module, used to obtain the proxy data service between the first server and the user according to the routing configuration information between the user and the first server, and store the routing configuration information in a first database, the first server is an intermediate proxy server, the first database is a relational database, and the routing configuration information includes a routing key; a data backup module, used to obtain a first message queue of the user proxy data service request according to the proxy data service between the first server and the user, search for a second server, and obtain a second message queue of the second server response result, the second server being a target server; based on the first message queue and the second message queue, obtain the backup data of the first message queue and the second message queue backed up to the second database by a third server, the third server being an offline server; a data recovery module, used to obtain the restored backup data of the second database according to the backup data of the second database and the failure type of the user proxy data service request.

[0014] According to another aspect of the present invention, a computing device is provided, comprising: one or more processors; and a memory; one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods for data backup and recovery as described above.

[0015] According to another aspect of the present invention, a computer-readable storage medium storing one or more programs is provided, wherein the one or more programs include instructions, which, when executed by a computing device, enable the computing device to perform any of the data backup and recovery methods described above.

[0016] According to the data backup and recovery scheme of the present invention, based on the routing configuration information between the user and the first server, the proxy data service between the first server and the user is obtained, and the routing configuration information is stored in the first database; based on the proxy data service between the first server and the user, the first message queue of the user proxy data service request is obtained, the second server is searched, and the second message queue of the second server response result is obtained; based on the first message queue and the second message queue, the backup data of the first message queue and the second message queue backed up to the second database by the third server, the third server is an offline server; based on the backup data of the second database and the failure type of the user proxy data service request, the restored backup data of the second database is obtained. The present application utilizes proxy technology to back up the request and response results through an intermediate server, and the business can be restored in time when the business needs it, thereby saving the development tasks of exception handling and data recovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To achieve the above and related purposes, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The above and other purposes, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout the present disclosure, the same reference numerals generally refer to the same parts or elements.

[0018] Figure 1 A schematic diagram showing the structure of a computing device 100 according to an embodiment of the present invention; and

[0019] Figure 2 A flow chart showing a method 200 for data backup and recovery according to an embodiment of the present invention; and

[0020] Figure 3 A schematic structural diagram of a data backup and recovery device 300 according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0021] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0022] Figure 11 is a block diagram of an example computing device 100. In a basic configuration 102, computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 may be used for communication between processor 104 and system memory 106.

[0023] Depending on the desired configuration, the processor 104 can be any type of processor, including but not limited to: a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. The processor 104 can include one or more levels of cache such as a first-level cache 110 and a second-level cache 112, a processor core 114, and registers 116. An example processor core 114 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An example memory controller 118 can be used with the processor 104, or in some implementations, the memory controller 118 can be an internal part of the processor 104.

[0024] Depending on the desired configuration, the system memory 106 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some embodiments, the application 122 may be arranged to operate on the operating system using the program data 124. In some embodiments, the computing device 100 is configured to perform a method 200 for data backup and recovery, which can back up request and response results by means of an intermediate proxy server, and restore the backup data according to business needs, and the program data 124 includes instructions for executing the method 200.

[0025] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via a network communication link via one or more communication ports 164.

[0026] A network communication link can be an example of a communication medium. The communication medium can generally be embodied as a computer-readable instruction, data structure, program module in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A "modulated data signal" can be a signal in which one or more of its data sets or its changes can be performed in a manner that encodes information in the signal. As a non-limiting example, the communication medium may include a wired medium such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used here may include both storage media and communication media. In some embodiments, one or more programs are stored in a computer-readable medium, and the one or more programs include instructions for executing certain methods, such as according to an embodiment of the present invention, the computing device 100 executes the method 200 of data backup and recovery through the instructions.

[0027] The computing device 100 may be implemented as part of a small-sized portable (or mobile) electronic device, such as a cellular phone, a personal digital assistant (PDA), a personal media player device, a wireless network browsing device, a personal head-mounted device, an application-specific device, or a hybrid device that may include any of the above functions. The computing device 100 may also be implemented as a personal computer including desktop and notebook computer configurations.

[0028] Figure 2 FIG. 2 is a flow chart of a method 200 for data backup and recovery according to an embodiment of the present invention. Figure 2As shown, the method 200 identifies and classes the telephone clue data to filter and process telephone clues of different levels. The method 200 starts at step S210, obtains the proxy data service of the first server and the user according to the routing configuration information of the user and the first server, and stores the routing configuration information in the first database. The first server is an intermediate proxy server, the first database is a relational database, and the routing configuration information includes a routing key.

[0029] Specifically, the user establishes a proxy data service with the first server, and the first server becomes the user's intermediate server. The user can access the corresponding target server through the first server. The routing configuration information used for the first server will be stored in the first database. The first database is a relational database. When the user specifically accesses a server, he first types the address of the server to be accessed, and then accesses the target server through the first server, obtains the response data sent by the target server, and then forwards it to the user. The first server obtains the target server through the routing key in the routing configuration information set by the user.

[0030] Specifically, in one embodiment of the present application, the step of obtaining the proxy data service between the first server and the user based on the routing configuration information between the user and the first server, and storing the routing configuration information in the first database includes:

[0031] The user completes the routing configuration information between the user and the first server through the routing information configuration page; specifically, the routing information configuration page requires the user to configure the following related parameters: routing key, whether to call synchronously, whether the interface of the synchronous call is downgraded, the downgraded interface return value setting, the order service target address, the timeout setting, the content type, etc. After completing the configuration of the corresponding parameters through the routing information configuration page, the routing configuration information can be stored in the first database. Since the first database is a relational database, the relationship between the user and the first server is established. Since the order service target address is set in the routing configuration information, that is, the server that the user needs to access and obtain data, the relationship between the user and the access target server through the intermediate server is also established at this time.

[0032] According to the completed routing configuration information between the user and the first server, the routing configuration data of the routing configuration information is obtained and stored in the first database; specifically, after the routing configuration information between the user and the first server is completed, the routing configuration data of the routing configuration information is stored in the first database, and the relationship between the user and the first server is saved by the first database. At the same time, since the order service target address is set in the routing configuration information, the relationship between the user and the server of the access target through the intermediate server is established. If the routing configuration information between the user and the first server is configured multiple times, it is equivalent to establishing a relationship between the user and multiple servers of the access target through the server. Since the routing keys in the routing configuration information are different, the first server can realize the user's data acquisition of servers of different access targets by first selecting different routing keys.

[0033] According to the routing configuration data storing the routing configuration information in the first database, a proxy data service between the first server and the user is established. Specifically, after the routing configuration is completed and the routing configuration data of the routing configuration information is stored, the proxy data service between the user and the first server is completed, and the user can access and obtain the data of the server of the corresponding access target through the first server.

[0034] Through step S220, according to the proxy data service between the first server and the user, a first message queue of the user proxy data service request is obtained, and a second server is searched to obtain a second message queue of the second server response result, where the second server is the target server.

[0035] Specifically, when a user accesses a database or browses a web page, or performs other data services, the first server first parses the request information sent by the user and generates a unique request serial number. At this time, the first server sends the request serial number, the user's request information body, and the previously set routing key to the first message queue. The message queue is a queue that queues the messages sent by the first server and processes them according to the queue sequence. When the user's request enters the first message queue, it will enter the subsequent processing program according to the execution order of the message queue. After processing the user's request, the corresponding second server can be found according to the routing key added to the message queue. The second server is the user's request. The target server that obtains the corresponding data and can provide the corresponding data service is sought. The target server is the server providing data service to which the user points when sending the request information. After finding the second server, the second server parses the user's request information body, request sequence number and routing key contained in the first message queue, and provides the corresponding data service according to the user's request information body. The corresponding service data is sent to the first server according to the request sequence number and routing key. The first server adds the corresponding data service result to the second message queue according to the request sequence number and routing key. The second message queue is the message queue where the first server provides data distribution to each user. The data in the second message queue is mainly for users.

[0036] Specifically, in one embodiment of the present application, the step of obtaining a first message queue of a user proxy data service request based on the proxy data service between the first server and the user, searching a second server, and obtaining a second message queue of a response result of the second server includes:

[0037] Based on the proxy data service between the first server and the user, a user proxy data service request sent by the user to the first server is obtained; specifically, when the user accesses a server and obtains the corresponding service, the user proxy data service request is first sent to the first server, and the first server directs the corresponding service request to the corresponding server according to the routing key in the user proxy data service request.

[0038] According to the user proxy data service request sent by the user to the first server, proxy service information generated by the first server according to the user proxy data service request is obtained, wherein the proxy service information includes a request sequence number generated by the first server according to the user proxy data service request, and a request message body and a routing key contained in the user proxy data service request; specifically, the request sequence number is a unique sequence number generated by the first server according to the user proxy data service request sent by the user, and the request sequence number is an identification mark of the user's data request service this time. For the user, it may be necessary to send multiple data service requests to a certain server, or to send multiple data service requests to multiple servers. These multiple data service requests are distinguished by the request sequence number. The first server can correctly reply to the user's data service request according to the request sequence number, and send the data returned by the server providing the data service to the user.

[0039] According to the proxy service information, the proxy service information is obtained and added to the first message queue information; specifically, the first server may provide proxy data services to multiple users at the same time, and these users may send multiple user proxy data service requests at the same time. At this time, the first server needs to process these user proxy data service requests in a certain order. The first message queue queues the user proxy data service requests sent by the first server, and transfers the executed user proxy data service requests from the first message queue to a certain area. The unexecuted user proxy data service requests are queued, and the first server executes them one by one according to the order of the user proxy data service requests in the first message queue.

[0040] The first message queue information is added according to the proxy service information, and the second server pointed to by the user proxy data service request is obtained by searching the first database; specifically, since the user proxy data service request contains a routing key, the role of the routing key is to point to the server that needs to provide data service. In this embodiment, the server that provides data service is called the second server. Since multiple second servers are set, a unique second server can be pointed to by the routing key. The data of the user proxy data service request is stored in the second database. Therefore, the routing key contained in the user proxy data service request can be searched through the second database, and the second server pointed to by the user proxy data service request can be found through the routing key.

[0041] According to the user proxy data service request, the second server pointed to is searched through the first database, the response code and response result of the second server are obtained, and the response code and response result of the second server and the request sequence number are added to the second message queue. Specifically, after obtaining the user proxy data service request, the second server parses the request sequence number, the user request message body, the routing key and other information in the user proxy data service request. At this time, the second server generates a response code and provides a corresponding response result according to the user request message body. This response code is equivalent to a sequence number generated for the user proxy data service request. The response code and the request sequence number are one-to-one corresponding. Therefore, the response code can be associated with a certain user proxy data service request of the user, and at the same time, it can correctly point to a certain request of the user. The response result is the data service provided according to the user request message body. After generating the response code and the response result, the second server sends the request sequence number to the first server together. Since the first server may receive data sent by multiple second servers at the same time, it is necessary to queue the data sent by the second server. At this time, the second message queue is required to queue the received data. The first server queues the messages in the second message queue and sends the data sent by the second server to the corresponding users in sequence.

[0042] Through step S230, according to the first message queue and the second message queue, the backup data of the first message queue and the second message queue backed up to the second database by the third server is obtained, and the third server is an offline server.

[0043] Specifically, in order to improve the data processing efficiency of the first server and to ensure the data security of the first server, a dedicated third server and a second database are set up at this time. The third server is an offline server, which provides offline data services, that is, for the data requested by the user, when the second server providing data services is offline and cannot provide data services, the previous data can be obtained through the offline server, that is, offline messages. The second database is to store the data previously provided by the second server, that is, backup data. The data backup of the first message queue and the second message queue is stored in the second database, so that when the user, the first server, or any one or more of the second servers goes down, restarts the service, or the data is interrupted, the data obtained by the previous user proxy data service request can be maintained, and the data can be sent to the user. The existence of the third server and the second database makes the reliability of user data acquisition higher, and at the same time, it also makes the data transmission more secure, so that when the hardware device fails and cannot accurately obtain the requested data, the previously requested data can be quickly obtained after the hardware is restored.

[0044] Through step S240, the restored backup data of the second database is obtained according to the backup data of the second database and the failure type of the user agent data service request.

[0045] Specifically, after the user sends a user proxy data service request, the user can obtain the data of the user proxy data service request from the backup data stored in the second database, thereby realizing data recovery.

[0046] Specifically, in one embodiment of the present application, acquiring the restored backup data of the second database according to the backup data of the second database and the failure type of the user agent data service request includes:

[0047] Based on the failure information of the third server extracting the backup data from the second database, the third server automatically resumes the user proxy data service request to obtain data from the second server; specifically, this failure type is that the second database does not store the backup data sent by the second server obtained by the user proxy data service request. Since there is no backup data, the third server cannot extract the backup data pointed to by the current user proxy data service request from the second database. The possible reason at this time is that the current user proxy data service request is the first time to initiate the data request service, or it may be that the second database backup and the second server failed to send data, and it is necessary to re-obtain the data of the second server for backup.

[0048] According to the failure information of the user proxy data service request to obtain the backup data of the second database, a request is made to manually obtain the response result from the second server through the first server; specifically, this failure type is that the user fails to obtain the backup data of the second database through the third server. If the user needs to re-obtain the backup data that originally needs to be stored in the second database, then the first server needs to find the routing key in the original user proxy data service request based on the data stored in the first database, and find the specified second server to re-obtain the response result sent by the second server.

[0049] Initiate recovery of the response result of the second server to the user proxy data service request of the user through the first server according to the user request. Specifically, this failure type is that the user searches for all the user proxy data service request information of the user and the corresponding response result of the second server through the first server and the routing key in the user proxy data service request of the user. If the user needs to recover a certain user proxy data service request and the corresponding response result of the second server, the user initiates recovery of the user proxy data service request and the corresponding response result of the second server through the first server according to the needs.

[0050] Specifically, in one embodiment of the present application, according to the failure information of the third server to extract the backup data from the second database, the step of the third server automatically restoring the user agent data service request to obtain data from the second server includes:

[0051] Obtaining information that the third server fails to extract specified backup data from the second database; specifically, for example, after a user proxy data service request of a certain user has been completely processed, the response result of the corresponding second server is also stored in the second database. At this time, if the user needs to restore the response result of this user proxy data service request, the backup data of the response result can be obtained from the second database through the third server. At this time, if the third server fails to extract the backup data from the second database, it means that the user proxy data service request of the user has not been completely processed, and possible problems include backup failure. Therefore, if the user needs to restore the response result of this user proxy data service request, it is necessary to resend the request to the corresponding second server.

[0052] Based on the extraction of the failure information of the third server to extract the specified backup data from the second database, the second server pointed to by the routing key of the user proxy data service request in the first message queue is obtained; specifically, the user proxy data service request corresponding to the specified backup data is the data that the user needs to restore, and the backup data does not exist at this time, then it is necessary to find the routing key contained in the user proxy data service request corresponding to the backup data again, search the second server pointed to by the routing key, and re-complete the sending of the user proxy data service request.

[0053] According to the second server pointed to by the routing key of the user agent data service request in the first message queue, the response code and response result of the second server are obtained; specifically, after the second server obtains the user request body of the user agent data service request, it will resend the response code and response result according to the request content.

[0054] According to the response code and response result of the second server, the third server is obtained to write the response code and response result of the second server into the second database. Specifically, the response code and response result of the second server are sent to the second message queue together with the request sequence number of the user agent data service request, and the third server writes the response code and response result of the second server in the second message queue into the second database, completing the data recovery of the user's user agent data service request and completing the backup of the response code and response result of the second server.

[0055] Specifically, in one embodiment of the present application, the step of requesting the user agent data service to obtain the backup data failure information of the second database and requesting to manually obtain the response result from the second server through the first server includes:

[0056] Obtain the failure information of the user's local terminal extracting the backup data from the second database; specifically, the local terminal fails to extract the backup data from the second database, indicating that the backup data specified by the current user proxy data service request extracted by the user does not exist, and the backup data sent by the second server needs to be re-obtained.

[0057] Based on the failure information of the user's local terminal in extracting the backup data from the second database, the response result information of the second server pointed to by the user proxy data service request sent by the user to the first server for restoring the backup data is obtained; specifically, after obtaining the failure information of the user's local terminal in extracting the backup data from the second database, the first server obtains the user proxy data service request of the user to restore the backup data, indicating that the user needs to re-obtain the response result of the second server for the user proxy data service request.

[0058] According to the response result information of the second server pointed to by the user proxy data service request sent to the first server for recovery and extraction, the first server obtains the second server pointed to by the routing key of the user proxy data service request in the first database; specifically, the first server searches for the routing key included in the user proxy data service request in the first database, finds the pointed second server through the routing key, and resends the user proxy data service request to the second server.

[0059] According to the first server, the second server pointed to by the routing key of the user proxy data service request in the first database is obtained, and the response code and response result sent by the second server are obtained. Specifically, after obtaining the user proxy data service request, the second server can provide corresponding service data and generate a response code and response result by obtaining the user request body.

[0060] Specifically, in one embodiment of the present application, the step of recovering the response result of the second server initiating the user agent data service request of the user through the first server according to the user request includes:

[0061] Acquire the proxy data service between the first server and the user, and acquire the historical data of the user proxy data service request and the response code and response result of the second server to which it points;

[0062] Based on the historical data of the user proxy data service request and the response code and response result of the second server to which it points, the request information of the user to obtain the historical data again is obtained; specifically, after obtaining the user proxy data service request and the response code and response result of the second server to which it points, if the result is obtained again, the request information to obtain the historical data again can be initiated.

[0063] According to the request information of the user to obtain the historical data again, the information that the first server obtains the data of the second database through the third server according to the routing key is obtained. Specifically, for the request for obtaining historical data initiated by the user, the third server can search for the backup data in the second database according to the request sequence number in the user proxy data service request in the request for obtaining historical data initiated by the user. If the backup data exists, the backup data can be restored, so that the user can obtain the backed-up historical data.

[0064] According to the data backup and recovery scheme of the present invention, based on the routing configuration information between the user and the first server, the proxy data service between the first server and the user is obtained, and the routing configuration information is stored in the first database; based on the proxy data service between the first server and the user, the first message queue of the user proxy data service request is obtained, the second server is searched, and the second message queue of the second server response result is obtained; based on the first message queue and the second message queue, the backup data of the first message queue and the second message queue backed up to the second database by the third server, the third server is an offline server; based on the backup data of the second database and the failure type of the user proxy data service request, the restored backup data of the second database is obtained. The present application utilizes proxy technology to back up the request and response results through an intermediate server, and the business can be restored in time when the business needs it, thereby saving the development tasks of exception handling and data recovery.

[0065] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0066] In one embodiment, Figure 3 As shown, a data backup and recovery device 300 is provided. The device 300 backs up request and response results through an intermediate proxy server, and restores the backup data according to business needs. The device 300 includes: a routing configuration module, a data backup module, and a data recovery module.

[0067] A routing configuration module, used to obtain the proxy data service between the first server and the user according to the routing configuration information between the user and the first server, and store the routing configuration information in the first database, wherein the first server is an intermediate proxy server, the first database is a relational database, and the routing configuration information includes a routing key;

[0068] A data backup module is used to obtain a first message queue of a user proxy data service request based on the proxy data service between the first server and the user, find a second server, and obtain a second message queue of a response result of the second server, where the second server is a target server; based on the first message queue and the second message queue, obtain backup data of the first message queue and the second message queue backed up to a second database by a third server, where the third server is an offline server;

[0069] The data recovery module is used to obtain the restored backup data of the second database according to the backup data of the second database and the failure type of the user agent data service request.

[0070] Specifically, in another embodiment of the present application, the routing configuration module is used for the user to complete the routing configuration information between the user and the first server through the routing information configuration page; based on the completed routing configuration information between the user and the first server, obtain the routing configuration data of the routing configuration information stored in the first database; based on the routing configuration data of the routing configuration information stored in the first database, build a proxy data service between the first server and the user.

[0071] Specifically, in another embodiment of the present application, the data backup module is used to obtain a user proxy data service request sent by a user to the first server based on the proxy data service between the first server and the user; obtain proxy service information generated by the first server based on the user proxy data service request based on the user proxy data service request sent by the user to the first server, the proxy service information including a request serial number generated by the first server based on the user proxy data service request, and a request message body and a routing key contained in the user proxy data service request; obtain information to add the proxy service information to the first message queue based on the proxy service information; add the first message queue information based on the proxy service information, and obtain the second server pointed to by the user proxy data service request through the first database search; obtain the response code and response result of the second server based on the user proxy data service request through the first database search, and add the response code and response result of the second server and the request serial number to the second message queue.

[0072] Specifically, in another embodiment of the present application, the data recovery module is used to extract backup data failure information from the second database based on the third server, and the third server automatically recovers the user agent data service request to obtain data from the second server; based on the user agent data service request to obtain backup data failure information of the second database, request to manually obtain a response result from the second server through the first server; based on the user request, initiate recovery of the response result of the second server to the user agent data service request of the user through the first server.

[0073] Specifically, in another embodiment of the present application, the data recovery module is used to obtain the failure information of the third server in extracting the specified backup data from the second database; based on the extraction of the failure information of the third server in extracting the specified backup data from the second database, obtain the second server pointed to by the routing key of the user agent data service request in the first message queue; based on the second server pointed to by the routing key of the user agent data service request in the first message queue, obtain the response code and response result of the second server; based on the response code and response result of the second server, obtain the third server to write the response code and response result of the second server into the second database.

[0074] Specifically, in another embodiment of the present application, the data recovery module is used to obtain the failure information of the user's local terminal in extracting backup data from the second database; based on the failure information of the user's local terminal in extracting backup data from the second database, obtain the response result information of the user sending a request to the first server to recover and extract the second server pointed to by the user proxy data service request; based on the response result information sent by the user to the first server to recover and extract the second server pointed to by the user proxy data service request, the first server obtains the second server pointed to by the routing key of the user proxy data service request in the first database; based on the first server obtaining the second server pointed to by the routing key of the user proxy data service request in the first database, obtain the response code and response result sent by the second server.

[0075] Specifically, in another embodiment of the present application, the data recovery module is used to obtain the proxy data service between the first server and the user, obtain the historical data of the user's proxy data service request and the response code and response result pointed to by the second server; based on the user's proxy data service request and the historical data of the response code and response result pointed to by the second server, obtain the user's request information for obtaining the historical data again; based on the user's request information for obtaining the historical data again, obtain the information that the first server obtains the second database data through the third server according to the routing key.

[0076] According to the data backup and recovery scheme of the present invention, the routing configuration module obtains the proxy data service between the first server and the user based on the routing configuration information between the user and the first server, and stores the routing configuration information in the first database; the data backup module obtains the first message queue of the user proxy data service request based on the proxy data service between the first server and the user, searches the second server, and obtains the second message queue of the second server response result; based on the first message queue and the second message queue, obtains the backup data of the third server backing up the data of the first message queue and the second message queue to the second database, and the third server is an offline server; the data recovery module obtains the restored backup data of the second database based on the backup data of the second database and the failure type of the user proxy data service request. The present application utilizes proxy technology to back up the request and response results through an intermediate server, and can restore the business in a timely manner when the business needs it, thereby saving the development tasks of exception handling and data recovery.

[0077] It should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0078] Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices described in the embodiment, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or may be divided into multiple submodules.

[0079] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0080] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0081] In addition, some of the embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other devices that perform the functions. Therefore, a processor with necessary instructions for implementing the method or method elements forms a device for implementing the method or method elements. In addition, the elements described herein of the device embodiments are examples of devices for implementing the functions performed by the elements for the purpose of implementing the invention.

[0082] As used herein, unless otherwise specified, the use of ordinal numbers "first," "second," "third," etc. to describe common objects merely indicates that different instances of similar objects are involved, and is not intended to imply that the objects so described must have a given order in time, space, order, or in any other manner.

[0083] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.

Claims

1. A method for data backup and recovery, the method backs up request and response results by means of an intermediate proxy server, and recovers the backup data according to business needs, the method comprising the steps of: According to the routing configuration information between the user and the first server, the proxy data service between the first server and the user is obtained, and the routing configuration information is stored in the first database, the first server is an intermediate proxy server, the first database is a relational database, and the routing configuration information includes a routing key; According to the proxy data service between the first server and the user, a first message queue of the user proxy data service request is obtained, and a second message queue of the second server response result is obtained by searching for a second server, where the second server is a target server; Acquire, according to the first message queue and the second message queue, backup data of the first message queue and the second message queue backed up to a second database by a third server, wherein the third server is an offline server; Based on the backup data of the second database and the failure type of the user proxy data service request, the restored backup data of the second database is obtained, specifically including: based on the failure information of the third server extracting the backup data from the second database, the third server automatically recovers the user proxy data service request to obtain data from the second server, based on the user proxy data service request to obtain the failure information of the backup data of the second database, manually requesting to obtain a response result from the second server through the first server, and based on the user request, initiating the recovery of the response result of the second server to the user proxy data service request of the user through the first server.

2. The method of claim 1, wherein: The step of obtaining the proxy data service between the first server and the user according to the routing configuration information between the user and the first server, and storing the routing configuration information in the first database comprises: The user completes the routing configuration information between the user and the first server through the routing information configuration page; According to the completed routing configuration information between the user and the first server, obtaining the routing configuration data storing the routing configuration information in the first database; A proxy data service between the first server and the user is constructed based on the routing configuration data storing the routing configuration information in the first database.

3. The method of claim 1, wherein: The step of obtaining a first message queue of a user proxy data service request based on the proxy data service between the first server and the user, searching a second server, and obtaining a second message queue of a response result of the second server comprises: According to the proxy data service between the first server and the user, obtaining a user proxy data service request sent by the user to the first server; According to the user proxy data service request sent by the user to the first server, obtaining proxy service information generated by the first server according to the user proxy data service request, the proxy service information including a request sequence number generated by the first server according to the user proxy data service request, and a request message body and a routing key included in the user proxy data service request; According to the proxy service information, obtaining information of adding the proxy service information to the first message queue; Adding first message queue information according to the proxy service information, obtaining the second server pointed to by searching the first database for the user proxy data service request; According to the user agent data service request, the second server pointed to is searched through the first database, the response code and response result of the second server are obtained, and the response code and response result of the second server and the request sequence number are added to the second message queue.

4. The method of claim 1, wherein: According to the failure information of the third server extracting the backup data from the second database, the step of the third server automatically restoring the user agent data service request to obtain data from the second server includes: Obtaining information that the third server fails to extract the specified backup data from the second database; Extracting the specified backup data failure information from the second database according to the third server, obtaining the routing key of the user agent data service request in the first message queue, and determining the second server to which it points based on the obtained routing key; According to the second server pointed to by the routing key of the user agent data service request in the first message queue, obtaining a response code and a response result of the second server; According to the response code and response result of the second server, the third server writes the response code and response result of the second server into the second database.

5. The method of claim 1, wherein: The step of requesting the user proxy data service to obtain the backup data failure information of the second database and requesting to manually obtain the response result from the second server through the first server includes: Obtaining failure information of the user's local terminal extracting backup data from the second database; According to the failure information of the local terminal of the user to extract the backup data from the second database, obtaining the response result information of the second server pointed to by the service request for restoring the user proxy data sent by the user to the first server; According to the response result information sent by the user to the first server to recover and extract the second server pointed to by the user agent data service request, the first server obtains the second server pointed to by the routing key of the user agent data service request in the first database; The first server obtains the second server pointed to by the routing key of the user agent data service request in the first database, and obtains the response code and response result sent by the second server.

6. The method of claim 1, wherein: The step of recovering the response result of the second server initiating a user agent data service request for the user through the first server according to the user request comprises: Acquire the proxy data service between the first server and the user, and acquire the historical data of the user proxy data service request and the response code and response result of the second server to which it points; According to the user proxy data service request and the response code and historical data of the response result of the second server to which it points, obtaining the request information of the user to obtain the historical data again; According to the request information of the user to obtain the historical data again, the information that the first server obtains the data of the second database through the third server according to the routing key is obtained.

7. A data backup and recovery device, which backs up request and response results through an intermediate proxy server and recovers the backup data according to business needs, comprising: A routing configuration module, used to obtain the proxy data service between the first server and the user according to the routing configuration information between the user and the first server, and store the routing configuration information in the first database, wherein the first server is an intermediate proxy server, the first database is a relational database, and the routing configuration information includes a routing key; A data backup module is used to obtain a first message queue of a user proxy data service request based on the proxy data service between the first server and the user, find a second server, and obtain a second message queue of a response result of the second server, where the second server is a target server; based on the first message queue and the second message queue, obtain backup data of the first message queue and the second message queue backed up to a second database by a third server, where the third server is an offline server; A data recovery module is used to obtain the restored backup data of the second database based on the backup data of the second database and the failure type of the user proxy data service request, specifically including: according to the failure information of extracting the backup data from the second database by the third server, the third server automatically recovers the user proxy data service request to obtain data from the second server; according to the user proxy data service request, the failure information of obtaining the backup data of the second database is obtained, and a manual request is made to obtain a response result from the second server through the first server; according to the user request, the recovery of the response result of the second server to the user proxy data service request of the user is initiated through the first server.

8. An electronic device comprising: one or more processors; and Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for executing any of the methods according to claims 1-6.

9. A computer-readable storage medium storing one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by a computing device, the computing device performs any one of the methods according to claims 1-6.