CN115766882A - Distributed source data returning method and device, storage medium and electronic equipment - Google Patents

Distributed source data returning method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN115766882A
CN115766882A CN202211282670.8A CN202211282670A CN115766882A CN 115766882 A CN115766882 A CN 115766882A CN 202211282670 A CN202211282670 A CN 202211282670A CN 115766882 A CN115766882 A CN 115766882A
Authority
CN
China
Prior art keywords
machine room
target
weight
room
path
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202211282670.8A
Other languages
Chinese (zh)
Other versions
CN115766882B (en
Inventor
贾鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202211282670.8A priority Critical patent/CN115766882B/en
Priority claimed from CN202211282670.8A external-priority patent/CN115766882B/en
Publication of CN115766882A publication Critical patent/CN115766882A/en
Application granted granted Critical
Publication of CN115766882B publication Critical patent/CN115766882B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a distributed source data returning method, a distributed source data returning device, a storage medium and electronic equipment. The method comprises the following steps: determining the target weight of each path in all paths from the target machine room to the source machine room in the target machine room group under the condition that a downloading request of a client for downloading target data from the target machine room is received and the target data does not exist in the target machine room; determining the path with the minimum target weight as a target path; and controlling the target machine room to download the target data from the first machine room and sending the target data to the client, wherein the first machine room is a father machine room of the target machine room in the target path. The invention solves the technical problem that manual intervention is needed when the video content distribution network system selects the back source node.

Description

Distributed source data returning method and device, storage medium and electronic equipment
Technical Field
The invention relates to the field of computers, in particular to a method and a device for distributed source data returning, a storage medium and electronic equipment.
Background
A video CDN (Content Delivery Network) refers to a set of CDN systems capable of providing video streaming services, and generally includes systems for storage, synchronization, source return, scheduling, video file parsing, and the like. The client watches videos, and the downloading of the video stream files adopts the following mode: after a client initiates a request, an analysis list of video files is firstly obtained from a video file analysis server, and then downloading is carried out in sequence according to the files in the list. When downloading each file, a request needs to be made to the scheduler once, and the file is downloaded to the designated CDN edge node according to the result returned by the scheduler. If the downloading request of the file reaches the edge node, and the node stores the file, directly spitting data to the client; if the file does not exist, a downloading request of the file needs to be sent to an upstream node, the data is delivered to the client after the data of the upstream node is received, the file is stored locally, and if the same file request exists next time, the file does not need to be requested to the upstream node; if the upstream node does not have the file, a request needs to be sent upstream of the upstream node. The requested links finally form a tree structure, the edge nodes are leaf nodes of the tree, and the back source nodes are intermediate nodes and root nodes of the tree. The downloading mode of the tree-like hierarchical files is called a source return mode, and most of the files which are more popular can be sent to the whole network by using the downloading mode. However, if a certain file is newly online or is a relatively cold file, when a client requests the file, the source returning link is long, and the source returning speed is slow. At present, the selection of the back-source node is generally based on the rules of different operators and the experience of operation and maintenance personnel, for example, the back-source node cannot cross different operator networks, and when an alarm is received and a problem is found in a certain link or node, the back-source node bypasses a secondary link or node. The back source information is solidified in the video server configuration of each edge node and the upstream back source node, and the upstream node needs to be selected according to the configuration file each time back source. If a problem is found, the configuration file needs to be modified. The problem with this approach is that it relies on manual intervention, which is slow to respond when there is a problem with a node or link. Another problem is that, whether the adjustment of the source-returning relationship is manual or automatic, all the sources-returning relationships are centralized, and depend on the participation of the central control server and the message issuing service, and if such centralized service has a problem once, the source-returning relationship cannot be adjusted, which may affect the time for monitoring the fault and the guarantee of the service quality.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a storage medium and electronic equipment for distributed source returning data, which are used for at least solving the technical problem that manual intervention is needed when a source returning node is selected by a video content distribution network system.
According to an aspect of an embodiment of the present invention, a method for distributing back source data is provided, including: determining the target weight of each path in all paths from the target machine room to the source machine room in the target machine room group under the condition that a downloading request of a client for downloading target data from the target machine room is received and the target data does not exist in the target machine room; determining the path with the minimum target weight as a target path; and controlling the target machine room to download the target data from a first machine room and sending the target data to the client, wherein the first machine room is a father machine room of the target machine room in the target path.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for distributing back source data, including: the first determining module is used for determining the target weight of each path in all paths from the target machine room to the source machine room in the target machine room group under the condition that a downloading request of a client for downloading target data from the target machine room is received and the target data does not exist in the target machine room; a second determining module, configured to determine a path with the smallest target weight as a target path; and the first control module is used for controlling the target machine room to download the target data from the first machine room and sending the target data to the client, wherein the first machine room is a father machine room of the target machine room in the target path.
As an optional example, the apparatus further includes: the second control module is used for controlling the second machine room to send the resource information of the second machine room to a neighbor machine room of the second machine room when detecting that the second machine room is added into the target machine room group before, at the same time as or after the downloading request is received; the first processing module is configured to determine each machine room of the target machine room group as a current machine room, and execute the following operations on the current machine room: detecting whether the current machine room receives the resource information once every other time period; and under the condition that the current machine room is detected to receive the resource information, controlling the current machine room to store the resource information and sending the resource information to a neighbor machine room of the current machine room.
As an optional example, the apparatus further includes: the third control module is used for controlling each machine room of the target machine room group to send own resource information to the corresponding neighbor machine room at a time period before, at the same time or after the downloading request is received; and the deleting module is used for deleting the third machine room from the target machine room group under the condition that each machine room of the target machine room group is detected not to receive the resource information of the third machine room sent by the third machine room of the target machine room group.
As an optional example, the first determining module includes: a processing unit, configured to determine each path from the target computer room to the source computer room as a current path, and perform the following operations on the current path: calculating the sub-weight from each machine room except the target machine room to the corresponding sub-machine room in the current path; determining the sum of all sub-weights as the target weight of the current path; or determining the average value of all the sub-weights as the target weight of the current path; or determining a weighted summation result of all the sub-weights as the target weight of the current path.
As an optional example, the processing unit is further configured to: determining each machine room except the target machine room in the current path as a current machine room, and executing the following operations on the current machine room: determining a first weight in a weight table according to the available bandwidth from the current machine room to the sub-machine room of the current machine room; determining a second weight in the weight table according to the load of the current machine room; determining a third weight in the weight table according to the number of machines connected with the current machine room; determining a fourth weight in the weight table according to the distance from the current machine room to the source machine room; and calculating the sub-weight of the current machine room according to the first weight, the second weight, the third weight and the fourth weight.
As an optional example, the processing unit is further configured to: determining a sum of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room; or determining an average value of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room; or determining a weighted sum result of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room.
As an optional example, the apparatus further includes: a fourth processing module, configured to, when the target computer room is controlled to download the target data from a first computer room, take a parent computer room of the first computer room in the target path as a fourth computer room when the first computer room does not include the target data, and perform the following operations on the fourth computer room; when the fourth machine room includes the target data, taking the fourth machine room as a new first machine room; and when the target data is not included in the fourth machine room, taking a parent machine room of the fourth machine room in the target path as a new fourth machine room.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium, in which a computer program is stored, where the computer program is executed by a processor to perform the method for distributed source-back data.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the method for distributed source data returning through the computer program.
In the embodiment of the invention, the target weight of each path in all paths from the target machine room to the source machine room in the target machine room group is determined under the condition that a downloading request of the target data from the target machine room is received by a client and the target data does not exist in the target machine room; determining the path with the minimum target weight as a target path; the method for controlling the target machine room to download the target data from the first machine room and sending the target data to the client, wherein the first machine room is a father machine room of the target machine room in the target path.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention and do not constitute a limitation of the invention. In the drawings:
FIG. 1 is a flow diagram of an alternative method of distributing back source data in accordance with embodiments of the present invention;
FIG. 2 is a block diagram of an alternative method of distributing back source data in accordance with embodiments of the present invention;
FIG. 3 is a schematic structural diagram of an alternative distributed back-to-source data apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to a first aspect of the embodiments of the present invention, there is provided a method for returning source data in a distributed manner, optionally as shown in fig. 1, the method includes:
s102, determining the target weight of each path in all paths from a target machine room to a source machine room in a target machine room group under the condition that a downloading request of a client for downloading target data from the target machine room is received and the target data does not exist in the target machine room;
s104, determining the path with the minimum target weight as a target path;
and S106, controlling the target machine room to download the target data from the first machine room and sending the target data to the client, wherein the first machine room is a father machine room of the target machine room in the target path.
Optionally, in this embodiment, each room, which is a node providing video service, has tens of physical servers, and different rooms are deployed at different physical locations. The server in the computer room is a Cache server (Cache server). Each Cache server can respond to the video data according to the request of the client, and if no data exists, the video data is firstly returned to the source of the upstream computer room. The source machine room, a machine room storing the full amount of video resources, may be considered as a root node. All the back sources end up there.
Optionally, in this embodiment, when a request initiated by a client to download target data to a machine room a is received, first, whether the target data exists is searched from the machine room a, if yes, the target data in the machine room a is directly sent to the client, if not, an optimal source-returning parent machine room of the machine room a is selected in all the machine rooms, the selection rule is that an optimal source-returning target path is selected according to a target weight of each path from the machine room a to a source machine room, for example, three source-returning path paths 1 (machine room a-machine room b-machine room c-source machine room), path 2 (machine room a-machine room d-machine room e-source machine room), path 3 (machine room a-f-machine room g-source machine room), a target weight of path 1 is 1, a target weight of path 1 is 2, a target weight of path 3 is 4, path 1 with the smallest target weight is selected as the optimal source-returning path, target data is searched in parent machine room b of the machine room a in path 1, and if yes, the target data in the machine room b is sent to the machine room a, and then the target data is sent to the machine room a client. If the machine room b still does not have the target data, searching the target data in a parent machine room c except the machine room b, and so on until the target data is found, sending the target data to the machine room a, and finally sending the target data to the client by the machine room a.
According to the target weight of each path from the target machine room to the source machine room, the optimal target path is selected, and the optimal source returning parent machine room is selected in the target path, so that the aim of accelerating the source returning speed without manual intervention when the source returning node is selected is fulfilled, and the technical problem that manual intervention is needed when the source returning node is selected by a video content distribution network system is solved.
As an optional example, before, simultaneously with, or after receiving the download request, the method further includes:
under the condition that the second machine room is detected to be added into the target machine room group, controlling the second machine room to send the resource information of the second machine room to a neighbor machine room of the second machine room;
determining each machine room of the target machine room group as a current machine room, and executing the following operations on the current machine room:
detecting whether the current machine room receives resource information once every other time period;
and under the condition that the current machine room is detected to receive the resource information, controlling the current machine room to store the resource information and sending the resource information to a neighbor machine room of the current machine room.
Optionally, in this embodiment, the resource information includes key physical indicators such as available bandwidth, used bandwidth, load, the number of connected machines, and IP of a machine, and also includes neighbor information that has been learned by itself. When a new machine room is on line, the machine room is physically communicated with at least one machine room in all machine rooms, and the communicated machine room is a neighbor machine room of the machine room. For example, after the machine room h is on line, the machine room h is communicated with the machine room i, the machine room i is a neighbor machine room of the machine room h, the machine room h sends the resource information of the machine room i to the neighbor machine room i once every other time period, the machine room i learns after receiving the resource information sent by the machine room h, and sends the resource information of the machine room i and the resource information of the machine room h to the neighbor machine room of the machine room i once every other time period. And each machine room circularly sends the own resource information and the learned resource information of the neighbor machine rooms to the own neighbor machine rooms in the same time period, and the machine rooms h can learn the resource information of all the machine rooms through continuous interaction. And simultaneously, all the machine rooms learn the resource information of the machine room h.
As an optional example, before, simultaneously with, or after receiving the download request, the method further includes:
every other time period, each machine room of the target machine room group is controlled to send own resource information to the corresponding neighbor machine room;
and deleting the third machine room from the target machine room group under the condition that each machine room of the target machine room group is detected not to receive the resource information of the third machine room sent by the third machine room of the target machine room group.
Optionally, in this embodiment, all the computer rooms perform periodic interaction continuously, each computer room sends its resource information to its neighbor computer room at an interval of a time period, and when all the computer rooms do not receive the resource information of a certain computer room, it indicates that the computer room has a fault, and then the computer room is deleted from all the computer rooms.
As an optional example, when a download request of a client requesting to download target data from a target computer room is received and the target data does not exist in the target computer room, determining a target weight of each path in all paths from the target computer room to a source computer room in a target computer room group includes:
determining each path from the target machine room to the source machine room as a current path, and executing the following operations on the current path:
calculating the sub-weight from each machine room except the target machine room in the current path to the corresponding sub-machine room;
determining the sum of all the sub-weights as the target weight of the current path; or alternatively
Determining the average value of all the sub-weights as the target weight of the current path; or
And determining the weighted summation result of all the sub-weights as the target weight of the current path.
Optionally, in this embodiment, taking calculation of the target weight of the path 1 (machine room a-machine room b-machine room c-source machine room) as an example, a sum of a first sub-weight from the machine room b to the machine room a, a second sub-weight from the machine room c to the machine room b, and a third sub-weight from the source machine room to the machine room c may be used as the target weight of the path 1. The average of the first sub-weight, the second sub-weight, and the third sub-weight may be used as the target weight of path 1. The result of the weighted summation of the first sub-weight, the second sub-weight, and the third sub-weight may also be used as the target weight of path 1. The first sub-weight, the second sub-weight and the third sub-weight can also be summed according to a certain proportion to be used as the target weight of the path 1. And obtaining the target weight of each path according to the rule.
As an optional example, calculating the sub-weight from each room in the current path except the target room to the corresponding sub-room includes:
determining each machine room except the target machine room in the current path as a current machine room, and executing the following operations on the current machine room:
determining a first weight in a weight table according to the available bandwidth from the current machine room to the sub-machine room of the current machine room;
determining a second weight in the weight table according to the load of the current machine room;
determining a third weight in the weight table according to the number of machines connected with the current machine room;
determining a fourth weight in the weight table according to the distance from the current machine room to the source machine room;
and calculating the sub-weight of the current machine room according to the first weight, the second weight, the third weight and the fourth weight.
Optionally, in this embodiment, taking a sub-weight from computer room b to computer room a as an example, a first weight, a second weight, a third weight, and a fourth weight are determined in a weight table according to an available bandwidth from computer room b to computer room a, a load of computer room b, a number of machines connected to computer room b, and a distance from computer room b to a source computer room, where the higher the available bandwidth from computer room b to computer room a is, the smaller the first weight is, the smaller the load of computer room b is, the smaller the second weight is, the more machines connected to computer room b are, the smaller the third weight is, the smaller the distance from computer room b to the source computer room is, and the smaller the fourth weight is, the weight table may be shown in table 1, for example, the available bandwidth from computer room b a is 1700Mb/s, the first weight is determined to be 0.4, the load of computer room b is 15%, the second weight is determined to be 0.2, the number of machines connected to computer room b is 2, the first weight is determined to be 1, the distance from computer room b to the source computer room b is 1200, the first weight is determined to the fourth weight, and the fourth weight is calculated according to the second weight, the fourth weight, the second weight, the third weight is calculated.
(Table 1)
Figure BDA0003898640680000091
As an alternative example, calculating the sub-weight of the current machine room according to the first weight, the second weight, the third weight and the fourth weight includes:
determining the sum of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room; or
Determining the average value of the first weight, the second weight, the third weight and the fourth weight as the sub-weight of the current machine room; or alternatively
And determining a weighted summation result of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room.
Optionally, in this embodiment, calculating the sub-weight from room b to room a is taken as an example, and a sum of the first weight, the second weight, the third weight, and the fourth weight from room b to room a may be taken as the sub-weight from room b to room a. The first weight, the second weight, the third weight and the fourth weight from the machine room b to the machine room a may also be used as the sub-weights from the machine room b to the machine room a. The weighted summation result of the first weight, the second weight, the third weight and the fourth weight from the machine room b to the machine room a can also be used as the sub-weight from the machine room b to the machine room a. The first weight, the second weight, the third weight and the fourth weight from the machine room b to the machine room a can also be summed according to a certain proportion to be used as the sub-weights from the machine room b to the machine room a. And obtaining the sub-weight from each machine room to the corresponding sub-machine room according to the rule.
As an optional example, when the control target computer room downloads the target data from the first computer room, the method further includes:
when the target data is not included in the first machine room, taking a parent machine room of the first machine room in the target path as a fourth machine room, and executing the following operations on the fourth machine room:
taking the fourth machine room as a new first machine room under the condition that the fourth machine room comprises the target data;
and under the condition that the fourth machine room does not comprise the target data, taking a parent machine room of the fourth machine room in the target path as a new fourth machine room.
Optionally, in this embodiment, when there is no target data in the parent machine room b of the machine room a in the path 1, the parent machine room c of the machine room b in the path 1 searches for the target data, and when there is the target data in the machine room c, the machine room c sends the target data to the machine room b, the machine room b sends the target data to the machine room a, and finally the machine room a sends the target data to the client. Under the condition that no target data exists in the machine room c, the target data are searched in a parent machine room source machine room of the machine room c in the path 1, all data are stored in the source machine room, the target data are stored in all the source machine rooms, the source machine room sends the target data to the machine room c, the machine room c sends the target data to the machine room b, the machine room b sends the target data to the machine room a, and finally the machine room a sends the target data to the client. According to the above rule, the target data can be found in the shortest path quickly.
The application relates to a distributed data back-source method, which enables each machine room to automatically obtain an optimal back-source parent machine room through a route broadcasting and self-organizing method without the participation of operation and maintenance personnel and a central control server. Each group of rooms needs to deploy a state collection server, as shown in fig. 2, and this service may be deployed on a single server or a Cache server. The server collects key physical indexes such as available bandwidth, used bandwidth, machine load, machine quantity and the like of all the computer rooms. The indexes are broadcasted to the neighbor computer rooms according to a certain period. When receiving the message, the neighbor machine room records the message in the database of the neighbor machine room, and simultaneously broadcasts the neighbor message and the state of the neighbor machine room to the neighbor, so that the machine rooms of the whole network can automatically form a mesh topology after a period of time.
When the target machine room needs to return source target data, the state collection server selects an optimal return source parent machine room of the target machine room according to physical resource conditions of the whole network, the selection criteria are that the target weight of each path from the target machine room to the source machine room is calculated according to the available bandwidth from each machine room to the target machine room, the load of each machine room and the number of machines connected with each machine room, the distance from each machine room to the source machine room, the path with the minimum target weight is selected as an optimal return source path, and an optimal return source parent node is selected in the optimal return source path.
When a new machine room is on line, an initialization seed machine room list is needed, and the list comprises machine rooms with better connectivity. The newly brought room needs to be in physical communication with at least one of these lists. The new room also needs to know the room information (such as the name, physical location, etc.) of the source room. And after the new machine room is on line, the resource information can be periodically interacted with all the machine rooms in the list. The resource information comprises key physical indexes such as available bandwidth, used bandwidth, machine load, machine quantity, IP of the machine and the like, and also comprises neighbor information learned by the resource information. Through continuous interaction, the new machine room can learn the resource information of all the machine rooms. And simultaneously, all the computer rooms can learn the resource information of the new computer room. The nodes of the topology are all the machine rooms, and if a connection is arranged between the nodes of the topology, the two machine rooms can be directly communicated.
If a certain machine room fails, the neighbor machine room of the machine room cannot receive the neighbor information in several broadcast periods. At this time, the neighbor machine room deletes the machine room from all machine rooms. After several times of interaction, the information of the machine room is removed from the full-network topology. At this time, each online machine room needs to update its own back-source parent machine room.
It should be noted that for simplicity of description, the above-mentioned method embodiments are shown as a series of combinations of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiments of the present application, there is further provided an apparatus for distributing back source data, as shown in fig. 3, including:
a first determining module 302, configured to determine, in a target room group, a target weight of each path in all paths from a target room to a source room in a case that a download request of a client requesting to download target data from the target room is received and the target data does not exist in the target room;
a second determining module 304, configured to determine a path with the smallest target weight as a target path;
the first control module 306 is configured to control the target machine room to download the target data from the first machine room, and send the target data to the client, where the first machine room is a parent machine room of the target machine room in the target path.
Optionally, in this embodiment, a computer room is a node providing a video service, each computer room has tens of physical servers, and different computer rooms are deployed at different physical locations. The server in the computer room is a Cache server (Cache server). Each Cache server can respond to the video data according to the request of the client, and if no data exists, the video data is firstly returned to the source of the upstream computer room. The source machine room, which stores the full amount of video resources, may be considered as a root node. All the back sources end up there.
Optionally, in this embodiment, when a request initiated by a client to download target data to a machine room a is received, first, whether the target data exists is searched from the machine room a, if yes, the target data in the machine room a is directly sent to the client, if not, an optimal source-backed parent machine room of the machine room a is selected from all the machine rooms, the selection rule is that an optimal source-backed target path is selected according to a target weight of each path from the machine room a to a source machine room, for example, three source-backed path paths 1 (machine room a-machine room b-machine room c-source machine room), a path 2 (machine room a-machine room d-machine room e-source machine room), a path 3 (machine room a-f-machine room g-source machine room), a target weight of the path 1 is 1, a target weight of the path 1 is 2, a target weight of the path 3 is 4, a path 1 with the smallest target weight is selected as an optimal source-backed path, target data is searched from the parent machine room b of the machine room a in the path 1, and if yes, the target data in the machine room b is sent to the machine room a, and then the target data is sent to the machine room a client. If the machine room b does not have the target data, searching the target data in a parent machine room c of the machine room b, repeating the steps until the target data is found, sending the target data to the machine room a, and finally sending the target data to the client side by the machine room a.
The optimal target path is selected according to the target weight of each path from the target machine room to the source machine room, and the optimal source returning father machine room is selected in the target path, so that the purpose that manual intervention is not needed when the source returning node is selected, the source returning speed is accelerated, and the technical problem that manual intervention is needed when the source returning node is selected by a video content distribution network system is solved.
As an optional example, the apparatus further includes:
the second control module is used for controlling the second machine room to send the resource information of the second machine room to a neighbor machine room of the second machine room under the condition that the second machine room is detected to be added into the target machine room group before, simultaneously with or after the downloading request is received;
the second processing module is configured to determine each machine room of the target machine room group as a current machine room, and execute the following operations on the current machine room:
detecting whether the current machine room receives resource information once every other time period;
and under the condition that the current machine room is detected to receive the resource information, controlling the current machine room to store the resource information and sending the resource information to a neighbor machine room of the current machine room.
Optionally, in this embodiment, the resource information includes key physical indicators such as available bandwidth, used bandwidth, load, the number of connected machines, and IP of a machine, and also includes neighbor information that has been learned by itself. When a new machine room is on line, the machine room is physically communicated with at least one machine room in all machine rooms, and the communicated machine room is a neighbor machine room of the machine room. For example, after the machine room h is on line, the machine room h is communicated with the machine room i, the machine room i is a neighbor machine room of the machine room h, the machine room h sends the resource information of the machine room i to the neighbor machine room i once every other time period, the machine room i learns after receiving the resource information sent by the machine room h, and sends the resource information of the machine room i and the resource information of the machine room h to the neighbor machine room of the machine room i once every other time period. And each machine room circularly sends the resource information of the machine room and the learned resource information of the neighbor machine room to the neighbor machine room of the machine room, and the machine rooms h can learn the resource information of all the machine rooms through continuous interaction. And simultaneously, all the computer rooms learn the resource information of the computer room h.
As an optional example, the apparatus further includes:
the third control module is used for controlling each machine room of the target machine room group to send own resource information to the corresponding neighbor machine room at intervals of a time period before, at the same time or after the downloading request is received;
and the deleting module is used for deleting the third machine room from the target machine room group under the condition that each machine room of the target machine room group is detected not to receive the resource information of the third machine room sent by the third machine room of the target machine room group.
Optionally, in this embodiment, all the computer rooms perform periodic interaction continuously, each computer room sends its resource information to its neighbor computer room at an interval of a time period, and when all the computer rooms do not receive the resource information of a certain computer room, it indicates that the computer room has a fault, and then the computer room is deleted from all the computer rooms.
As an alternative example, the first determining module includes:
the processing unit is used for determining each path from the target machine room to the source machine room as a current path, and executing the following operations on the current path:
calculating the sub-weight from each machine room except the target machine room in the current path to the corresponding sub-machine room;
determining the sum of all the sub-weights as the target weight of the current path; or
Determining the average value of all the sub-weights as the target weight of the current path; or
And determining the weighted summation result of all the sub-weights as the target weight of the current path.
Optionally, in this embodiment, taking calculating the target weight of path 1 (machine room a-machine room b-machine room c-source machine room) as an example, calculating a sum of a first sub-weight from machine room b to machine room a, a second sub-weight from machine room c to machine room b, and a third sub-weight from source machine room to machine room c as the target weight of path 1. The average of the first sub-weight, the second sub-weight, and the third sub-weight may be used as the target weight of path 1. The result of weighted summation of the first sub-weight, the second sub-weight and the third sub-weight can also be used as the target weight of path 1. The first sub-weight, the second sub-weight and the third sub-weight can also be summed according to a certain proportion to be used as the target weight of the path 1. And obtaining the target weight of each path according to the rules.
As an optional example, the processing unit is further adapted to:
determining each machine room except the target machine room in the current path as a current machine room, and executing the following operations on the current machine room:
determining a first weight in a weight table according to the available bandwidth from the current machine room to the sub-machine room of the current machine room;
determining a second weight in the weight table according to the load of the current machine room;
determining a third weight in the weight table according to the number of machines connected with the current machine room;
determining a fourth weight in the weight table according to the distance from the current machine room to the source machine room;
and calculating the sub-weight of the current machine room according to the first weight, the second weight, the third weight and the fourth weight.
Optionally, in this embodiment, taking a sub-weight from computer room b to computer room a as an example, a first weight, a second weight, a third weight, and a fourth weight are determined in a weight table according to an available bandwidth from computer room b to computer room a, a load of computer room b, a number of machines connected to computer room b, and a distance from computer room b to a source computer room, where the higher the available bandwidth from computer room b to computer room a is, the smaller the first weight is, the smaller the load of computer room b is, the smaller the second weight is, the more machines connected to computer room b are, the smaller the third weight is, the smaller the distance from computer room b to the source computer room is, and the smaller the fourth weight is, the weight table may be shown in table 1, for example, the available bandwidth from computer room b a is 1700Mb/s, the first weight is determined to be 0.4, the load of computer room b is 15%, the second weight is determined to be 0.2, the number of machines connected to computer room b is 2, the first weight is determined to be 1, the distance from computer room b to the source computer room b is 1200, the first weight is determined to the fourth weight, and the fourth weight is calculated according to the second weight, the fourth weight, the second weight, the third weight is calculated.
(Table 1)
Figure BDA0003898640680000161
As an optional example, the processing unit is further configured to:
determining the sum of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room; or
Determining the average value of the first weight, the second weight, the third weight and the fourth weight as the sub-weight of the current machine room; or
And determining the weighted sum result of the first weight, the second weight, the third weight and the fourth weight as the sub-weight of the current machine room.
Optionally, in this embodiment, taking the sub-weight from the computer room b to the computer room a as an example, a sum of the first weight, the second weight, the third weight, and the fourth weight from the computer room b to the computer room a may be used as the sub-weight from the computer room b to the computer room a. The first weight, the second weight, the third weight and the fourth weight from the machine room b to the machine room a may also be used as the sub-weights from the machine room b to the machine room a. The weighted summation result of the first weight, the second weight, the third weight and the fourth weight from the machine room b to the machine room a can also be used as the sub-weight from the machine room b to the machine room a. The first weight, the second weight, the third weight and the fourth weight from the machine room b to the machine room a can also be summed according to a certain proportion to be used as the sub-weights from the machine room b to the machine room a. And obtaining the sub-weight from each machine room to the corresponding sub-machine room according to the rule.
As an optional example, the apparatus further includes:
the fourth processing module is used for taking a father machine room of the first machine room in the target path as a fourth machine room when the target machine room is controlled to download the target data from the first machine room and the target data is not included in the first machine room, and executing the following operation on the fourth machine room;
taking the fourth computer room as a new first computer room under the condition that the target data is included in the fourth computer room;
and under the condition that the target data is not included in the fourth machine room, taking a parent machine room of the fourth machine room in the target path as a new fourth machine room.
Optionally, in this embodiment, when there is no target data in the parent machine room b of the machine room a in the path 1, the parent machine room c of the machine room b in the path 1 searches for the target data, and when there is the target data in the machine room c, the machine room c sends the target data to the machine room b, the machine room b sends the target data to the machine room a, and finally the machine room a sends the target data to the client. Under the condition that no target data exists in the machine room c, the target data are searched in a parent machine room source machine room of the machine room c in the path 1, all data are stored in the source machine room, the target data are stored in all the source machine rooms, the source machine room sends the target data to the machine room c, the machine room c sends the target data to the machine room b, the machine room b sends the target data to the machine room a, and finally the machine room a sends the target data to the client. According to the above rule, the target data can be found in the shortest path quickly.
For other examples of this embodiment, please refer to the above examples, which are not described herein.
Fig. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 4, including a processor 402, a communication interface 404, a memory 406, and a communication bus 408, where the processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408, where,
a memory 406 for storing a computer program;
the processor 402, when executing the computer program stored in the memory 406, performs the following steps:
determining the target weight of each path in all paths from the target machine room to the source machine room in the target machine room group under the condition that a downloading request of a client for downloading target data from the target machine room is received and the target data does not exist in the target machine room;
determining the path with the minimum target weight as a target path;
and controlling the target machine room to download the target data from the first machine room and sending the target data to the client, wherein the first machine room is a father machine room of the target machine room in the target path.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus. The communication interface is used for communication between the electronic equipment and other equipment.
The memory may include RAM, and may also include non-volatile memory, such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
As an example, the memory 406 may include, but is not limited to, the first determining module 302, the second determining module 304, and the first controlling module 306 of the apparatus for distributed back to source data. In addition, the device may further include, but is not limited to, other module units in the above-mentioned distributed source data returning device, which is not described in detail in this example.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 4 is only an illustration, and the device implementing the method for distributed data back source may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 4 does not limit the structure of the electronic apparatus. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
According to a further aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium in which a computer program is stored, wherein the computer program, when executed by a processor, performs the steps in the above method of distributed source data return.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the various methods in the foregoing embodiments may be implemented by a program instructing hardware related to the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and amendments can be made without departing from the principle of the present invention, and these modifications and amendments should also be considered as the protection scope of the present invention.

Claims (10)

1. A method of distributing back source data, comprising:
under the condition that a downloading request of a client for downloading target data from a target machine room is received and the target data does not exist in the target machine room, determining the target weight of each path in all paths from the target machine room to a source machine room in a target machine room group;
determining the path with the minimum target weight as a target path;
and controlling the target machine room to download the target data from a first machine room, and sending the target data to the client, wherein the first machine room is a parent machine room of the target machine room in the target path.
2. The method of claim 1, wherein before, or simultaneously with, or after receiving the download request, the method further comprises:
under the condition that a second machine room is detected to be added into the target machine room group, controlling the second machine room to send resource information of the second machine room to a neighbor machine room of the second machine room;
determining each machine room of the target machine room group as a current machine room, and executing the following operations on the current machine room:
detecting whether the current machine room receives the resource information once every other time period;
and under the condition that the current machine room is detected to receive the resource information, controlling the current machine room to store the resource information and sending the resource information to a neighbor machine room of the current machine room.
3. The method of claim 1, wherein before, or simultaneously with, or after receiving the download request, the method further comprises:
controlling each machine room of the target machine room group to send own resource information to a corresponding neighbor machine room at intervals of a time period;
and deleting the third machine room from the target machine room group under the condition that each machine room of the target machine room group is detected not to receive the resource information of the third machine room sent by the third machine room of the target machine room group.
4. The method of claim 1, wherein in the case that a download request of a client requesting to download target data from a target machine room is received and the target data does not exist in the target machine room, determining a target weight of each path in a target machine room group from all paths from the target machine room to a source machine room comprises:
determining each path from the target machine room to the source machine room as a current path, and executing the following operations on the current path:
calculating the sub-weight from each machine room except the target machine room in the current path to the corresponding sub-machine room;
determining a sum of all sub-weights as the target weight of the current path; or alternatively
Determining an average of all sub-weights as the target weight of the current path; or alternatively
Determining a weighted summation result of all sub-weights as the target weight of the current path.
5. The method of claim 4, wherein the calculating the sub-weight of each room in the current path, except the target room, to the corresponding sub-room comprises:
determining each machine room except the target machine room in the current path as a current machine room, and executing the following operations on the current machine room:
determining a first weight in a weight table according to the available bandwidth from the current machine room to the sub-machine room of the current machine room;
determining a second weight in the weight table according to the load of the current machine room;
determining a third weight in the weight table according to the number of machines connected with the current machine room;
determining a fourth weight in the weight table according to the distance from the current machine room to the source machine room;
and calculating the sub-weight of the current machine room according to the first weight, the second weight, the third weight and the fourth weight.
6. The method of claim 5, wherein the calculating the sub-weight of the current room according to the first weight, the second weight, the third weight, and the fourth weight comprises:
determining the sum of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room; or
Determining an average value of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room; or alternatively
Determining a weighted summation result of the first weight, the second weight, the third weight and the fourth weight as a sub-weight of the current machine room.
7. The method of claim 1, wherein when controlling the target room to download the target data from a first room, the method further comprises:
when the target data is not included in the first machine room, taking a parent machine room of the first machine room in the target path as a fourth machine room, and executing the following operations on the fourth machine room:
taking the fourth machine room as a new first machine room under the condition that the target data is included in the fourth machine room;
and taking a parent machine room of the fourth machine room in the target path as a new fourth machine room when the target data is not included in the fourth machine room.
8. An apparatus for distributed data retrieval, comprising:
the first determining module is used for determining the target weight of each path in all paths from the target machine room to the source machine room in the target machine room group under the condition that a downloading request of a client for downloading target data from the target machine room is received and the target data does not exist in the target machine room;
a second determining module, configured to determine the path with the smallest target weight as a target path;
and the first control module is used for controlling the target machine room to download the target data from the first machine room and sending the target data to the client, wherein the first machine room is a father machine room of the target machine room in the target path.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202211282670.8A 2022-10-19 Method and device for distributing back source data, storage medium and electronic equipment Active CN115766882B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211282670.8A CN115766882B (en) 2022-10-19 Method and device for distributing back source data, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211282670.8A CN115766882B (en) 2022-10-19 Method and device for distributing back source data, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN115766882A true CN115766882A (en) 2023-03-07
CN115766882B CN115766882B (en) 2024-10-15

Family

ID=

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102155942A (en) * 2011-02-26 2011-08-17 山东大学 Global path planning method based on fuzzy topological map under large-scale environment
WO2014084940A1 (en) * 2012-11-30 2014-06-05 International Business Machines Corporation Parallel top-k simple shortest paths discovery
CN107483346A (en) * 2017-08-09 2017-12-15 广州市百果园信息技术有限公司 Message delivery method, device and corresponding messaging system in autonomous system
WO2019011338A1 (en) * 2017-07-13 2019-01-17 华为技术有限公司 Method for determining shortest path and controller
CN109275159A (en) * 2018-10-10 2019-01-25 北京新联铁集团股份有限公司 The mobile switch method and device of industrial wireless sensor network
CN109951738A (en) * 2017-12-21 2019-06-28 腾讯数码(天津)有限公司 Transmission path acquisition methods, the first electronic equipment and readable storage medium storing program for executing
CN111385298A (en) * 2020-03-05 2020-07-07 网易有道信息技术(北京)有限公司江苏分公司 Data transmission method, medium, device and computing equipment
CN111795488A (en) * 2020-07-10 2020-10-20 哈尔滨工程大学 Intelligent temperature regulation and control system and method for distributed machine room
CN112020103A (en) * 2020-08-06 2020-12-01 暨南大学 Content cache deployment method in mobile edge cloud
CN113824641A (en) * 2021-10-13 2021-12-21 武汉理工大学 Internet of vehicles routing method, system, equipment and storage medium
CN114501073A (en) * 2022-02-16 2022-05-13 上海哔哩哔哩科技有限公司 Live broadcast source returning method and device
CN114650234A (en) * 2022-03-14 2022-06-21 中天宽带技术有限公司 Data processing method and device and server

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102155942A (en) * 2011-02-26 2011-08-17 山东大学 Global path planning method based on fuzzy topological map under large-scale environment
WO2014084940A1 (en) * 2012-11-30 2014-06-05 International Business Machines Corporation Parallel top-k simple shortest paths discovery
WO2019011338A1 (en) * 2017-07-13 2019-01-17 华为技术有限公司 Method for determining shortest path and controller
CN107483346A (en) * 2017-08-09 2017-12-15 广州市百果园信息技术有限公司 Message delivery method, device and corresponding messaging system in autonomous system
CN109951738A (en) * 2017-12-21 2019-06-28 腾讯数码(天津)有限公司 Transmission path acquisition methods, the first electronic equipment and readable storage medium storing program for executing
CN109275159A (en) * 2018-10-10 2019-01-25 北京新联铁集团股份有限公司 The mobile switch method and device of industrial wireless sensor network
CN111385298A (en) * 2020-03-05 2020-07-07 网易有道信息技术(北京)有限公司江苏分公司 Data transmission method, medium, device and computing equipment
CN111795488A (en) * 2020-07-10 2020-10-20 哈尔滨工程大学 Intelligent temperature regulation and control system and method for distributed machine room
CN112020103A (en) * 2020-08-06 2020-12-01 暨南大学 Content cache deployment method in mobile edge cloud
CN113824641A (en) * 2021-10-13 2021-12-21 武汉理工大学 Internet of vehicles routing method, system, equipment and storage medium
CN114501073A (en) * 2022-02-16 2022-05-13 上海哔哩哔哩科技有限公司 Live broadcast source returning method and device
CN114650234A (en) * 2022-03-14 2022-06-21 中天宽带技术有限公司 Data processing method and device and server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MINGXIU LIN;: "Path planning of mobile robot based on improved A* algorithm", 2017 29TH CHINESE CONTROL AND DECISION CONFERENCE (CCDC), 17 July 2017 (2017-07-17) *
白鹤;汤迪斌;王劲林;: "分布式多主题网络爬虫系统的研究与实现", 计算机工程, no. 19, 5 October 2009 (2009-10-05) *

Similar Documents

Publication Publication Date Title
EP3439239B1 (en) Data transmission method and system based on peer-to-peer network
CN104301741B (en) A kind of data broadcast system and method
CN110519183B (en) Node speed limiting method and device, electronic equipment and storage medium
CN103607424B (en) Server connection method and server system
US20140188801A1 (en) Method and system for intelligent load balancing
CN104052803A (en) Decentralized distributed rendering method and system
CN110213203B (en) Network scheduling method and device and computer storage medium
CN108156257B (en) Information pushing method and device
CN103685511B (en) Data distributing method, device and system
WO2015167427A2 (en) Data distribution based on network information
CN102420863B (en) Rapid file distribution system, method thereof and apparatus thereof
CN1937554A (en) Method for making P2P file download flow localized
CN108540505B (en) Content updating method and device
US20160381127A1 (en) Systems and methods for dynamic networked peer-to-peer content distribution
CN113676514B (en) File source returning method and device
CN110166800A (en) Video returns source method, system, device and computer readable storage medium
CN113055461A (en) ZooKeeper-based unmanned cluster distributed cooperative command control method
WO2017215415A1 (en) Resource control method and apparatus, and iptv server
CN115706741A (en) Method and device for returning slice file
EP3998754A1 (en) Data distribution method, electronic device, and storage medium
CN106790689B (en) Node recommendation method, server and client based on peer-to-peer network
CN115766882B (en) Method and device for distributing back source data, storage medium and electronic equipment
CN115766882A (en) Distributed source data returning method and device, storage medium and electronic equipment
CN111464624A (en) Content refreshing method and device for CDN (content delivery network) and electronic equipment
CN103414639A (en) Routing request method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant