WO2021248466A1 - 文件分发方法、装置、电子设备和计算机可读存储介质 - Google Patents

文件分发方法、装置、电子设备和计算机可读存储介质 Download PDF

Info

Publication number
WO2021248466A1
WO2021248466A1 PCT/CN2020/095861 CN2020095861W WO2021248466A1 WO 2021248466 A1 WO2021248466 A1 WO 2021248466A1 CN 2020095861 W CN2020095861 W CN 2020095861W WO 2021248466 A1 WO2021248466 A1 WO 2021248466A1
Authority
WO
WIPO (PCT)
Prior art keywords
deployed
file
node
identifier
download address
Prior art date
Application number
PCT/CN2020/095861
Other languages
English (en)
French (fr)
Inventor
魏荣碧
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN202080098101.0A priority Critical patent/CN115244912A/zh
Priority to PCT/CN2020/095861 priority patent/WO2021248466A1/zh
Publication of WO2021248466A1 publication Critical patent/WO2021248466A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • This application relates to the field of computer technology, and in particular to a file distribution method, device, electronic equipment, and computer-readable storage medium.
  • P2P Peer to Peer, peer-to-peer network
  • P2P technology belongs to the category of overlay network, which is a kind of network information exchange relative to the client/server (C/S) model. Way. In the C/S mode, a dedicated server is used for data distribution, and multiple clients obtain data from this server.
  • C/S client/server
  • the current file distribution method has the problem of occupying too many server resources.
  • a file distribution method, apparatus, electronic device, and computer-readable storage medium are provided.
  • a file distribution method includes: obtaining 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; and obtaining the file identifier to be deployed and the corresponding node to be deployed Identification; determine the target download address corresponding to the identification of the file to be deployed according to the mapping relationship; send the identification of the file to be deployed and the target download address to the node to be deployed corresponding to the identification 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.
  • a file distribution device includes:
  • the first obtaining module is configured to obtain 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;
  • the second acquiring module is used to acquire the identifier of the file to be deployed and the corresponding identifier of the node to be deployed;
  • a determining module configured to determine a target download address corresponding to the identifier of the file to be deployed according to the mapping relationship
  • a sending module configured to send a first file deployment instruction carrying the file to be deployed identifier and the target download address to the node to be deployed corresponding to the node identifier to be deployed, and the first file deployment instruction is used to instruct The node to be deployed deploys the corresponding file to be deployed according to the identifier of the file to be deployed and the target download address.
  • An electronic device including a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the file distribution method described in each embodiment of the present application A step of.
  • a computer-readable storage medium has a computer program stored thereon, and the computer program implements the steps of the file distribution method described in each embodiment of the present application when the computer program is executed by a processor.
  • the embodiment of the application obtains file information, which includes file identification and node identification, and there is a mapping relationship between the file identification and the download address, obtains the identification of the file to be deployed and the corresponding identification of the node to be deployed, and determines the identification of the file to be deployed according to the mapping relationship.
  • the target download address corresponding to the file identifier sends a first file deployment instruction carrying the file identifier to be deployed and the target download address to the node to be deployed corresponding to the node identifier to be deployed, and the first file deployment instruction is used to instruct the node to be deployed according to
  • the identification of the file to be deployed and the target download address deploy the corresponding file to be deployed, and the node to be deployed may not only obtain the file to be deployed from the file storage server each time, which reduces the service resource occupation of the file storage server.
  • Fig. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment.
  • Fig. 2 is a schematic diagram of an application environment of a file distribution method in an embodiment.
  • Fig. 3 is a flowchart of a file distribution method in an embodiment.
  • Fig. 4 is a schematic diagram of a pre-downloading flow in an embodiment.
  • Fig. 5 is a schematic structural diagram of a file distribution method in an embodiment.
  • Fig. 6 is a structural block diagram of a file distribution device in an embodiment.
  • the electronic device is a server.
  • the electronic device may specifically be a file distribution server.
  • the server may include a file distribution system for sending file deployment instructions, so that each node to be deployed successfully deploys the file to be deployed.
  • the file distribution system is a centralized service that is responsible for coordination and distribution tasks, such as coordinating file distribution tasks.
  • the server includes a processor and a memory connected through a system bus. Among them, the processor is used to provide calculation and control capabilities to support the operation of the entire electronic device.
  • the memory may include a non-volatile storage medium and 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 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 composed of multiple servers. Those skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of 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 are shown in the figure, or some components are combined, or have different component arrangements.
  • FIG. 2 it is a schematic diagram of an application environment of the file distribution method in an embodiment, which includes 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 through a network.
  • the target node 204 may also be a node to be deployed.
  • Both the target node 204 and the node to be deployed 206 are servers.
  • the node to be deployed will open a security interface through the agent program, and use the file that it has downloaded as a source file to download to other nodes, and the node can become the target node.
  • HTTP HyperText Transfer Protocol
  • HTTP is a simple request-response protocol, which usually runs on top of 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.
  • 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; and obtains 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 identifier of the file to be deployed according to the mapping relationship.
  • the file distribution server 202 sends a file deployment instruction carrying the file identification to be deployed and the target node to the node to be deployed 206 corresponding to the identification of the deployed node, and the file deployment instruction is used to instruct the node to be deployed 206 according to the file identification to be deployed and the target download address Deploy the corresponding files to be deployed.
  • a file distribution method is provided.
  • the method is applied to the electronic device shown in FIG. 1 as an example for description.
  • the method includes:
  • the file information is obtained.
  • the file information includes the file identifier and the download address, and there is a mapping relationship between the file identifier and the download address.
  • the file identifier is used to uniquely identify the file.
  • the document identification can be composed of at least one of numbers, letters, characters, and symbols.
  • the file identifier may specifically be the file name or the MD5 value of the file, etc., and is not limited to this.
  • the file MDS value is calculated by MD5 message digest algorithm (Message-Digest Algorithm).
  • the download address can be a node identifier or a URL (Uniform Resource Locator, Uniform Resource Locator).
  • the node identifier is used to uniquely identify the service node.
  • the node identifier may specifically be the MAC (Media Access Control, media access control) address of the node, the IP (Internet Protocol, Internet Protocol) address of the node, etc., and the like is not limited to this.
  • 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.
  • mapping relationship between the file identifier and the download address is used to indicate where the file corresponding to a certain file identifier is stored in the node corresponding to which download address.
  • this application is applied to a file distribution scenario of a file distribution system.
  • the electronic device obtains the stored file information, the file information includes the file identifier and the download address, and there is a mapping relationship between the file identifier and the download address.
  • the file information may also include at least one of whether the distribution is successful, the time of the distribution, and the server cluster identifier of the distribution.
  • Operation 304 Obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed.
  • 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.
  • the number of file identifiers to be deployed and node identifiers to be deployed is not limited.
  • the terminal obtains the selected or input identification of the file to be deployed and the corresponding identification of the node to be deployed.
  • the electronic device obtains the identification of the file to be deployed and the corresponding identification of the node to be deployed from the terminal. For example, if the file to be deployed is identified as "file A”, the node to be deployed is identified as "node Z, node Y, and node X".
  • the identifiers of the files to be deployed and the corresponding identifiers of the nodes to be deployed are used to indicate which nodes need to deploy which files to be deployed.
  • the target download address corresponding to the identifier of the file to be deployed is determined according to the mapping relationship.
  • the target node corresponding to the target download address contains the file to be deployed corresponding to the file to be deployed identifier.
  • 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, if the mapping relationship contains the node identifier corresponding to "file A" only "node P", the node identifier corresponding to "file B" is "node M and node N”, and the file to be deployed is identified as "file A”, then according to For the mapping relationship, it is determined that the target download address corresponding to the identification "file A" of the file to be deployed is only "node P".
  • Operation 308 Send a first file deployment instruction carrying the file identification to be deployed and the target download address to the node to be deployed corresponding to the identification of the node to be deployed, where the first file deployment instruction is used to instruct the node to be deployed to download according to the identification of the file to be deployed and the target download The file to be deployed corresponding to the address deployment.
  • deployment may also be referred to as installation
  • the file to be deployed corresponding to deployment may refer to the installation of a program package corresponding to the file to be deployed.
  • the program package may be a binary program package, such as a jar package of java.
  • the electronic device sends the first file deployment instruction carrying the file to be deployed identifier and the target download address to the node to be deployed corresponding to the node identifier to be deployed. That is, the first file deployment instruction may include the identification of the file to be deployed and the target download address. The first file deployment instruction may also include other data, such as the source file download address.
  • 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 the target download address.
  • the electronic device sends a file deployment instruction carrying the identifier of the file to be deployed "file A” and the target download address "node P" to the node to be deployed, and the node to be deployed obtains the file A from the node P and deploys it.
  • the node to be deployed obtains and deploys the file to be deployed corresponding to the identifier of the node to be deployed from any target node corresponding to the target download address.
  • the file distribution method in the embodiment of the present application obtains file information.
  • the file information includes the file identifier and the node identifier, and there is a mapping relationship between the file identifier and the download address.
  • the file identifier to be deployed and the corresponding node identifier to be deployed are obtained according to the mapping
  • the relationship determines the target download address corresponding to the identifier of the file to be deployed, 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 node identifier to be deployed, and the first file deployment instruction is used for Instruct the node to be deployed to deploy the corresponding file to be deployed according to the file identifier and the target download address.
  • the node to be deployed does not necessarily only obtain the file to be deployed from the file storage server each time, reducing the service resource occupation of the file storage server, and A single file storage server can serve limited objects at the same time due to the limitations of service resources such as memory and network bandwidth.
  • Using the method in the embodiment of this application can improve the scalability of the system; and if the file storage server fails, it can also The files to be deployed are deployed normally.
  • determining the target download address corresponding to the identification of the file to be deployed according to the mapping relationship includes: selecting the candidate download address corresponding to the identification of the file to be deployed from the mapping relationship; and determining the node to be deployed from the candidate download address The target download address corresponding to the target node whose transmission distance is within the preset distance range, wherein the identifier of the node to be deployed corresponds to the node to be deployed.
  • 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 within a certain distance range, and the preset distance range can be preset.
  • the electronic device can preset which nodes have a transmission distance within a preset range.
  • the electronic device selects the candidate download address corresponding to the file identifier 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 from the candidate download address .
  • candidate download addresses corresponding to the file identification 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.
  • the file distribution method in this embodiment selects candidate download addresses corresponding to the identification of the file to be deployed from the mapping relationship, and determines from the candidate download addresses that the target node whose transmission distance to the node to be deployed is within a preset distance corresponds to The target download address of the node to be deployed corresponds to the node to be deployed. Since the transmission distance between the node to be deployed and the target node within the preset distance range, the signal during data transmission is better and the transmission speed is faster Therefore, the efficiency of file distribution can be improved, and the efficiency of file deployment can also be improved.
  • determining 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 a preset distance includes: obtaining from the candidate download address the same as the node to be deployed The reference download address corresponding to the node of the server cluster will be the reference download address as the target download address.
  • the same server cluster is the same computer room. And the communication between the same server cluster is through the local area network.
  • the target node whose transmission distance from the node to be deployed is within the preset distance range includes nodes located in the same server cluster as the node to be deployed.
  • the reference node located in the same server cluster can be regarded as having the smallest transmission distance from the node to be deployed.
  • the electronic device obtains the reference download address corresponding to the node located in the same server cluster as the node to be deployed from the candidate download address, and uses the reference download address as the target download address.
  • the reference download address corresponding to the node in the same server cluster as the node to be deployed is obtained from the candidate download address.
  • the identifiers corresponding to the target nodes that are closer to each other improve the efficiency of file distribution and also improve the efficiency of file deployment.
  • using the reference download address as the target download address includes: detecting the file timestamp of the file identification to be deployed corresponding to each reference download address; taking the reference download address whose file timestamp is within the preset time range as Target download address.
  • the file timestamp may 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 identified by the file to be deployed corresponding to each reference download address, and uses the reference download address whose file timestamp is within a preset time range as the target download address.
  • the preset time range may refer to within a certain preset time range, for example, within 10 days.
  • the preset time range may also refer to whether the file timestamp identified by the file to be deployed is in the latest preset number of file timestamps corresponding to the reference download address. For example, whether the file timestamp identified by the file to be deployed is among the latest five file timestamps corresponding to the reference download address.
  • the file distribution method in this embodiment detects the file timestamp of the file identification to be deployed corresponding to each reference download address, and uses the reference download address whose file timestamp is within a preset time range as the target download address.
  • the file timestamp corresponding to the file identifier is too old, and 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, so the reference download address with the file timestamp within the preset time range is taken as the target
  • the download address can obtain the target node that actually contains the file to be deployed, which improves the probability that the node to be deployed successfully obtains the file to be deployed.
  • the file distribution method further includes: if the reference download address whose file timestamp is within the preset time range is not obtained, determining from the candidate download addresses that the transmission distance to the node to be deployed is within the preset distance The target download address corresponding to the target node within the range, except for the target node located in the same server cluster as the node to be deployed.
  • the electronic device obtains the reference download address A corresponding to the node in the same server cluster as the node to be deployed from the candidate download address, 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 expire. Then, the electronic device can determine the target download address corresponding to the target node where the node to be deployed is located in the adjacent server cluster from the candidate download addresses.
  • the probability of obtaining the file to be deployed can be improved.
  • sending the first file deployment instruction carrying the file to be deployed identifier and the target download address to the node to be deployed corresponding to the node identifier to be deployed includes:
  • the corresponding target node fails to download the file to be deployed, and the file to be deployed is deployed according to the source file download address.
  • the source file download address may refer to the IP address of the file storage server used to store the file, or a URL (Uniform Resource Locator, Uniform Resource Locator) address, etc.
  • the failure of the node to be deployed 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, and the like is not limited to this.
  • the electronic device sends the first to-be-deployed instruction carrying the to-be-deployed file identifier, the target download address and the source file download address to the node to-be-deployed corresponding to the node identifier to be deployed.
  • the first to-be-deployed instruction is also used for, if the node to be deployed cannot successfully download the file to be deployed from the target node corresponding to the target download address, download the file to be deployed from the source file download address and deploy the file to be deployed.
  • the first to-be-deployed instruction carrying the to-be-deployed file identifier, target download address, and source file download address is sent to the node-to-be-deployed corresponding to the node identifier to be deployed, and the first to-be-deployed instruction is also used for If the node to be deployed fails to download the file to be deployed from the target node, the file to be deployed is deployed according to the source file download address, that is, the node to be deployed prefers to deploy the file through the target node, which can provide another mechanism for downloading the file to be deployed to ensure that the node to be deployed The files to be deployed are successfully deployed.
  • 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, sending the download address carrying the active file to the node to be deployed corresponding to the identifier of the node to be deployed.
  • 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.
  • the electronic device if it cannot obtain the target download address corresponding to the identifier of the node to be deployed from the file information, it sends the second file deployment instruction carrying the active file download address to the node to be deployed corresponding to the node identifier to be deployed.
  • the node to be deployed can obtain the file to be deployed from the source file download address and deploy the file to be deployed. That is, the to-be-deployed file corresponding to the to-be-deployed file identifier has not been deployed by any node.
  • 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. Then when the target download address corresponding to the first node to be deployed is obtained from the file information, since there may not be other nodes that have deployed the file to be deployed, the electronic device cannot obtain the identity of the node to be deployed from the file information. Corresponding target download address. Therefore, the electronic device sends the source file download address to the node to be deployed corresponding to the node identifier to be deployed, so that the node to be deployed downloads the file to be deployed from the source file download address.
  • the second file deployment instruction carrying the active file download address is sent to the node to be deployed, and the second file The 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 no other node has deployed the file to be deployed, the electronic device cannot obtain the target download corresponding to the node identifier to be deployed from the file information Therefore, it provides another mechanism for downloading the files to be deployed to ensure that the nodes to be deployed successfully deploy the files to be deployed.
  • the file distribution method further includes: receiving and The download result corresponding to the file to be deployed; in response to the download result being that the download is successful, the node identifier to be deployed corresponding to the file identifier to be deployed is updated to an available state, so that the file to be deployed in the node to be deployed can be downloaded.
  • the download result is 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.
  • 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.
  • the electronic device updates the identifier of the node to be deployed corresponding to the identifier of the file to be deployed to an available state, so that the file to be deployed in the node to be deployed can be downloaded.
  • the node identifier A corresponding to the file identifier to be deployed is in an unavailable state.
  • the node to be deployed returns that the file A is downloaded successfully, and in response to the download result being that the download is successful, the electronic device updates the node identifier A corresponding to the file identifier to be deployed to an available state, and then other nodes can download the file to be deployed from the node to be deployed .
  • the file distribution method in this embodiment receives the download result corresponding to the file to be deployed returned by the node to be deployed, and in response to the download result being that the download is successful, updates the node identifier to be deployed corresponding to the file identifier to be deployed to an available state, In order to enable the file to be deployed in the node to be deployed to be downloaded, the way to download the file to be deployed is increased.
  • the file distribution method further includes:
  • Step 402 Obtain the pre-download node identifier and the corresponding identifier of the file to be deployed sent by the terminal, and send a pre-download instruction carrying the identifier of the file to be deployed and the download address of the source file to the pre-download node corresponding to the pre-download node identifier.
  • the pre-download instruction is used for Instruct the pre-download node corresponding to the pre-download node identifier to obtain the file to be deployed corresponding to the file identifier to be deployed from the source file download address, where the pre-download node identifier is at least one of the node identifiers to be deployed.
  • the files to be deployed include:
  • Step 404 Send a first file deployment instruction carrying the identifier of the file to be deployed and the target download address to the pre-download node, where the first file deployment instruction is used to instruct the pre-download node to deploy the corresponding file to be deployed, and if the pre-download node cannot be deployed
  • the deployment file deploys the corresponding to-be-deployed file according to the identifier of the to-be-deployed file and the target download address.
  • the pre-download node identifier is at least one of the identifiers of the nodes to be deployed.
  • Pre-downloading refers to downloading files in advance before deployment.
  • the pre-download instruction is used to make the node to be deployed download the file to be deployed before obtaining the file information.
  • the file 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 identifier of the file to be deployed sent by the terminal, and sends a pre-download instruction carrying the identifier of the file to be deployed and the download address of the source file to the pre-download node corresponding to the pre-download node identifier. Then, when the file is deployed, the electronic device still sends the first file deployment instruction carrying the identifier of the file to be deployed and the target download address to the pre-download node.
  • the file distribution method in this embodiment sends a pre-download instruction carrying the identifier of the file to be deployed and the download address of the source file to the pre-download node.
  • the pre-download instruction is used to instruct the pre-download node to obtain the file to be deployed from the source file download address, and if The first file deployment instruction is received and the file to be deployed is deployed. If the file to be deployed cannot be deployed, the corresponding file to be deployed is deployed according to the identifier of the file to be deployed and the target download address, so that the file can be quickly deployed.
  • a file distribution method includes:
  • Step a1 Obtain the pre-download node identifier and the corresponding identifier of the file to be deployed sent by the terminal, and send a pre-download instruction carrying the identifier of the file to be deployed and the download address of the source file to the pre-download node corresponding to the pre-download node identifier.
  • Step a2 Obtain file information.
  • the file information includes the file identifier and the download address, and there is a mapping relationship between the file identifier and the download address.
  • Step a3 Obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed.
  • Step a4 Select candidate download addresses corresponding to the identification of the file to be deployed from the mapping relationship.
  • Step a5 Obtain a reference download address corresponding to a node in the same server cluster as the node to be deployed from the candidate download address.
  • Step a6 detecting the file timestamp of the to-be-deployed file identifier corresponding to each reference download address.
  • Step a7 Use the reference download address with the file timestamp within the preset time range as the target download address, where the identifier of the node to be deployed corresponds to the node to be deployed.
  • Step a8 If the reference download address with the file timestamp within the preset time range is not obtained, from the candidate download addresses, determine that the transmission distance to the node to be deployed is within the preset distance range, except that the node to be deployed is located The target download address corresponding to the target node outside the same server cluster.
  • Step a9 Send a first file deployment instruction carrying the identifier of the file to be deployed 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 file to be deployed, and if the pre-download node cannot deploy the file to be deployed
  • the deployment file deploys the corresponding to-be-deployed file according to the identifier of the to-be-deployed file and the target download address.
  • Step a10 if the target download address corresponding to the node identifier to be deployed cannot be obtained from the file information, the second file deployment instruction carrying the active file download address is sent to the node to be deployed corresponding to the node identifier to be deployed, the second file The 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.
  • the file distribution method in the embodiment of the application obtains file information, the file information includes the mapping relationship between the file identifier and the download address, obtains the file identifier to be deployed and the corresponding node identifier to be deployed, and determines the file to be deployed according to the mapping relationship Identify the corresponding target download address, and send a first file deployment instruction carrying the file to be deployed identifier and the target download address to the node to be deployed corresponding to the node identifier to be deployed, and the first file deployment instruction is used to instruct the node to be deployed according to the
  • the deployment file identification and the target download address deploy the corresponding file to be deployed, and the node to be deployed does not necessarily only obtain the file to be deployed from the file storage server each time, which reduces the service resource occupation of the server that stores the file, and a single file storage server Due to the limitation of service resources such as memory, network bandwidth, etc., the objects that can be served at the same time are limited.
  • the method in the embodiment of this application can improve the scalability of
  • FIG. 5 it is a schematic diagram of the architecture of the file distribution method in one embodiment, including a publishing system (ie file distribution server), computer room A (ie server cluster A), and computer room B (ie server cluster B). ) And computer room C (ie server cluster C).
  • File distribution metadata ie, file information
  • Computer room A includes a node 502 and b node 504
  • computer room B includes c node 508 and d node 510
  • computer room C includes e node 512 and f node 514.
  • the publishing system can publish deployment tasks to at least one node among 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 file to be deployed according to the identifier of the file to be deployed and the target download address.
  • the arrows in the figure are for illustration only.
  • the node to be deployed is first downloaded through the optimal release file download address. If the download fails, it is downloaded from the source file download address to ensure the availability of the file to be deployed.
  • the deployment node will notify the publishing system of the download result, and the publishing system will modify the file location recorded this time to be available, thus achieving file sharing and downloading among the nodes to be deployed.
  • Pre-download data pre-heating for the computer room (server cluster) before release to improve the efficiency of the first distribution as a whole.
  • the technical solution of this application establishes a file sharing system between nodes in a traditional resource environment, breaks through the download bottleneck of deployment (especially overseas deployment), and improves deployment efficiency.
  • the reliability of the download is guaranteed.
  • the need to maintain a file distribution service cluster separately, which perfectly combines publishing and file download acceleration.
  • the deployment efficiency is improved, and the download bottleneck caused by broadband restrictions is solved.
  • the source file download address is used to download it, which ensures its availability and controllable risks.
  • FIGS. 3 and 4 are displayed in sequence as indicated by the arrows, these operations are not necessarily performed in sequence in the order indicated by the arrows. Unless specifically stated in this article, the execution of these operations is not restricted in a strict order, and these operations can be executed in other orders. Moreover, at least a part of the operations in FIGS. 3 and 4 may include multiple sub-operations or multiple stages. These sub-operations or stages are not necessarily executed at the same time, but can be executed at different times. These sub-operations or The execution order of the stages is not necessarily carried out sequentially, but may be executed alternately or alternately with at least a part of other operations or sub-operations or stages of other operations.
  • FIG. 6 it is a structural block diagram of a file distribution apparatus in an embodiment.
  • the apparatus includes: a first acquiring module 602, a second acquiring module 604, a determining module 606, and a sending module 608. in,
  • the first obtaining module 602 is used to obtain 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 second obtaining module 604 is configured to obtain the identifier of the file to be deployed and the corresponding identifier of the node to be deployed;
  • the determining module 606 is configured to determine the target download address corresponding to the identifier of the file to be deployed according to the mapping relationship;
  • the sending module 608 is configured to send a first file deployment instruction carrying a file to be deployed identifier and a 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 according to the identifier of the file to be deployed and Deploy the file to be deployed corresponding to the target download address.
  • the file distribution device in the embodiment of the present application obtains file information.
  • the file information contains the file identification and download address.
  • the file identification to be deployed and the corresponding node identification to be deployed are obtained according to the mapping
  • the relationship determines the target download address corresponding to the identifier of the file to be deployed, 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 node identifier to be deployed, and the first file deployment instruction is used for Instruct the node to be deployed to deploy the corresponding file to be deployed according to the file identifier and the target download address.
  • the node to be deployed does not necessarily only obtain the file to be deployed from the file storage server each time, reducing the service resource occupation of the file storage server, and A single file storage server can serve limited objects at the same time due to the limitations of service resources such as memory and network bandwidth.
  • the device in the embodiment of this application can improve the scalability of the system; and if the file storage server fails, it can also The files to be deployed are deployed normally.
  • the determining module 606 is configured to select a candidate download address corresponding to the file identifier to be deployed from the mapping relationship; determine a target node whose transmission distance to the node to be deployed is within a preset distance from the candidate download address The corresponding target download address, where the identifier of the node to be deployed corresponds to the node to be deployed.
  • the file distribution device in this embodiment selects the candidate download address corresponding to the file identifier to be deployed from the mapping relationship, and determines from the candidate download address that the target node whose transmission distance to the node to be deployed is within a preset distance corresponds to The target download address of the node to be deployed corresponds to the node to be deployed. Since the transmission distance between the node to be deployed and the target node within the preset distance range, the signal during data transmission is better and the transmission speed is faster Therefore, the efficiency of file distribution can be improved, and the efficiency of file deployment can also be improved.
  • the determining module 606 is configured to obtain 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, and use the reference download address as the target download address.
  • the file distribution device in this embodiment obtains the reference download address corresponding to the node in the same server cluster as the node to be deployed from the candidate download address.
  • the identifiers corresponding to the target nodes that are closer to each other improve the efficiency of file distribution and also improve the efficiency of file deployment.
  • the determining module 606 is used to detect the file timestamp of the file to be deployed identifier corresponding to each reference download address; the reference download address whose file timestamp is within the preset time range is used as the target download address.
  • the file distribution device in this embodiment detects the file timestamp of the file identification to be deployed corresponding to each reference download address, and uses the reference download address whose file timestamp is within the preset time range as the target download address.
  • the file timestamp corresponding to the file identifier is too old, and 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, so the reference download address with the file timestamp within the preset time range is taken as the target
  • the download address can obtain the target node that actually contains the file to be deployed, which improves the probability that the node to be deployed successfully obtains the file to be deployed.
  • the determining module 606 is further configured to determine that the transmission distance to the node to be deployed is within the preset distance range from the candidate download addresses if the reference download address whose file timestamp is within the preset time range is not obtained.
  • the target download address corresponding to the target node inside and except for the target node located outside the same server cluster as the node to be deployed.
  • the file distribution device in this embodiment, if the reference download address whose file timestamp is within the preset time range is not obtained, it is determined from the candidate download addresses that the transmission distance to the node to be deployed is within the preset distance range, and Except for the target download address corresponding to the target node outside the same server cluster as the node to be deployed, the probability of obtaining the file to be deployed can be improved.
  • the sending module 608 is configured to send the first to-be-deployed instruction that carries the to-be-deployed file identifier, the target download address, and the source file download address to the node-to-be-deployed corresponding to the node identifier to be deployed. If the node to be deployed fails to download the file to be deployed from the target node corresponding to the target download address, deploy the file to be deployed according to the source file download address.
  • the file distribution device in this embodiment sends a first to-be-deployed instruction carrying the to-be-deployed file identifier, target download address, and source file download address to the node-to-be-deployed corresponding to the node identifier to be deployed, and the first to-be-deployment instruction is also used for If the node to be deployed fails to download the file to be deployed from the target node, the file to be deployed is deployed according to the source file download address, that is, the node to be deployed prefers to deploy the file through the target node, which can provide another mechanism for downloading the file to be deployed to ensure that the node to be deployed The files to be deployed are successfully deployed.
  • the sending module 608 is configured to, if the target download address corresponding to the identification of the node to be deployed cannot be obtained from the file information, send the first download address carrying the active file download address to the node to be deployed corresponding to the identification of the node to be deployed A second file deployment instruction, where 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.
  • the second file deployment instruction carrying the active file download address is sent to the node to be deployed, and the second file The 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 no other node has deployed the file to be deployed, the electronic device cannot obtain the target download corresponding to the node identifier to be deployed from the file information Therefore, it provides another mechanism for downloading the files to be deployed to ensure that the nodes to be deployed successfully deploy the files to be deployed.
  • the file distribution device further includes an update module, which is used to receive the download result corresponding to the file to be deployed returned from the node to be deployed;
  • the identifier of the node to be deployed is updated to an available state, so that the file to be deployed in the node to be deployed can be downloaded.
  • the file distribution device in this embodiment receives the download result corresponding to the file to be deployed returned by the node to be deployed, and in response to the download result being that the download is successful, updates the node identifier to be deployed corresponding to the file identifier to be deployed to an available state, In order to enable the file to be deployed in the node to be deployed to be downloaded, the way to download the file to be deployed is increased.
  • the sending module 608 is further configured to obtain the pre-download node identifier and the corresponding file to be deployed identifier sent by the terminal, and send to the pre-download node corresponding to the pre-download node identifier the file that carries the file to be deployed identifier and the source file download address.
  • the pre-download instruction, the pre-download instruction is used to instruct the pre-download node corresponding to the pre-download node identifier to obtain the file to be deployed corresponding to the file identifier to be deployed from the source file download address, and the pre-download node identifier is at least one of the node identifiers to be deployed.
  • the sending module 608 is also configured to send a first file deployment instruction carrying the identifier of the file to be deployed 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 file to be deployed, and if the node is pre-downloaded The file to be deployed cannot be deployed, and the corresponding file to be deployed is deployed according to the identifier of the file to be deployed and the target download address.
  • the file distribution device in this embodiment sends a pre-download instruction carrying the identifier of the file to be deployed and the download address of the source file to the pre-download node.
  • the pre-download instruction is used to instruct the pre-download node to obtain the file to be deployed from the source file download address, and if The first file deployment instruction is received and the file to be deployed is deployed. If the file to be deployed cannot be deployed, the corresponding file to be deployed is deployed according to the identifier of the file to be deployed and the target download address, so that the file can be quickly deployed.
  • the file distribution device may be divided into different modules as needed to complete all or part of the functions of the file distribution device.
  • Each module in the above-mentioned file distribution device can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the foregoing modules may be embedded in the form of hardware or independent of the processor in the electronic device, or may 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 foregoing modules.
  • each module in the file distribution device may be in the form of a computer program.
  • the computer program can be run on electronic devices such as terminals or servers.
  • the program module composed of the computer program can be stored in the memory of the electronic device.
  • an electronic device including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
  • the processor executes the computer program to implement the file distribution provided by the foregoing embodiments. Method of operation.
  • a computer-readable storage medium stores a computer program.
  • the computer program is executed by the processor, the file distribution described in the embodiments of the present application is realized. Method of operation.
  • a computer program product containing instructions is provided, if it runs on a computer, the computer executes the file distribution method described in each embodiment of the present application.
  • 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 acts as external cache memory.
  • 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).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种文件分发方法,包括:获取文件信息,所述文件信息中包含文件标识与下载地址,文件标识与下载地址之间存在映射关系;获取待部署文件标识以及对应的待部署节点标识;根据所述映射关系确定与所述待部署文件标识相对应的目标下载地址;及向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述待部署节点根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件。

