File processing method, device and storage medium

By switching the storage cluster when the client fails to upload, the problem of high probability of file upload failure in the distributed file storage system is solved, and the success rate of file upload retry is improved. It is suitable for high-performance and easy-to-expand data storage in the financial industry. need.

CN112612769BActive Publication Date: 2024-10-15WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011493644.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2024-10-15
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

When file upload fails, the existing distributed file storage system has a simple retry strategy, resulting in a low success rate of file upload retries, especially due to a high probability of storage failure due to partial server-side storage failure.

Method used

When the client fails to upload, it sends the file to a server in a different cluster for retry storage, ensuring that the file is stored in a different cluster from the last upload, reducing the probability of storage failure and improving the success rate of file upload retries.

Benefits of technology

By switching the storage cluster when the client uploads and retries, the probability of storage failure caused by partial server-side storage failure is reduced, the success rate of file upload retries is improved, and the bottleneck of file upload failure in traditional file storage systems is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112612769B_ABST
    Figure CN112612769B_ABST
Patent Text Reader

Abstract

The present application provides a file processing method, device and storage medium. The method sends a first upload request to a first server through a client, and then the first server stores the file to be stored carried by the first upload request in a first cluster. If the storage fails, the first server returns storage failure information to the client, and the information carries the identifier of the first cluster. Then the client sends a second upload request to the second server, and then the second server stores the above-mentioned file to be stored in a second cluster, which is different from the above-mentioned first cluster, thereby solving the problem of file upload failure in the existing file storage system. Moreover, in the embodiment of the present application, when the client retries the upload, the second server stores the above-mentioned file to be stored in the second cluster, and the second cluster is different from the cluster where the file uploaded by the client last time is stored, thereby reducing the probability of storage failure caused by failure of the server-side storage part and improving the success rate of the client file upload retry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to file storage technology of financial technology (Fintech), and in particular to a file processing method, device and storage medium. Background Art

[0002] With the development of computer technology, more and more technologies are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology, and file storage is no exception. However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on file storage technology.

[0003] The current financial industry needs to store more and more data. Traditional file systems can no longer meet the current requirements of high performance and easy scalability of data storage due to insufficient disk space and limited processing power. In recent years, distributed file systems have developed rapidly, such as Google File System (GFS) and Hadoop Distributed File System (HDFS). Various bottlenecks of traditional file systems have been solved to a considerable extent.

[0004] However, although the distributed file storage system solves the problem of high-performance and scalable file storage, it will inevitably encounter the problem of file upload failure. In the case of file upload failure, the existing method simply optimizes the number of retries and time, resulting in a low success rate of file upload retries. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the present application provides a file processing method, device and storage medium.

[0006] In a first aspect, an embodiment of the present application provides a file processing method, which is applied to a client, and the method includes:

[0007] Sending a first upload request to a first server, wherein the first upload request carries a file to be stored, and the first upload request is used to instruct the first server to store the file to be stored in a first cluster, and the first cluster is used to store the file uploaded by the client;

[0008] If storage failure information returned by the first server is received, and the storage failure information carries the identifier of the first cluster, a second upload request is sent to the second server, and the second upload request carries the identifier of the file to be stored and the first cluster. The second upload request is used to instruct the second server to store the file to be stored in the second cluster. The second cluster is different from the first cluster, and the second cluster is used to store the files uploaded by the client.

[0009] In a second aspect, an embodiment of the present application provides another file processing method, which is applied to a server side, wherein the server side includes a first server and a second server, and the method includes:

[0010] The first server receives a first upload request sent by a client, where the first upload request carries a file to be stored;

[0011] The first server stores the file to be stored in a first cluster according to the first upload request, and the first cluster is used to store the file uploaded by the client;

[0012] If the storage fails, the first server returns storage failure information to the client, and the storage failure information carries the identifier of the first cluster;

[0013] The second server receives a second upload request sent by the client, where the second upload request carries the file to be stored and an identifier of the first cluster;

[0014] The second server stores the file to be stored in a second cluster according to the second upload request, where the second cluster is different from the first cluster and is used to store the file uploaded by the client.

[0015] In a third aspect, an embodiment of the present application provides a file processing device, applied to a client, comprising:

[0016] A first upload module, configured to send a first upload request to a first server, wherein the first upload request carries a file to be stored, and the first upload request is used to instruct the first server to store the file to be stored in a first cluster, and the first cluster is used to store the file uploaded by the client;

[0017] A second upload module is configured to send a second upload request to a second server if storage failure information returned by the first server is received, and the storage failure information carries the identifier of the first cluster. The second upload request carries the identifier of the file to be stored and the first cluster. The second upload request is used to instruct the second server to store the file to be stored in a second cluster, which is different from the first cluster and is used to store files uploaded by the client.

[0018] In a fourth aspect, an embodiment of the present application provides another file processing device, including a first server and a second server;

[0019] The first server is configured to receive a first upload request sent by a client, where the first upload request carries a file to be stored;

[0020] The first server is used to store the file to be stored in a first cluster according to the first upload request, and the first cluster is used to store the file uploaded by the client;

[0021] The first server is configured to return storage failure information to the client if storage fails, wherein the storage failure information carries an identifier of the first cluster;

[0022] The second server is configured to receive a second upload request sent by the client, where the second upload request carries the file to be stored and an identifier of the first cluster;

[0023] The second server is used to store the file to be stored in a second cluster according to the second upload request, where the second cluster is different from the first cluster and is used to store the file uploaded by the client.

[0024] In a fifth aspect, an embodiment of the present application provides a client, including:

[0025] processor;

[0026] Memory; and

[0027] Computer programs;

[0028] The computer program is stored in the memory and is configured to be executed by the processor, wherein the computer program includes instructions for executing the method as described in the first aspect.

[0029] In a sixth aspect, an embodiment of the present application provides a server side, including:

[0030] processor;

[0031] Memory; and

[0032] Computer programs;

[0033] The computer program is stored in the memory and is configured to be executed by the processor, wherein the computer program includes instructions for executing the method as described in the second aspect.

[0034] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a server to execute the method described in the first aspect.

[0035] In an eighth aspect, an embodiment of the present application provides another computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a server to execute the method described in the second aspect.

[0036] In a ninth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, wherein the computer instructions are executed by a processor to perform the method described in the first aspect.

[0037] In a tenth aspect, an embodiment of the present application provides another computer program product, including computer instructions, wherein the computer instructions are executed by a processor to perform the method described in the second aspect.

[0038] The file processing method, device and storage medium provided by the embodiment of the present application, the method sends a first upload request to the first server through the client, the first upload request carries the file to be stored, and then the first server stores the above-mentioned file to be stored in the first cluster. If the storage fails, the first server returns the storage failure information to the client, and the storage failure information carries the identifier of the first cluster, then the client sends a second upload request to the second server, the second upload request carries the identifier of the above-mentioned file to be stored and the first cluster, and then the second server stores the above-mentioned file to be stored in the second cluster, the second cluster is different from the above-mentioned first cluster, and solves the problem of file upload failure in the existing file storage system. Moreover, in the embodiment of the present application, when the client retry the upload, the second server stores the above-mentioned file to be stored in the second cluster, and the second cluster is different from the cluster where the file uploaded by the client last time is stored, thereby reducing the probability of storage failure caused by failure of the server-side storage part and improving the success rate of the client file upload retry. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0040] Figure 1 A schematic diagram of a file processing system architecture provided in an embodiment of the present application;

[0041] Figure 2 A flowchart of a file processing method provided in an embodiment of the present application;

[0042] Figure 3 A schematic diagram of a connection between a client and a server provided in an embodiment of the present application;

[0043] Figure 4 A schematic diagram of an FPS client uploading a file provided in an embodiment of the present application;

[0044] Figure 5 A flowchart of another file processing method provided in an embodiment of the present application;

[0045] Figure 6 A schematic diagram of an FPS client downloading a file provided in an embodiment of the present application;

[0046] Figure 7 A flowchart of another file processing method provided in an embodiment of the present application;

[0047] Figure 8 A flowchart of another file processing method provided in an embodiment of the present application;

[0048] Fig. 9 A schematic diagram of the structure of a file processing device provided in an embodiment of the present application;

[0049] Fig.10 A schematic diagram of the structure of another file processing device provided in an embodiment of the present application;

[0050] Fig.11 A schematic diagram of the structure of another file processing device provided in an embodiment of the present application;

[0051] Fig.12 A schematic diagram of the structure of another file processing device provided in an embodiment of the present application;

[0052] Fig.13A A possible structural diagram of the client of the present application is shown;

[0053] Fig. 13B Another possible structural diagram of the client of the present application is shown;

[0054] Fig.14A A possible structural diagram of the server side of this application is shown;

[0055] Fig. 14B Another possible structural diagram of the server side of the present application is shown. DETAILED DESCRIPTION

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

[0057] The terms "first", "second", "third", and "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0058] The current financial industry needs to store more and more data. Traditional file systems can no longer meet the current requirements of high performance and easy scalability of data storage due to insufficient disk space and limited processing power. In recent years, distributed file systems have developed rapidly, such as GFS and HDFS, and various bottlenecks of traditional file systems have been solved to a considerable extent.

[0059] However, although the distributed file storage system solves the problem of high-performance and scalable file storage, it will inevitably encounter the problem of file storage failure. In the case of file storage failure, the existing system simply optimizes the number of retries and time, resulting in a low success rate of file upload retries. For example, when the file storage fails, the existing client usually only waits for a certain period of time before retrying, or sets the number of retries and the retry interval, and then uploads the file based on the set number of retries and the retry interval.

[0060] However, in the case of partial failure of the server-side storage, the above-mentioned file upload retry method cannot achieve the purpose of successfully uploading files. For example, the distributed file system may have storage failure in a certain area. If the client retries to upload the file, the server still stores the file uploaded by the client in the area where the storage failed, resulting in storage failure. As a result, the client's upload retries continue to fail, and the success rate of the client's upload retries is low.

[0061] Therefore, an embodiment of the present application proposes a file processing method. When a client retries to upload a file, the file to be stored is sent to a server. The server stores the file to be stored in a cluster, which is different from the cluster where the file uploaded by the client last time was stored. This solves the problem of file upload failure in the existing file storage system, reduces the probability of storage failure caused by failure of the server-side storage part, and improves the success rate of client file upload retries.

[0062] The file processing method provided in the embodiment of the present application can be applied to file uploading and downloading in various scenarios. For example, take the example of uploading and downloading files from a client to a server in a distributed file storage system, such as taking the example of uploading and downloading files from a client to a server in an FPS system. Here, the FPS system is a small file storage and processing system with specific life cycle management, cross-computer room disaster recovery and other functions.

[0063] Optionally, Figure 1 A schematic diagram of a file processing system architecture provided in an embodiment of the present application. Figure 1 In the example, taking the FPS client uploading and downloading files to the server as an example, the above architecture includes an FPS client 11 and an FPS server 12.

[0064] The number of FPS clients 11 can be determined according to actual conditions. Figure 1 In the example, three FPS clients 11 are used. The FPS server 12 may be composed of one or more computer rooms, each of which includes multiple FPS servers and multiple Hadoop clusters connected to the multiple FPS servers, each of which is used to store files uploaded by the FPS clients. Figure 1 In the example, the FPS server end 12 is composed of two computer rooms (computer room 1 and computer room 2), and each computer room (computer room 1 or computer room 2) includes 6 FPS servers, and the 6 FPS servers are connected to 2 Hadoop clusters, namely cluster 00 and cluster 01.

[0065] Here, the FPS server 12 can divide the functions of the above two computer rooms, namely computer room 1 and computer room 2, for example, computer room 1 is used as the main computer room, and computer room 2 is used as the backup computer room, that is, the backup computer room of computer room 1. The data in computer room 1 can be backed up to computer room 2 by asynchronous data synchronization. Accordingly, cluster 00 and cluster 01 in computer room 1 can be used as the main cluster, and cluster 00 and cluster 01 in computer room 2 can be used as the backup cluster, for example, cluster 00 in computer room 2 can be used as the backup cluster of cluster 00 in computer room 1, and cluster 01 in computer room 2 can be used as the backup cluster of cluster 01 in computer room 1.

[0066] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the file processing architecture. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0067] In the specific implementation process, any one of the three FPS clients 11 sends the file to be stored to an FPS server in the main computer room of the FPS server end 12. The FPS server stores the file to be stored in a cluster, such as cluster 00. If the storage fails, the FPS client retries the file upload and sends the file to be stored to an FPS server in the main computer room of the FPS server end 12. The FPS server stores the file to be stored in another cluster, such as cluster 01, which is different from the cluster where the file uploaded by the FPS client last time was stored, thereby solving the problem of file upload failure existing in the existing file storage system, reducing the probability of storage failure caused by failure of the server-side storage part, and improving the success rate of client file upload retries.

[0068] If the file to be stored is successfully stored in another cluster 01, the FPS server may return a storage success message to the FPS client, and the storage success message carries the identifier of the cluster 01. If the file to be stored is not successfully stored in another cluster 01, the FPS server may store the file to be stored in cluster 00. If the file to be stored is successfully stored in cluster 00, the FPS server may return a storage success message to the FPS client, and the storage success message carries the identifier of the cluster 00.

[0069] In addition, the system architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0070] The technical solution of the present application is described below by taking several embodiments as examples, and the same or similar concepts or processes may not be repeated in some embodiments.

[0071] Figure 2 The present invention provides a method for processing files, which can be applied to a client. Figure 2 As shown, in Figure 1 Based on the system architecture shown, the file processing method provided in the embodiment of the present application includes the following steps:

[0072] S201: Send a first upload request to a first server, the first upload request carrying a file to be stored, the first upload request being used to instruct the first server to store the file to be stored in a first cluster, the first cluster being used to store the file uploaded by the client.

[0073] Here, before sending the first upload request to the first server, the client needs to establish a connection with the first server. Exemplarily, when establishing a connection with the first server, the client may first obtain pre-stored server parameters, which include the weight of the server and the address of the server. Then, the client determines the first server according to the weight of the server, and obtains the address of the first server from the address of the server, thereby sending a first connection request to the first server according to the address of the first server, and the first connection request is used to instruct the first server to determine whether to establish a connection with the client.

[0074] The server parameters may be pre-stored by the client. Exemplarily, the client may obtain the server parameters from a registration system of the server and store them in advance.

[0075] Here, when the client determines the first server according to the weight of the server, the first server can be determined according to the weight of the server and the preset weight. The preset weight can be randomly determined by the server, or can be determined by the server according to the performance of the included servers. For example, the server sets the server with better performance and a larger server weight, or sets the server with poorer performance and a smaller server weight, etc. If the client requires the first server to be a server with better performance, the client can send corresponding information to the server, such as sending information to the server that needs to determine the server with better performance. After receiving the information sent by the client, the server can set the preset weight to a larger weight, so that the client can determine the server with better performance as the first server according to the weight and preset weight of the server to meet the different needs of different scenarios.

[0076] The server side may be provided with a registration system. After the server on the server side is successfully started, the address of the server may be uploaded to the registration system. The registration system saves the address of the uploaded server, which includes the actual server address (real server ip, rsip) and the IP address. In this way, the registration system stores the weight of the server and the address of the server, and this information may be stored in a server parameter table. The client may obtain the server parameters from the server parameter table of the registration system, that is, obtain the weight of the server and the address of the server.

[0077] When the server stops, the weight and address of the server will be deleted from the registration system. The registration system can perform the deletion through heartbeat monitoring with the server. For example, if the heartbeat monitoring times out, the registration system will delete the weight and address of the server.

[0078] Here, in order to ensure that the server parameters obtained by the client from the registration system are the latest server parameters, the server side can generate a hash code according to the weight of the server and the address of the server. Exemplarily, the server side can generate a hash code according to the weight of the server and the address of the server. For example, taking the server side including three servers as an example, the server side can combine the weights of the three servers and the addresses of the servers, and then generate a hash code based on the combination result. For example, hash (rsip1:port1:weight1+rsip2:port2:weight2+…+rsip3:port3:weight3) generates a hash code. Among them, weight 1 represents the weight corresponding to a server with an actual address of rsip1 and an IP address of port1. Other weights are similar and will not be repeated here. The server side uploads the generated hash code to the registration system, and the registration system saves the hash code. The client first obtains the hash code from the registration system, and then compares the obtained hash code with the hash code obtained from the registration system last time. If they are different, the client obtains the latest server parameters from the registration system.

[0079] After determining the first server in the server side, the client may try to connect to rsip+port to determine whether the network is connected, that is, send a first connection request to the first server according to the address of the first server.

[0080] The client can determine the first server according to the weight of the server and obtain the address of the first server from the address of the server, and then determine whether the network area to which the client belongs is the preset network service area. If yes, the client sends a first connection request to the first server, and the first server receives the first connection request and establishes a connection with the client according to the first connection request. If no, the client sends a second connection request to the preset gateway and establishes a connection with the first server through the preset gateway.

[0081] Exemplarily, after the client sends the second connection request to the preset gateway, the second connection request carries the identifier of the first server, and the preset gateway establishes a connection with the client according to the second connection request. Figure 1Taking the case where the client uploads and downloads files to the server in the FPS as an example, the client can send a second connection request to the tgw, which is a system that realizes unified access to multiple networks, forwards external network requests, and supports automatic load balancing. The tgw establishes a connection with the client according to the second connection request, and sends a third connection request to the first server according to the identifier of the first server. The first server establishes a connection with the tgw according to the third connection request.

[0082] For example, Figure 3 As shown, if the network area to which the client belongs is a preset network service area, the interaction between the client and the server in the server side can be directly connected and interacted through the server address. If the network area to which the client belongs is not a preset network service area, that is, the network area to which the client belongs is in the network external connection area, the client and the server in the server side cannot be directly connected and interacted, and the interaction between the client and the server in the server side is completed through a preset gateway, for example, through the above-mentioned tgw.

