File management method and system, electronic equipment and storage medium
By determining and using the server with the highest file interaction efficiency in the enterprise's private file storage system, the problem of inefficient file interaction across regions is solved and the work efficiency of staff is improved.
Patent Information
- Application Number
- CN202411859096.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the enterprise's private file storage system, cross-region file interaction is inefficient, resulting in corresponding reduction in work efficiency of staff.
By determining the optimal server for maintaining the team space, that is, the server with the highest file interaction efficiency, in the first server, and returning its access address to the first client, the client can interact with the team space through the optimal server.
Improve the efficiency of file interaction, thereby improving the work efficiency of staff.
Smart Images

Figure CN119814763A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of file management, and in particular to a file management method, system, electronic device and storage medium. Background Art
[0002] For data security reasons, enterprises generally do not store their internal data on cloud services, but rather store them through private file storage systems. Moreover, since enterprises have different teams in different regions, they will create corresponding team spaces for the teams for data security and access convenience, and deploy sites corresponding to the teams locally, i.e. servers. Multiple sites will be built for different regions, each site providing services for local teams. Then the private file storage system of an enterprise or company will evolve into a multi-site LAN connected by a virtual private network (VPN), thereby providing file services for the company's personnel.
[0003] However, in the above-mentioned private file storage system, when the company's staff need to interact with files in the team space across regions, they need to go remotely to the site where the team space is located to interact with the files. Due to network delays, the file interaction efficiency is low, which in turn causes low work efficiency of the staff. Summary of the invention
[0004] The embodiments of the present application provide a file management method, system, electronic device and storage medium. When a staff member needs to interact with files in a team space across regions, the optimal server will be determined from the servers maintaining the team space, and the optimal server will be used to interact with the files in the team space, thereby improving the file interaction efficiency and further improving the work efficiency of the staff member.
[0005] In a first aspect, an embodiment of the present application provides a file management method, the method comprising:
[0006] The first client sends a first file interaction request to the first server, wherein the first file interaction request includes a team space, and the first client and the first server are located in the same area;
[0007] The first server acquires at least one second server that maintains the team space, wherein the at least one second server is located in a different region from the first client, and each second server has a full set of files of the team space;
[0008] The first server determines a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server;
[0009] The first server returns the access address of the target server to the first client;
[0010] The first client uses the access address of the target server to perform file interaction with the team space through the target server.
[0011] In a second aspect, an embodiment of the present application provides a file management system, the file management system comprising: a first client, a first server, and at least one second server, wherein the first client and the first server are located in the same area, and the first client and the at least one second server are located in different areas;
[0012] The first client is used to send a first file interaction request to the first server, wherein the first file interaction request includes a team space;
[0013] The first server is used to obtain at least one second server that maintains the team space, each second server having a full set of files of the team space;
[0014] The first server is used to determine a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server;
[0015] The first server is used to return the access address of the target server to the first client;
[0016] The first client is used to use the access address of the target server to perform file interaction with the team space through the target server.
[0017] In a third aspect, an embodiment of the present application provides a file management method, applied to a first client, the method comprising:
[0018] Sending a first file interaction request to a first server, wherein the first file interaction request includes a team space, the first file interaction request is used to request file interaction with the team space, and the first client and the first server are located in the same area;
[0019] receiving an access address of a target server from the first server, wherein the target server is a server with the highest file interaction efficiency among at least one second server determined by the first server, and the at least one second server is a server maintaining the team space;
[0020] Use the access address of the target server to perform file interaction with the team space through the target server.
[0021] In a fourth aspect, an embodiment of the present application provides a client, comprising: a transceiver unit and a processing unit;
[0022] The transceiver unit is used for the first server to send a first file interaction request, wherein the first file interaction request includes a team space, the first file interaction request is used to request file interaction with the team space, and the first client and the first server are located in the same area;
[0023] The transceiver unit is configured to receive an access address of a target server from the first server, wherein the target server is a server with the highest file interaction efficiency among at least one second server determined by the first server, and the at least one second server is a server maintaining the team space;
[0024] The processing unit is used to use the access address of the target server to perform file interaction with the team space through the target server.
[0025] In a fifth aspect, an embodiment of the present application provides a file management method, which is applied to a first server, and the method includes:
[0026] receiving a first file interaction request from a first client, wherein the first file interaction request includes a team space, the first file interaction request is used to request file interaction with the team space, and the first client and the first server are located in the same area;
[0027] Acquire at least one second server that maintains the team space, wherein the at least one second server is located in a different region from the first client, and each second server has a full set of files of the team space;
[0028] Determining a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server;
[0029] The access address of the target server is returned to the first client, so that the first client uses the access address of the target server to perform file interaction with the team space through the target server.
[0030] In a sixth aspect, an embodiment of the present application provides a server, including: a transceiver unit and a processing unit;
[0031] The transceiver unit is configured to receive a first file interaction request from a first client, wherein the first file interaction request includes a team space, the first file interaction request is used to request file interaction with the team space, and the first client and the first server are located in the same area;
[0032] The processing unit is configured to obtain at least one second server for maintaining the team space, wherein the at least one second server is located in a different region from the first client, and each second server has a full set of files of the team space;
[0033] Determining a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server;
[0034] The transceiver unit is further used to return the access address of the target server to the first client, so that the first client uses the access address of the target server to interact with the team space through the target server.
[0035] In the seventh aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, the processor being connected to the memory, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory, so that the electronic device executes the method described in the first aspect, the third aspect or the fifth aspect.
[0036] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect, the third aspect, or the fifth aspect is implemented.
[0037] In a ninth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the method described in the first aspect, the third aspect or the fifth aspect is implemented.
[0038] Implementing the embodiments of the present application has the following beneficial effects:
[0039] It can be seen that in an embodiment of the present application, under the enterprise's private file storage system, when the first client needs to interact with files in a team space across regions, it first sends a first file interaction request to the server in the region, that is, the first server, and then the first server responds to the first file interaction request to determine at least one second server that maintains the team space. Then the first server determines the target server among the at least one second server, that is, determines the server with the highest file interaction efficiency, that is, selects the best server among the at least one second server, and returns the access address of the target server to the first client, so that the first client can use the access address to interact with the team space through the target server, thereby interacting with the team space through the server with the highest file interaction efficiency, and then can quickly complete the file interaction, thereby improving the work efficiency of the staff. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 A schematic diagram of a file management system provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of another file management system provided in an embodiment of the present application;
[0043] Figure 3 A flowchart of a file management method provided in an embodiment of the present application;
[0044] Figure 4 A schematic diagram of a file management system provided in an embodiment of the present application;
[0045] Figure 5 A schematic diagram of a client provided in an embodiment of the present application;
[0046] Figure 6 A schematic diagram of a server provided in an embodiment of the present application;
[0047] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] 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 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.
[0049] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof 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 limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0050] Reference to "embodiments" herein means that a particular feature, result, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0051] First of all, it should be noted that the file management system involved in this application can be a file management system for an enterprise or company, which is compatible with the security requirements of enterprise data. In the file management system of this application, servers located in different areas exchange data and communicate through a virtual private network (VPN). Moreover, devices located in the same area in the file management system, such as servers located in the same area, communicate data through a local area network.
[0052] Furthermore, the files in the team space in this application can be any type of files, such as enterprise contract files, enterprise financial files, etc. This application mainly uses drug development files, such as GMP files, as an example for explanation.
[0053] Secondly, since the file management of this application is for the file management of the enterprise's private file storage system, the cross-domain communication in this application is carried out through a VPN connection. For example, the communication between servers in different areas is carried out through a VPN connection; and the communication within the local area is carried out through a local area network, for example, the communication between the client and the load balancer within the local area.
[0054] See also Figure 1 , Figure 1 A schematic diagram of a file management system provided in an embodiment of the present application. Figure 1 As shown, the file management system includes multiple servers, namely server 1, server 2, ..., server n-1, and service area n. The multiple servers are distributed in multiple areas, and each area is deployed with one or more of the multiple servers. This application is mainly described by taking one server deployed in each area as an example. Figure 1 As shown, server 1 is deployed in region 1, server 2 is deployed in region 2, ..., server n is deployed in region n-1 and region n.
[0055] based on Figure 1 The file management system shown, for any team space, when creating the team space, the team space can be deployed to multiple servers of the above-mentioned file management system, and the multiple servers can be servers located in multiple different areas. Optionally, a server is determined in each different area to deploy the team space, that is, the multiple servers correspond to the multiple different areas one by one, or multiple servers can be selected in each different area to deploy the team space, that is, the multiple servers do not correspond to the multiple different areas one by one. This application does not limit the deployment method.
[0056] For example, if Figure 1 As shown, when creating team space 1, team space 1 can be deployed to server 1 in region 1 and server 2 in region 2. When creating team space 2, team space 2 can be deployed to server n-1 in region n-1 and server n in region n.
[0057] Exemplarily, a team space can be created through the above-mentioned console. Exemplarily, the console can obtain a team space creation event, which includes basic information of the team space (for example, the name of the team space) and the names of multiple servers, that is, the team space creation event indicates that the team space is deployed on the multiple services. Then, the console can send a team space creation request to each server, wherein the team space creation request includes basic information of the team space, and the team space creation request is used to indicate that the team space is created based on the basic information. After each server has created the team space, the console can bind the team space to the multiple servers, obtain the binding relationship between the team space and the multiple servers, and synchronize the binding relationship to each server in the file management system, so that each server can query the server to which the team space is bound, and so that the servers that deploy the team space can use the binding relationship for data synchronization.
[0058] Furthermore, for multiple servers deployed with the same team space, data can be synchronized between the multiple servers, so that each server has all the files or data in the team space. Figure 1 The team space 2 shown in the figure will perform data synchronization between the server n-1 and the server n where the team space 2 is deployed, so that both the server n-1 and the server n can obtain the full files or full data of the team space 2.
[0059] Therefore, based on Figure 1 The file management system shown, when the first client performs file interaction with the team space across regions, the first client sends a first file interaction request to the first server, wherein the first file interaction request includes the team space, the first client and the first server are located in the same region, wherein the first server can be any one of the servers in the above-mentioned file management system; the first server obtains at least one second server that maintains the team space, the at least one second server is in a different region from the first client, and each second server has all the files of the team space; the first server determines the target server among the at least one second server, wherein the target server is the server with the highest file interaction efficiency among the at least one second server; the first server returns the access address of the target server to the first client; the first client uses the access address of the target server to perform file interaction with the team space through the target server.
[0060] For example, when the first client in Region 1 needs to interact with Team Space 2 through files, the first client can send a first file interaction request to the first server in Region 1, namely Server 1, which indicates that the first client needs to interact with Team Space 2. Then, Server 1 responds to the first file interaction request, obtains the servers maintaining Team Space 2 as Server n-1 and Server n, and then determines the target server between Server n-1 and Server n. For example, if the target server is Server n, Server 1 returns the access address of Server n to the first client in Region 1. Then, the first client can use the access address to interact with Team Space 2 through Server n through the access address.
[0061] See also Figure 2 , Figure 2 A schematic diagram of another file management system provided in an embodiment of the present application. Figure 1 The document management system shown is based on Figure 2 The file management system shown in the figure also has a load balancer (NGINX) deployed on each server. Figure 2 As shown in the figure, NGINX1, NGINX2, ..., NGINX n-1, and NGINX n are deployed on server 1, server 2, ..., server n-1, and service area n, respectively. After a load balancer is deployed on each server, all requests arriving at the server will first pass through the load balancer of the server, and then the load balancer will route the request to the corresponding device. For example, for Figure 2 In the file management system shown, NGINX1 of server 1 can establish a VPN connection with NGINX2 of server 2, ..., NGINX n-1 of server n-1, and NGINX n of server n. If server 1 needs to communicate with server 2, ..., server n-1, and server n, server 1 can route through NGINX1, route the request of server 1 to the NGINX of the corresponding server, and then the NGINX routes it to the corresponding server, thereby completing the communication between the servers. Similarly, NGINX2 of server 2 can also establish a VPN connection with NGINX1 of server 1, ..., NGINX n-1 of server n-1, and NGINX n of server n to communicate with the corresponding servers, and NGINX n of server n can also establish a VPN connection with NGINX1 of server 1, NGINX2 of server 2, ..., and NGINX n-1 of server n-1 to communicate with the corresponding servers.
[0062] Exemplarily, for the above-mentioned first file interaction request, the first client first sends the first file interaction request to NGINX1, and then NGINX1 will route the first file interaction request to server 1, and let server 1 process the first file interaction request, and then server 1 will also determine the target server in response to the first file interaction request, and return the access address of the target server to the first client. Finally, the first client sends a second file interaction request to NGINX1, and the second file interaction request includes the access address of the target server. Then NGINX1 will respond to the second file interaction request and route the second file interaction request to the load balancer of the target server, and then the load balancer of the target server will route the second interaction request to the target server, thereby interacting with the team space.
[0063] It should be noted that in Figure 2 In the file management system shown, when each server side is configured with a load balancer, the load balancers in different areas communicate and exchange data through VPN connections.
[0064] It can be seen that based on Figure 1 and Figure 2 The file management system shown, in an embodiment of the present application, under the enterprise's private file storage system, when the first client needs to interact with files in a team space across regions, it first sends a first file interaction request to the server in the local area, that is, the first server, and then the first server responds to the first file interaction request to determine at least one second server that maintains the team space, and then the first server determines the target server among the at least one second server, that is, determines the server with the highest file interaction efficiency, that is, selects the best server among the at least one second server, and returns the access address of the target server to the first client, so that the first client can use the access address to interact with the team space through the target server, thereby interacting with the team space through the server with the highest file interaction efficiency, and thus can quickly complete the file interaction, thereby improving the work efficiency of the staff.
[0065] See also Figure 3 , Figure 3 A flowchart of a file management method provided in an embodiment of the present application. The method is applied to the above-mentioned file management system. The method includes but is not limited to the following steps:
[0066] 301: A first client sends a first file interaction request to a first server, wherein the first file interaction request includes a team space, and the first client and the first server are located in the same area.
[0067] Exemplarily, when the first client needs to interact with the files in the team space, it can request to interact with the files in the team space by sending a request. Figure 1 and Figure 2 In the file management system shown, a first client can send a first file interaction request to a first server through a local area network where the first client and the first server are located, wherein the first file interaction request includes a team space, i.e., includes an identifier of the team space, thereby indicating through the first file interaction request that the first client needs to interact with files in the team space.
[0068] It should be noted that the logos of the team spaces involved in this application can all be understood as the names of the team spaces, and will not be repeated later.
[0069] It should be noted that when the first client receives the user's interaction behavior with the files in the team space, the first client only knows that the user needs to interact with the team space for files, and does not know which server to use to interact with the team space for files. Therefore, the first file interaction request does not carry the destination access address, that is, it does not carry the destination IP address, that is, the request header of the first file interaction request does not carry the destination IP address.
[0070] Furthermore, the first server locally corresponds to a first load balancer, so after the first client generates the first file interaction request, it will first send the first file interaction request to the first load balancer through the local area network. The first load balancer parses the first file interaction request and routes the first file interaction request to the first server. Specifically, the first load balancer parses the first file interaction request and determines that the first file interaction request does not carry a destination IP address, then the first load balancer will route the first file interaction request to the local server by default, that is, to the first server, so that the first client sends the first file interaction request to the first server.
[0071] Among them, the file interaction with the team space in this application includes but is not limited to: uploading files to the team space, downloading files from the team space, viewing, browsing, sharing, forwarding or collecting files in the team space. This application mainly uses uploading files to the team space and downloading files from the team space as examples for illustration.
[0072] 302: The first server obtains at least one second server that maintains the team space, where the at least one second server is located in a different region from the first client, and each second server has all files of the team space.
[0073] First, the cross-domain interaction of files in this application is explained and illustrated.
[0074] For enterprises, there may be different offices in different locations, that is, there are different teams in different areas. For data security and management specifications, team spaces will be created for different teams to store and manage the team's files. In addition, for data reliability and stability, a corresponding site (also understood as a server) is generally created in the area where the team is located (which can also be understood as the office location of the team) to deploy the team's team space to the site, that is, to maintain the team's team space through the site. For example, taking a drug research and development company as an example, different laboratories will be deployed in different areas, and different laboratories need to manage and store their own drug research and development files separately. Therefore, corresponding team spaces will be created for different laboratories, and corresponding sites will be created for each laboratory in different laboratory areas, so that the team spaces of different laboratories will be deployed to the sites corresponding to the laboratories. However, members of the team may have business trips, academic exchanges, or learning, which will cause the members to have cross-domain access to the team space. For example, members of Team A go to the area where Team B is located for academic exchanges. When members of Team A need to access the team space corresponding to Team A, they will access the team space in the area where Team B is located, resulting in cross-domain access to the team space.
[0075] In one embodiment of the present application, when deploying each team space, in order to ensure the stability of the team space, a team space can also be deployed on multiple servers, and the multiple servers can be located in the same area or in different areas, which is not limited by the present application. In this way, when one of the servers is down or fails, other servers can continue to provide services, thereby ensuring the stability of the team space.
[0076] In addition, the server maintenance team space involved in this application can also be understood as a server management team space, or the team space is deployed on the server, or the team space is distributed on the server. These descriptions are essentially similar and do not need to be distinguished.
[0077] Exemplarily, first, the first server will parse the first file interaction request to obtain the team space, that is, obtain the identifier of the team space. Then, in response to the first file interaction request, the first server determines at least one second server corresponding to the above-mentioned team space based on the binding relationship between the team space and the server, wherein the at least one second server is in a different area from the first client, but the at least one second server may be in a different area or the same area, and this application does not limit this. It can be understood that when the number of at least one second server is multiple, the above-mentioned team space is deployed on multiple servers. Through multi-site deployment, when a server fails, other servers can still provide services to the team members of the team space, thereby maintaining the stability of the team space.
[0078] In one embodiment of the present application, when creating the above-mentioned team space, relevant personnel, such as operation and maintenance personnel or management personnel, can create the above-mentioned team space through the visual interface of the console. For example, relevant personnel can fill in the basic information of the team space in the visual interface, such as the name of the team space, and fill in the server to be deployed by the team, that is, the at least one second server mentioned above. Then, the relevant personnel perform the operation of creating the team space on the visual interface, and the corresponding console can obtain the team space creation event for the team space, and the team space creation event indicates that the team space is deployed on the at least one second server. In response to the team space creation event, the console sends a team space creation request to each of the at least one second server, wherein the team space creation request is used to indicate the creation of the team space, and the team space creation request includes the basic information of the team space.
[0079] Optionally, the above basic information includes, but is not limited to: the name of the team space, the version of the team space, the storage capacity of the team space, the purpose description of the team space, the access rights of the team space, and the like.
[0080] Accordingly, each second server deploys the team space on each second server in response to the team creation request. For example, each second server allocates corresponding storage space to the team space according to the storage capacity required by the team space. Furthermore, after creating the team space, each second server sends a team space creation response to the team space creation request to the console, wherein the team space creation response is used to indicate that the team space has been created.
[0081] Furthermore, after the console receives the team creation responses from all the second servers, that is, all the second servers have completed the creation of the team space, the console will establish a binding relationship between the team space and the at least one second server, that is, bind the team space to the at least one second server. And synchronize the binding relationship to the first server and the at least one second server, that is, synchronize the binding relationship to each server in the above-mentioned file management system, so that each server stores the binding relationship between the team space and the server.
[0082] It should be noted that the process of creating any team space in this application is similar to the above and will not be repeated.
[0083] Therefore, the first server can determine at least one second server corresponding to the team space based on the binding relationship between the team space and the server and the identifier (name) of the team space.
[0084] 303: The first server determines a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server.
[0085] Exemplarily, the first server determines the file interaction efficiency of each second server, wherein the file interaction efficiency of each second server is the efficiency of the first client interacting with the files in the team space through the second server. For example, when the file interaction is uploading a file to the team space, the file interaction efficiency is the speed of uploading the file to the team space; when the file interaction is downloading a file from the team space, the file interaction efficiency is the speed of downloading the file from the team space.
[0086] Exemplarily, the first server obtains the communication delay between the first client and each second server, wherein the communication delay is the time difference between the first client sending a request to the second server and the first client receiving a response to the request returned by the second server.
[0087] Exemplarily, the first server obtains a time difference, which is the time difference between a first moment and a second moment, the first moment being the moment when the first server receives the first file interaction request sent by the first client, and the second moment being the moment when the first server last receives the first file interaction request sent by the second client located in the first area, that is, the moment when the client located in the first area interacts with the team space. The second client and the first client can be the same client or different clients, and this application does not limit this. Then, based on the time difference, the first server determines the communication delay between the first client and each second server.
[0088] Optionally, if the time difference is greater than or equal to a threshold, the first server returns the access address of each second server to the first client, and optionally, the access address is the IP address of each second server. It should be noted that each server in the file management system stores the IP addresses of all servers in the file management system. Optionally, the console can obtain the IP address of each server in the file management system, and then synchronize the IP address of each server to any server in the management system.
[0089] Then, the first client sends a delay test request to each second server based on the access address of each second server. Optionally, the delay test request can be a ping test request. Exemplarily, each server is deployed with a load balancer, then for any second server, the first client first sends a delay test request to the first load balancer of the first server through the local area network of the first area, wherein the delay test request includes the access address of the second server, that is, the request header of the delay test request carries the access address of the second server, then the first load balancer responds to the request header of the delay test request carrying the access address of the second server, and routes the delay test request to the second load balancer corresponding to the second server, that is, sends the delay request to the second load balancer through a VPN connection. Similarly, the second load balancer responds to the request header of the delay test request carrying the access address of the second server, and routes the delay test request to the second server. Then, in response to the delay test request, the second server returns a test response to the delay test request to the first client. Exemplarily, the second server sends the delay test response to the second load balancer, and then the second load balancer routes the delay test response to the first load balancer, and the first load balancer routes the delay test response to the first client.
[0090] Then, the first client obtains the time of sending the delay test request and the time of receiving the delay test response, and calculates the difference between the two times, and uses the difference as the communication delay between the first client and the second server. After performing the above delay test on each second server, the communication delay between the first client and each second server can be obtained. Finally, the first client sends the communication delay corresponding to the first client and each second server to the first server. Similarly, the first client can first send the communication delay corresponding to each second server to the first load balancer, which will be routed to the first server by the first load balancer.
[0091] Optionally, if the time difference is less than a threshold, the first server obtains the communication delay between the second client and each second server, that is, obtains the communication delay between the second client and each second server from the cache, and uses the communication delay between the second client and each second server as the communication delay between the first client and each second server.
[0092] It should be noted that since communication delay is an indicator parameter related to the time period, generally speaking, communication delay will not change all the time, and the communication delay within a period of time is similar. Therefore, when the time difference in interaction with the team space is less than the threshold, the first server will use the communication delay during the last interaction as the communication delay this time, and will no longer instruct the client to test the communication delay with the second server. It will directly reuse the communication delay tested last time to avoid the client frequently performing invalid communication delay tests, which will result in the client being unable to interact with the server in a timely manner, and therefore unable to interact with the files in the team space in a timely manner. This will improve the efficiency of file interaction with the team space while using the server with the highest file interaction efficiency.
[0093] Furthermore, the first server can also obtain the bandwidth occupancy rate of each second server, that is, the bandwidth occupancy rate of the second server at the current moment, and the first server can obtain the bandwidth occupancy rate of each second server in real time. For example, each second server can report its own bandwidth occupancy rate to the console in real time. Then, the first server can obtain the bandwidth occupancy rate of each second server from the console in real time. Alternatively, the first server directly obtains the bandwidth occupancy rate of each second server from each second server in real time, and this application does not limit the method of obtaining the bandwidth occupancy rate of each second server.
[0094] Finally, the first server determines the file interaction efficiency of each second server based on the communication delay between each second server and the first client and the bandwidth occupancy rate of each second server.
[0095] Exemplarily, the first server normalizes the communication delay between each second server and the first client to obtain the communication delay rate between the first client and each second server, and the normalized result is used as the communication delay rate between the first client and each second server. Then, based on a preset weight, the communication delay rate between the first client and each second server and the bandwidth occupancy rate of each second server are weighted to obtain the file interaction efficiency of each second server. Exemplarily, the file interaction efficiency of each second server can be expressed by formula (1):
[0096] D rate =1-(α*r Latency +β*rBandwidth ) formula (1);
[0097] Among them, α and β are preset weights, r Latency is the communication delay rate, r Bandwidth is the bandwidth utilization rate, D rate For file interaction efficiency.
[0098] It can be seen that the higher the file interaction efficiency of the second server, the smaller the bandwidth occupancy rate and communication delay rate of the second server, and the higher the speed and efficiency of interacting with the files in the team space through the second server. Therefore, the first server uses the second server with the highest file interaction efficiency among at least one second server as the target server.
[0099] In one embodiment of the present application, before the first server returns the access address of each second server to the first client, the first server obtains the distance between the first client and each second server, for example, the distance may be the distance between the location of the first client and the location of each second server. Then, the first server sorts at least one second server in order of distance from far to near, obtains the sorting result of the at least one second server, and returns the sorting result to the first client. Correspondingly, the first client generates a delay test request corresponding to each second server, and then the first client stores the delay test request corresponding to at least one second server in the message queue in the order of the sorting result; finally, the sending thread of the first client can take out the delay test request corresponding to at least one second server from the message queue in turn, and send the delay test request corresponding to at least one second server to the first load balancer of the first server respectively, so that the delay test request corresponding to the second server with the farthest distance will be sent to the first load balancer first, and the delay test request will be routed to the second server with the farthest distance first, that is, the delay test request will be sent to the second server with the relatively farthest distance first, so that the first client can obtain the delay test response returned by each second server at almost the same time as much as possible, and obtain the communication delay corresponding to each second server at almost the same time as much as possible, so that the first client can quickly obtain the communication delay of at least one second server, and package the communication delay of at least one second server and send it to the first server, so that the first server can decide the target server as soon as possible, thereby improving the file interaction efficiency and the work efficiency of the staff.
[0100] 304: The first server returns the access address of the target server to the first client.
[0101] The access address is the IP address of the target server.
[0102] 305: The first client uses the access address of the target server to perform file interaction with the team space through the target server.
[0103] Exemplarily, the first client sends a second file interaction request to the target server, wherein the second file interaction request is used to request file interaction with the team space, and the second file interaction request includes an access address of the target server.
[0104] Specifically, the first client sends the second file interaction request to the first load balancer corresponding to the first server, and carries the access address of the target server in the request header of the second file interaction request. The first load balancer routes the file interaction request to the load balancer of the target server in response to the access address, and then the load balancer of the target server routes the second file interaction request to the target server.
[0105] Finally, the target server processes the second file interaction request, thereby enabling the first client to interact with the team space. Optionally, when the first client uploads a file to the team space, the target server can receive the file uploaded by the first client based on the second file interaction request, and store the file in the storage space corresponding to the team space. Optionally, when the first client downloads a file from the team space, the target server determines the file to be downloaded by the first client based on the second file interaction request, then reads the file from the storage space corresponding to the team space, and returns the file to the first client.
[0106] It can be seen that in an embodiment of the present application, under the enterprise's private file storage system, when the first client needs to interact with files in a team space across regions, it first sends a first file interaction request to the server in the region, that is, the first server, and then the first server responds to the first file interaction request to determine at least one second server that maintains the team space. Then the first server determines the target server among the at least one second server, that is, determines the server with the highest file interaction efficiency, that is, selects the best server among the at least one second server, and returns the access address of the target server to the first client, so that the first client can use the access address to interact with the team space through the target server, thereby interacting with the team space through the server with the highest file interaction efficiency, and then can quickly complete the file interaction, thereby improving the work efficiency of the staff.
[0107] In one embodiment of the present application, if the second server A obtains a change operation for files in the team space, the second server A can determine the remaining second servers based on the binding relationship between the team space and at least one second server, wherein the second server A is any one of the at least one second server, and the remaining servers are servers other than the second server A in the at least one second server. Then, the second server A synchronizes the change operation to the remaining second servers so that each second server performs the change operation on the files in the team space, so that when any second server changes the files in the team space, the remaining second servers will also change synchronously, so that each second server has the same and full amount of files in the team space. Optionally, the second server can synchronize the above-mentioned change operation to the remaining second servers through the rsync tool.
[0108] The change operation includes, but is not limited to: uploading files to the team space, updating files in the team space, deleting files in the team space, modifying files in the team space, and the like.
[0109] In one embodiment of the present application, if the at least one second server includes the first server, that is, the team space is also deployed on the first server, then the file interaction behavior of the first client is local area access. After receiving the first file interaction request, the first server can determine that the team space is deployed on the first server. Then, the first server can directly process the first file interaction request to enable the first client to perform file interaction with the team space. That is to say, if the team space for file interaction of the client is deployed locally, then the client can directly perform file interaction with the team space locally without the need for cross-regional interaction.
[0110] In one embodiment of the present application, the first file processing interaction request includes a user's identity identifier. Before the first server decides on a target server, it can also determine whether the user has authority based on the identity identifier; if so, at least one second server corresponding to the above-mentioned team space is obtained; if not, the first client returns a failure prompt message.
[0111] In one embodiment of the present application, since each area may be deployed with multiple servers, when creating a team space, relevant personnel may not know which server to deploy the team space on. Therefore, the present application can design a solution for automatically screening servers to deploy team spaces.
[0112] Exemplarily, when creating the above-mentioned team space, relevant personnel can fill in the basic information of the team space in the visual interface. In addition to the basic information mentioned above, the basic information may also include: the team that the team space is to serve, the region where the team that the team space is to serve is located, and the number of servers that the team space is to deploy.
[0113] Therefore, the console determines the type of file produced by the team to be served by the team space; based on the type of the file, determines the size of the file, as well as the number of accesses and size of the file in each time period, wherein the correspondence between the type of the file, the number of accesses and the size is pre-statisticed, and the various time periods can be obtained by dividing a day according to the granularity of hours. Then, the console determines the target time period based on the number of accesses in each time period, wherein the number of accesses in the target time period is the largest; then, the console determines the bandwidth required for the file in the target time period based on the number of accesses and the size of the file in the target time period. The console determines multiple third servers deployed in the region based on the region where the team to be served by the team space is located, and obtains the occupied bandwidth of each third server in the target time period for each third server. For example, the deployed team space on each third server is obtained, and the occupied bandwidth of each third server in the target time period is determined based on the bandwidth occupancy of the deployed team space on each third server in the target time period, wherein the bandwidth occupancy of the deployed team space on each third server in the target time period can be determined based on the access records of the team members to the deployed team space on each third server. Then, the console determines the idle bandwidth of each third server within the target time period based on the occupied bandwidth of each third server within the target time period and the total bandwidth of each third server, and filters out the at least one second server from the multiple third servers in order of the idle bandwidth from high to low, wherein the number of the at least one second server is the number of servers to be deployed in the team space.
[0114] It can be seen that in the embodiment of the present application, when creating a team space, you only need to provide basic information related to the team space, and the console will automatically distribute the team space to the most suitable server, thereby improving the intelligence and automation of team space creation and reducing the complexity of team space creation.
[0115] See also Figure 4 , Figure 4 A schematic diagram of a file management system provided in an embodiment of the present application. Figure 4As shown, the file management system 400 includes: a first client 401, a first server 402, and at least one second server 403, wherein the first client 401 and the first server 402 are located in the same area, and the first client 401 and the at least one second server 403 are located in different areas;
[0116] The first client 401 is used to send a first file interaction request to the first server, wherein the first file interaction request includes a team space;
[0117] The first server 402 is used to obtain at least one second server for maintaining the team space, each second server having a full set of files of the team space;
[0118] The first server 402 is used to determine a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server;
[0119] The first server 402 is used to return the access address of the target server to the first client;
[0120] The first client 401 is used to use the access address of the target server to perform file interaction with the team space through the target server.
[0121] It should be noted that the specific functions of the first client 401, the first server 402 and the second server 403 can be found in the above detailed description of the first client 401, the first server 402 and the second server 403, and will not be described again.
[0122] See also Figure 5 , Figure 5 A schematic diagram of a client provided in an embodiment of the present application. The client 500 includes: a transceiver unit 501 and a processing unit 502, wherein:
[0123] The transceiver unit 501 is used for the first server to send a first file interaction request, wherein the first file interaction request includes a team space, the first file interaction request is used to request file interaction with the team space, and the first client and the first server are located in the same area;
[0124] The transceiver unit 501 is used to receive an access address of a target server from the first server, wherein the target server is a server with the highest file interaction efficiency among at least one second server determined by the first server, and the at least one second server is a server maintaining the team space;
[0125] The processing unit 502 is configured to use the access address of the target server to perform file interaction with the team space through the target server.
[0126] For more specific functions of the transceiver unit 501 and the processing unit 502, please refer to the above method embodiment and will not be described in detail again.
[0127] See also Figure 6 , Figure 6 A schematic diagram of a server provided in an embodiment of the present application. The server 600 includes: a transceiver unit 601 and a processing unit 602, wherein:
[0128] The transceiver unit 601 is configured to receive a first file interaction request from a first client, wherein the first file interaction request includes a team space, the first file interaction request is used to request file interaction with the team space, and the first client and the first server are located in the same area;
[0129] The processing unit 602 is configured to obtain at least one second server that maintains the team space, wherein the at least one second server is located in a different region from the first client, and each second server has a full set of files of the team space;
[0130] Determining a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server;
[0131] The transceiver unit 601 is further used to return the access address of the target server to the first client, so that the first client uses the access address of the target server to interact with the team space through the target server.
[0132] For more specific functions of the transceiver unit 601 and the processing unit 602, please refer to the above method embodiment and will not be described in detail again.
[0133] See also Figure 7 , Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 700 includes a transceiver 701, a processor 702 and a memory 703. They are connected via a bus 704. The memory 703 is used to store computer programs and data, and can transmit the data stored in the memory 703 to the processor 702. Optionally, the electronic device 700 can be the above-mentioned client 500 or the above-mentioned server 600.
[0134] Optionally, when the electronic device 700 is the above-mentioned client 500, the processor 702 is used to read the computer program in the memory 703 to perform the following operations:
[0135] Control the transceiver 701 to send a first file interaction request to the first server, wherein the first file interaction request includes a team space, the first file interaction request is used to request file interaction with the team space, and the first client and the first server are located in the same area;
[0136] Controlling the transceiver 701 to receive an access address of a target server from the first server, wherein the target server is a server with the highest file interaction efficiency among at least one second server determined by the first server, and the at least one second server is a server maintaining the team space;
[0137] Use the access address of the target server to perform file interaction with the team space through the target server.
[0138] Specifically, the transceiver 701 may be Figure 5 The transceiver unit 501 of the client 500 of the embodiment described above, the processor 702 may be Figure 5 The processing unit 502 of the client 500 of the described embodiment.
[0139] Optionally, when the electronic device 700 is the above-mentioned server 600, the processor 702 is used to read the computer program in the memory 703 to perform the following operations:
[0140] The control transceiver 701 receives a first file interaction request from a first client, wherein the first file interaction request includes a team space, the first file interaction request is used to request file interaction with the team space, and the first client and the first server are located in the same area;
[0141] Acquire at least one second server that maintains the team space, wherein the at least one second server is located in a different region from the first client, and each second server has a full set of files of the team space;
[0142] Determining a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server;
[0143] The control transceiver 701 returns the access address of the target server to the first client, so that the first client uses the access address of the target server to perform file interaction with the team space through the target server.
[0144] Specifically, the transceiver 701 may be Figure 6 The transceiver unit 601 of the server 600 of the embodiment described above, the processor 702 may be Figure 6 The processing unit 602 of the server 600 of the described embodiment.
[0145] It should be understood that the client in this application may include a smart phone, a computer, a tablet, a computer, an Internet device or a wearable device, etc. The above-mentioned client is only an example, not an exhaustive list, and includes but is not limited to the above-mentioned electronic devices. In practical applications, the above-mentioned client may also include: a smart vehicle terminal, a computer device, etc.
[0146] The server of the present application may be a cloud computing server, a content delivery network (CDN) server, a network time protocol (NTP), a domain name resolution system (DNS) server, and other types of servers. The above servers are only examples, not exhaustive, and include but are not limited to the above servers.
[0147] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement part or all of the steps of any file management method recorded in the above method embodiments.
[0148] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any file management method recorded in the above method embodiments.
[0149] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0150] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0151] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which 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, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0152] 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.
[0153] 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 integrated unit may be implemented in the form of hardware or in the form of a software program module.
[0154] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.
[0155] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.
[0156] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A file management method, characterized in that: The method comprises: The first client sends a first file interaction request to the first server, wherein the first file interaction request includes a team space, and the first client and the first server are located in the same area; The first server acquires at least one second server that maintains the team space, wherein the at least one second server is located in a different region from the first client, and each second server has a full set of files of the team space; The first server determines a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server; The first server returns the access address of the target server to the first client; The first client uses the access address of the target server to perform file interaction with the team space through the target server.
2. The method according to claim 1, characterized in that The first server determines a target server among the at least one second server, including: The first server obtains a communication delay between the first client and each second server; The first server obtains the bandwidth occupancy rate of each second server; The first server determines the file interaction efficiency of each second server based on the communication delay between each second server and the first client and the bandwidth occupancy rate of each second server; Based on the file interaction efficiency of each second server, a target server among the at least one second server is determined.
3. The method according to claim 2, characterized in that The first server obtains the communication delay between the first client and each second server, including: The first server acquires a time difference, where the time difference is a time difference between a first moment and a second moment, where the first moment is a moment when the first server receives the first file interaction request sent by the first client, and the second moment is a moment when the first server last receives the first file interaction request sent by a second client located in the first area; The first server determines a communication delay between the first client and each second server based on the time difference.
4. The method according to claim 3, characterized in that The first server determines, based on the time difference, a communication delay between the first client and each second server, including: If the time difference is greater than or equal to the threshold, the first server returns the access address of each second server to the first client, and the first client sends a delay test request to each second server based on the access address of each second server; the first client receives a delay test response to the delay test request from each second server, and determines the communication delay corresponding to each second server based on the delay test request and the delay test response corresponding to each second server; the first client sends the communication delay corresponding to each second server to the first server; If the time difference is less than the threshold, the first server obtains the communication delay between the second client and each second server, and uses the communication delay between the second client and each second server as the communication delay between the first client and each second server.
5. The method according to any one of claims 2 to 4, characterized in that: The first server determines the file interaction efficiency of each second server based on the communication delay between each second server and the first client and the bandwidth occupancy rate of each second server, including: The first server normalizes the communication delay between the first client and each second server to obtain a communication delay rate between the first client and each second server; The first server weights the communication delay rate between the first client and each second server and the bandwidth occupancy rate of each second server based on a preset weight to obtain the file interaction efficiency of each second server.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: If the second server A obtains a change operation on the files in the team space, the second server A determines the remaining second servers based on the binding relationship between the team space and the at least one second server, and synchronizes the change operation to the remaining second servers, so that each second server performs the change operation on the files in the team space, so that each second server has all the files in the team space; The second server A is any one of the at least one second server, and the remaining servers are servers other than the second server A in the at least one second server.
7. The method according to claim 6, characterized in that The method further comprises: The console obtains a team space creation event, wherein the team space creation event is used to indicate that the team space is deployed on the at least one second server; In response to the team space creation event, the console sends a team space creation request to each second server of the at least one second server, wherein the team space creation request is used to instruct the creation of the team space; Each second server sends a team space creation response to the team space creation request to the console, wherein the team space creation response is used to indicate that the team space has been created; The console establishes a binding relationship between the team space and the at least one second server in response to receiving a team space creation response from the at least one second server; The console synchronizes the binding relationship to the first server and the at least one second server.
8. A file management system, characterized in that: The file management system comprises: a first client, a first server, and at least one second server, wherein the first client and the first server are located in the same area, and the first client and the at least one second server are located in different areas; The first client is used to send a first file interaction request to the first server, wherein the first file interaction request includes a team space; The first server is used to obtain at least one second server that maintains the team space, each second server having a full set of files of the team space; The first server is used to determine a target server among the at least one second server, wherein the target server is a server with the highest file interaction efficiency among the at least one second server; The first server is used to return the access address of the target server to the first client; The first client is used to use the access address of the target server to perform file interaction with the team space through the target server.
9. An electronic device, characterized in that: include: A processor and a memory, the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 7.