Description

文件分发方法、装置、电子设备和计算机可读存储介质 技术领域
本申请涉及计算机技术领域,特别是涉及一种文件分发方法、装置、电子设备和计算机可读存储介质。
背景技术
目前文件分发通常采用P2P(Peer to Peer,对等网络),P2P技术属于覆盖层网络(Overlay Network)的范畴,是相对于客户机/服务器(C/S)模式来说的一种网络信息交换方式。在C/S模式中,数据分发采用专门的服务器,多个客户端都从此服务器获取数据。然而,目前的文件分发方式,存在占用过多服务器资源的问题。
发明内容
根据本申请的各种实施例提供一种文件分发方法、装置、电子设备和计算机可读存储介质。
一种文件分发方法,包括:获取文件信息,所述文件信息中包含文件标识与下载地址,所述文件标识与所述下载地址之间存在映射关系;获取待部署文件标识以及对应的待部署节点标识;根据所述映射关系确定与所述待部署文件标识相对应的目标下载地址;向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述待部署节点根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件。
一种文件分发装置,所述装置包括:
第一获取模块,用于获取文件信息,所述文件信息中包含文件标识与下载地址,所述文件标识与所述下载地址之间存在映射关系;
第二获取模块,用于获取待部署文件标识以及对应的待部署节点标识;
确定模块,用于根据所述映射关系确定与所述待部署文件标识相对应的目标下载地址;
发送模块,用于向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述待部署节点根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件。
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行本申请各实施例中所述的文件分发方法的步骤。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现本申请各实施例中所述的文件分发方法的步骤。
本申请实施例通过获取文件信息,文件信息中包含文件标识与节点标识,文件标识与下载地址之间存在映射关系,获取待部署文件标识以及对应的待部署节点标识,根据映射关系确定与待部署文件标识相对应的目标下载地址,向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,该第一文件部署指令用于指示待部署节点根据待部署文件标识以及目标下载地址部署对应的待部署文件,则待部署节点每次不一定只从文件存储服务器中获取待部署文件,减少了文件存储服务器的服务资源占用。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为一个实施例中电子设备的内部结构示意图。
图2为一个实施例中文件分发方法的应用环境示意图。
图3为一个实施例中文件分发方法的流程图。
图4为一个实施例中预下载的流程示意图。
图5为一个实施例中文件分发方法的架构示意图。
图6为一个实施例中文件分发装置的结构框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
在一个实施例中,如图1所示,提供了一种电子设备的内部结构示意图。该电子设备为服务器。该电子设备具体可以是文件分发服务器。该服务器中可包含文件分发***,用于发送文件部署指令,使得各待部署节点成功部署待部署文件。文件分发***是中心化服务,负责协调和分发任务,例如协调文件分发任务。该服务器包括通过***总线连接的处理器和存储器。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器可包括非易失性存储介质及内存储器。非易失性存储介质存储有操作***和计算机程序。该计算机程序可被处理器所执行,以用于实现以下各个实施例所提供的一种文件分发方法。内存储器为非易失性存储介质中的操作***计算机程序提供高速缓存的运行环境。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。本领域技术人员可以理解,图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器的限定,具体的服务器可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。通过上述的架构,可实现本申请各个实施例中的文件分发方法。
在一个实施例中,如图2所示,为一个实施例中文件分发方法的应用环境示意图,包括文件分发服务器202、目标节点204和待部署节点206。文件分发服务器202、目标节点204和待部署节点206之间通过网络进行通信。目标节点204也可以是待部署节点。目标节点204和待部署节点206均为服务器。待部署节点会通过代理程序开通安全接口,将自身已经下载的文件作为源文件给其他节点下载,则该节点可成为目标节点。节点之间具体可以是通过HTTP(HyperText Transfer Protocol,超文本传输协议)进行通信交互。HTTP是一个简单的请求-响应协议,它通常运行在TCP(Transmission Control Protocol,传输控制协议)之上。它指定了客户端可能发送给服务器什么样的消息以及得到什么样的响应。文件分发服务器202用于获取文件信息,文件信息中包含文件标识与下载地址,文件标识和下载地址之间存在映射关系;并获取待部署文件标识以及对应的待部署节点标识。文件分发服务器202根据映射关系确定与待部署文件标识相对应的目标下载地址。文件分发服务器202向部署节点标识所对应的待部署节点206发送携带有待部署文件标识和目标节点的文件部署指令,该文件部署指令用于指示该待部署节点206根据待部署文件标识以及目标下载地址部署对应的待部署文件。
在一个实施例中,如图3所示,提供了一种文件分发方法,本实施例以该方法应用于如图1所示的电子设备为例进行说明。该方法包括:
操作302,获取文件信息,文件信息中包含文件标识和下载地址,文件标识与下载地 址之间存在映射关系。
其中,文件标识用于唯一标识文件。文件标识可以由数字、字母、文字、符号中至少一种组成。文件标识具体可以是文件名称或者文件MD5值等不限于此。文件MDS值是通过MD5信息摘要算法(Message-Digest Algorithm)计算得到的。下载地址可以是节点标识或者URL(Uniform Resource Locator,统一资源定位符)。节点标识用于唯一地标识服务节点。节点标识具体可以是节点的MAC(Media Access Control,媒体访问控制)地址、节点的IP(Internet Protocol,互联网协议)地址等不限于此。文件标识和下载地址之间的映射关系用于表示某个下载地址所对应的节点包含文件。或者,文件标识和下载地址之间的映射关系用于表示某个文件标识所对应的文件在哪些下载地址所对应的节点内保存。
具体地,本申请应用于文件分发***的文件分发场景中。电子设备获取存储的文件信息,文件信息中包含文件标识和下载地址,文件标识与下载地址之间存在映射关系。文件信息中还可以包含是否分发成功、分发的时间、分发的服务器集群标识中至少一种。
操作304,获取待部署文件标识以及对应的待部署节点标识。
其中,待部署文件标识是指待部署文件所对应的标识。待部署节点标识是指待部署节点所对应的标识。待部署文件标识和待部署节点标识的数量均不限。
具体地,终端获取选取的或输入的待部署文件标识以及对应的待部署节点标识。电子设备从终端获取该待部署文件标识以及对应的待部署节点标识。例如,待部署文件标识为“文件A”对应的待部署节点标识为“节点Z、节点Y和节点X”。待部署文件标识和对应的待部署节点标识用于表示哪些节点需要部署哪些待部署文件。
操作306,根据映射关系确定与待部署文件标识相对应的目标下载地址。
其中,目标下载地址所对应的目标节点包含该待部署文件标识所对应的待部署文件。
具体地,电子设备根据文件标识和节点标识之间的映射关系,确定包含待部署文件标识的目标节点的目标下载地址。例如,映射关系中包含“文件A”对应的节点标识仅有“节点P”,“文件B”对应的节点标识为“节点M和节点N”,待部署文件标识为“文件A”,那么根据映射关系,确定与待部署文件标识“文件A”相对应的目标下载地址仅有“节点P”。
操作308,向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,第一文件部署指令用于指示待部署节点根据待部署文件标识以及目标下载地址部署对应的待部署文件。
其中,部署也可以称为安装,部署对应的待部署文件可以是指安装待部署文件所对应的程序包。例如程序包可为二进制程序包,比如java的jar包。
具体地,电子设备向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令。即该第一文件部署指令中可包括待部署文件标识和目标下载地址。第一文件部署指令还可以包含其他数据,例如源文件下载地址等。待部署节点接收到该文件部署指令后,从目标下载地址所对应的目标节点中获取并部署待部署节点标识对应的待部署文件。例如,电子设备向待部署节点发送携带有待部署文件标识“文件A”和目标下载地址“节点P”的文件部署指令,则待部署节点从节点P中获取文件A并部署。
本实施例中,若目标下载地址为至少两个,待部署节点从任意一个目标下载地址所对应的目标节点中获取并部署待部署节点标识对应的待部署文件。
本申请实施例中的文件分发方法,获取文件信息,文件信息中包含文件标识与节点标识,文件标识与下载地址之间存在映射关系,获取待部署文件标识以及对应的待部署节点标识,根据映射关系确定与待部署文件标识相对应的目标下载地址,向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,该第一文件部署指令用于指示待部署节点根据待部署文件标识以及目标下载地址部署对应的 待部署文件,则待部署节点每次不一定只从文件存储服务器中获取待部署文件,减少了文件存储服务器的服务资源占用,并且单一的文件存储服务器由于服务资源例如内存、网络带宽等的限制,可同时服务的对象有限,采用本申请实施例中的方法能够提高***的可扩展性;并且若文件存储服务器出现故障,也能正常部署待部署文件。
在一个实施例中,根据映射关系确定与待部署文件标识相对应的目标下载地址,包括:从映射关系中选取与待部署文件标识对应的候选下载地址;从候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,其中,待部署节点标识与待部署节点相对应。
其中,候选下载地址所对应的候选节点即为包含待部署文件的候选节点所对应的标识。预设距离范围是指在一定距离范围内的,预设距离范围可预先设置。电子设备可预先设置哪些节点之间的传输距离在预设范围内。
具体地,电子设备从映射关系中选取与待部署文件标识对应的候选下载地址,从候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址。例如,待部署文件标识对应的候选下载地址包括位于中国的节点、位于日本的节点和位于美国的节点。那么,位于中国的节点和位于日本的节点之间的传输距离可设为在预设范围内。
本实施例中的文件分发方法,从映射关系中选取与待部署文件标识对应的候选下载地址,从候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,待部署节点标识与待部署节点相对应,由于与待部署节点之间的传输距离在预设距离范围内的目标节点,在进行数据传输时的信号较好、传输速度较快,因此,可以提高文件分发的效率,也提高文件部署效率。
在一个实施例中,从候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,包括:从候选下载地址中获取与待部署节点位于同一服务器集群的节点所对应的参考下载地址,将参考下载地址作为目标下载地址。
其中,同一服务器集群即同一机房。且同一服务器集群之间的通信通过局域网进行通信。与待部署节点之间传输距离在预设距离范围内的目标节点包括与待部署节点位于同一服务器集群的节点。且位于同一服务器集群的参考节点可视为与待部署节点之间传输距离最小。
具体地,电子设备从候选下载地址中获取与待部署节点位于同一服务器集群的节点所对应的参考下载地址,将参考下载地址作为目标下载地址。
本实施例中的文件分发方法,从候选下载地址中获取与待部署节点位于同一服务器集群的节点所对应的参考下载地址,作为目标下载地址,能够得到包含待部署文件的且与待部署节点之间距离较近的目标节点所对应的标识,提高文件分发效率,也提高了文件部署效率。
在一个实施例中,将参考下载地址作为目标下载地址,包括:检测每个参考下载地址所对应的待部署文件标识的文件时间戳;将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址。
具体地,文件时间戳可用于表示该待部署文件的创建时间、或者该部署文件的分发时间等。电子设备检测每个参考下载地址所对应的待部署文件标识的文件时间戳,将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址。预设时间范围内可以是指在某个预设时长范围内,例如10天内。预设时间范围内还可以是指该待部署文件标识的文件时间戳,是否在该参考下载地址所对应的最新的预设数量个文件时间戳中。例如,该待部署文件标识的文件时间戳是否在该参考下载地址所对应的最新的5个文件时间戳中。
本实施例中的文件分发方法,检测每个参考下载地址所对应的待部署文件标识的文件时间戳,将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址,由于若待部 署文件标识对应的文件时间戳太久远,对应的该待部署文件可能已经不在参考节点中,即参考节点删除了该待部署文件,因此将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址,能够得到真正包含待部署文件的目标节点,提高待部署节点成功获取待部署文件的概率。
在一个实施例中,该文件分发方法还包括:若未获取到文件时间戳在预设时间范围内的参考下载地址,从候选下载地址中,确定与待部署节点之间传输距离在预设距离范围内、且除与待部署节点位于同一服务器集群外的目标节点所对应的目标下载地址。
具体地,若未获取到文件时间戳在预设时间范围内的参考下载地址,从与待部署节点标识所对应的候选下载地址中,确定与待部署节点之间传输距离在预设距离范围内、且除与待部署节点位于同一服务器集群之外的目标节点所对应的目标下载地址。例如,电子设备从候选下载地址中获取与待部署节点位于同一服务器集群的节点所对应的参考下载地址A,而A节点中的该待部署文件标识对应的文件时间戳未在预设时间范围内,即A节点中的该待部署文件可能过期。那么电子设备可从候选下载地址中,确定与待部署节点位于相邻服务器集群的目标节点所对应的目标下载地址。
本实施例中的文件分发方法,若未获取到文件时间戳在预设时间范围内的参考下载地址,从候选下载地址中,确定与待部署节点之间传输距离在预设距离范围内、且除与待部署节点位于同一服务器集群外的目标节点所对应的目标下载地址,能够提高获取到待部署文件的概率。
在一个实施例中,向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,包括:
向待部署节点标识所对应的待部署节点发送携带有待部署文件标识、目标下载地址和源文件下载地址的第一待部署指令,第一待部署指令还用于若待部署节点从目标下载地址所对应的目标节点下载待部署文件失败,根据源文件下载地址部署待部署文件。
其中,源文件下载地址可以是指用于存储文件的文件存储服务器的IP地址,或者是URL(Uniform Resource Locator,统一资源定位符)地址等。
具体地,待部署节点从目标节点下载待部署文件失败的情况可以是传输通路受阻、待部署文件损坏等不限于此。电子设备向待部署节点标识所对应的待部署节点发送携带有待部署文件标识、目标下载地址和源文件下载地址的第一待部署指令。第一待部署指令还用于若待部署节点无法从目标下载地址对应的目标节点成功下载待部署文件,从源文件下载地址下载该待部署文件并部署该待部署文件。
本实施例中的文件分发方法,向待部署节点标识所对应的待部署节点发送携带有待部署文件标识、目标下载地址和源文件下载地址的第一待部署指令,第一待部署指令还用于若待部署节点从目标节点下载待部署文件失败,根据源文件下载地址部署待部署文件,即待部署节点优先通过目标节点部署文件,能够提供另一种下载待部署文件的机制,保证待部署节点成功部署待部署文件。
在一个实施例中,该文件分发方法还包括:若无法从文件信息中获取到与待部署节点标识相对应的目标下载地址,向待部署节点标识对应的待部署节点发送携带有源文件下载地址的第二文件部署指令,该第二文件部署指令用于指示待部署节点根据源文件下载地址部署待部署文件。
具体地,若电子设备无法从文件信息中获取到与待部署节点标识相对应的目标下载地址,向待部署节点标识对应的待部署节点发送携带有源文件下载地址的第二文件部署指令。待部署节点可从该源文件下载地址获取待部署文件并部署该待部署文件。即该待部署文件标识对应的待部署文件还未被任意节点部署。
例如,电子设备从终端获取待部署文件标识以及对应的待部署节点标识。那么从文件信息中获取与第一个待部署节点标识相对应的目标下载地址时,由于可能还没有其他节点 部署了该待部署文件,则电子设备无法从文件信息中获取到与待部署节点标识对应的目标下载地址。因此电子设备向待部署节点标识对应的待部署节点发送源文件下载地址,以使待部署节点从源文件下载地址下载待部署文件。
本实施例中的文件分发方法,若无法从文件信息中获取到与待部署节点标识相对应的目标下载地址,向待部署节点发送携带有源文件下载地址的第二文件部署指令,第二文件部署指令用于指示待部署节点根据源文件下载地址部署待部署文件,由于可能还没有其他节点部署了该待部署文件,则电子设备无法从文件信息中获取到与待部署节点标识对应的目标下载地址,因此提供另一种下载待部署文件的机制,保证待部署节点成功部署待部署文件。
在一个实施例中,在向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令之后,该文件分发方法还包括:接收待部署节点返回的与待部署文件所对应的下载结果;响应于下载结果为下载成功,将待部署文件标识所对应的待部署节点标识更新为可用状态,以使待部署节点中的待部署文件能被下载。
其中,下载结果即待部署节点是否能从目标节点中成功获取到待部署文件。即下载结果包括下载成功或下载失败。
具体地,待部署节点从目标节点下载待部署文件,并生成下载结果,向电子设备发送该下载结果。电子设备接收待部署节点返回的与待部署文件所对应的下载结果。响应于下载结果为下载成功,电子设备将待部署文件标识所对应的待部署节点标识,更新为可用状态,以使待部署节点中的该待部署文件能够被下载。例如,待部署文件标识对应的节点标识A为不可用状态。待部署节点返回A文件下载成功,响应于下载结果为下载成功,电子设备将待部署文件标识所对应的节点标识A更新为可用状态,那么其他节点即可从该待部署节点下载该待部署文件。
本实施例中的文件分发方法,接收待部署节点返回的与待部署文件所对应的下载结果,响应于下载结果为下载成功,将待部署文件标识所对应的待部署节点标识更新为可用状态,以使待部署节点中的待部署文件能被下载,增加了下载该待部署文件的途径。
在一个实施例中,如图4所示,为一个实施例中预下载的流程示意图,在获取文件信息之前,该文件分发方法还包括:
步骤402,获取终端发送的预下载节点标识和对应的待部署文件标识,向预下载节点标识对应的预下载节点发送携带有待部署文件标识和源文件下载地址的预下载指令,预下载指令用于指示预下载节点标识对应的预下载节点从源文件下载地址获取待部署文件标识所对应的待部署文件,预下载节点标识是待部署节点标识中的至少一个。
向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,第一文件部署指令用于指示待部署节点根据待部署文件标识以及目标下载地址部署对应的待部署文件,包括:
步骤404,向预下载节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,第一文件部署指令用于指示预下载节点部署对应的待部署文件,并且若预下载节点无法部署待部署文件,根据待部署文件标识以及目标下载地址部署对应的待部署文件。
其中,预下载节点标识是待部署节点标识中的至少一个。预下载是指在部署之前提前下载文件。预下载指令则用于在获取文件信息之前使待部署节点下载该待部署文件。
具体地,在进行文件部署之前,可提前下载待部署文件。终端获取预下载节点标识以及对应的待部署文件标识,向电子设备发送预下载节点标识以及对应的待部署文件标识。电子设备接收终端发送的预下载节点和对应的待部署文件标识,向预下载节点标识对应的预下载节点发送携带有待部署文件标识和源文件下载地址的预下载指令。那么在进行文件部署时,电子设备依旧向预下载节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令。
本实施例中的文件分发方法,向预下载节点发送携带有待部署文件标识和源文件下载地址的预下载指令,预下载指令用于指示预下载节点从源文件下载地址获取待部署文件,且若接收到第一文件部署指令,部署待部署文件,若无法部署该待部署文件,根据待部署文件标识以及目标下载地址部署对应的待部署文件,能够快速部署文件。
在一个实施例中,一种文件分发方法,包括:
步骤a1,获取终端发送的预下载节点标识和对应的待部署文件标识,向预下载节点标识所对应的预下载节点发送携带有待部署文件标识和源文件下载地址的预下载指令,预下载指令用于指示预下载节点标识对应的预下载节点从源文件下载地址获取待部署文件标识所对应的待部署文件,预下载节点标识是待部署节点标识中的至少一个。
步骤a2,获取文件信息,文件信息中包含文件标识与下载地址,文件标识与下载地址之间存在映射关系。
步骤a3,获取待部署文件标识以及对应的待部署节点标识。
步骤a4,从映射关系中选取与待部署文件标识对应的候选下载地址。
步骤a5,从候选下载地址中获取与待部署节点位于同一服务器集群的节点所对应的参考下载地址。
步骤a6,检测每个参考下载地址所对应的待部署文件标识的文件时间戳。
步骤a7,将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址,其中,待部署节点标识与待部署节点相对应。
步骤a8,若未获取到文件时间戳在预设时间范围内的参考下载地址,从候选下载地址中,确定与待部署节点之间传输距离在预设距离范围内、且除与待部署节点位于同一服务器集群之外的目标节点所对应的目标下载地址。
步骤a9,向预下载节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,第一文件部署指令用于指示预下载节点部署对应的待部署文件,并且若预下载节点无法部署待部署文件,根据待部署文件标识以及目标下载地址部署对应的待部署文件。
步骤a10,若无法从文件信息中获取到与待部署节点标识相对应的目标下载地址,向待部署节点标识对应的待部署节点发送携带有源文件下载地址的第二文件部署指令,第二文件部署指令用于指示待部署节点根据源文件下载地址部署待部署文件。
本申请实施例中的文件分发方法,获取文件信息,文件信息中包含文件标识与下载地址之间的映射关系,获取待部署文件标识以及对应的待部署节点标识,根据映射关系确定与待部署文件标识相对应的目标下载地址,向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,该第一文件部署指令用于指示待部署节点根据待部署文件标识以及目标下载地址部署对应的待部署文件,则待部署节点每次不一定只从文件存储服务器中获取待部署文件,减少了存储文件的服务器的服务资源占用,并且单一的文件存储服务器由于服务资源例如内存、网络带宽等的限制,可同时服务的对象有限,采用本申请实施例中的方法能够提高***的可扩展性;并且若某一存储文件的服务器出现故障,也能正常部署待部署文件。
在一个实施例中,如图5所示,为一个实施例中文件分发方法的架构示意图,包括发布***(即文件分发服务器)、机房A(即服务器集群A)、机房B(即服务器集群B)和机房C(即服务器集群C)。发布***中可记录文件分布元数据(即文件信息),根据文件信息确定目标下载地址。机房A中包括a节点502和b节点504,机房B中包括c节点508和d节点510,机房C中包括e节点512和f节点514。发布***可向a节点、b节点、c节点、d节点、e节点和f节点中至少一个节点发布部署任务。而a节点、b节点、c节点、d节点、e节点和f节点根据待部署文件标识以及目标下载地址部署对应的待部署文件。图中的箭头仅做示意。
传统的发布架构,每次发布都要从源文件服务器下载文件,源文件服务器很容易受机房位置和宽带等因素影响,下载效率低下。
1、部署应用前,首先发布***将本次发布信息记录下来,然后发布***通过已经记录的元数据,根据同机房优先、其次相邻机房的算法(即传输距离在预设距离范围内),计算出一个最优(优先同机房,其次相邻机房)的发布文件下载地址(即目标下载地址)。如果存在最优的发布文件下载地址,发布***将源文件下载地址和最优的发布文件下载地址传递给待部署节点。
2、应用部署时,待部署节点优先通过最优的发布文件下载地址下载,如果下载失败,从源文件下载地址下载,从而保证待部署文件的可用性。
3、文件部署结束后,部署节点将下载结果通知给发布***,发布***将本次记录的文件位置修改为可用,这样就实现了待部署节点间的文件共享下载。
4、发布前针对机房(服务器集群)进行预下载(数据预热),整体提升首次分发效率。
本申请的技术方案,在传统资源的环境下建立起节点间的文件共享体系,突破部署(尤其是海外部署)的下载瓶颈,提升部署效率。同时,通过源文件下载地址,保证了下载的可靠性。更不用单独维护文件分发服务集群,将发布和文件下载加速完美结合在一起。通过记录文件的下载去向、计算和配置,共享节点间的文件,整合发布***,不需要额外的资源申请和占用,一方面提升部署效率,解决因为宽带限制带来的下载瓶颈,同时,即使加速过程失败,通过源文件下载地址进行下载,保证了其可用性,风险可控。
应该理解的是,虽然图3和图4的流程图中的各个操作按照箭头的指示依次显示,但是这些操作并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些操作的执行并没有严格的顺序限制,这些操作可以以其它的顺序执行。而且,图3和图4中的至少一部分操作可以包括多个子操作或者多个阶段,这些子操作或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子操作或者阶段的执行顺序也不必然是依次进行,而是可以与其它操作或者其它操作的子操作或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图6所示,为一个实施例中文件分发装置的结构框图,该装置包括:第一获取模块602、第二获取模块604、确定模块606和发送模块608。其中,
第一获取模块602用于获取文件信息,文件信息中包含文件标识与下载地址,文件标识与下载地址之间存在映射关系;
第二获取模块604用于获取待部署文件标识以及对应的待部署节点标识;
确定模块606用于根据映射关系确定与待部署文件标识相对应的目标下载地址;
发送模块608用于向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,第一文件部署指令用于指示待部署节点根据待部署文件标识以及目标下载地址部署对应的待部署文件。
本申请实施例中的文件分发装置,获取文件信息,文件信息中包含文件标识与下载地址,文件标识与下载地址之间存在映射关系,获取待部署文件标识以及对应的待部署节点标识,根据映射关系确定与待部署文件标识相对应的目标下载地址,向待部署节点标识所对应的待部署节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,该第一文件部署指令用于指示待部署节点根据待部署文件标识以及目标下载地址部署对应的待部署文件,则待部署节点每次不一定只从文件存储服务器中获取待部署文件,减少了文件存储服务器的服务资源占用,并且单一的文件存储服务器由于服务资源例如内存、网络带宽等的限制,可同时服务的对象有限,采用本申请实施例中的装置能够提高***的可扩展性;并且若文件存储服务器出现故障,也能正常部署待部署文件。
在一个实施例中,确定模块606用于从映射关系中选取与待部署文件标识对应的候选下载地址;从候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,其中,待部署节点标识与待部署节点相对应。
本实施例中的文件分发装置,从映射关系中选取与待部署文件标识对应的候选下载地址,从候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,待部署节点标识与待部署节点相对应,由于与待部署节点之间的传输距离在预设距离范围内的目标节点,在进行数据传输时的信号较好、传输速度较快,因此,可以提高文件分发的效率,也提高文件部署效率。
在一个实施例中,确定模块606用于从候选下载地址中获取与待部署节点位于同一服务器集群的节点所对应的参考下载地址,将参考下载地址作为目标下载地址。
本实施例中的文件分发装置,从候选下载地址中获取与待部署节点位于同一服务器集群的节点所对应的参考下载地址,作为目标下载地址,能够得到包含待部署文件的且与待部署节点之间距离较近的目标节点所对应的标识,提高文件分发效率,也提高了文件部署效率。
在一个实施例中,确定模块606用于检测每个参考下载地址所对应的待部署文件标识的文件时间戳;将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址。
本实施例中的文件分发装置,检测每个参考下载地址所对应的待部署文件标识的文件时间戳,将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址,由于若待部署文件标识对应的文件时间戳太久远,对应的该待部署文件可能已经不在参考节点中,即参考节点删除了该待部署文件,因此将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址,能够得到真正包含待部署文件的目标节点,提高待部署节点成功获取待部署文件的概率。
在一个实施例中,确定模块606还用于若未获取到文件时间戳在预设时间范围内的参考下载地址,从候选下载地址中,确定与待部署节点之间传输距离在预设距离范围内、且除与待部署节点位于同一服务器集群外的目标节点所对应的目标下载地址。
本实施例中的文件分发装置,若未获取到文件时间戳在预设时间范围内的参考下载地址,从候选下载地址中,确定与待部署节点之间传输距离在预设距离范围内、且除与待部署节点位于同一服务器集群外的目标节点所对应的目标下载地址,能够提高获取到待部署文件的概率。
在一个实施例中,发送模块608用于向待部署节点标识所对应的待部署节点发送携带有待部署文件标识、目标下载地址和源文件下载地址的第一待部署指令,第一待部署指令还用于若待部署节点从目标下载地址所对应的目标节点下载待部署文件失败,根据源文件下载地址部署待部署文件。
本实施例中的文件分发装置,向待部署节点标识所对应的待部署节点发送携带有待部署文件标识、目标下载地址和源文件下载地址的第一待部署指令,第一待部署指令还用于若待部署节点从目标节点下载待部署文件失败,根据源文件下载地址部署待部署文件,即待部署节点优先通过目标节点部署文件,能够提供另一种下载待部署文件的机制,保证待部署节点成功部署待部署文件。
在一个实施例中,发送模块608用于若无法从文件信息中获取到与待部署节点标识相对应的目标下载地址,向待部署节点标识对应的待部署节点发送携带有源文件下载地址的第二文件部署指令,该第二文件部署指令用于指示待部署节点根据源文件下载地址部署待部署文件。
本实施例中的文件分发装置,若无法从文件信息中获取到与待部署节点标识相对应的目标下载地址,向待部署节点发送携带有源文件下载地址的第二文件部署指令,第二文件部署指令用于指示待部署节点根据源文件下载地址部署待部署文件,由于可能还没有其他 节点部署了该待部署文件,则电子设备无法从文件信息中获取到与待部署节点标识对应的目标下载地址,因此提供另一种下载待部署文件的机制,保证待部署节点成功部署待部署文件。
在一个实施例中,文件分发装置还包括更新模块,更新模块用于接收待部署节点返回的与待部署文件所对应的下载结果;响应于下载结果为下载成功,将待部署文件标识所对应的待部署节点标识更新为可用状态,以使待部署节点中的待部署文件能被下载。
本实施例中的文件分发装置,接收待部署节点返回的与待部署文件所对应的下载结果,响应于下载结果为下载成功,将待部署文件标识所对应的待部署节点标识更新为可用状态,以使待部署节点中的待部署文件能被下载,增加了下载该待部署文件的途径。
在一个实施例中,发送模块608还用于获取终端发送的预下载节点标识和对应的待部署文件标识,向预下载节点标识对应的预下载节点发送携带有待部署文件标识和源文件下载地址的预下载指令,预下载指令用于指示预下载节点标识对应的预下载节点从源文件下载地址获取待部署文件标识所对应的待部署文件,预下载节点标识是待部署节点标识中的至少一个。发送模块608还用于向预下载节点发送携带有待部署文件标识和目标下载地址的第一文件部署指令,第一文件部署指令用于指示预下载节点部署对应的待部署文件,并且若预下载节点无法部署待部署文件,根据待部署文件标识以及目标下载地址部署对应的待部署文件。
本实施例中的文件分发装置,向预下载节点发送携带有待部署文件标识和源文件下载地址的预下载指令,预下载指令用于指示预下载节点从源文件下载地址获取待部署文件,且若接收到第一文件部署指令,部署待部署文件,若无法部署该待部署文件,根据待部署文件标识以及目标下载地址部署对应的待部署文件,能够快速部署文件。
上述文件分发装置中各个模块的划分仅用于举例说明,在其他实施例中,可将文件分发装置按照需要划分为不同的模块,以完成上述文件分发装置的全部或部分功能。
关于文件分发装置的具体限定可以参见上文中对于文件分发方法的限定,在此不再赘述。上述文件分发装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
本申请实施例中提供的文件分发装置中的各个模块的实现可为计算机程序的形式。该计算机程序可在终端或服务器等电子设备上运行。该计算机程序构成的程序模块可存储在电子设备的存储器上。该计算机程序被处理器执行时,实现本申请实施例中所描述的文件分发方法的操作。
在一个实施例中,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述各实施例所提供的文件分发方法的操作。
在一个实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序对处理器执行时,实现本申请各实施例中所描述的文件分发方法的操作。
在一个实施例中,提供了一种包含指令的计算机程序产品,若其在计算机上运行时,使得计算机执行本申请各实施例中所描述的文件分发方法。
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接 RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种文件分发方法,其特征在于,包括:
    获取文件信息,所述文件信息中包含文件标识与下载地址,所述文件标识与所述下载地址之间存在映射关系;
    获取待部署文件标识以及对应的待部署节点标识;
    根据所述映射关系确定与所述待部署文件标识相对应的目标下载地址;及
    向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述待部署节点根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述映射关系确定与所述待部署文件标识相对应的目标下载地址,包括:
    从所述映射关系中选取与所述待部署文件标识对应的候选下载地址;
    从所述候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,其中,所述待部署节点标识与所述待部署节点相对应。
  3. 根据权利要求2所述的方法,其特征在于,所述从所述候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,包括:
    从所述候选下载地址中获取与所述待部署节点位于同一服务器集群的节点所对应的参考下载地址;
    将所述参考下载地址作为目标下载地址。
  4. 根据权利要求3所述的方法,其特征在于,所述将所述参考下载地址作为目标下载地址,包括:
    检测每个所述参考下载地址所对应的所述待部署文件标识的文件时间戳;
    将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址。
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    若未获取到文件时间戳在预设时间范围内的参考下载地址,从所述候选下载地址中,确定与所述待部署节点之间传输距离在预设距离范围内、且除与所述待部署节点位于所述同一服务器集群之外的目标节点所对应的目标下载地址。
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,包括:
    向所述待部署节点标识所对应的待部署节点发送携带有待部署文件标识、目标下载地址和源文件下载地址的第一待部署指令,所述第一待部署指令还用于当所述待部署节点从所述目标下载地址所对应的目标节点下载所述待部署文件失败时,根据所述源文件下载地址部署所述待部署文件。
  7. 根据权利要求1至5任一项所述的方法,其特征在于,所述方法还包括:
    若无法从所述文件信息中获取到与待部署节点标识相对应的目标下载地址,向所述待部署节点标识对应的待部署节点发送携带有源文件下载地址的第二文件部署指令,所述第二文件部署指令用于指示所述待部署节点根据所述源文件下载地址部署所述待部署文件。
  8. 根据权利要求1至5任一项所述的方法,其特征在于,在所述向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令之后,所述方法还包括:
    接收所述待部署节点返回的与所述待部署文件所对应的下载结果;
    若所述下载结果为下载成功,将所述待部署文件标识所对应的待部署节点标识更新为可用状态,以使所述待部署节点中的所述待部署文件能被下载。
  9. 根据权利要求1至5任一项所述的方法,其特征在于,在所述获取文件信息之前, 所述方法还包括:
    获取终端发送的预下载节点标识和对应的待部署文件标识,向所述预下载节点标识所对应的预下载节点发送携带有所述待部署文件标识和源文件下载地址的预下载指令,所述预下载指令用于指示所述预下载节点标识对应的预下载节点从源文件下载地址获取所述待部署文件标识所对应的待部署文件,所述预下载节点标识是待部署节点标识中的至少一个;
    所述向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述待部署节点根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件,包括:
    向所述预下载节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述预下载节点部署对应的待部署文件,并且当所述预下载节点无法部署所述待部署文件时,根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件。
  10. 一种文件分发装置,其特征在于,所述装置包括:
    第一获取模块,用于获取文件信息,所述文件信息中包含文件标识与下载地址,所述文件标识与所述下载地址之间存在映射关系;
    第二获取模块,用于获取待部署文件标识以及对应的待部署节点标识;
    确定模块,用于根据所述映射关系确定与所述待部署文件标识相对应的目标下载地址;
    发送模块,用于向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述待部署节点根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件。
  11. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器执行如下操作:
    获取文件信息,所述文件信息中包含文件标识与下载地址,所述文件标识与所述下载地址之间存在映射关系;
    获取待部署文件标识以及对应的待部署节点标识;
    根据所述映射关系确定与所述待部署文件标识相对应的目标下载地址;及
    向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述待部署节点根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件。
  12. 根据权利要求11所述的电子设备,其特征在于,所述处理器执行根据所述映射关系确定与所述待部署文件标识相对应的目标下载地址,还执行以下操作:
    从所述映射关系中选取与所述待部署文件标识对应的候选下载地址;
    从所述候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,其中,所述待部署节点标识与所述待部署节点相对应。
  13. 根据权利要求12所述的电子设备,其特征在于,所述处理器执行从所述候选下载地址中确定与待部署节点之间传输距离在预设距离范围内的目标节点所对应的目标下载地址,还执行以下操作:
    从所述候选下载地址中获取与所述待部署节点位于同一服务器集群的节点所对应的参考下载地址;
    将所述参考下载地址作为目标下载地址。
  14. 根据权利要求13所述的电子设备,其特征在于,所述处理器执行将所述参考下载地址作为目标下载地址,还执行以下操作:
    检测每个所述参考下载地址所对应的所述待部署文件标识的文件时间戳;
    将文件时间戳在预设时间范围内的参考下载地址作为目标下载地址。
  15. 根据权利要求14所述的电子设备,其特征在于,所述处理器还执行以下操作:
    若未获取到文件时间戳在预设时间范围内的参考下载地址,从所述候选下载地址中,确定与所述待部署节点之间传输距离在预设距离范围内、且除与所述待部署节点位于所述同一服务器集群之外的目标节点所对应的目标下载地址。
  16. 根据权利要求11至15任一项所述的电子设备,其特征在于,所述处理器执行所述向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,还执行以下操作:
    向所述待部署节点标识所对应的待部署节点发送携带有待部署文件标识、目标下载地址和源文件下载地址的第一待部署指令,所述第一待部署指令还用于当所述待部署节点从所述目标下载地址所对应的目标节点下载所述待部署文件失败时,根据所述源文件下载地址部署所述待部署文件。
  17. 根据权利要求11至15任一项所述的电子设备,其特征在于,所述处理器还执行以下操作:
    若无法从所述文件信息中获取到与待部署节点标识相对应的目标下载地址,向所述待部署节点标识对应的待部署节点发送携带有源文件下载地址的第二文件部署指令,所述第二文件部署指令用于指示所述待部署节点根据所述源文件下载地址部署所述待部署文件。
  18. 根据权利要求11至15任一项所述的电子设备,其特征在于,所述处理器在执行所述向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令之后,还执行以下操作:
    接收所述待部署节点返回的与所述待部署文件所对应的下载结果;
    若所述下载结果为下载成功,将所述待部署文件标识所对应的待部署节点标识更新为可用状态,以使所述待部署节点中的所述待部署文件能被下载。
  19. 根据权利要求11至15任一项所述的电子设备,其特征在于,所述处理器在执行所述获取文件信息之前,还执行以下操作:
    获取终端发送的预下载节点标识和对应的待部署文件标识,向所述预下载节点标识所对应的预下载节点发送携带有所述待部署文件标识和源文件下载地址的预下载指令,所述预下载指令用于指示所述预下载节点标识对应的预下载节点从源文件下载地址获取所述待部署文件标识所对应的待部署文件,所述预下载节点标识是待部署节点标识中的至少一个;
    所述处理器执行向所述待部署节点标识所对应的待部署节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述待部署节点根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件,还执行以下操作:
    向所述预下载节点发送携带有所述待部署文件标识和所述目标下载地址的第一文件部署指令,所述第一文件部署指令用于指示所述预下载节点部署对应的待部署文件,并且当所述预下载节点无法部署所述待部署文件时,根据所述待部署文件标识以及所述目标下载地址部署对应的待部署文件。
  20. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至9中任一项所述方法的步骤。