[0083] Here, in an embodiment of the present application, the interaction mode between the above-mentioned client and the server in the above-mentioned server side can be determined based on the network area to which the client belongs, so as to meet different application needs and be suitable for the application.

[0084] In addition, when the client is directly connected to the server in the server-side through the address of the server, the client will count the success rate of uploading and downloading of each server. After the success rate of a server in the recent period of time drops to a certain threshold, the weight of the server is adjusted to 0, and the client is connected through other servers. Correspondingly, the embodiment of the present application also provides a weight recovery mechanism, that is, every period of time X, the client will gradually increase the weight of the server whose weight is adjusted to 0 at each Y time interval (before the weight is restored, the server's address will be tried to connect the handshake, and the handshake will be successfully restored step by step), if it still fails, it will be reset to 0, and wait for the next attempt.

[0085] S202: If storage failure information returned by the first server is received, and the storage failure information carries the identifier of the first cluster, a second upload request is sent to the second server, and the second upload request carries the identifier of the file to be stored and the first cluster. The second upload request is used to instruct the second server to store the file to be stored in the second cluster, which is different from the first cluster. The second cluster is used to store files uploaded by the client.

[0086] The second server is different from the first server.

[0087] Here, the client uploads a file to the first server. If the first server returns storage failure information, it means that the client fails to upload the file. The reason for the failure may be that the first cluster where the first server stores the file has a storage failure. In order to solve this problem, in an embodiment of the present application, when the client retries to upload the file, it sends the file to be stored to a server, and the server stores the file to be stored in a cluster, where the cluster is different from the cluster where the file uploaded by the client last time was stored, thereby reducing the probability of storage failure caused by partial failure of the server-side storage.

[0088] In addition, the failure of the client to upload the file may be caused not only by the storage failure of the first cluster, but also by the problem of the first service itself, such as performance failure, which leads to signal interruption, thereby making it impossible for the first server to transfer the file to the first cluster, resulting in the failure of the first cluster storage. In order to solve this problem, in an embodiment of the present application, when the client retry to upload the file, it sends the file to be stored to a certain server, and the server stores the file to be stored in a certain cluster, wherein the certain server is different from the server selected by the client for the last file upload, thereby solving the problem of file upload failure caused by the server itself and improving the success rate of the client file upload retry.

[0089] In the embodiment of the present application, the second upload request may also carry a retry flag, and the second upload request is used to instruct the second server to store the file to be stored in the second cluster after determining that the second upload request is a retry request according to the retry flag. That is, the second server will store the file to be stored in the second cluster only after determining that the second upload request is a retry request according to the retry flag, so that when the client retries the upload, the server will change the cluster to store the file uploaded by the client.

[0090] Here, before sending the second upload request to the second server, the client needs to establish a connection with the second server. The specific connection establishment process refers to the connection establishment process between the client and the first server, which will not be repeated here.

[0091] For example, Figure 4 As shown, Figure 1 Take the file processing system architecture shown as an example. The FPS client sends a first upload request to the FPS server 1, and the first upload request carries the file to be stored. The FPS server 1 stores the above-mentioned file to be stored in cluster 00. If the above-mentioned file to be stored is successfully stored in cluster 00, cluster 00 returns a successful storage to the FPS server 1, and accordingly, the FPS server 1 returns a storage success message to the FPS client, and the storage success message carries the identifier of the above-mentioned cluster 00, such as cluster 00.

[0092] If the storage fails, cluster 00 returns a storage failure to FPS server 1, and accordingly, FPS server 1 returns a storage failure message to the FPS client, and the storage failure message carries the identifier of the above-mentioned cluster 00, such as cluster 00. The FPS client sends a second upload request to FPS server 2, and the second upload request carries the above-mentioned file to be stored and the identifier of the above-mentioned cluster 00. FPS server 2 stores the above-mentioned file to be stored in cluster 01. If the storage is successful, cluster 01 returns a storage success to FPS server 2, and accordingly, FPS server 2 returns a storage success message to the FPS client, and the storage success message carries the identifier of the above-mentioned cluster 01, such as cluster 01. In addition, if the storage in cluster 01 fails, FPS server 2 can store the above-mentioned file to be stored in cluster 00. If the above-mentioned file to be stored is successfully stored in cluster 00, cluster 00 returns a storage success to FPS server 2, and accordingly, FPS server 2 returns a storage success message to the FPS client, and the storage success message carries the identifier of the above-mentioned cluster 00, such as cluster 00.

[0093] In an embodiment of the present application, a client sends a first upload request to a first server, and the first upload request carries the file to be stored. Then, the first server stores the file to be stored in a first cluster. If the storage fails, the first server returns storage failure information to the client, and the storage failure information carries the identifier of the first cluster. Then, the client sends a second upload request to a second server, and the second upload request carries the identifier of the file to be stored and the first cluster. Then, the second server stores the file to be stored in a second cluster, which is different from the first cluster, thereby solving the problem of file upload failure in the existing file storage system. Moreover, in an embodiment of the present application, when the client retries to upload, the second server stores the file to be stored in a second cluster, which is different from the cluster where the file uploaded by the client last time was stored, thereby reducing the probability of storage failure caused by failure of the server-side storage part and improving the success rate of the client file upload retry.

[0094] In addition, in the embodiment of the present application, after the client uploads a file to the server, and the server successfully stores the file uploaded by the client into the corresponding cluster, the client can send a download request to the server, that is, the client can download the file from the server. Figure 1Based on the file processing system architecture shown, any one of the three FPS clients 11 sends a download request to an FPS server in the main computer room of the FPS server end 12. The download request carries the identifier of the file to be downloaded and the identifier of the target cluster. The FPS server downloads the file to be downloaded corresponding to the download file identifier in the target cluster (e.g., cluster 00) of the main cluster. If the acquisition fails, the FPS client retry the file download and sends a second download request to an FPS server in the main computer room of the FPS server end 12, the download request carrying the identifier of the file to be downloaded and the identifier of the target cluster. The FPS server downloads the file to be downloaded corresponding to the download file identifier in the target cluster (e.g., cluster 00) of the standby cluster, the standby cluster is a backup cluster of the main cluster, for example, cluster 00 in computer room 2 can be used as a backup cluster of cluster 00 in computer room 1, solving the problem of file acquisition failure in the existing file storage system. Moreover, when the client downloads and retries, a server downloads the file to be downloaded in the standby cluster, reducing the probability of file acquisition failure caused by failure of the server-side storage part, and improving the success rate of client file download retries.

[0095] For example, Figure 5 This is a flow chart of another file processing method proposed in the embodiment of the present application. Figure 5 As shown, the method includes:

[0096] S501: Send a first download request to a third server, where the first download request carries an identifier of a file to be downloaded and an identifier of a target cluster. The first download request is used to instruct the third server to download the file to be downloaded corresponding to the download file identifier in a target cluster of a main cluster according to the identifier of the target cluster, where the main cluster includes the target cluster.

[0097] Here, before sending the first download request to the third server, the client needs to establish a connection with the third server. The specific connection establishment process refers to the connection establishment process between the client and the first server, which will not be repeated here.

[0098] In addition, the target cluster is a cluster where the to-be-downloaded file corresponding to the to-be-downloaded file identifier is stored. The main cluster includes the target cluster.

[0099] S502: If the acquisition failure information returned by the above-mentioned third server is received, a second download request is sent to the fourth server, and the above-mentioned second download request carries the above-mentioned file identifier to be downloaded and the identifier of the above-mentioned target cluster. The above-mentioned second download request is used to instruct the above-mentioned fourth server to download the file to be downloaded corresponding to the above-mentioned download file identifier in the above-mentioned target cluster of the standby cluster according to the identifier of the above-mentioned target cluster. The above-mentioned standby cluster includes the above-mentioned target cluster, and the above-mentioned standby cluster is a backup cluster of the above-mentioned main cluster.

[0100] Among them, the fourth server mentioned above is different from the third server mentioned above.

[0101] Here, the client sends a first download request to the third server. If the third server returns a failed acquisition message, it means that the client fails to download the file. The reason for the failure may be that a storage failure occurs in the target cluster of the main cluster where the third server downloads the file to be downloaded. In order to solve this problem, in an embodiment of the present application, when the client retries to download the file, it sends a second download request to the fourth server, and the server downloads the file to be downloaded corresponding to the download file identifier in the target cluster of the backup cluster, wherein the backup cluster is a backup cluster of the main cluster, thereby reducing the probability of file acquisition failure caused by partial failure of the server-side storage.

[0102] In addition, the failure of the client to download the file may be caused not only by the storage failure of the target cluster of the main cluster, but also by the problem of the third service itself, such as performance failure, which leads to signal interruption, thereby making it impossible for the third server to transmit the first download request to the target cluster of the main cluster, resulting in failure to obtain the file. In order to solve this problem, in an embodiment of the present application, when retrying the file download, the client sends a second download request to the fourth server, and the server downloads the file to be downloaded corresponding to the download file identifier in the target cluster of the backup cluster, wherein the fourth server is different from the third server, thereby solving the problem of file download failure caused by the server's own problems and improving the success rate of the client's file download retry.

[0103] In an embodiment of the present application, the second download request may also carry a retry flag, and the second download request is used to instruct the fourth server to download the file to be downloaded corresponding to the download file flag in the target cluster of the backup cluster according to the flag of the target cluster after determining that the second download request is a retry request according to the retry flag. That is, the fourth server will download the file to be downloaded in the target cluster of the backup cluster only after determining that the second download request is a retry request according to the retry flag, so that when the client retries the download, the server will change the cluster to download the corresponding file, which is suitable for application.

[0104] Here, before sending the second download request to the fourth server, the client needs to establish a connection with the fourth server. The specific connection establishment process refers to the connection establishment process between the client and the first server, which will not be repeated here.

[0105] For example, Figure 6 As shown, Figure 1 Take the file processing system architecture shown as an example. The FPS client sends a first download request to the FPS server 3, and the first download request carries the identifier of the file to be downloaded and the identifier of the target cluster, such as cluster 00. According to the identifier of the target cluster, the FPS server 3 downloads the file to be downloaded corresponding to the above download file identifier in the target cluster of the main cluster, for example, cluster 00 in the computer room 1 downloads the file to be downloaded corresponding to the above download file identifier. If the acquisition is successful, the target cluster, such as cluster 00, returns the acquisition success to the FPS server 3, and accordingly, the FPS server 3 returns the acquisition success information to the FPS client.

[0106] If the acquisition fails, the target cluster returns the acquisition failure to the FPS server 3, and accordingly, the FPS server 3 returns the acquisition failure information to the FPS client. The FPS client sends a second download request to the FPS server 4, and the second download request carries the above-mentioned file identifier to be downloaded and the identifier of the above-mentioned target cluster, such as cluster 00. According to the identifier of the above-mentioned target cluster, the FPS server 4 downloads the file to be downloaded corresponding to the above-mentioned download file identifier in the above-mentioned target cluster of the standby cluster, for example, cluster 00 in the computer room 2 downloads the file to be downloaded corresponding to the above-mentioned download file identifier. If the acquisition is successful, the target cluster returns the acquisition success to the FPS server 4, and accordingly, the FPS server 4 returns the acquisition success information to the FPS client. In addition, if the acquisition fails, the FPS server 2 can download the file to be downloaded corresponding to the above-mentioned download file identifier in the target cluster of the main cluster, for example, cluster 00 in the computer room 1 downloads the file to be downloaded corresponding to the above-mentioned download file identifier. If the acquisition is successful, the target cluster returns the acquisition success to the FPS server 2, and accordingly, the FPS server 2 returns the acquisition success information to the FPS client.

[0107] In the embodiment of the present application, the client sends a first download request to the third server, and the first download request carries the identifier of the file to be downloaded and the identifier of the target cluster. Then, the third server downloads the file to be downloaded corresponding to the above download file identifier in the target cluster of the main cluster according to the identifier of the target cluster. If the acquisition fails, the third server returns the acquisition failure information to the client, and the client sends a second download request to the fourth server, and the second download request carries the above file to be downloaded and the identifier of the target cluster. Then, the fourth server downloads the file to be downloaded corresponding to the above download file identifier in the target cluster of the backup cluster according to the identifier of the target cluster. The backup cluster is a backup cluster of the above main cluster, which reduces the probability of file acquisition failure caused by the failure of the server-side storage part and improves the success rate of the client file download retry.

[0108] Combination of the above Figure 2-6 The file processing method according to the embodiment of the present application is described in detail from the client side. Figure 7 A further file processing method provided according to an embodiment of the present application is described in detail from the application server side. It should be understood that some concepts and features described on the server side correspond to those described on the client side, and for the sake of brevity, repeated descriptions are appropriately omitted.

[0109] Figure 7 A flowchart of another file processing method is provided for the embodiment of the present application. The execution subject of this embodiment can be Figure 1 The server side in the embodiment shown includes a first server and a second server. Figure 7 As shown, the method may include:

[0110] S701: A first server receives a first upload request sent by a client, where the first upload request carries a file to be stored.

[0111] Here, the first server needs to establish a connection with the client before receiving the first upload request sent by the client. Exemplarily, if the first server receives the first connection request sent by the client, the first connection request is sent to the first server according to the address of the first server after the client determines that the network area to which the client belongs is the preset network service area. Then the first server establishes a connection with the client according to the first connection request.

[0112] Exemplarily, the client may obtain pre-stored server parameters, which include server weights and server addresses. Then, the client determines the first server according to the server weights, obtains the address of the first server from the addresses of the servers, and determines whether the network area to which the client belongs is a preset network service area. If the network area to which the client belongs is a preset network service area, the client sends a first connection request to the first server according to the address of the first server. The first server establishes a connection with the client according to the first connection request.

[0113] If the network area to which the client belongs is not the preset network service area, the client sends a second connection request to the preset gateway, and the second connection request carries the identifier of the first server. The preset gateway establishes a connection with the client according to the second connection request, and sends a third connection request to the first server according to the identifier of the first server. The first server establishes a connection with the preset gateway according to the third connection request.

[0114] Here, if the network area to which the client belongs is not the preset network service area, the client cannot establish a connection with the first server, and the client needs to establish a connection with the first server through the preset gateway. That is, the client can send a second connection request to the preset gateway, and the second connection request carries the identifier of the first server. Figure 1 Taking the case where the client uploads and downloads files to the server in the FPS as an example, the client can send a second connection request to the tgw. The tgw establishes a connection with the client, and sends a third connection request to the first server according to the identifier of the first server. The first server establishes a connection with the tgw according to the third connection request.

[0115] In an embodiment of the present application, the interaction mode between the above-mentioned client and the server in the above-mentioned server side can be determined based on the network area to which the client belongs, so as to meet different application needs and be suitable for the application.

[0116] S702: The first server stores the file to be stored in a first cluster according to the first upload request. The first cluster is used to store the file uploaded by the client.

[0117] S703: If the storage fails, the first server returns storage failure information to the client, and the storage failure information carries an identifier of the first cluster.

[0118] S704: The second server receives a second upload request sent by the client, where the second upload request carries the file to be stored and an identifier of the first cluster.

[0119] S705: The second server stores the file to be stored in a second cluster according to the second upload request. The second cluster is different from the first cluster and is used to store the file uploaded by the client.

[0120] Here, before storing the file to be stored in the second cluster according to the second upload request, the second server may also determine whether the second cluster is in a normal state, where the normal state is a state in which the second cluster has the ability to store the file to be stored. If the second cluster is in the normal state, the second server stores the file to be stored in the second cluster according to the second upload request.

[0121] If, with a first preset time period as a storage cycle, the second cluster successfully stores the file uploaded by the client in the storage cycle for a first preset number of consecutive times, the second server determines that the second cluster is in the normal state. Alternatively, if, within a second preset time period, the success rate of the second cluster in successfully storing the file uploaded by the client the most recent time is greater than or equal to a first preset success rate threshold, the second server determines that the second cluster is in the normal state.

[0122] In an embodiment of the present application, the second server may adopt a heartbeat mechanism to determine whether the second cluster is in the normal state. For example, a first preset time period is taken as a storage cycle, such as 5 seconds as a storage cycle. If the second cluster successfully stores the files uploaded by the client in the first preset number of consecutive storage cycles, for example, the files uploaded by the client are successfully stored in 5 consecutive storage cycles, then it is determined that the second cluster is in the normal state.

[0123] In addition to the above, the second server may also adopt a success rate monitoring mechanism to determine whether the second cluster is in the normal state. For example, within a second preset time period, such as 20 seconds, the success rate of the second cluster's most recent successful storage of the file uploaded by the client is greater than or equal to a first preset success rate threshold, for example, greater than 95%, then it is determined that the second cluster is in the normal state.

[0124] If the second cluster is in the normal state, the second server stores the file to be stored in the second cluster according to the second upload request, thereby improving the storage success rate and further improving the success rate of the client upload retry.

[0125] In addition, if the second cluster is in the abnormal state or downtime state, the second server switches clusters and stores the file to be stored in another cluster different from the second cluster according to the second upload request.

[0126] Among them, the second server can use a success rate monitoring mechanism to determine whether the second cluster is in the abnormal state. For example, within a second preset time period, such as 20 seconds, the success rate of the second cluster in the most recent successful storage of the file uploaded by the client is less than the first preset success rate threshold, such as less than 95%, then the second cluster is judged to be in the abnormal state. Similarly, the second server can use a heartbeat mechanism to determine whether the second cluster is in the downtime state. For example, a third preset time period is a storage cycle, such as 5 seconds as a storage cycle. If the second cluster fails to store the file uploaded by the client for the second preset number of consecutive storage cycles, for example, the second cluster fails to store the file uploaded by the client for three consecutive storage cycles, then the second cluster is judged to be in the downtime state. In addition, the above-mentioned second server may also adopt a success rate monitoring mechanism to determine whether the above-mentioned second cluster is in the above-mentioned downtime state. For example, within a second preset time period, such as within 20 seconds, the above-mentioned second cluster stores the files uploaded by the above-mentioned client for the third most recent preset number of times, and the success rate of storing the files uploaded by the client for the fourth preset number of times is less than the first preset success rate threshold. For example, the success rate of 3 times out of the most recent 4 times is lower than 95%, then it is determined that the above-mentioned second cluster is in the above-mentioned downtime state.

[0127] In addition, the second server is different from the first server.

[0128] Here, the client uploads a file to the first server. If the first server returns a storage failure message, it means that the client fails to upload the file. The reason for the failure may be that the first cluster where the first server stores the file has a storage failure. In order to solve this problem, in an embodiment of the present application, when the client retries to upload the file, it sends the file to be stored to a server, and the server stores the file to be stored in a cluster, where the cluster is different from the cluster where the file uploaded by the client last time was stored, thereby reducing the probability of storage failure caused by partial failure of the server-side storage.

[0129] In addition, the failure of the client to upload the file may be caused not only by the storage failure of the first cluster, but also by the problem of the first service itself, such as performance failure, which leads to signal interruption, thereby making it impossible for the first server to transfer the file to the first cluster, resulting in the failure of the first cluster storage. In order to solve this problem, in an embodiment of the present application, when the client retry to upload the file, it sends the file to be stored to a certain server, and the server stores the file to be stored in a certain cluster, wherein the certain server is different from the server selected by the client for the last file upload, thereby solving the problem of file upload failure caused by the server itself and improving the success rate of the client file upload retry.

[0130] In the embodiment of the present application, the second upload request may also carry a retry flag, and the second server stores the file to be stored in the second cluster after determining that the second upload request is a retry request according to the retry flag. That is, the second server stores the file to be stored in the second cluster only after determining that the second upload request is a retry request according to the retry flag, so that when the client retries the upload, the server will change the cluster to store the file uploaded by the client.

[0131] Here, before the second server receives the second upload request sent by the client, it needs to establish a connection with the client. The specific connection establishment process refers to the connection establishment process between the first server and the client, which will not be repeated here.

[0132] In an embodiment of the present application, a client sends a first upload request to a first server, and the first upload request carries the file to be stored. Then, the first server stores the file to be stored in a first cluster. If the storage fails, the first server returns storage failure information to the client, and the storage failure information carries the identifier of the first cluster. Then, the client sends a second upload request to a second server, and the second upload request carries the identifier of the file to be stored and the first cluster. Then, the second server stores the file to be stored in a second cluster, which is different from the first cluster, thereby solving the problem of file upload failure in the existing file storage system. Moreover, in an embodiment of the present application, when the client retries to upload, the second server stores the file to be stored in a second cluster, which is different from the cluster where the file uploaded by the client last time was stored, thereby reducing the probability of storage failure caused by failure of the server-side storage part and improving the success rate of the client file upload retry.

[0133] In addition, in the embodiment of the present application, after the client uploads a file to the server, and the server successfully stores the file uploaded by the client into the corresponding cluster, the client can send a download request to the server, that is, the client can download the file from the server. Figure 8 The above-mentioned server side includes a third server and a fourth server, such as Figure 8 As shown, the method includes:

[0134] S801: The third server receives a first download request sent by the client, where the first download request carries an identifier of a file to be downloaded and an identifier of a target cluster.

[0135] Here, before the third server receives the first download request sent by the client, it needs to establish a connection with the client. The specific connection establishment process refers to the connection establishment process between the first server and the client, which will not be repeated here.

[0136] S802: The third server obtains the to-be-downloaded file corresponding to the download file identifier in the target cluster of the main cluster according to the identifier of the target cluster, where the main cluster includes the target cluster.

[0137] The target cluster is a cluster where the to-be-downloaded file corresponding to the to-be-downloaded file identifier is stored. The main cluster includes the target cluster.

[0138] S803: If the acquisition fails, the third server returns acquisition failure information to the client.

[0139] S804: The fourth server receives a second download request sent by the client, where the second download request carries the identifier of the file to be downloaded and the identifier of the target cluster.

[0140] S805: The fourth server obtains the to-be-downloaded file corresponding to the download file identifier in the target cluster of the standby cluster according to the identifier of the target cluster, the standby cluster includes the target cluster, and the standby cluster is a backup cluster of the main cluster.

[0141] Here, before the fourth server obtains the to-be-downloaded file corresponding to the download file identifier in the target cluster of the standby cluster according to the identifier of the target cluster, it may also determine whether the target cluster of the standby cluster is in a down state, where the target cluster of the standby cluster does not have the ability to obtain the to-be-downloaded file. If the target cluster of the standby cluster is not in a down state, the fourth server obtains the to-be-downloaded file corresponding to the download file identifier in the target cluster of the standby cluster according to the identifier of the target cluster.

[0142] Wherein, if the third preset time period is taken as a storage cycle, and the target cluster of the standby cluster fails to store the file uploaded by the client in the second preset number of consecutive storage cycles, then the fourth server determines that the target cluster of the standby cluster is in the downtime state. Alternatively, if within the fourth preset time period, the target cluster of the standby cluster has stored the files uploaded by the client for the third preset number of times recently, and the success rate of storing the files uploaded by the client for the fourth preset number of times is less than the second preset success rate threshold, then the fourth server determines that the target cluster of the standby cluster is in the downtime state, and the fourth preset number of times is less than the third preset number of times.

[0143] In an embodiment of the present application, the fourth server may adopt a heartbeat mechanism to determine whether the target cluster of the standby cluster is in the downtime state. For example, a third preset time period is taken as a storage cycle, such as 5s as a storage cycle. If the target cluster of the standby cluster fails to store the file uploaded by the client for the second preset number of consecutive storage cycles, for example, the file uploaded by the client fails to be stored for three consecutive storage cycles, then it is determined that the target cluster of the standby cluster is in the downtime state.

[0144] In addition to the above, the fourth server may also adopt a success rate monitoring mechanism to determine whether the target cluster of the standby cluster is in the downtime state. For example, within a fourth preset time period, such as 20 seconds, the target cluster of the standby cluster has stored the files uploaded by the client for the third preset number of times recently, and the success rate of storing the files uploaded by the client for the fourth preset number of times is less than the second preset success rate threshold. For example, 3 out of the last 4 times have a success rate lower than 95%, then the target cluster of the standby cluster is in the downtime state.

[0145] If the target cluster of the backup cluster is not in the downtime state, the fourth server obtains the file to be downloaded corresponding to the download file identifier in the target cluster of the backup cluster according to the identifier of the target cluster, thereby improving the success rate of obtaining the download file, and further improving the success rate of the client download retry.

[0146] Here, the above-mentioned target cluster of the above-mentioned standby cluster is not in the above-mentioned downtime state, which can be understood as the above-mentioned target cluster of the above-mentioned standby cluster is in an abnormal state or a normal state, wherein the judgment of the abnormal state or the normal state can refer to the description of the above-mentioned second server judging whether the second cluster is in the above-mentioned abnormal state or the normal state, which will not be repeated here.

[0147] If the target cluster of the standby cluster is in the downtime state, the fourth server switches clusters and obtains the file to be downloaded corresponding to the download file identifier in the target cluster of the main cluster according to the identifier of the target cluster.

[0148] If we consider here that the second server receives the second upload request sent by the client, and the fourth server receives the second download request sent by the client, that is, the file upload and download situation between the client and the server, the status of the cluster in the server includes three types: the normal state, the abnormal state and the downtime state.

[0149] For the above-mentioned normal state, cluster switching is not performed for file uploading and downloading between the above-mentioned client and the above-mentioned server; for the above-mentioned abnormal state, cluster switching is performed for file uploading between the above-mentioned client and the above-mentioned server, but cluster switching is not performed for downloading; for the above-mentioned downtime state, cluster switching is performed for file uploading between the above-mentioned client and the above-mentioned server, and cluster switching is also performed for file downloading. Please refer to the above for details and will not be repeated here.

[0150] Accordingly, the embodiment of the present application may set a recovery mechanism, for example, after a period of time, for example, 5 minutes after the above cluster switching, 5% of the traffic will be switched back, and if there is no failure within 1 minute, 2.5% more traffic will be switched (to 7.5%, and so on). If the success rate after switching is lower than 95%, the above abnormal state will be processed again and the timing will be restarted.

[0151] Exemplarily, the cluster switching process for uploading and downloading files between the client and the server may be as shown in Table 1.

[0152] Table 1

[0153]

[0154] In addition, the third server is different from the fourth server.

[0155] Here, the client sends a first download request to the third server. If the third server returns a failed acquisition message, it means that the client fails to download the file. The reason for the failure may be that a storage failure occurs in the target cluster of the main cluster where the third server downloads the file to be downloaded. In order to solve this problem, in an embodiment of the present application, when the client retries to download the file, it sends a second download request to the fourth server, and the server downloads the file to be downloaded corresponding to the download file identifier in the target cluster of the backup cluster, wherein the backup cluster is a backup cluster of the main cluster, thereby reducing the probability of file acquisition failure caused by partial failure of the server-side storage.

[0156] In addition, the failure of the client to download the file may be caused not only by the storage failure of the target cluster of the main cluster, but also by the problem of the third service itself, such as performance failure, which leads to signal interruption, thereby making it impossible for the third server to transmit the first download request to the target cluster of the main cluster, resulting in failure to obtain the file. In order to solve this problem, in an embodiment of the present application, when retrying the file download, the client sends a second download request to the fourth server, and the server downloads the file to be downloaded corresponding to the download file identifier in the target cluster of the backup cluster, wherein the fourth server is different from the third server, thereby solving the problem of file download failure caused by the server's own problems and improving the success rate of the client's file download retry.

[0157] In the embodiment of the present application, the second download request may also carry a retry flag, and after the fourth server determines that the second download request is a retry request according to the retry flag, it downloads the file to be downloaded corresponding to the download file flag in the target cluster of the standby cluster according to the flag of the target cluster. That is, the fourth server will download the file to be downloaded in the target cluster of the standby cluster only after it determines that the second download request is a retry request according to the retry flag, so that when the client retries the download, the server will change the cluster to download the corresponding file.

[0158] Here, before the fourth server receives the second download request sent by the client, it needs to establish a connection with the client. The specific connection establishment process refers to the connection establishment process between the first server and the client, which will not be repeated here.

[0159] In the embodiment of the present application, the client sends a first download request to the third server, and the first download request carries the identifier of the file to be downloaded and the identifier of the target cluster. Then, the third server downloads the file to be downloaded corresponding to the above download file identifier in the target cluster of the main cluster according to the identifier of the target cluster. If the acquisition fails, the third server returns the acquisition failure information to the client, and the client sends a second download request to the fourth server, and the second download request carries the above file to be downloaded and the identifier of the target cluster. Then, the fourth server downloads the file to be downloaded corresponding to the above download file identifier in the target cluster of the backup cluster according to the identifier of the target cluster. The backup cluster is a backup cluster of the above main cluster, which reduces the probability of file acquisition failure caused by the failure of the server-side storage part and improves the success rate of the client file download retry.

[0160] Corresponding to the file processing method of the above embodiment, Fig. 9 This is a schematic diagram of the structure of a file processing device provided in an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown. Fig. 9 A schematic diagram of the structure of a file processing device provided in an embodiment of the present application, the file processing device 90 includes: a first upload module 901 and a second upload module 902. The file processing device here can be the above-mentioned client itself, or a chip or integrated circuit that implements the functions of the client. It should be noted here that the division of the first upload module and the second upload module is only a division of logical functions, and physically the two can be integrated or independent.

[0161] Among them, the first upload module 901 is used to send a first upload request to the first server, the first upload request carries the file to be stored, the first upload request is used to instruct the first server to store the file to be stored in the first cluster, and the first cluster is used to store the file uploaded by the client.

[0162] The second upload module 902 is used to send a second upload request to the second server if storage failure information returned by the first server is received, and the storage failure information carries the identifier of the first cluster. The second upload request carries the identifier of the file to be stored and the first cluster. The second upload request is used to instruct the second server to store the file to be stored in the second cluster. The second cluster is different from the first cluster, and the second cluster is used to store the files uploaded by the client.

[0163] In a possible implementation, the first uploading module 901 is further configured to:

[0164] Obtaining pre-stored server parameters, wherein the server parameters include a server weight and a server address;

[0165] Determine the first server according to the weight of the server, and obtain the address of the first server from the addresses of the server;

[0166] Determining whether the network area to which the client belongs is a preset network service area;

[0167] If the network area to which the client belongs is the preset network service area, a first connection request is sent to the first server according to the address of the first server, where the first connection request is used to instruct the first server to establish a connection with the client.

[0168] In a possible implementation, the first uploading module 901 is further configured to:

[0169] If the network area to which the client belongs is not the preset network service area, a second connection request is sent to the preset gateway, the second connection request carries the identifier of the first server, the second connection request is used to instruct the preset gateway to establish a connection with the client, and according to the identifier of the first server, a third connection request is sent to the first server, the third connection request is used to instruct the first server to establish a connection with the preset gateway.

[0170] In a possible implementation manner, the second server is different from the first server.

[0171] In a possible implementation, the second upload request further carries a retry flag, and the second upload request is used to instruct the second server to store the file to be stored in the second cluster after determining that the second upload request is a retry request according to the retry flag.

[0172] The device provided in the embodiment of the present application can be used to perform the above Figure 2 The technical solution of the method embodiment shown has similar implementation principles and technical effects, and will not be repeated here in the embodiments of the present application.

[0173] Fig.10 A schematic diagram of the structure of another file processing device provided in an embodiment of the present application. Fig. 9 Based on the illustrated embodiment, the file processing device 90 further includes: a first downloading module 903 and a second downloading module 904 .

[0174] Among them, the first download module 903 is used to send a first download request to the third server, the first download request carries the identifier of the file to be downloaded and the identifier of the target cluster, and the first download request is used to instruct the third server to obtain the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the main cluster according to the identifier of the target cluster, and the main cluster includes the target cluster.

[0175] The second download module 904 is used to send a second download request to the fourth server if it receives the acquisition failure information returned by the third server. The second download request carries the identifier of the file to be downloaded and the identifier of the target cluster. The second download request is used to instruct the fourth server to obtain the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the backup cluster according to the identifier of the target cluster. The backup cluster includes the target cluster, and the backup cluster is a backup cluster of the main cluster.

[0176] In a possible implementation manner, the third server is different from the fourth server.

[0177] The device provided in the embodiment of the present application can be used to perform the above Figure 5 The technical solution of the method embodiment shown has similar implementation principles and technical effects, and will not be repeated here in the embodiments of the present application.

[0178] Fig.11 This is a schematic diagram of the structure of another file processing device provided in an embodiment of the present application. Fig.11As shown, the file processing device 110 includes: a first server 1101 and a second server 1102. The file processing device here can be the above-mentioned server itself, or a chip or integrated circuit that implements the function of the server. It should be noted here that the division of the first server and the second server is only a division of logical functions, and the two can be integrated or independent physically.

[0179] The first server 1101 is used to receive a first upload request sent by a client, where the first upload request carries a file to be stored.

[0180] The first server 1101 is used to store the file to be stored in a first cluster according to the first upload request, and the first cluster is used to store the file uploaded by the client.

[0181] The first server 1101 is configured to return storage failure information to the client if storage fails, wherein the storage failure information carries an identifier of the first cluster.

[0182] The second server 1102 is configured to receive a second upload request sent by the client, where the second upload request carries the file to be stored and an identifier of the first cluster.

[0183] The second server 1102 is used to store the file to be stored in a second cluster according to the second upload request. The second cluster is different from the first cluster, and the second cluster is used to store the file uploaded by the client.

[0184] In a possible implementation, the second server 1102 is further configured to:

[0185] Determine whether the second cluster is in a normal state, where the normal state is a state in which the second cluster has the ability to store the file to be stored;

[0186] If the second cluster is in the normal state, the file to be stored is stored in the second cluster according to the second upload request.

[0187] In a possible implementation, the second server 1102 is further configured to:

[0188] If the first preset time period is taken as a storage cycle, and the second cluster successfully stores the file uploaded by the client in the storage cycle for a first preset number of consecutive times, then the second server determines that the second cluster is in the normal state;

[0189] or

[0190] If, within a second preset time period, the success rate of the second cluster in successfully storing the file uploaded by the client the most recent time is greater than or equal to a first preset success rate threshold, the second server determines that the second cluster is in the normal state.

[0191] In a possible implementation, the second server 1102 is different from the first server 1101 .

[0192] In a possible implementation, the second upload request further carries a retry flag;

[0193] The second server 1102 is further used for:

[0194] The second upload request is determined to be a retry request according to the retry identifier.

[0195] In a possible implementation, the first server 1101 is further configured to:

[0196] receiving a first connection request sent by the client, wherein the first connection request is sent by the client to the first server according to the address of the first server after determining that the network area to which the client belongs is a preset network service area;

[0197] Establish a connection with the client according to the first connection request.

[0198] In a possible implementation, the first server 1101 is further configured to:

[0199] receiving a third connection request sent by a preset gateway, wherein the third connection request is sent by the preset gateway to the first server according to the identifier of the first server, the preset gateway receives the second connection request sent by the client, and establishes a connection with the client, the second connection request is sent by the client to the preset gateway after determining that the network area to which the client belongs is not a preset network service area, and the second connection request carries the identifier of the first server;

[0200] Establishing a connection with the preset gateway according to the third connection request.

[0201] The device provided in the embodiment of the present application can be used to perform the above Figure 7 The technical solution of the method embodiment shown has similar implementation principles and technical effects, and will not be repeated here in the embodiments of the present application.

[0202] Fig.12 A schematic diagram of the structure of another file processing device provided in an embodiment of the present application. Fig.11Based on the illustrated embodiment, the file processing device 110 further includes: a third server 1103 and a fourth server 1104 .

[0203] The third server 1103 is used to receive a first download request sent by the client, where the first download request carries an identifier of a file to be downloaded and an identifier of a target cluster.

[0204] The third server 1103 is configured to obtain, according to the identifier of the target cluster, the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the main cluster, wherein the main cluster includes the target cluster.

[0205] The third server 1103 is used to return acquisition failure information to the client if the acquisition fails.

[0206] The fourth server 1104 is configured to receive a second download request sent by the client, where the second download request carries the identifier of the file to be downloaded and the identifier of the target cluster.

[0207] The fourth server 1104 is configured to obtain the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the standby cluster according to the identifier of the target cluster, the standby cluster including the target cluster, and the standby cluster is a backup cluster of the main cluster.

[0208] In a possible implementation, the third server 1103 is different from the fourth server 1104 .

[0209] In a possible implementation, the fourth server 1104 is specifically configured to:

[0210] Determine whether the target cluster of the standby cluster is in a downtime state, where the downtime state is a state in which the target cluster of the standby cluster does not have the ability to obtain the file to be downloaded;

[0211] If the target cluster of the standby cluster is not in a downtime state, then according to the identifier of the target cluster, the file to be downloaded corresponding to the identifier of the file to be downloaded is obtained in the target cluster of the standby cluster.

[0212] In a possible implementation, the fourth server 1104 is specifically configured to:

[0213] If the third preset time period is used as a storage cycle, and the target cluster of the standby cluster fails to store the file uploaded by the client in the storage cycle for a second preset number of consecutive times, it is determined that the target cluster of the standby cluster is in the downtime state;

[0214] or

[0215] If within a fourth preset time period, the target cluster of the standby cluster has stored the files uploaded by the client for the third preset number of times recently, and the success rate of storing the files uploaded by the client for the fourth preset number of times is less than the second preset success rate threshold, then it is determined that the target cluster of the standby cluster is in the down state, and the fourth preset number of times is less than the third preset number of times.

[0216] The device provided in the embodiment of the present application can be used to perform the above Figure 8 The technical solution of the method embodiment shown has similar implementation principles and technical effects, and will not be repeated here in the embodiments of the present application.

[0217] Optionally, Fig.13A and 13B A possible basic hardware architecture of the client described in this application is schematically provided.

[0218] See also Fig.13A and 13B The client 1300 includes at least one processor 1301 and a communication interface 1303. Optionally, it may also include a memory 1302 and a bus 1304.

[0219] The client 1300 may be a computer or a server, and this application does not impose any particular limitation on this. In the client 1300, the number of processors 1301 may be one or more. Fig.13A and 13B Only one of the processors 1301 is shown. Optionally, the processor 1301 may be a central processing unit (CPU), a graphics processing unit (GPU), or a digital signal processor (DSP). If the client 1300 has multiple processors 1301, the types of the multiple processors 1301 may be different or the same. Optionally, the multiple processors 1301 of the client 1300 may also be integrated into a multi-core processor.

[0220] The memory 1302 stores computer instructions and data; the memory 1302 may store computer instructions and data required to implement the above-mentioned file processing method provided in the present application, for example, the memory 1302 stores instructions for implementing the steps of the above-mentioned file processing method. The memory 1302 may be any one or any combination of the following storage media: non-volatile memory (e.g., read-only memory (ROM), solid-state drive (SSD), hard disk (HDD), optical disk), volatile memory.

[0221] The communication interface 1303 can provide information input / output for the at least one processor, and can also include any one or any combination of the following devices: a network interface (eg, Ethernet interface), a wireless network card, and other devices with network access functions.

[0222] Optionally, the communication interface 1303 may also be used for the client 1300 to perform data communications with other computing devices or terminals.

[0223] Further optional, Fig.13A and 13B A thick line represents the bus 1304. The bus 1304 can connect the processor 1301 with the memory 1302 and the communication interface 1303. Thus, through the bus 1304, the processor 1301 can access the memory 1302, and can also use the communication interface 1303 to exchange data with other computing devices or terminals.

[0224] In the present application, the client 1300 executes the computer instructions in the memory 1302, so that the client 1300 implements the above-mentioned file processing method provided in the present application, or enables the client 1300 to deploy the above-mentioned file processing device.

[0225] From the perspective of logical function division, for example, Fig.13A As shown, the memory 1302 may include a first upload module 901 and a second upload module 902. The inclusion here only refers to the fact that when the instructions stored in the memory are executed, the functions of the first upload module and the second upload module can be realized respectively, and is not limited to the physical structure.

[0226] A possible design, such as Fig. 13B As shown, the memory 1302 may include a first download module 903 and a second download module 904. The inclusion here only refers to the fact that when the instructions stored in the memory are executed, the functions of the first download module and the second download module can be realized respectively, and is not limited to the physical structure.

[0227] In addition, the above client can Fig.13A and 13B In addition to being implemented through software, it can also be implemented through hardware as a hardware module or as a circuit unit.

[0228] Optionally, Fig.14A and 14B A possible basic hardware architecture of the server side described in this application is schematically provided.

[0229] See also Fig.14A and 14BThe server end 1400 includes at least one processor 1401 and a communication interface 1403. Further optionally, it may also include a memory 1402 and a bus 1404.

[0230] The server side 1400 may be a computer or a server, and this application does not impose any particular limitation on this. In the server side 1400, the number of processors 1401 may be one or more. Fig.14A and 14B Only one of the processors 1401 is shown. Optionally, the processor 1401 may be a CPU, a GPU, or a DSP. If the server 1400 has multiple processors 1401, the types of the multiple processors 1401 may be different or the same. Optionally, the multiple processors 1401 of the server 1400 may also be integrated into a multi-core processor.

[0231] The memory 1402 stores computer instructions and data; the memory 1402 may store computer instructions and data required to implement the above-mentioned file processing method provided in the present application, for example, the memory 1402 stores instructions for implementing the steps of the above-mentioned file processing method. The memory 1402 may be any one or any combination of the following storage media: non-volatile memory (such as ROM, SSD, HDD, optical disk), volatile memory.

[0232] The communication interface 1403 can provide information input / output for the at least one processor, and can also include any one or any combination of the following devices: a network interface (eg, Ethernet interface), a wireless network card, and other devices with network access functions.

[0233] Optionally, the communication interface 1403 may also be used for data communication between the server 1400 and other computing devices or terminals.

[0234] Further optional, Fig.14A and 14B A thick line represents the bus 1404. The bus 1404 can connect the processor 1401 with the memory 1402 and the communication interface 1403. Thus, through the bus 1404, the processor 1401 can access the memory 1402, and can also use the communication interface 1403 to exchange data with other computing devices or terminals.

[0235] In the present application, the server side 1400 executes the computer instructions in the memory 1402, so that the server side 1400 implements the above-mentioned file processing method provided in the present application, or enables the server side 1400 to deploy the above-mentioned file processing device.

[0236] From the perspective of logical function division, for example, Fig.14AAs shown, the memory 1402 may include a first server 1101 and a second server 1102. The inclusion here only refers to the fact that when the instructions stored in the memory are executed, the functions of the first server and the second server can be realized respectively, and is not limited to the physical structure.

[0237] A possible design, such as Fig. 14B As shown, the memory 1402 may include a third server 1103 and a fourth server 1104. The inclusion here only refers to the fact that when the instructions stored in the memory are executed, the functions of the third server and the fourth server can be realized respectively, and is not limited to the physical structure.

[0238] In addition, the server can also Fig.14A and 14B In addition to being implemented through software, it can also be implemented through hardware as a hardware module or as a circuit unit.

[0239] The present application provides a computer-readable storage medium storing a computer program, wherein the computer program enables a server to execute Figures 2 to 6 The method described.

[0240] The present application provides another computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program enables a server to execute Figure 7 or Figure 8 The method described.

[0241] The present application provides a computer program product, comprising computer instructions, wherein the computer instructions are executed by a processor. Figures 2 to 6 The method described.

[0242] The present application provides another computer program product, including computer instructions, wherein the computer instructions are executed by a processor. Figure 7 or Figure 8 The method described.

[0243] The present application provides a chip, including at least one processor and a communication interface, wherein the communication interface provides information input and / or output for the at least one processor. Further, the chip may also include at least one memory, wherein the memory is used to store computer instructions. The at least one processor is used to call and run the computer instructions to execute the above-mentioned Figures 2 to 6 The method described.

[0244] The present application provides another chip, comprising at least one processor and a communication interface, wherein the communication interface provides information input and / or output for the at least one processor. Further, the chip may also include at least one memory, wherein the memory is used to store computer instructions. The at least one processor is used to call and run the computer instructions to execute the above-mentioned Figure 7 or Figure 8 The method described.

[0245] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0246] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0247] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

