File distribution method, device, electronic device and computer-readable storage medium
By obtaining the file identification and download address mapping relationship in the file information, the deployment instructions are sent to the node to be deployed, so that it can obtain files from multiple nodes, which solves the problem of excessive server resources occupied by file distribution methods and realizes the scalability of the system Sex and fault tolerance.
Patent Information
- Application Number
- CN202080098101.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-12
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-06-12
AI Technical Summary
The existing file distribution method occupies too much server resources, resulting in limited server resources and is unable to effectively scale and deal with failures.
By obtaining the mapping relationship between the file identity and the download address in the file information, determine the target download address, and send deployment instructions to the node to be deployed, so that it can obtain and deploy files from multiple nodes, reducing the amount of time to a single file storage server rely.
It reduces the service resource usage of the file storage server, improves the scalability of the system, and can still deploy files normally when the file storage server fails, improving file distribution and deployment efficiency.
Smart Images

Figure CN115244912B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a file distribution method, device, electronic device and computer-readable storage medium. Background Art
[0002] At present, file distribution usually adopts P2P (Peer to Peer, peer-to-peer network). P2P technology belongs to the category of overlay network, which is a network information exchange method relative to the client / server (C / S) model. In the C / S model, data distribution uses a dedicated server, and multiple clients obtain data from this server. However, the current file distribution method has the problem of occupying too many server resources. Summary of the invention
[0003] According to various embodiments of the present application, a file distribution method, an apparatus, an electronic device, and a computer-readable storage medium are provided.
[0004] A file distribution method comprises: obtaining file information, wherein the file information comprises a file identifier and a download address, and a mapping relationship exists between the file identifier and the download address; obtaining a file identifier to be deployed and a corresponding node identifier to be deployed; determining a target download address corresponding to the file identifier to be deployed according to the mapping relationship; and sending a first file deployment instruction carrying the file identifier to be deployed and the target download address to a node to be deployed corresponding to the node identifier to be deployed, wherein the first file deployment instruction is used to instruct the node to be deployed to deploy the corresponding file to be deployed according to the file identifier to be deployed and the target download address.
[0005] A file distribution device, comprising:
[0006] A first acquisition module is used to acquire file information, wherein the file information includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address;
[0007] The second acquisition module is used to obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed;
[0008] A determination module, configured to determine a target download address corresponding to the identifier of the file to be deployed according to the mapping relationship;
[0009] A sending module is used to send a first file deployment instruction carrying the to-be-deployed file identifier and the target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier, wherein the first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
[0010] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the file distribution method described in each embodiment of the present application.
[0011] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the file distribution method described in each embodiment of the present application.
[0012] The embodiment of the present application obtains file information, wherein the file information includes a file identifier and a node identifier, and there is a mapping relationship between the file identifier and the download address, obtains the identifier of the file to be deployed and the corresponding identifier of the node to be deployed, determines the target download address corresponding to the identifier of the file to be deployed according to the mapping relationship, and sends a first file deployment instruction carrying the identifier of the file to be deployed and the target download address to the node to be deployed corresponding to the identifier of the node to be deployed. The first file deployment instruction is used to instruct the node to be deployed to deploy the corresponding file to be deployed according to the identifier of the file to be deployed and the target download address. Therefore, the node to be deployed does not necessarily obtain the file to be deployed only from the file storage server each time, thereby reducing the service resource occupation of the file storage server. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] 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 work.
[0014] Figure 1 FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment.
[0015] Figure 2 The figure is a schematic diagram of an application environment of a file distribution method in an embodiment.
[0016] Figure 3 The figure is a flowchart of a file distribution method in one embodiment.
[0017] Figure 4 The figure is a schematic diagram of the pre-downloading process in one embodiment.
[0018] Figure 5 The figure is a schematic diagram of the architecture of a file distribution method in one embodiment.
[0019] Figure 6 FIG. 4 is a structural block diagram of a file distribution device in an embodiment. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0021] In one embodiment, Figure 1 As shown, a schematic diagram of the internal structure of an electronic device is provided. The electronic device is a server. The electronic device can specifically be a file distribution server. The server can include a file distribution system for sending file deployment instructions so that each node to be deployed successfully deploys the files to be deployed. The file distribution system is a centralized service responsible for coordinating and distributing tasks, such as coordinating file distribution tasks. The server includes a processor and a memory connected via a system bus. Among them, the processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement a file distribution method provided in each of the following embodiments. The internal memory provides a cached operating environment for the operating system computer program in the non-volatile storage medium. The server can be implemented as an independent server or a server cluster consisting of multiple servers. Those skilled in the art can understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. The specific server may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements. Through the above-mentioned architecture, the file distribution method in each embodiment of the present application can be implemented.
[0022] In one embodiment, Figure 2As shown, it is a schematic diagram of the application environment of the file distribution method in an embodiment, including a file distribution server 202, a target node 204 and a node to be deployed 206. The file distribution server 202, the target node 204 and the node to be deployed 206 communicate with each other through the network. The target node 204 can also be a node to be deployed. The target node 204 and the node to be deployed 206 are both servers. The node to be deployed will open a security interface through an agent program, and use the file that it has downloaded as a source file for other nodes to download, and then the node can become a target node. The nodes can specifically communicate and interact through HTTP (HyperText Transfer Protocol). HTTP is a simple request-response protocol, which usually runs on TCP (Transmission Control Protocol). It specifies what kind of message the client may send to the server and what kind of response it gets. The file distribution server 202 is used to obtain file information, which includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address; and obtain the file identifier to be deployed and the corresponding node identifier to be deployed. The file distribution server 202 determines the target download address corresponding to the file identifier to be deployed according to the mapping relationship. The file distribution server 202 sends a file deployment instruction carrying a to-be-deployed file identifier and a target node to the to-be-deployed node 206 corresponding to the deployment node identifier. The file deployment instruction is used to instruct the to-be-deployed node 206 to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
[0023] In one embodiment, Figure 3 As shown, a file distribution method is provided. In this embodiment, the method is applied to Figure 1 The electronic device shown in FIG. 1 is used as an example for explanation. The method includes:
[0024] Operation 302: Obtain file information. The file information includes a file identifier and a download address. There is a mapping relationship between the file identifier and the download address.
[0025] Among them, the file identifier is used to uniquely identify the file. The file identifier can be composed of at least one of numbers, letters, text, and symbols. The file identifier can specifically be a file name or a file MD5 value, etc., but is not limited to this. The file MD5 value is calculated by the MD5 message digest algorithm (Message-Digest Algorithm). The download address can be a node identifier or a URL (Uniform Resource Locator). The node identifier is used to uniquely identify the service node. The node identifier can specifically be the MAC (Media Access Control) address of the node, the IP (Internet Protocol) address of the node, etc., but is not limited to this. The mapping relationship between the file identifier and the download address is used to indicate that the node corresponding to a certain download address contains the file. Alternatively, the mapping relationship between the file identifier and the download address is used to indicate that the file corresponding to a certain file identifier is stored in the nodes corresponding to which download addresses.
[0026] Specifically, the present application is applied to a file distribution scenario in a file distribution system. An electronic device obtains stored file information, the file information includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address. The file information may also include whether the distribution is successful, the time of distribution, and at least one of the server cluster identifiers of the distribution.
[0027] Operation 304: Obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed.
[0028] The identifier of the file to be deployed refers to the identifier corresponding to the file to be deployed. The identifier of the node to be deployed refers to the identifier corresponding to the node to be deployed. There is no limit on the number of identifiers of file to be deployed and identifiers of node to be deployed.
[0029] Specifically, the terminal obtains the selected or input file identifier to be deployed and the corresponding node identifier to be deployed. The electronic device obtains the file identifier to be deployed and the corresponding node identifier to be deployed from the terminal. For example, the file identifier to be deployed is "file A" and the corresponding node identifier to be deployed is "node Z, node Y and node X". The file identifier to be deployed and the corresponding node identifier to be deployed are used to indicate which nodes need to deploy which files to be deployed.
[0030] Operation 306: Determine the target download address corresponding to the identifier of the file to be deployed according to the mapping relationship.
[0031] The target node corresponding to the target download address includes the file to be deployed corresponding to the identifier of the file to be deployed.
[0032] Specifically, the electronic device determines the target download address of the target node containing the file identifier to be deployed according to the mapping relationship between the file identifier and the node identifier. For example, the mapping relationship contains that the node identifier corresponding to "file A" is only "node P", the node identifiers corresponding to "file B" are "node M and node N", and the file identifier to be deployed is "file A", then according to the mapping relationship, it is determined that the target download address corresponding to the file identifier to be deployed "file A" is only "node P".
[0033] Operation 308: Send a first file deployment instruction carrying a to-be-deployed file identifier and a target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
[0034] Wherein, deployment can also be referred to as installation, and deploying the corresponding to-be-deployed file can refer to installing the program package corresponding to the to-be-deployed file. For example, the program package can be a binary program package, such as a java jar package.
[0035] Specifically, the electronic device sends a first file deployment instruction carrying a to-be-deployed file identifier and a target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier. That is, the first file deployment instruction may include the to-be-deployed file identifier and the target download address. The first file deployment instruction may also include other data, such as a source file download address, etc. After receiving the file deployment instruction, the to-be-deployed node obtains and deploys the to-be-deployed file corresponding to the to-be-deployed node identifier from the target node corresponding to the target download address. For example, the electronic device sends a file deployment instruction carrying a to-be-deployed file identifier "File A" and a target download address "Node P" to the to-be-deployed node, and the to-be-deployed node obtains File A from Node P and deploys it.
[0036] In this embodiment, if there are at least two target download addresses, the node to be deployed obtains and deploys the file to be deployed corresponding to the identifier of the node to be deployed from the target node corresponding to any one of the target download addresses.
[0037] The file distribution method in the embodiment of the present application obtains file information, wherein the file information includes a file identifier and a node identifier, and a mapping relationship exists between the file identifier and the download address. The identifier of the file to be deployed and the corresponding node identifier to be deployed are obtained, and the target download address corresponding to the identifier of the file to be deployed is determined according to the mapping relationship. A first file deployment instruction carrying the identifier of the file to be deployed and the target download address is sent to the node to be deployed corresponding to the identifier of the node to be deployed, wherein the first file deployment instruction is used to instruct the node to be deployed to deploy the corresponding file to be deployed according to the identifier of the file to be deployed and the target download address. Then, the node to be deployed does not necessarily obtain the file to be deployed only from the file storage server each time, thereby reducing the service resource occupation of the file storage server. Moreover, due to the limitation of service resources such as memory and network bandwidth, the objects that can be served simultaneously by a single file storage server are limited. The method in the embodiment of the present application can improve the scalability of the system; and if the file storage server fails, the file to be deployed can also be deployed normally.
[0038] In one embodiment, determining a target download address corresponding to a file identifier to be deployed based on a mapping relationship includes: selecting a candidate download address corresponding to the file identifier to be deployed from the mapping relationship; determining a target download address corresponding to a target node whose transmission distance to the node to be deployed is within a preset distance range from the candidate download addresses, wherein the node identifier to be deployed corresponds to the node to be deployed.
[0039] The candidate node corresponding to the candidate download address is the identifier corresponding to the candidate node containing the file to be deployed. The preset distance range refers to a certain distance range, and the preset distance range can be preset. The electronic device can preset which nodes have transmission distances within the preset range.
[0040] Specifically, the electronic device selects a candidate download address corresponding to the identifier of the file to be deployed from the mapping relationship, and determines the target download address corresponding to the target node whose transmission distance from the node to be deployed is within a preset distance range from the candidate download addresses. For example, the candidate download addresses corresponding to the identifier of the file to be deployed include nodes located in China, nodes located in Japan, and nodes located in the United States. Then, the transmission distance between the node located in China and the node located in Japan can be set to be within a preset range.
[0041] The file distribution method in this embodiment selects a candidate download address corresponding to the identifier of the file to be deployed from the mapping relationship, and determines the target download address corresponding to the target node whose transmission distance to the node to be deployed is within a preset distance range from the candidate download address. The identifier of the node to be deployed corresponds to the node to be deployed. Since the target node whose transmission distance to the node to be deployed is within the preset distance range has a better signal and a faster transmission speed when performing data transmission, the efficiency of file distribution can be improved, and the efficiency of file deployment can also be improved.
[0042] In one embodiment, a target download address corresponding to a target node whose transmission distance to the node to be deployed is within a preset distance range is determined from candidate download addresses, including: obtaining a reference download address corresponding to a node located in the same server cluster as the node to be deployed from the candidate download addresses, and using the reference download address as the target download address.
[0043] The same server cluster is the same computer room. The communication between the same server clusters is performed via a local area network. The target nodes whose transmission distance to the node to be deployed is within a preset distance range include nodes located in the same server cluster as the node to be deployed. The reference nodes located in the same server cluster can be regarded as having the shortest transmission distance to the node to be deployed.
[0044] Specifically, the electronic device obtains a reference download address corresponding to a node located in the same server cluster as the node to be deployed from the candidate download addresses, and uses the reference download address as the target download address.
[0045] The file distribution method in this embodiment obtains a reference download address corresponding to a node located in the same server cluster as the node to be deployed from the candidate download address as the target download address, and can obtain an identifier corresponding to the target node that contains the file to be deployed and is close to the node to be deployed, thereby improving the file distribution efficiency and the file deployment efficiency.
[0046] In one embodiment, taking the reference download address as the target download address includes: detecting the file timestamp of the to-be-deployed file identifier corresponding to each reference download address; and taking the reference download address whose file timestamp is within a preset time range as the target download address.
[0047] Specifically, the file timestamp can be used to indicate the creation time of the file to be deployed, or the distribution time of the deployed file, etc. The electronic device detects the file timestamp of the file to be deployed corresponding to each reference download address, and uses the reference download address with a file timestamp within a preset time range as the target download address. The preset time range may refer to a preset time range, such as 10 days. The preset time range may also refer to whether the file timestamp of the file to be deployed is within the latest preset number of file timestamps corresponding to the reference download address. For example, whether the file timestamp of the file to be deployed is within the latest 5 file timestamps corresponding to the reference download address.
[0048] The file distribution method in this embodiment detects the file timestamp of the to-be-deployed file identifier corresponding to each reference download address, and uses the reference download address with a file timestamp within a preset time range as the target download address. If the file timestamp corresponding to the to-be-deployed file identifier is too old, the corresponding to-be-deployed file may no longer be in the reference node, that is, the reference node has deleted the to-be-deployed file. Therefore, using the reference download address with a file timestamp within the preset time range as the target download address can obtain the target node that truly contains the to-be-deployed file, thereby increasing the probability that the to-be-deployed node successfully obtains the to-be-deployed file.
[0049] In one embodiment, the file distribution method further includes: if a reference download address with a file timestamp within a preset time range is not obtained, determining from the candidate download addresses a target download address corresponding to a target node whose transmission distance to the node to be deployed is within a preset distance range and which is located in the same server cluster as the node to be deployed.
[0050] Specifically, if a reference download address with a file timestamp within a preset time range is not obtained, a target download address corresponding to a target node whose transmission distance from the node to be deployed is within a preset distance range and is located in a server cluster other than the node to be deployed from the candidate download addresses corresponding to the identifier of the node to be deployed is determined. For example, the electronic device obtains a reference download address A corresponding to a node located in the same server cluster as the node to be deployed from the candidate download addresses, and the file timestamp corresponding to the identifier of the file to be deployed in node A is not within the preset time range, that is, the file to be deployed in node A may be expired. Then the electronic device can determine the target download address corresponding to the target node located in an adjacent server cluster to the node to be deployed from the candidate download addresses.
[0051] In the file distribution method of this embodiment, if a reference download address with a file timestamp within a preset time range is not obtained, the target download address corresponding to the target node whose transmission distance to the node to be deployed is within a preset distance range and is not located in the same server cluster as the node to be deployed is determined from the candidate download addresses, thereby increasing the probability of obtaining the file to be deployed.
[0052] In one embodiment, sending a first file deployment instruction carrying a to-be-deployed file identifier and a target download address to a to-be-deployed node corresponding to a to-be-deployed node identifier includes:
[0053] A first to-be-deployed instruction carrying a to-be-deployed file identifier, a target download address, and a source file download address is sent to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first to-be-deployed instruction is also used to deploy the to-be-deployed file according to the source file download address if the to-be-deployed node fails to download the to-be-deployed file from the target node corresponding to the target download address.
[0054] The source file download address may refer to an IP address of a file storage server used to store files, or a URL (Uniform Resource Locator) address, etc.
[0055] Specifically, the situation where the node to be deployed fails to download the file to be deployed from the target node may be that the transmission path is blocked, the file to be deployed is damaged, etc., but is not limited thereto. The electronic device sends a first instruction to be deployed that carries the identifier of the file to be deployed, the target download address, and the source file download address to the node to be deployed corresponding to the identifier of the node to be deployed. The first instruction to be deployed is also used to download the file to be deployed from the source file download address and deploy the file to be deployed if the node to be deployed cannot successfully download the file to be deployed from the target node corresponding to the target download address.
[0056] The file distribution method in this embodiment sends a first to-be-deployed instruction carrying a to-be-deployed file identifier, a target download address, and a source file download address to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first to-be-deployed instruction is also used to deploy the to-be-deployed file according to the source file download address if the to-be-deployed node fails to download the to-be-deployed file from the target node. That is, the to-be-deployed node preferentially deploys the file through the target node, which can provide another mechanism for downloading the to-be-deployed file to ensure that the to-be-deployed node successfully deploys the to-be-deployed file.
[0057] In one embodiment, the file distribution method further includes: if the target download address corresponding to the identifier of the node to be deployed cannot be obtained from the file information, a second file deployment instruction carrying the source file download address is sent to the node to be deployed corresponding to the identifier of the node to be deployed, and the second file deployment instruction is used to instruct the node to be deployed to deploy the file to be deployed according to the source file download address.
[0058] Specifically, if the electronic device cannot obtain the target download address corresponding to the to-be-deployed node identifier from the file information, a second file deployment instruction carrying the source file download address is sent to the to-be-deployed node corresponding to the to-be-deployed node identifier. The to-be-deployed node can obtain the to-be-deployed file from the source file download address and deploy the to-be-deployed file. That is, the to-be-deployed file corresponding to the to-be-deployed file identifier has not been deployed by any node.
[0059] For example, the electronic device obtains the identifier of the file to be deployed and the corresponding identifier of the node to be deployed from the terminal. When obtaining the target download address corresponding to the first identifier of the node to be deployed from the file information, since no other node may have deployed the file to be deployed, the electronic device cannot obtain the target download address corresponding to the identifier of the node to be deployed from the file information. Therefore, the electronic device sends the source file download address to the node to be deployed corresponding to the identifier of the node to be deployed, so that the node to be deployed downloads the file to be deployed from the source file download address.
[0060] In the file distribution method of this embodiment, if the target download address corresponding to the identifier of the node to be deployed cannot be obtained from the file information, a second file deployment instruction carrying the source file download address is sent to the node to be deployed, and the second file deployment instruction is used to instruct the node to be deployed to deploy the file to be deployed according to the source file download address. Since other nodes may not have deployed the file to be deployed, the electronic device cannot obtain the target download address corresponding to the identifier of the node to be deployed from the file information, and therefore another mechanism for downloading the file to be deployed is provided to ensure that the node to be deployed successfully deploys the file to be deployed.
[0061] In one embodiment, after sending a first file deployment instruction carrying a to-be-deployed file identifier and a target download address to a to-be-deployed node corresponding to a to-be-deployed node identifier, the file distribution method further includes: receiving a download result corresponding to the to-be-deployed file returned by the to-be-deployed node; in response to a successful download, updating the to-be-deployed node identifier corresponding to the to-be-deployed file identifier to an available state, so that the to-be-deployed file in the to-be-deployed node can be downloaded.
[0062] The download result refers to whether the node to be deployed can successfully obtain the file to be deployed from the target node. That is, the download result includes download success or download failure.
[0063] Specifically, the node to be deployed downloads the file to be deployed from the target node, generates a download result, and sends the download result to the electronic device. The electronic device receives the download result corresponding to the file to be deployed returned by the node to be deployed. In response to the download result being a successful download, the electronic device updates the node to be deployed identifier corresponding to the file to be deployed identifier to an available state, so that the file to be deployed in the node to be deployed can be downloaded. For example, the node identifier A corresponding to the file to be deployed identifier is in an unavailable state. The node to be deployed returns that file A is downloaded successfully. In response to the download result being a successful download, the electronic device updates the node identifier A corresponding to the file to be deployed identifier to an available state, so that other nodes can download the file to be deployed from the node to be deployed.
[0064] The file distribution method in this embodiment receives a download result corresponding to the file to be deployed returned by the node to be deployed, and in response to the download result being a successful download, updates the node to be deployed identifier corresponding to the file to be deployed identifier to an available state, so that the file to be deployed in the node to be deployed can be downloaded, thereby increasing the way to download the file to be deployed.
[0065] In one embodiment, Figure 4 FIG. 1 is a schematic diagram of a pre-download process in an embodiment. Before obtaining the file information, the file distribution method further includes:
[0066] Step 402, obtain the pre-download node identifier and the corresponding to-be-deployed file identifier sent by the terminal, and send a pre-download instruction carrying the to-be-deployed file identifier and the source file download address to the pre-download node corresponding to the pre-download node identifier, the pre-download instruction is used to instruct the pre-download node corresponding to the pre-download node identifier to obtain the to-be-deployed file corresponding to the to-be-deployed file identifier from the source file download address, and the pre-download node identifier is at least one of the to-be-deployed node identifiers.
[0067] Sending a first file deployment instruction carrying a to-be-deployed file identifier and a target download address to a to-be-deployed node corresponding to the to-be-deployed node identifier, wherein the first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address, including:
[0068] Step 404, sending a first file deployment instruction carrying a to-be-deployed file identifier and a target download address to the pre-download node, the first file deployment instruction is used to instruct the pre-download node to deploy the corresponding to-be-deployed file, and if the pre-download node cannot deploy the to-be-deployed file, deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
[0069] The pre-download node identifier is at least one of the identifiers of the nodes to be deployed. Pre-download refers to downloading files in advance before deployment. The pre-download instruction is used to enable the node to be deployed to download the file to be deployed before obtaining the file information.
[0070] Specifically, before performing file deployment, the files to be deployed can be downloaded in advance. The terminal obtains the pre-download node identifier and the corresponding file identifier to be deployed, and sends the pre-download node identifier and the corresponding file identifier to be deployed to the electronic device. The electronic device receives the pre-download node and the corresponding file identifier to be deployed sent by the terminal, and sends a pre-download instruction carrying the file identifier to be deployed and the source file download address to the pre-download node corresponding to the pre-download node identifier. Then, when performing file deployment, the electronic device still sends the first file deployment instruction carrying the file identifier to be deployed and the target download address to the pre-download node.
[0071] The file distribution method in this embodiment sends a pre-download instruction carrying a to-be-deployed file identifier and a source file download address to the pre-download node. The pre-download instruction is used to instruct the pre-download node to obtain the to-be-deployed file from the source file download address, and if the first file deployment instruction is received, the to-be-deployed file is deployed. If the to-be-deployed file cannot be deployed, the corresponding to-be-deployed file is deployed according to the to-be-deployed file identifier and the target download address, so that the file can be deployed quickly.
[0072] In one embodiment, a file distribution method includes:
[0073] Step a1, obtain the pre-download node identifier and the corresponding to-be-deployed file identifier sent by the terminal, and send a pre-download instruction carrying the to-be-deployed file identifier and the source file download address to the pre-download node corresponding to the pre-download node identifier. The pre-download instruction is used to instruct the pre-download node corresponding to the pre-download node identifier to obtain the to-be-deployed file corresponding to the to-be-deployed file identifier from the source file download address. The pre-download node identifier is at least one of the to-be-deployed node identifiers.
[0074] Step a2, obtaining file information, wherein the file information includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address.
[0075] Step a3, obtaining the identifier of the file to be deployed and the corresponding identifier of the node to be deployed.
[0076] Step a4: Select a candidate download address corresponding to the identifier of the file to be deployed from the mapping relationship.
[0077] Step a5: Obtain, from the candidate download addresses, a reference download address corresponding to a node located in the same server cluster as the node to be deployed.
[0078] Step a6: Detect the file timestamp of the to-be-deployed file identifier corresponding to each reference download address.
[0079] Step a7: taking a reference download address whose file timestamp is within a preset time range as a target download address, wherein the to-be-deployed node identifier corresponds to the to-be-deployed node.
[0080] Step a8: If the reference download address with a file timestamp within the preset time range is not obtained, determine from the candidate download addresses the target download address corresponding to the target node whose transmission distance to the node to be deployed is within the preset distance range and is not located in the same server cluster as the node to be deployed.
[0081] Step a9, sending a first file deployment instruction carrying a to-be-deployed file identifier and a target download address to the pre-download node, wherein the first file deployment instruction is used to instruct the pre-download node to deploy the corresponding to-be-deployed file, and if the pre-download node cannot deploy the to-be-deployed file, deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
[0082] Step a10: If the target download address corresponding to the node to be deployed identifier cannot be obtained from the file information, a second file deployment instruction carrying the source file download address is sent to the node to be deployed corresponding to the node to be deployed identifier, and the second file deployment instruction is used to instruct the node to be deployed to deploy the file to be deployed according to the source file download address.
[0083] The file distribution method in the embodiment of the present application obtains file information, the file information includes a mapping relationship between a file identifier and a download address, obtains a to-be-deployed file identifier and a corresponding to-be-deployed node identifier, determines a target download address corresponding to the to-be-deployed file identifier according to the mapping relationship, and sends a first file deployment instruction carrying the to-be-deployed file identifier and the target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address. Then, the to-be-deployed node does not necessarily obtain the to-be-deployed file from the file storage server each time, thereby reducing the service resource occupation of the server storing the files. Moreover, due to the limitation of service resources such as memory and network bandwidth, a single file storage server can only serve a limited number of objects at the same time. The method in the embodiment of the present application can improve the scalability of the system. Moreover, if a server storing files fails, the to-be-deployed files can be deployed normally.
[0084] In one embodiment, Figure 5As shown, it is a schematic diagram of the architecture of the file distribution method in one embodiment, including a publishing system (i.e., a file distribution server), computer room A (i.e., server cluster A), computer room B (i.e., server cluster B), and computer room C (i.e., server cluster C). File distribution metadata (i.e., file information) can be recorded in the publishing system, and the target download address can be determined based on the file information. Computer room A includes a node 502 and b node 504, computer room B includes c node 508 and d node 510, and computer room C includes e node 512 and f node 514. The publishing system can publish deployment tasks to at least one of the a node, b node, c node, d node, e node, and f node. The a node, b node, c node, d node, e node, and f node deploy the corresponding files to be deployed according to the file identifier to be deployed and the target download address. The arrows in the figure are for illustration only.
[0085] In the traditional publishing architecture, files must be downloaded from the source file server for each release. The source file server is easily affected by factors such as the location of the computer room and bandwidth, resulting in low download efficiency.
[0086] 1. Before deploying the application, the publishing system first records the publishing information, and then calculates an optimal (preferentially same computer room, then adjacent computer room) publishing file download address (i.e. target download address) based on the recorded metadata and the algorithm of giving priority to the same computer room and then adjacent computer rooms (i.e. the transmission distance is within the preset distance range). If there is an optimal publishing file download address, the publishing system passes the source file download address and the optimal publishing file download address to the node to be deployed.
[0087] 2. When deploying an application, the node to be deployed will first download the file from the optimal release file download address. If the download fails, it will be downloaded from the source file download address to ensure the availability of the file to be deployed.
[0088] 3. After the file deployment is completed, the deployment node notifies the publishing system of the download results, and the publishing system modifies the file location recorded this time to be available, thus realizing file sharing and downloading among the nodes to be deployed.
[0089] 4. Before release, pre-download (preheat data) is performed for the computer room (server cluster) to improve the overall efficiency of the first distribution.
[0090] The technical solution of the present application establishes a file sharing system between nodes in the environment of traditional resources, breaks through the download bottleneck of deployment (especially overseas deployment), and improves deployment efficiency. At the same time, the reliability of download is guaranteed through the source file download address. There is no need to maintain a file distribution service cluster separately, and the publishing and file download acceleration are perfectly combined. By recording the download destination, calculation and configuration of files, sharing files between nodes, and integrating the publishing system, no additional resource application and occupation are required. On the one hand, the deployment efficiency is improved and the download bottleneck caused by broadband restrictions is solved. At the same time, even if the acceleration process fails, downloading through the source file download address ensures its availability and controllable risks.
[0091] It should be understood that although Figure 3 and Figure 4 The operations in the flowchart are shown in sequence as indicated by the arrows, but these operations are not necessarily performed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these operations, and these operations can be performed in other orders. Moreover, Figure 3 and Figure 4 At least part of the operations may include multiple sub-operations or multiple stages. These sub-operations or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these sub-operations or stages is not necessarily sequentially, but can be performed in turn or alternately with other operations or at least part of the sub-operations or stages of other operations.
[0092] In one embodiment, Figure 6 , is a structural block diagram of a file distribution device in an embodiment, the device includes: a first acquisition module 602, a second acquisition module 604, a determination module 606 and a sending module 608.
[0093] The first acquisition module 602 is used to acquire file information, where the file information includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address;
[0094] The second acquisition module 604 is used to obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed;
[0095] The determination module 606 is used to determine the target download address corresponding to the identifier of the file to be deployed according to the mapping relationship;
[0096] The sending module 608 is used to send a first file deployment instruction carrying a to-be-deployed file identifier and a target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
[0097] The file distribution device in the embodiment of the present application obtains file information, the file information includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address, obtains the identifier of the file to be deployed and the corresponding identifier of the node to be deployed, determines the target download address corresponding to the identifier of the file to be deployed according to the mapping relationship, and sends a first file deployment instruction carrying the identifier of the file to be deployed and the target download address to the node to be deployed corresponding to the identifier of the node to be deployed, the first file deployment instruction is used to instruct the node to be deployed to deploy the corresponding file to be deployed according to the identifier of the file to be deployed and the target download address, then the node to be deployed does not necessarily obtain the file to be deployed only from the file storage server each time, reducing the service resource occupation of the file storage server, and a single file storage server is limited in the objects that can be served at the same time due to the limitation of service resources such as memory, network bandwidth, etc., the use of the device in the embodiment of the present application can improve the scalability of the system; and if the file storage server fails, the file to be deployed can also be deployed normally.
[0098] In one embodiment, the determination module 606 is used to select a candidate download address corresponding to the identifier of the file to be deployed from the mapping relationship; determine the target download address corresponding to the target node whose transmission distance to the node to be deployed is within a preset distance range from the candidate download addresses, wherein the identifier of the node to be deployed corresponds to the node to be deployed.
[0099] The file distribution device in this embodiment selects a candidate download address corresponding to the identifier of the file to be deployed from the mapping relationship, and determines the target download address corresponding to the target node whose transmission distance to the node to be deployed is within a preset distance range from the candidate download address. The identifier of the node to be deployed corresponds to the node to be deployed. Since the target node whose transmission distance to the node to be deployed is within the preset distance range has a better signal and a faster transmission speed when transmitting data, the efficiency of file distribution can be improved, and the efficiency of file deployment can also be improved.
[0100] In one embodiment, the determination module 606 is used to obtain, from the candidate download addresses, a reference download address corresponding to a node located in the same server cluster as the node to be deployed, and use the reference download address as the target download address.
[0101] The file distribution device in this embodiment obtains a reference download address corresponding to a node located in the same server cluster as the node to be deployed from the candidate download address as the target download address, and can obtain an identifier corresponding to the target node that contains the file to be deployed and is close to the node to be deployed, thereby improving the file distribution efficiency and the file deployment efficiency.
[0102] In one embodiment, the determination module 606 is used to detect the file timestamp of the to-be-deployed file identifier corresponding to each reference download address; and use the reference download address with a file timestamp within a preset time range as the target download address.
[0103] The file distribution device in this embodiment detects the file timestamp of the file to be deployed identifier corresponding to each reference download address, and uses the reference download address with a file timestamp within a preset time range as the target download address. If the file timestamp corresponding to the file to be deployed identifier is too old, the corresponding file to be deployed may no longer be in the reference node, that is, the reference node has deleted the file to be deployed. Therefore, using the reference download address with a file timestamp within the preset time range as the target download address can obtain the target node that truly contains the file to be deployed, thereby increasing the probability that the node to be deployed successfully obtains the file to be deployed.
[0104] In one embodiment, if a reference download address with a file timestamp within a preset time range is not obtained, the determination module 606 is also used to determine, from the candidate download addresses, a target download address corresponding to a target node whose transmission distance to the node to be deployed is within a preset distance range and is not located in the same server cluster as the node to be deployed.
[0105] The file distribution device in this embodiment, if the reference download address with a file timestamp within a preset time range is not obtained, determines from the candidate download addresses a target download address corresponding to a target node whose transmission distance to the node to be deployed is within a preset distance range and is not located in the same server cluster as the node to be deployed, thereby increasing the probability of obtaining the file to be deployed.
[0106] In one embodiment, the sending module 608 is used to send a first to-be-deployed instruction carrying a to-be-deployed file identifier, a target download address, and a source file download address to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first to-be-deployed instruction is also used to deploy the to-be-deployed file according to the source file download address if the to-be-deployed node fails to download the to-be-deployed file from the target node corresponding to the target download address.
[0107] The file distribution device in this embodiment sends a first to-be-deployed instruction carrying a to-be-deployed file identifier, a target download address, and a source file download address to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first to-be-deployed instruction is also used to deploy the to-be-deployed file according to the source file download address if the to-be-deployed node fails to download the to-be-deployed file from the target node. That is, the to-be-deployed node preferentially deploys the file through the target node, which can provide another mechanism for downloading the to-be-deployed file to ensure that the to-be-deployed node successfully deploys the to-be-deployed file.
[0108] In one embodiment, the sending module 608 is used to send a second file deployment instruction carrying the source file download address to the node to be deployed corresponding to the node to be deployed identifier if the target download address corresponding to the node to be deployed identifier cannot be obtained from the file information. The second file deployment instruction is used to instruct the node to be deployed to deploy the file to be deployed according to the source file download address.
[0109] The file distribution device in this embodiment sends a second file deployment instruction carrying the source file download address to the node to be deployed if the target download address corresponding to the node to be deployed identifier cannot be obtained from the file information. The second file deployment instruction is used to instruct the node to be deployed to deploy the file to be deployed according to the source file download address. Since other nodes may not have deployed the file to be deployed, the electronic device cannot obtain the target download address corresponding to the node to be deployed identifier from the file information. Therefore, another mechanism for downloading the file to be deployed is provided to ensure that the node to be deployed successfully deploys the file to be deployed.
[0110] In one embodiment, the file distribution device also includes an update module, which is used to receive a download result corresponding to the file to be deployed returned by the node to be deployed; in response to the download result being a successful download, the node to be deployed identifier corresponding to the file to be deployed identifier is updated to an available state, so that the file to be deployed in the node to be deployed can be downloaded.
[0111] The file distribution device in this embodiment receives a download result corresponding to the file to be deployed returned by the node to be deployed, and in response to the download result being a successful download, updates the node to be deployed identifier corresponding to the file to be deployed identifier to an available state, so that the file to be deployed in the node to be deployed can be downloaded, thereby increasing the way to download the file to be deployed.
[0112] In one embodiment, the sending module 608 is further used to obtain the pre-download node identifier and the corresponding to-be-deployed file identifier sent by the terminal, and to send a pre-download instruction carrying the to-be-deployed file identifier and the source file download address to the pre-download node corresponding to the pre-download node identifier, the pre-download instruction is used to instruct the pre-download node corresponding to the pre-download node identifier to obtain the to-be-deployed file corresponding to the to-be-deployed file identifier from the source file download address, and the pre-download node identifier is at least one of the to-be-deployed node identifiers. The sending module 608 is also used to send a first file deployment instruction carrying the to-be-deployed file identifier and the target download address to the pre-download node, the first file deployment instruction is used to instruct the pre-download node to deploy the corresponding to-be-deployed file, and if the pre-download node cannot deploy the to-be-deployed file, the corresponding to-be-deployed file is deployed according to the to-be-deployed file identifier and the target download address.
[0113] The file distribution device in this embodiment sends a pre-download instruction carrying a to-be-deployed file identifier and a source file download address to the pre-download node. The pre-download instruction is used to instruct the pre-download node to obtain the to-be-deployed file from the source file download address, and if the first file deployment instruction is received, the to-be-deployed file is deployed. If the to-be-deployed file cannot be deployed, the corresponding to-be-deployed file is deployed according to the to-be-deployed file identifier and the target download address, so that the file can be deployed quickly.
[0114] The division of the various modules in the above-mentioned file distribution device is only for illustration. In other embodiments, the file distribution device may be divided into different modules as needed to complete all or part of the functions of the above-mentioned file distribution device.
[0115] For the specific definition of the file distribution device, please refer to the definition of the file distribution method above, which will not be repeated here. Each module in the above-mentioned file distribution device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0116] The implementation of each module in the file distribution device provided in the embodiment of the present application can be in the form of a computer program. The computer program can be run on an electronic device such as a terminal or a server. The program module constituted by the computer program can be stored in the memory of the electronic device. When the computer program is executed by the processor, the operation of the file distribution method described in the embodiment of the present application is implemented.
[0117] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the operations of the file distribution method provided in the above embodiments are implemented.
[0118] In one embodiment, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed on a processor, the operations of the file distribution method described in each embodiment of the present application are implemented.
[0119] In one embodiment, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer is enabled to execute the file distribution method described in the embodiments of the present application.
[0120] Any reference to memory, storage, database or other medium used in this application may include non-volatile and / or volatile memory. Suitable non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0121] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A file distribution method, characterized in that: Applied to electronic devices, the file distribution method includes: Acquire file information, wherein the file information includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address; Obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed; Selecting a candidate download address corresponding to the identifier of the file to be deployed from the mapping relationship; Obtaining, from the candidate download addresses, a reference download address corresponding to a node located in the same server cluster as the node to be deployed; wherein the same server cluster represents the same computer room, and communication between the same server clusters is performed via a local area network; Detecting a file timestamp of the to-be-deployed file identifier corresponding to each of the reference download addresses; Using a reference download address with a file timestamp within a preset time range as a target download address, wherein the to-be-deployed node identifier corresponds to the to-be-deployed node; and A first file deployment instruction carrying the to-be-deployed file identifier and the target download address is sent to the to-be-deployed node corresponding to the to-be-deployed node identifier, wherein the first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
2. The method according to claim 1, characterized in that The method further comprises: If a reference download address with a file timestamp within a preset time range is not obtained, determine from the candidate download addresses a target download address corresponding to a target node whose transmission distance to the node to be deployed is within a preset distance range and which is located in the same server cluster as the node to be deployed.
3. The method according to any one of claims 1 to 2, characterized in that: The sending a first file deployment instruction carrying the identifier of the file to be deployed and the target download address to the node to be deployed corresponding to the identifier of the node to be deployed includes: A first to-be-deployed instruction carrying a to-be-deployed file identifier, a target download address, and a source file download address is sent to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first to-be-deployed instruction is also used to deploy the to-be-deployed file according to the source file download address when the to-be-deployed node fails to download the to-be-deployed file from the target node corresponding to the target download address.
4. The method according to any one of claims 1 to 2, characterized in that: The method further comprises: If the target download address corresponding to the identifier of the node to be deployed cannot be obtained from the file information, a second file deployment instruction carrying the source file download address is sent to the node to be deployed corresponding to the identifier of the node to be deployed, and the second file deployment instruction is used to instruct the node to be deployed to deploy the file to be deployed according to the source file download address.
5. The method according to any one of claims 1 to 2, characterized in that: After sending the first file deployment instruction carrying the to-be-deployed file identifier and the target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier, the method further includes: Receiving a download result corresponding to the file to be deployed returned by the node to be deployed; If the download result is a successful download, the to-be-deployed node identifier corresponding to the to-be-deployed file identifier is updated to an available state, so that the to-be-deployed file in the to-be-deployed node can be downloaded.
6. The method according to any one of claims 1 to 2, characterized in that: Before obtaining the file information, the method further includes: Obtaining a pre-download node identifier and a corresponding to-be-deployed file identifier sent by the terminal, and sending a pre-download instruction carrying the to-be-deployed file identifier and a source file download address to the pre-download node corresponding to the pre-download node identifier, wherein the pre-download instruction is used to instruct the pre-download node corresponding to the pre-download node identifier to obtain the to-be-deployed file corresponding to the to-be-deployed file identifier from the source file download address, wherein the pre-download node identifier is at least one of the to-be-deployed node identifiers; The sending a first file deployment instruction carrying the to-be-deployed file identifier and the target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier, wherein the first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address, includes: A first file deployment instruction carrying the to-be-deployed file identifier and the target download address is sent to the pre-download node, wherein the first file deployment instruction is used to instruct the pre-download node to deploy the corresponding to-be-deployed file, and when the pre-download node cannot deploy the to-be-deployed file, the corresponding to-be-deployed file is deployed according to the to-be-deployed file identifier and the target download address.
7. A file distribution device, characterized in that: Applied to electronic equipment, the device comprises: A first acquisition module is used to acquire file information, wherein the file information includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address; The second acquisition module is used to obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed; A determination module is used to select a candidate download address corresponding to the to-be-deployed file identifier from the mapping relationship; obtain a reference download address corresponding to a node in the same server cluster as the to-be-deployed node from the candidate download address; wherein the same server cluster represents the same computer room, and communication between the same server clusters is performed via a local area network; detect the file timestamp of the to-be-deployed file identifier corresponding to each of the reference download addresses; and use the reference download address with a file timestamp within a preset time range as a target download address, wherein the to-be-deployed node identifier corresponds to the to-be-deployed node; A sending module is used to send a first file deployment instruction carrying the to-be-deployed file identifier and the target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier, wherein the first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
8. The device according to claim 7, characterized in that The determination module is also used to determine, from the candidate download addresses, a target download address corresponding to a target node whose transmission distance to the node to be deployed is within a preset distance range and is located in the same server cluster as the node to be deployed, if a reference download address with a file timestamp within a preset time range is not obtained.
9. The device according to any one of claims 7 to 8, characterized in that The sending module is also used to send a first to-be-deployed instruction carrying a to-be-deployed file identifier, a target download address and a source file download address to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first to-be-deployed instruction is also used to deploy the to-be-deployed file according to the source file download address when the to-be-deployed node fails to download the to-be-deployed file from the target node corresponding to the target download address.
10. The device according to any one of claims 7 to 8, characterized in that The sending module is also used to send a second file deployment instruction carrying the source file download address to the node to be deployed corresponding to the node to be deployed identifier if the target download address corresponding to the node to be deployed identifier cannot be obtained from the file information, and the second file deployment instruction is used to instruct the node to be deployed to deploy the file to be deployed according to the source file download address.
11. The device according to any one of claims 7 to 8, characterized in that The device also includes an update module; the update module is used to receive a download result corresponding to the file to be deployed returned by the node to be deployed; if the download result is a successful download, the node to be deployed identifier corresponding to the file to be deployed identifier is updated to an available state, so that the file to be deployed in the node to be deployed can be downloaded.
12. The device according to any one of claims 7 to 8, characterized in that The sending module is also used to obtain the pre-download node identifier and the corresponding to-be-deployed file identifier sent by the terminal, and send a pre-download instruction carrying the to-be-deployed file identifier and the source file download address to the pre-download node corresponding to the pre-download node identifier, wherein the pre-download instruction is used to instruct the pre-download node corresponding to the pre-download node identifier to obtain the to-be-deployed file corresponding to the to-be-deployed file identifier from the source file download address, and the pre-download node identifier is at least one of the to-be-deployed node identifiers; the sending module is also used to send a first file deployment instruction carrying the to-be-deployed file identifier and the target download address to the pre-download node, wherein the first file deployment instruction is used to instruct the pre-download node to deploy the corresponding to-be-deployed file, and when the pre-download node cannot deploy the to-be-deployed file, the corresponding to-be-deployed file is deployed according to the to-be-deployed file identifier and the target download address.
13. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor performs the following operations: Acquire file information, wherein the file information includes a file identifier and a download address, and there is a mapping relationship between the file identifier and the download address; Obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed; Selecting a candidate download address corresponding to the identifier of the file to be deployed from the mapping relationship; Obtaining, from the candidate download addresses, a reference download address corresponding to a node located in the same server cluster as the node to be deployed; wherein the same server cluster represents the same computer room, and communication between the same server clusters is performed via a local area network; Detecting a file timestamp of the to-be-deployed file identifier corresponding to each of the reference download addresses; Using a reference download address with a file timestamp within a preset time range as a target download address, wherein the to-be-deployed node identifier corresponds to the to-be-deployed node; and A first file deployment instruction carrying the to-be-deployed file identifier and the target download address is sent to the to-be-deployed node corresponding to the to-be-deployed node identifier, wherein the first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address.
14. The electronic device according to claim 13, characterized in that: The processor also performs the following operations: If a reference download address with a file timestamp within a preset time range is not obtained, determine from the candidate download addresses a target download address corresponding to a target node whose transmission distance to the node to be deployed is within a preset distance range and which is located in the same server cluster as the node to be deployed.
15. The electronic device according to any one of claims 13 to 14, characterized in that: The processor executes the step of sending the first file deployment instruction carrying the identifier of the file to be deployed and the target download address to the node to be deployed corresponding to the identifier of the node to be deployed, and further performs the following operations: A first to-be-deployed instruction carrying a to-be-deployed file identifier, a target download address, and a source file download address is sent to the to-be-deployed node corresponding to the to-be-deployed node identifier. The first to-be-deployed instruction is also used to deploy the to-be-deployed file according to the source file download address when the to-be-deployed node fails to download the to-be-deployed file from the target node corresponding to the target download address.
16. The electronic device according to any one of claims 13 to 14, characterized in that: The processor also performs the following operations: If the target download address corresponding to the identifier of the node to be deployed cannot be obtained from the file information, a second file deployment instruction carrying the source file download address is sent to the node to be deployed corresponding to the identifier of the node to be deployed, and the second file deployment instruction is used to instruct the node to be deployed to deploy the file to be deployed according to the source file download address.
17. The electronic device according to any one of claims 13 to 14, characterized in that: After executing the step of sending the first file deployment instruction carrying the identifier of the file to be deployed and the target download address to the node to be deployed corresponding to the identifier of the node to be deployed, the processor further performs the following operations: Receiving a download result corresponding to the file to be deployed returned by the node to be deployed; If the download result is a successful download, the to-be-deployed node identifier corresponding to the to-be-deployed file identifier is updated to an available state, so that the to-be-deployed file in the to-be-deployed node can be downloaded.
18. The electronic device according to any one of claims 13 to 14, characterized in that: Before executing the step of obtaining the file information, the processor further performs the following operations: Obtaining a pre-download node identifier and a corresponding to-be-deployed file identifier sent by the terminal, and sending a pre-download instruction carrying the to-be-deployed file identifier and a source file download address to the pre-download node corresponding to the pre-download node identifier, wherein the pre-download instruction is used to instruct the pre-download node corresponding to the pre-download node identifier to obtain the to-be-deployed file corresponding to the to-be-deployed file identifier from the source file download address, wherein the pre-download node identifier is at least one of the to-be-deployed node identifiers; The processor executes sending a first file deployment instruction carrying the to-be-deployed file identifier and the target download address to the to-be-deployed node corresponding to the to-be-deployed node identifier, wherein the first file deployment instruction is used to instruct the to-be-deployed node to deploy the corresponding to-be-deployed file according to the to-be-deployed file identifier and the target download address, and further performs the following operations: A first file deployment instruction carrying the to-be-deployed file identifier and the target download address is sent to the pre-download node, wherein the first file deployment instruction is used to instruct the pre-download node to deploy the corresponding to-be-deployed file, and when the pre-download node cannot deploy the to-be-deployed file, the corresponding to-be-deployed file is deployed according to the to-be-deployed file identifier and the target download address.
19. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