PCT/CN2020/095861 2020-06-12 2020-06-12 文件分发方法、装置、电子设备和计算机可读存储介质 WO2021248466A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080098101.0A CN115244912A (zh) 2020-06-12 2020-06-12 文件分发方法、装置、电子设备和计算机可读存储介质
PCT/CN2020/095861 WO2021248466A1 (zh) 2020-06-12 2020-06-12 文件分发方法、装置、电子设备和计算机可读存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/095861 WO2021248466A1 (zh) 2020-06-12 2020-06-12 文件分发方法、装置、电子设备和计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2021248466A1 true WO2021248466A1 (zh) 2021-12-16

Family

ID=78846804

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/095861 WO2021248466A1 (zh) 2020-06-12 2020-06-12 文件分发方法、装置、电子设备和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN115244912A (zh)
WO (1) WO2021248466A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338650A (zh) * 2021-12-23 2022-04-12 中电金信软件有限公司 文件传输方法、装置、电子设备及可读存储介质
CN114785677A (zh) * 2022-04-22 2022-07-22 武汉联影医疗科技有限公司 日志管理方法、装置、计算机设备、存储介质和程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101389927A (zh) * 2006-03-08 2009-03-18 通腾科技股份有限公司 用于检测特定计算机命令的处理装置、方法及计算机程序
CN103324553A (zh) * 2013-06-21 2013-09-25 华为技术有限公司 数据恢复方法、***及装置
US20150006895A1 (en) * 2009-06-01 2015-01-01 Maidsafe Foundation Distributed network system
CN107179918A (zh) * 2016-03-09 2017-09-19 华为软件技术有限公司 软件处理方法、装置及***
CN109962972A (zh) * 2018-12-25 2019-07-02 阿里巴巴集团控股有限公司 一种离线包重组方法及***

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616166B (zh) * 2008-06-25 2014-08-06 上海聚力传媒技术有限公司 在互联网中用于高速下载多媒体内容的方法与装置
CN107819802B (zh) * 2016-09-13 2021-02-26 华为技术有限公司 一种在节点集群中的镜像获取方法、节点设备及服务器
CN107872475A (zh) * 2016-09-26 2018-04-03 北京优朋普乐科技有限公司 P2p网络的节点筛选方法、客户端和登录服务器
CN107948677B (zh) * 2016-10-13 2020-02-14 ***通信有限公司研究院 一种调度方法、服务器及第一对等节点

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101389927A (zh) * 2006-03-08 2009-03-18 通腾科技股份有限公司 用于检测特定计算机命令的处理装置、方法及计算机程序
US20150006895A1 (en) * 2009-06-01 2015-01-01 Maidsafe Foundation Distributed network system
CN103324553A (zh) * 2013-06-21 2013-09-25 华为技术有限公司 数据恢复方法、***及装置
CN107179918A (zh) * 2016-03-09 2017-09-19 华为软件技术有限公司 软件处理方法、装置及***
CN109962972A (zh) * 2018-12-25 2019-07-02 阿里巴巴集团控股有限公司 一种离线包重组方法及***

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338650A (zh) * 2021-12-23 2022-04-12 中电金信软件有限公司 文件传输方法、装置、电子设备及可读存储介质
CN114785677A (zh) * 2022-04-22 2022-07-22 武汉联影医疗科技有限公司 日志管理方法、装置、计算机设备、存储介质和程序产品
CN114785677B (zh) * 2022-04-22 2023-12-22 武汉联影医疗科技有限公司 日志管理方法、装置、计算机设备、存储介质和程序产品