Claims

1. A file processing method, characterized in that: Applied to the client, including: Obtaining pre-stored server parameters, wherein the server parameters include a server weight and a server address; Determine a first server according to the weight of the server, and obtain the address of the first server from the addresses of the server; Determining whether the network area to which the client belongs is a preset network service area; If the network area to which the client belongs is the preset network service area, sending a first connection request to the first server according to the address of the first server, wherein the first connection request is used to instruct the first server to establish a connection with the client; Sending a first upload request to a first server, wherein the first upload request carries a file to be stored, and the first upload request is used to instruct the first server to store the file to be stored in a first cluster, and the first cluster is used to store the file uploaded by the client; If storage failure information returned by the first server is received, and the storage failure information carries the identifier of the first cluster, a second upload request is sent to the second server, and the second upload request carries the identifier of the file to be stored and the first cluster. The second upload request is used to instruct the second server to store the file to be stored in the second cluster. The second cluster is different from the first cluster, and the second cluster is used to store the files uploaded by the client.

2. The method according to claim 1, characterized in that After determining whether the network area to which the client belongs is a preset network service area, the method further includes: If the network area to which the client belongs is not the preset network service area, a second connection request is sent to the preset gateway, the second connection request carries the identifier of the first server, the second connection request is used to instruct the preset gateway to establish a connection with the client, and according to the identifier of the first server, a third connection request is sent to the first server, the third connection request is used to instruct the first server to establish a connection with the preset gateway.

