Data backup method, device and system
By pre-stored the bottom-up data file on the bottom-up server and forwarding http requests using the gateway, the problem that the client cannot obtain data when the server interface is unavailable is solved, and the effect of reducing development costs and improving efficiency is achieved.
Patent Information
- Application Number
- CN202210799588.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-08
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-07-08
AI Technical Summary
When the client interacts with multiple server interfaces, if a certain server interface is unavailable, the client cannot obtain business data. The existing technology requires the development of a large number of guarantee systems for each server interface, which is under great pressure and cost. high.
The bottom-up server pre-stores the bottom-up data file corresponding to the business data required by the client, and forwards the client's http request through the gateway to the bottom-up server. The bottom-up server searches and sends the bottom-up data to the client based on the storage path in the request. .
There is no need to develop a bottom-up system for each server interface, which reduces development costs and pressures, improves the development efficiency of the bottom-up system, and ensures that the client can still implement functions when any server interface is unavailable.
Smart Images

Figure CN115208953B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of software function implementation, and more specifically, to a data backup method, device and system. Background Art
[0002] With the development of Internet technology, the application functions of clients are becoming increasingly complex. Each function of the client is implemented by sending a corresponding http request to obtain the corresponding business data from the corresponding server interface. Therefore, in order to realize complete functions, a client needs to interact with a large number of server interfaces. Even if only some basic functions are realized, the number of server interfaces that need to be interacted is not small.
[0003] When a server interface is unavailable and the client cannot obtain the corresponding business data, the client will not be able to implement the corresponding function. Currently, it is often necessary to design a backup system for each server interface to ensure the implementation of the corresponding client function. Due to the large number of server interfaces associated with the client's function implementation, a large number of backup systems need to be developed, which leads to high development pressure and high development cost. Summary of the invention
[0004] In view of the above problems, the present application is proposed to provide a data backup method, device and system to reduce the cost of developing a backup system for multiple server interfaces and improve the development efficiency of the backup system.
[0005] The specific plan is as follows:
[0006] In a first aspect, a data backup method is provided, which is applied to a backup server, wherein the backup server pre-stores backup data files corresponding to business data required by a client, and the storage path of each backup data file on the backup server is consistent with the storage path of the business data corresponding to the backup data file on the server, and the method comprises:
[0007] Receiving an http request forwarded by a gateway, wherein the http request is forwarded by the gateway when it is determined that a corresponding server interface is unavailable, and the http request is a request sent by the client to the gateway for obtaining business data;
[0008] Determine the storage path of the backup data file corresponding to the business data on the backup server according to the storage path in the http request;
[0009] Searching the backup data file locally according to the storage path, and obtaining the backup data stored in the backup data file;
[0010] The backup data is sent to the client.
[0011] In a second aspect, a data backup device is provided, which is applied to a backup server, wherein the backup server pre-stores backup data files corresponding to business data required by a client, and the storage path of each backup data file on the backup server is consistent with the storage path of the business data corresponding to the backup data file on the server, and the device includes:
[0012] A receiving unit, configured to receive an http request forwarded by a gateway, wherein the http request is forwarded by the gateway when it is determined that the corresponding server interface is unavailable, and the http request is a request sent by the client to the gateway for obtaining business data;
[0013] An addressing unit, used to determine a storage path of a backup data file corresponding to the business data on the backup server according to a storage path in the http request;
[0014] A backup data acquisition unit, used to search the backup data file locally according to the storage path, and acquire the backup data stored in the backup data file;
[0015] A response unit is used to send the backup data to the client.
[0016] Thirdly, a data backup system is provided, including a client, a gateway, a server and a backup server;
[0017] The client is used to send an http request and receive a corresponding response, wherein the http request is used to obtain data;
[0018] The gateway is used to receive the http request sent by the client, and forward the http request to the server interface if the corresponding server interface is available, and forward the http request to the backup server if the corresponding server interface is unavailable;
[0019] The server is used to provide a service interface for the client to obtain business data;
[0020] The underlying server is used to store underlying data files corresponding to the business data required by the client, receive the http request forwarded by the gateway, determine the local storage path of the underlying data file corresponding to the required business data according to the relevant parameters in the http request, search for the underlying data file according to the storage path and obtain the underlying data therein, and send the underlying data to the client, wherein the storage path of each underlying data file on the underlying server is consistent with the storage path of the business data corresponding to the underlying data file on the server.
[0021] By means of the above technical scheme, the present application pre-stores a plurality of backup data files corresponding to the business data required by the client on the backup server, and when the client sends an http request for obtaining business data to the gateway, and the corresponding server interface is unavailable, the gateway forwards the http request to the backup server, and the backup server obtains the corresponding backup data file in the storage space according to the request, obtains and sends the backup data therein to the client. Since the backup server pre-stores the backup data files corresponding to the business data required by the client, when the client cannot obtain any of the above business data due to the unavailability of any server interface, the corresponding function can be achieved by providing the client with each backup data by the backup server, without the need to develop a corresponding backup system for each server interface, thereby reducing the development cost of the backup system and improving the development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0023] Figure 1 A flowchart of a data backup method provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of a process for obtaining and storing a backup data file is illustrated;
[0025] Figure 3 A schematic diagram of a process for determining the storage path of a backup data file is illustrated;
[0026] Figure 4 A schematic diagram of the structure of a data backup device provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of the structure of a data backup system provided in an embodiment of the present application;
[0028] Figure 6 A schematic diagram of the structure of another data backup system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] The present application provides a data backup method, device and system, which can provide corresponding backup data to the client when the client needs to obtain business data but the corresponding server interface is unavailable, thereby ensuring the client's function is realized.
[0031] It should be noted that a client may need to interact with multiple server interfaces on multiple servers to obtain business data, where a server can store multiple business data and have multiple server interfaces for the client to obtain each business data. The data backup solution provided by this application can be applied to situations where multiple server interfaces are unavailable, where the multiple server interfaces can belong to one server or to different servers.
[0032] The data backup method provided by the present application can be applied to a backup server, in which the backup server pre-stores backup data files corresponding to the business data required by the client, and the storage path of each backup data file on the backup server is consistent with the storage path of the business data corresponding to the backup data file on the server. In other words, the backup server can obtain multiple backup data corresponding to the business data required by the client, and each backup data is stored by the backup server in the form of a backup data file according to the storage path of the corresponding business data on the server. Therefore, the backup data corresponding to the required business data can be obtained in the storage space of the backup server without changing the http request sent by the client for obtaining the business data.
[0033] The backup server can correspond to multiple servers that provide business data to the client, and is the provider of multiple backup data, so that when the client cannot obtain business data from the corresponding server interface, the function can be realized by providing the corresponding backup data. The backup server can be a terminal with data processing capabilities, which can be a server or a server cluster composed of multiple servers or a cloud.
[0034] Next, combine Figure 1 The data backup method provided by this application is introduced from the perspective of the backup server, which may specifically include the following steps:
[0035] Step S101: receiving an http request forwarded by a gateway.
[0036] It should be noted that the http request is forwarded by the gateway when it is determined that the corresponding server interface is unavailable. In this solution, the gateway plays the role of an agent in the process of the client obtaining business data, which is specifically reflected in that the http request sent by the client is sent to the corresponding server or backup server via the gateway. When the gateway determines that the corresponding server interface is available, that is, it can be used by the client to obtain the required business data, the gateway forwards the http request to the server, and the server obtains the corresponding business data and sends it to the client. When the gateway determines that the corresponding server interface is unavailable, that is, it cannot provide the business data required by the client, the request is forwarded to the backup server, and the backup server obtains the backup data corresponding to the required business data and sends it to the client, so as to ensure that the client can realize the corresponding function when the corresponding server interface is available or unavailable.
[0037] In addition, the http request is a request sent by the client to the gateway for obtaining business data. The storage path information contained in the http request points to the storage path of the required business data on the server. Since the storage path of the business data on the server is consistent with the storage path of the underlying data file on the underlying server, it also points to the storage path of the corresponding underlying data file on the underlying server.
[0038] Step S102: Determine the storage path of the backup data file corresponding to the business data on the backup server according to the storage path in the http request.
[0039] Specifically, the storage path of the catch-all data file on the catch-all server may include a storage address and a file name. It should be noted that the information contained in the storage path in the http request may be consistent with the information contained in the storage path of the catch-all data file on the catch-all server, or may have a certain correspondence with the information contained in the storage path of the catch-all data file on the catch-all server, so that the storage path of the catch-all data file can be determined by the http request based on the above-mentioned correspondence.
[0040] Step S103: Search the backup data file locally according to the storage path to obtain the backup data stored in the backup data file.
[0041] Step S104: Send the backup data to the client.
[0042] The data backup method provided in the embodiment of the present application is to pre-store multiple backup data files corresponding to the business data required by the client on the backup server, and when the client sends an http request for obtaining business data to the gateway, and the corresponding server interface is unavailable, the gateway forwards the http request to the backup server, and the backup server obtains the corresponding backup data file in the storage space according to the request, obtains and sends the backup data therein to the client. Since the backup server pre-stores the backup data files corresponding to the business data required by the client, when the client cannot obtain any of the above-mentioned business data due to the unavailability of any server interface, the corresponding function can be achieved by providing the client with each backup data by the backup server, without the need to develop a corresponding backup system for each server interface, thereby reducing the development cost of the backup system and improving the development efficiency.
[0043] In some embodiments provided in the present application, before step S101, receiving the http request forwarded by the gateway, the method may further include: storing various backup data files corresponding to various business data required by the client.
[0044] It should be noted that the client obtains the required business data from a server interface to implement the corresponding function. Therefore, in order to ensure that the corresponding function of the client can still be implemented when any server interface is unavailable, it is necessary to pre-store multiple backup data corresponding to each server interface on the backup server, where the backup data corresponding to one server interface may be one or more.
[0045] On this basis, the above-mentioned step of storing the backup data files corresponding to the business data required by the client may include the following steps:
[0046] Step S1: For each server interface, obtain the address of the fallback interface corresponding to the server interface.
[0047] Each of the backup interfaces corresponds to a server interface on a one-to-one basis, and the backup interface is used for the backup server to obtain corresponding business data, and the business data is stored in the server according to a certain storage path. For example, the server can be a channel server, and the server interface can be a channel information interface, which is used to provide channel information to the client.
[0048] In a possible implementation, the addresses of the above-mentioned bottom-line interfaces may be manually configured through the bottom-line operation background so as to be acquired by the bottom-line server.
[0049] In a possible implementation, the step S1 of acquiring the address of the fallback interface corresponding to the server interface may include:
[0050] Obtain a fallback interface configuration file corresponding to the server interface, parse the fallback interface configuration file, and obtain the address of the fallback interface corresponding to the server interface.
[0051] Step S2: Send a request to the fallback interface according to the address of the fallback interface to obtain corresponding business data and a corresponding storage path.
[0052] It should be noted that the purpose of obtaining the storage path of business data is to store the business data in the backup server according to the storage path, so that without modifying the relevant parameters in the http request, the backup server can find the corresponding backup data in the local storage space in the same way as the server searches for business data.
[0053] Step S3: store the acquired business data in the form of a backup data file according to the corresponding storage path.
[0054] It should be noted that the above steps S1-S3 can be executed repeatedly, that is, the backup server can periodically update the backup data files it stores based on the backup data files corresponding to the business data required by the client, wherein an update process is consistent with the above steps S1-S3, so that the client can obtain the backup data that is closer to the required business data to implement the corresponding function when the corresponding server interface is unavailable.
[0055] The data fallback method provided in the embodiment of the present application uses business data pre-acquired from a server interface corresponding to the required business data as fallback data, and provides the fallback data to the client when the corresponding server interface is unavailable. It should be noted that the fallback data provided by the fallback server is more universal than the business data, that is, when the corresponding server interface is unavailable, any client sending the request will obtain the same fallback data, and when the server interface is available, each client sending the request may obtain different business data. Compared with arbitrarily set fallback data, the fallback data obtained by the above method has a smaller gap with the business data required by the client, and can replace the required business data to a certain extent, thereby basically ensuring the realization of the corresponding functions of the client.
[0056] In a possible implementation, the address of each of the fallback interfaces includes the address of the first fallback interface and the address of the second fallback interface, and there is more than one piece of business data corresponding to a server interface. On this basis, the above step S2, sending a request to the fallback interface according to the address of the fallback interface to obtain the corresponding business data and the corresponding storage path, may include:
[0057] S21. Send a storage path acquisition request to the first fallback interface according to the address of the first fallback interface to obtain a storage path of each piece of business data on the server;
[0058] S22. According to the address of the second fallback interface, send multiple business data acquisition requests to the second fallback interface in sequence, each business data acquisition request carries a storage path of the business data, and is used to obtain a business data under the storage path.
[0059] Among them, the purpose of obtaining the storage path of business data on the server is to obtain the business data under the path and store the business data on the underlying server according to the corresponding storage path. It is more suitable for obtaining multiple business data from a server interface and can distinguish different business data.
[0060] For example, take a server interface http: / / channel.mgtv.com / channel / index as an example. Figure 2 A possible process diagram of obtaining and storing various service data from the server interface is shown, wherein the address of the first fallback interface corresponding to the server interface is http: / / bak.channel.mgtv.com / channels, and the address of the second fallback interface corresponding to the server interface is http: / / bak.channel.mgtv.com / channel / index. It should be noted that in this example, multiple service data corresponding to a server interface are stored in one directory, that is, the storage addresses of multiple service data are consistent, which can be set to channel.mgtv.com / channel / index. The difference between the storage paths is only reflected in the part corresponding to the file name. Figure 2As shown, since the difference between the storage paths is only reflected in the part corresponding to the file name, a storage path acquisition request is sent to the first fallback interface to obtain multiple storage paths of business data corresponding to the server interface, which are channelId:1:channelType:a and channelId:2:channelType:b. Requests are sent to the second fallback interface respectively. Each business data acquisition request contains one of the above storage paths. The request can be http: / / bak.channel.mgtv.com / channel / index?channelId=1&channelType=a. That is, the storage path obtained by the first fallback interface is reflected as a parameter in the business data acquisition request sent to the second fallback interface. The result of the request is as follows: Figure 2 On this basis, the backup data corresponding to the service data is stored in the backup data file channel.mgtv.com / channel / index / channelId:1:channelType:a, where the storage address of the file is channel.mgtv.com / channel / index and the file name is channelId:1:channelType:a.
[0061] In some embodiments provided in the present application, the storage path in the http request may include target path information and target request parameters, and the file name of the backup data file includes target preset parameters.
[0062] The catch-all server also pre-stores a parameter comparison table, which can be used to characterize the correspondence between request parameters and preset parameters. It should be noted that the request parameters in the http request may contain a large amount of information, and when storing the catch-all data file, part of the information that can refer to the required data, that is, the preset parameters, can be selected as the file name of the catch-all data file. By setting the parameter comparison table, a basis can be provided for the catch-all server to determine the corresponding catch-all data file according to the http request.
[0063] In a possible implementation, the above-mentioned parameter comparison table may be manually configured through the bottom-line operation background so as to be acquired by the bottom-line service end.
[0064] Among them, the parameter comparison table can be obtained by the bottom-line server from the bottom-line operation background, and the process of the bottom-line server obtaining and storing the parameter comparison table can be repeated, that is, the bottom-line server regularly updates the parameter comparison table it stores.
[0065] It should be noted that the parameter comparison table may be multiple parameter comparison tables, each of which corresponds to a server interface. In the above case, the parameter comparison table can be obtained together with the address of the above-mentioned fallback interface, that is, the fallback configuration is manually performed for each server interface through the fallback operation background, and each fallback configuration includes the address of the fallback interface corresponding to the server interface and the corresponding parameter comparison table. In addition, for any parameter comparison table, the information contained therein may be a partial correspondence that ensures that the file name can be determined by the request parameters, rather than a complete correspondence.
[0066] On the basis of the above, step S102, determining the storage path of the backup data file corresponding to the business data on the backup server according to the storage path in the http request, may include:
[0067] Determine the storage address of the backup data file corresponding to the business data on the backup server according to the target path information in the http request;
[0068] According to the parameter comparison table, the target preset parameters corresponding to the target request parameters in the http request are determined, and the backup data file with the file name of the target preset parameters is searched in the storage address.
[0069] Figure 3 The present invention is a schematic diagram of a possible process of determining a storage path of a corresponding underlying data file according to an http request according to an exemplary embodiment, wherein the http request forwarded by the gateway is http: / / channel.mgtv.com / channel / index?cid=1&ctype=a&appVersion=6.0&terminal=1, and the storage path may include three parts: a request domain name (channel.mgtv.com), an interface path (channel / index) and a request parameter (cid=1&ctype=a&appVersion=6.0&terminal=1). The request domain name and the interface path correspond to the path information, which may correspond to the storage address of the required business data on the server side, and therefore also correspond to the storage address of the underlying data file corresponding to the required business data on the underlying server side. Then, it can be determined that the corresponding underlying data file is stored in the channel.mgtv.com / channel / index directory; as for the request parameter part, this part corresponds to the file name of the file storing the required business data, and also corresponds to the file name of the underlying data file corresponding to the required business data. Figure 3The parameter comparison table shown shows the types of preset parameters contained in the file name of the catch-all data file, which are channelId and channelType, respectively, wherein channelId corresponds to the parameter cid in the http request, and channelType corresponds to the parameter ctype in the http request. Therefore, according to the parameter comparison table, it can be determined that the file name of the catch-all data file corresponding to the http request is channelId:1:channelType:a, and thus it can be determined that the storage path of the catch-all data file corresponding to the http request is channel.mgtv.com / channe / index / channelId:1:channelType:a.
[0070] The data backup device provided in the embodiment of the present application is described below. The data backup device described below and the data backup method described above can be referenced to each other.
[0071] See also Figure 4 , Figure 4 This is a structural schematic diagram of a data backup device disclosed in an embodiment of the present application. The data backup device disclosed in an embodiment of the present application can be applied to a backup server. The backup server pre-stores backup data files corresponding to business data required by a client. The storage path of each backup data file on the backup server is consistent with the storage path of the business data corresponding to the backup data file on the server.
[0072] like Figure 4 As shown, the device may include:
[0073] The receiving unit 11 is used to receive an http request forwarded by the gateway, wherein the http request is forwarded by the gateway when it is determined that the corresponding server interface is unavailable, and the http request is a request sent by the client to the gateway for obtaining business data;
[0074] The addressing unit 12 is used to determine the storage path of the backup data file corresponding to the business data on the backup server according to the storage path in the http request;
[0075] A backup data acquisition unit 13, configured to search the backup data file locally according to the storage path, and acquire the backup data stored in the backup data file;
[0076] The response unit 14 is used to send the backup data to the client.
[0077] In a possible implementation, the device may also include a catch-all data file acquisition unit, which is used to obtain the address of the catch-all interface corresponding to each server interface, send a request to the catch-all interface according to the address of the catch-all interface to obtain corresponding business data and a corresponding storage path, and store the acquired business data in the form of a catch-all data file according to the corresponding storage path.
[0078] Optionally, the address of each of the fallback interfaces includes the address of the first fallback interface and the address of the second fallback interface; and there is more than one piece of business data corresponding to a server interface.
[0079] On this basis, the process in which the above-mentioned underlying data file acquisition unit sends a request to the underlying interface according to the address of the underlying interface to obtain the corresponding business data and the corresponding storage path may include:
[0080] Sending a storage path acquisition request to the first fallback interface according to the address of the first fallback interface to obtain a storage path of each piece of business data on the server;
[0081] According to the address of the second fallback interface, multiple business data acquisition requests are sent to the second fallback interface in sequence, each business data acquisition request carries a storage path of a business data, and is used to obtain a business data under the storage path.
[0082] In one possible implementation, the storage path in the http request includes target path information and target request parameters, the file name of the catch-all data file includes target preset parameters, and the catch-all server also pre-stores a parameter comparison table, which is used to characterize the correspondence between request parameters and preset parameters.
[0083] On this basis, the process in which the addressing unit 12 determines the storage path of the backup data file corresponding to the business data on the backup server according to the storage path in the http request may include:
[0084] Determine the storage address of the backup data file corresponding to the business data on the backup server according to the target path information in the http request;
[0085] According to the parameter comparison table, the target preset parameters corresponding to the target request parameters in the http request are determined, and the backup data file with the file name of the target preset parameters is searched in the storage address.
[0086] In a possible implementation, the process of the above-mentioned fallback data file acquisition unit acquiring the address of the fallback interface corresponding to the server interface may include:
[0087] Obtain a fallback interface configuration file corresponding to the server interface, parse the fallback interface configuration file, and obtain the address of the fallback interface corresponding to the server interface.
[0088] Optionally, the address of the backup interface is manually configured through the backup operation background so as to be obtained by the backup server.
[0089] Optionally, the parameter comparison table is manually configured through the bottom-line operation background so as to be obtained by the bottom-line server.
[0090] The data backup system provided in the embodiment of the present application is described below. The data backup system described below and the data backup method described above can be referenced to each other.
[0091] Figure 5 This is a schematic diagram of the structure of a data backup system disclosed in an embodiment of the present application. Figure 5 As shown, the data backup system may include a client 1, a gateway 2, a server 3 and a backup server 4;
[0092] The client 1 is used to send an http request and receive a corresponding response, and the http request is used to obtain data.
[0093] Exemplarily, the client 1 may be a terminal such as a mobile phone, an IPAD, or a computer. A third-party application may be installed on the client 1 to implement the functions of the client. The third-party application may be a browser, a video software, or the like.
[0094] The gateway 2 is used to receive the http request sent by the client 1, and forward the http request to the server interface on the server 3 when the corresponding server interface is available, and forward the http request to the backup server 4 when the corresponding server interface is unavailable.
[0095] The gateway 2 may be a proxy layer for the client 1 to send http requests to obtain business data, and may have functions such as forwarding requests, logging or caching. The gateway may forward according to a forwarding configuration, and the forwarding configuration may forward the http request to the server interface on the server 3 when the corresponding server interface is available, and forward the http request to the backup server 4 when the corresponding server interface is unavailable.
[0096] The server 3 is used to provide a server interface for the client 1 to obtain business data.
[0097] The server 3 is used to provide service data to the client 1, such as providing channel content, on-demand content, live content and other service data. Each server may have multiple server interfaces to provide different service data.
[0098] The catch-all server 4 is used to store each catch-all data file corresponding to each business data required by the client 1, receive the http request forwarded by the gateway 2, determine the storage path of the catch-all data file corresponding to the business data on the catch-all server 4 according to the storage path in the http request, search for the catch-all data file locally according to the storage path, obtain the catch-all data stored in the catch-all data file, and send the catch-all data to the client 1, wherein the storage path of each catch-all data file on the catch-all server is consistent with the storage path of the business data corresponding to the catch-all data file on the server.
[0099] It should be noted that one backup server can provide multiple backup data for the client, ensuring that the client's functions are implemented when multiple server interfaces are unavailable.
[0100] Figure 6 This is a schematic diagram of the structure of another data backup system disclosed in an embodiment of the present application. Figure 6 As shown, the system also includes a bottom-line operation background 5, which is used to manually configure the address of the bottom-line interface corresponding to each server interface, so that the bottom-line server 4 can obtain it;
[0101] The process of storing the backup data files corresponding to the business data required by the client 1 by the backup server 4 may include:
[0102] For each server interface, the bottom-line server obtains the address of the bottom-line interface corresponding to the server interface from the bottom-line operation background 5;
[0103] Send a request to the backup interface on the server 3 according to the address of the backup interface to obtain the corresponding business data and the corresponding storage path;
[0104] The acquired business data is stored in the form of a backup data file according to the corresponding storage path.
[0105] It should be noted that if it is necessary to ensure that the client can obtain the data corresponding to a certain server interface, certain backup configurations must be performed for the server interface, that is, the server provides a backup interface corresponding to the server interface, so that the backup server can send a request to the backup interface to obtain the corresponding business data, and configure the address of the backup interface in the backup operation background for the backup server to obtain it.
[0106] In a possible implementation, the storage path in the http request includes request parameters, and the file name of the backup data file includes preset parameters;
[0107] The bottom-line operation backend 5 is also used to provide a manual configuration parameter comparison table for the bottom-line service end 4 to obtain;
[0108] The bottom-line service end 4 is also used to obtain and store the parameter comparison table from the bottom-line operation background 5, and the parameter comparison table is used to represent the correspondence between the request parameters and the preset parameters;
[0109] The process in which the backup server 4 determines the storage path of the backup data file corresponding to the business data on the backup server according to the storage path in the http request may include:
[0110] The backup server 4 determines the storage address of the backup data file corresponding to the business data on the backup server according to the storage path in the http request;
[0111] According to the parameter comparison table, the target preset parameters corresponding to the target request parameters in the http request are determined, and the file name of the backup data file corresponding to the business data is determined according to the target preset parameters.
[0112] Optionally, the refined and extended functions of the above system may refer to the relevant description in the method section above.
[0113] The data backup system provided in the embodiment of the present application forwards the http request sent by the client to the backup server through the gateway when it is determined that the server interface corresponding to the business data required by the client is unavailable, and the backup server provides the client with the backup data corresponding to the required business data, thereby ensuring the implementation of the corresponding functions of the client. Considering the resource occupation, the corresponding backup data can be configured for the business data that realizes the core functions of the client first. For example, for video playback clients, the backup data can be configured for the core functions such as channels, on-demand or live broadcasts first to ensure the implementation of the above functions.
[0114] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0115] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0116] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data backup method, characterized in that: Applied to a backup server, the backup server pre-stores backup data files corresponding to business data required by the client, and the storage path of each backup data file on the backup server is consistent with the storage path of the business data corresponding to the backup data file on the server. The method includes: Receive an http request forwarded by a gateway, wherein the http request is forwarded by the gateway when it is determined that a corresponding server interface is unavailable, and the http request is a request sent by the client to the gateway for obtaining business data; determine a storage path of a backup data file corresponding to the business data on the backup server according to a storage path in the http request; wherein the information contained in the storage path in the http request is consistent with the information contained in the storage path of the backup data file on the backup server, or has a certain corresponding relationship with the information contained in the storage path of the backup data file on the backup server; Searching the backup data file locally according to the storage path, and obtaining the backup data stored in the backup data file; Sending the backup data to the client; In the case where the information contained in the storage path in the http request is consistent with the information contained in the storage path of the backup data file on the backup server, before receiving the http request forwarded by the gateway, the method further includes: For each server interface, obtain the address of the fallback interface corresponding to the server interface, wherein the address of each fallback interface includes the address of the first fallback interface and the address of the second fallback interface; there is more than one piece of business data corresponding to one server interface; Sending a storage path acquisition request to the first fallback interface according to the address of the first fallback interface to obtain a storage path of each piece of business data on the server; According to the address of the second catch-all interface, multiple business data acquisition requests are sent to the second catch-all interface in sequence, each business data acquisition request carries a storage path of the business data, and is used to obtain a business data under the storage path; wherein the storage path obtained by the first catch-all interface is reflected as a parameter in the business data acquisition request sent to the second catch-all interface; the obtained business data is stored in the form of a catch-all data file according to the corresponding storage path.
2. The method according to claim 1, characterized in that The storage path in the http request includes target path information and target request parameters, and the file name of the backup data file includes target preset parameters; The backup server also pre-stores a parameter comparison table, which is used to characterize the correspondence between the request parameters and the preset parameters; Determining the storage path of the backup data file corresponding to the business data on the backup server according to the storage path in the http request includes: Determine the storage address of the backup data file corresponding to the business data on the backup server according to the target path information in the http request; According to the parameter comparison table, the target preset parameters corresponding to the target request parameters in the http request are determined, and the backup data file with the file name of the target preset parameters is searched in the storage address.
3. The method according to claim 1, characterized in that: The acquiring the address of the fallback interface corresponding to the server interface includes: Obtain a fallback interface configuration file corresponding to the server interface, parse the fallback interface configuration file, and obtain the address of the fallback interface corresponding to the server interface.
4. The method according to claim 1, characterized in that The address of the bottom-line interface is manually configured through the bottom-line operation background so as to be obtained by the bottom-line server.
5. The method according to claim 2, characterized in that: The parameter comparison table is manually configured through the bottom-line operation background so as to be obtained by the bottom-line service end.
6. A data backup device, characterized in that: Applied to a backup server, the backup server pre-stores backup data files corresponding to the business data required by the client, and the storage path of each backup data file on the backup server is consistent with the storage path of the business data corresponding to the backup data file on the server, the device includes: A receiving unit, configured to receive an http request forwarded by a gateway, wherein the http request is forwarded by the gateway when it is determined that the corresponding server interface is unavailable, and the http request is a request sent by the client to the gateway for obtaining business data; An addressing unit, used to determine the storage path of the underlying data file corresponding to the business data on the underlying server according to the storage path in the http request; wherein the information contained in the storage path in the http request is consistent with the information contained in the storage path of the underlying data file on the underlying server, or has a certain corresponding relationship with the information contained in the storage path of the underlying data file on the underlying server; A backup data acquisition unit, used to search the backup data file locally according to the storage path, and acquire the backup data stored in the backup data file; A response unit, used to send the backup data to the client; The storage unit is used, when the information contained in the storage path in the http request is consistent with the information contained in the storage path of the underlying data file in the underlying server, to obtain the address of the underlying interface corresponding to each server interface for each server interface before receiving the http request forwarded by the gateway, and the address of each underlying interface includes the address of the first underlying interface and the address of the second underlying interface; there is more than one business data corresponding to a server interface; according to the address of the first underlying interface, a storage path acquisition request is sent to the first underlying interface to obtain the storage path of each business data in the server; according to the address of the second underlying interface, multiple business data acquisition requests are sent to the second underlying interface in sequence, each business data acquisition request carries a storage path of a business data, and is used to obtain a business data under the storage path, wherein the storage path acquired by the first underlying interface is reflected as a parameter in the business data acquisition request sent to the second underlying interface; the acquired business data is stored in the form of an underlying data file according to the corresponding storage path.
7. A data backup system, characterized in that: Including client, gateway, server and backup server; The client is used to send an http request and receive a corresponding response, wherein the http request is used to obtain data; The gateway is used to receive the http request sent by the client, and forward the http request to the server interface if the corresponding server interface is available, and forward the http request to the backup server if the corresponding server interface is unavailable; The server is used to provide a service interface for the client to obtain business data; The backup server is used to store backup data files corresponding to the business data required by the client, receive the http request forwarded by the gateway, determine the local storage path of the backup data file corresponding to the required business data according to the relevant parameters in the http request, search for the backup data file according to the storage path and obtain the backup data therein, and send the backup data to the client, wherein the storage path of each backup data file in the backup server is consistent with the storage path of the business data corresponding to the backup data file in the server, wherein the information contained in the storage path in the http request is consistent with the information contained in the storage path of the backup data file in the backup server, or has a certain corresponding relationship with the information contained in the storage path of the backup data file in the backup server; The system also includes a bottom-up operation background for manually configuring the address of the bottom-up interface corresponding to each server interface for acquisition by the bottom-up server, wherein the address of each bottom-up interface includes the address of the first bottom-up interface and the address of the second bottom-up interface; there is more than one piece of business data corresponding to a server interface; The process of storing the backup data files corresponding to the business data required by the client at the backup server includes: For each server interface, the backup server obtains the address of the backup interface corresponding to the server interface from the backup operation background; Sending a storage path acquisition request to the first fallback interface according to the address of the first fallback interface to obtain a storage path of each piece of business data on the server; According to the address of the second fallback interface, multiple business data acquisition requests are sent to the second fallback interface in sequence, each business data acquisition request carries a storage path of the business data, and is used to obtain a business data under the storage path; wherein the storage path obtained by the first fallback interface is reflected as a parameter in the business data acquisition request sent to the second fallback interface; The acquired business data is stored in the form of a backup data file according to the corresponding storage path.
Citation Information
Patent Citations
Baotou data processing method and device
CN114610732A