Also Published As

Publication number Publication date
CN115244912A (zh) 2022-10-25

Similar Documents

Publication Publication Date Title
CN106844137B (zh) 服务器的监控方法和装置
US7978631B1 (en) Method and apparatus for encoding and mapping of virtual addresses for clusters
WO2019095577A1 (zh) 数据请求处理方法、装置、计算机设备和存储介质
CN107819802A (zh) 一种在节点集群中的镜像获取方法、节点设备及服务器
WO2021248466A1 (zh) 文件分发方法、装置、电子设备和计算机可读存储介质
US9182971B2 (en) Distributed control method and apparatus using URL
US20190089648A1 (en) Resource subscription method, resource subscription apparatus, and resource subscription system
Bracciale et al. Lightweight named object: An ICN-based abstraction for IoT device programming and management
CN109547508B (zh) 一种实现资源访问的方法、装置及***
CN108376154B (zh) ***基表同步方法、装置、计算机设备和存储介质
JP7279899B2 (ja) データ収集方法、データ収集装置、データ収集デバイスおよびコンピュータ可読記憶媒体
CN112929463A (zh) 一种基于dns的流量代理方法、服务器及***
CN113364660A (zh) Lvs负载均衡中的数据包处理方法及装置
CN116566984A (zh) 一种k8s容器集群的路由信息创建方法、装置及电子设备
CN113315848A (zh) 访问控制方法、装置及设备
CN110995829A (zh) 实例调用方法、装置及计算机存储介质
US10404578B2 (en) Method for calling routing algorithm, SDN controller, and SDN-OAF
CN111064785B (zh) 资源包下载方法、装置和***
CN108418857B (zh) 一种Zookeeper集群***及其连接方法和装置
CN115150333B (zh) 拥塞控制方法、装置、计算机设备和存储介质
US11973687B2 (en) Multilayer decentralized server network
US20230102122A1 (en) Methods, systems, and computer readable media for identifying alternate delivery endpoints for mobile originated data and monitoring reports in a communications network
CN115242882A (zh) 一种基于传输层路由访问k8s容器环境的方法及装置
WO2022027887A1 (en) Network nodes and methods therein for indirect communication
CN113626188A (zh) 任务推送方法、装置、计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20939553

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 20.04.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20939553

Country of ref document: EP

Kind code of ref document: A1