3. The method according to any one of claims 1 to 2, characterized in that The method further comprises: Sending a first download request to a third server, the first download request carrying an identifier of a file to be downloaded and an identifier of a target cluster, the first download request being used to instruct the third server to obtain, according to the identifier of the target cluster, a file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the main cluster, wherein the main cluster includes the target cluster; If the acquisition failure information returned by the third server is received, a second download request is sent to the fourth server, and the second download request carries the identifier of the file to be downloaded and the identifier of the target cluster. The second download request is used to instruct the fourth server to obtain the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the backup cluster according to the identifier of the target cluster. The backup cluster includes the target cluster, and the backup cluster is a backup cluster of the main cluster.

4. A file processing method, characterized in that: Applied to a server side, the server side includes a first server and a second server, and the method includes: The first server receives a first connection request sent by a client, wherein the first connection request is sent by the client to the first server according to the address of the first server after determining that the network area to which the client belongs is a preset network service area, the address of the first server is obtained from the address of the server in the pre-stored server parameters, the server parameters include the weight of the server and the address of the server, and the first server is determined according to the weight of the server; Establishing a connection with the client according to the first connection request; The first server receives a first upload request sent by the client, where the first upload request carries a file to be stored; The first server stores the file to be stored in a first cluster according to the first upload request, and the first cluster is used to store the file uploaded by the client; If the storage fails, the first server returns storage failure information to the client, and the storage failure information carries the identifier of the first cluster; The second server receives a second upload request sent by the client, where the second upload request carries the file to be stored and an identifier of the first cluster; The second server stores the file to be stored in a second cluster according to the second upload request, where the second cluster is different from the first cluster and is used to store the file uploaded by the client.

5. The method according to claim 4, characterized in that Before the second server stores the file to be stored in the second cluster according to the second upload request, the method further includes: The second server determines whether the second cluster is in a normal state, where the normal state is a state in which the second cluster has the ability to store the file to be stored; The second server stores the file to be stored in the second cluster according to the second upload request, including: If the second cluster is in the normal state, the second server stores the file to be stored in the second cluster according to the second upload request.

6. The method according to claim 5, characterized in that The second server determines whether the second cluster is in a normal state, including: If the first preset time period is taken as a storage cycle, and the second cluster successfully stores the file uploaded by the client in the storage cycle for a first preset number of consecutive times, then the second server determines that the second cluster is in the normal state; or If, within a second preset time period, the success rate of the second cluster in successfully storing the file uploaded by the client the most recent time is greater than or equal to a first preset success rate threshold, the second server determines that the second cluster is in the normal state.

7. The method according to any one of claims 4 to 6, characterized in that Before the first server receives the first upload request sent by the client, the method further includes: The first server receives a third connection request sent by a preset gateway, wherein the third connection request is sent by the preset gateway to the first server according to the identifier of the first server, the preset gateway receives a second connection request sent by the client, and establishes a connection with the client, the second connection request is sent by the client to the preset gateway after determining that the network area to which the client belongs is not a preset network service area, and the second connection request carries the identifier of the first server; Establishing a connection with the preset gateway according to the third connection request.

8. The method according to any one of claims 4 to 6, characterized in that The server side includes a third server and a fourth server, and the method further includes: The third server receives a first download request sent by the client, where the first download request carries an identifier of a file to be downloaded and an identifier of a target cluster; The third server obtains the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the main cluster according to the identifier of the target cluster, and the main cluster includes the target cluster; If the acquisition fails, the third server returns acquisition failure information to the client; The fourth server receives a second download request sent by the client, where the second download request carries the identifier of the file to be downloaded and the identifier of the target cluster; The fourth server obtains the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the standby cluster according to the identifier of the target cluster, the standby cluster includes the target cluster, and the standby cluster is a backup cluster of the main cluster.

9. The method according to claim 8, characterized in that Before the fourth server obtains the file to be downloaded corresponding to the to-be-download file identifier in the target cluster of the standby cluster according to the identifier of the target cluster, the method further includes: The fourth server determines whether the target cluster of the standby cluster is in a downtime state, where the downtime state is a state in which the target cluster of the standby cluster does not have the ability to obtain the file to be downloaded; The fourth server obtains the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the standby cluster according to the identifier of the target cluster, including: If the target cluster of the standby cluster is not in a downtime state, the fourth server obtains the file to be downloaded corresponding to the identifier of the file to be downloaded in the target cluster of the standby cluster according to the identifier of the target cluster.

10. The method according to claim 9, characterized in that The fourth server determines whether the target cluster of the standby cluster is in a downtime state, including: If the third preset time period is used as a storage cycle, and the target cluster of the standby cluster fails to store the file uploaded by the client in the storage cycle for a second preset number of consecutive times, the fourth server determines that the target cluster of the standby cluster is in the downtime state; or If within a fourth preset time period, the target cluster of the standby cluster has stored the files uploaded by the client for the third preset number of times recently, and the success rate of storing the files uploaded by the client for the fourth preset number of times is less than the second preset success rate threshold, then the fourth server determines that the target cluster of the standby cluster is in the down state, and the fourth preset number of times is less than the third preset number of times.

11. A file processing device, characterized in that: Applied to the client, including: A first upload module, configured to send a first upload request to a first server, wherein the first upload request carries a file to be stored, and the first upload request is used to instruct the first server to store the file to be stored in a first cluster, and the first cluster is used to store the file uploaded by the client; a second uploading module, configured to send a second upload request to a second server if storage failure information returned by the first server is received, the storage failure information carrying the identifier of the first cluster, the second upload request carrying the identifier of the file to be stored and the first cluster, the second upload request being used to instruct the second server to store the file to be stored in a second cluster, the second cluster being different from the first cluster, and the second cluster being used to store the file uploaded by the client; The first uploading module is further used for: Obtaining pre-stored server parameters, wherein the server parameters include a server weight and a server address; Determine a first server according to the weight of the server, and obtain the address of the first server from the addresses of the server; Determining whether the network area to which the client belongs is a preset network service area; If the network area to which the client belongs is the preset network service area, a first connection request is sent to the first server according to the address of the first server, where the first connection request is used to instruct the first server to establish a connection with the client.

12. A file processing device, characterized in that: Applied to the server side, including a first server and a second server; The first server is configured to receive a first upload request sent by a client, where the first upload request carries a file to be stored; The first server is used to store the file to be stored in a first cluster according to the first upload request, and the first cluster is used to store the file uploaded by the client; The first server is configured to return storage failure information to the client if storage fails, wherein the storage failure information carries an identifier of the first cluster; The second server is configured to receive a second upload request sent by the client, where the second upload request carries the file to be stored and an identifier of the first cluster; The second server is used to store the file to be stored in a second cluster according to the second upload request, where the second cluster is different from the first cluster and is used to store the file uploaded by the client; Wherein, the first server is further used for: receiving a first connection request sent by the client, wherein the first connection request is sent by the client to the first server according to the address of the first server after determining that the network area to which the client belongs is a preset network service area, the address of the first server is obtained from the address of the server in the pre-stored server parameters, the server parameters include the weight of the server and the address of the server, and the first server is determined according to the weight of the server; Establish a connection with the client according to the first connection request.

13. A client, characterized in that: include: processor; Memory; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor, wherein the computer program includes instructions for executing the method according to any one of claims 1 to 3.

14. A server, characterized in that: include: processor; Memory; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor, wherein the computer program includes instructions for executing the method according to any one of claims 4 to 10.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program enables the server to execute the method according to any one of claims 1 to 3 or any one of claims 4 to 10.

16. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are executed by a processor to execute the method according to any one of claims 1 to 3 or any one of claims 4 to 10.