Disclosure of Invention
An object of the embodiments of the present invention is to provide a data acquisition method, a data acquisition apparatus, a server, and a storage medium, so as to improve the ordering stability of each upper node. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a data acquisition method, including:
determining a first data transmission index of each upper node of a current detection period;
for each upper node in each upper node, preprocessing and stabilizing the first data transmission index of the upper node to obtain a second data transmission index of the upper node;
sorting each upper node based on the size of the second data transmission index of each upper node;
and sending a data acquisition request to the upper node with the first bit sequence in the sequenced upper nodes so as to enable the upper node with the first bit sequence to return request data corresponding to the data acquisition request.
Optionally, the preprocessing and the stability processing on the first data transmission indicator of the upper node to obtain a second data transmission indicator of the upper node include:
normalizing the first data transmission index of the upper node to obtain a third data transmission index of the upper node in the current detection period;
accumulating all the third data transmission indexes of the upper node within a preset time length to obtain a fourth data transmission index of the upper node; the preset time length comprises a current detection period and a plurality of historical detection periods;
and performing stability processing on the fourth data transmission index of the upper node to obtain a second data transmission index of the upper node.
Optionally, the step of performing normalization processing on the first data transmission indicator of the upper node to obtain a third data transmission indicator of the upper node in the current probing period includes:
based on a first preset expression, carrying out normalization processing on the first data transmission index of the upper node;
wherein the first preset expression is as follows:
in the formula (I), the compound is shown in the specification,
a third data transmission index indicating an ith upper node among the respective upper nodes; t is t
iA first data transmission indicator representing the ith upper node; t is t
minA first data transmission index indicating that the first data transmission index is minimum in all upper nodes; i is an integer greater than 0.
Optionally, the step of performing accumulation processing on all the third data transmission indexes of the upper node within a preset time length to obtain a fourth data transmission index of the upper node includes:
accumulating all the third data transmission indexes of the upper node within a preset time length through a second preset expression;
wherein the second preset expression is:
in the formula (I), the compound is shown in the specification,
a fourth data transmission index indicating an ith upper node among the respective upper nodes; period represents a preset time length; j represents the number of detection periods contained in the preset time length; alpha represents a first preset parameter;
a third data transmission index representing the ith upper node; i is an integer greater than 0.
Optionally, the step of performing stability processing on the fourth data transmission indicator of the upper node to obtain a second data transmission indicator of the upper node includes:
performing stability processing on the fourth data transmission index of the upper node through a third preset expression;
wherein the third preset expression is:
in the formula (I), the compound is shown in the specification,
a second data transmission index representing an ith upper node among the respective upper nodes; x represents a preset base number;
a fourth data transmission index representing the ith upper node; i is an integer greater than 0.
Optionally, after performing the stability processing on the fourth data transmission indicator of the upper node to obtain the second data transmission indicator of the upper node, the method includes:
judging whether the upper node is in a first order in the sequence of each upper node in the previous detection period of the current detection period;
under the condition that the upper node is not located in the first order, performing weighting processing on the second data transmission index obtained by the upper node in the current detection period to obtain a weighted second data transmission index;
and under the condition that the upper node is positioned in the first order, keeping the second data transmission index obtained by the upper node in the current detection period.
Optionally, the step of sorting each upper node based on the size of the second data transmission indicator of each upper node includes:
determining the size relationship of the designated data transmission indexes in each upper node; the designated data transmission indexes in the upper node are as follows: the weighted processed second data transmission indicator or the retained second data transmission indicator;
and sequencing the nodes of the upper layer according to the determined size relationship.
Optionally, the step of performing weighting processing on the second data transmission indicator obtained by the upper node in the current probing period to obtain a weighted second data transmission indicator includes:
weighting the second data transmission indexes of the upper nodes which are not positioned in the first bit sequence in the sequence of each upper node in the previous detection period of the current detection period through a fourth preset expression;
the fourth preset expression is as follows:
wherein m represents a weighting coefficient; countiRepresenting the number of times that the ith upper node in each upper node is located in the first bit sequence within the preset time length; count*Representing the total times of the upper nodes positioned in the first bit sequence in the previous detection period of the current detection period, wherein the upper nodes are sequenced into the first bit sequence within the preset time length; beta represents a second preset parameter; gamma represents a third preset parameter; i is an integer greater than 0.
In a second aspect, an embodiment of the present invention provides a data acquisition apparatus, including:
the determining module is used for determining a first data transmission index of each upper node of the current detection period;
the processing module is used for preprocessing and stabilizing the first data transmission index of each upper node aiming at each upper node in each upper node to obtain a second data transmission index of each upper node;
a sorting module, configured to sort each upper node based on a size of the second data transmission indicator of each upper node;
and the sending module is used for sending a data acquisition request to the upper node with the first bit sequence in the sequenced upper nodes so as to enable the upper node with the first bit sequence to return request data corresponding to the data acquisition request.
Optionally, the processing module includes:
the normalization processing submodule is used for performing normalization processing on the first data transmission index of the upper node to obtain a third data transmission index of the upper node in the current detection period;
the accumulation processing submodule is used for carrying out accumulation processing on all the third data transmission indexes of the upper node within a preset time length to obtain a fourth data transmission index of the upper node; the preset time length comprises a current detection period and a plurality of historical detection periods;
and the stability processing submodule is used for performing stability processing on the fourth data transmission index of the upper node to obtain a second data transmission index of the upper node.
Optionally, the normalization processing sub-module is configured to:
based on a first preset expression, carrying out normalization processing on the first data transmission index of the upper node;
wherein the first preset expression is as follows:
in the formula (I), the compound is shown in the specification,
a third data transmission index indicating an ith upper node among the respective upper nodes; t is t
iA first data transmission indicator representing the ith upper node; t is t
minA first data transmission index indicating that the first data transmission index is minimum in all upper nodes; i is an integer greater than 0.
Optionally, the accumulation processing sub-module is configured to:
accumulating all the third data transmission indexes of the upper node within a preset time length through a second preset expression;
wherein the second preset expression is:
in the formula (I), the compound is shown in the specification,
a fourth data transmission index indicating an ith upper node among the respective upper nodes; period represents a preset time length; j represents the number of detection periods contained in the preset time length; alpha represents a first preset parameter;
a third data transmission index representing the ith upper node; i is an integer greater than 0.
Optionally, the stability processing sub-module is specifically configured to:
performing stability processing on the fourth data transmission index of the upper node through a third preset expression;
the third preset expression is as follows:
in the formula (I), the compound is shown in the specification,
a second data transmission index representing an ith upper node among the respective upper nodes; x represents a preset base number;
a fourth data transmission index representing the ith upper node; i is an integer greater than 0.
Optionally, the apparatus further comprises:
the judging module is used for judging whether the upper node is positioned in a first order in the sequence of each upper node in the previous detection period of the current detection period;
the weighting processing module is used for weighting the second data transmission index obtained by the upper node in the current detection period under the condition that the upper node is not located in the first order to obtain a weighted second data transmission index;
and a reserving module, configured to reserve the second data transmission indicator obtained by the upper node in the current probing period when the upper node is located in the first order.
Optionally, the sorting module includes:
the determining submodule is used for determining the size relationship of the specified data transmission indexes in each upper-layer node; the designated data transmission indexes in the upper node are as follows: the weighted processed second data transmission indicator or the retained second data transmission indicator;
and the sequencing submodule is used for sequencing each upper-layer node according to the determined size relationship.
Optionally, the weighting processing module is configured to:
weighting the second data transmission indexes of the upper nodes which are not positioned in the first bit sequence in the sequence of each upper node in the previous detection period of the current detection period through a fourth preset expression;
wherein the fourth preset expression is:
wherein m represents a weighting coefficient; countiRepresenting the number of times that the ith upper node in each upper node is located in the first bit sequence within the preset time length; count*Representing the total times of the upper nodes positioned in the first bit sequence in the previous detection period of the current detection period, wherein the upper nodes are sequenced into the first bit sequence within the preset time length; beta represents a second preset parameter; gamma represents a third preset parameter; i is an integer greater than 0.
In a third aspect, an embodiment of the present invention provides a server, which includes a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to implement the method steps of the data acquisition method provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps of the data acquisition method provided in the first aspect are implemented.
In a fifth aspect, an embodiment of the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to perform the method steps of the data acquisition method provided in the first aspect.
In a sixth aspect, an embodiment of the present invention further provides a computer program, which when run on a computer, causes the computer to perform the method steps of the data acquisition method provided in the first aspect.
In the data acquisition method, the data acquisition device, the server and the storage medium provided by the embodiment of the invention, after the first data transmission index of each upper node in the current detection period is determined, the second data transmission index is obtained by preprocessing and stabilizing the first data transmission index, and because the second data transmission index is less prone to fluctuation compared with the first data transmission index, the bit sequence of each upper node is more stable after each upper node is sequenced, so that the possibility that the edge node acquires required data from the same upper node is increased, the situation that the upper node further requests the required data from the upper node and then transmits the required data back to the edge node layer by layer due to the fact that the required data is not stored in the switched upper node after the upper node is switched is avoided, so that the data acquisition process is reduced, the data acquisition time is reduced, and the data acquisition cost is reduced. Of course, it is not necessary for any product or method of practicing the invention to achieve all of the above-described advantages at the same time.
Detailed Description
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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the CDN in the related art, a plurality of available upper layer node IPs are usually configured for an edge node, that is, the edge node may select one of the plurality of upper layer nodes that has the best data transmission index, and obtain data from the selected upper layer node. When determining the transmission quality of each upper node, the edge node may periodically send a probe request to each upper node through its own probe program, and each upper node returns a preset file after receiving the probe request, where the size of the preset file is usually tens of KB (kilobytes) to MB (megabytes). And the upper nodes determine the data transmission indexes of the upper nodes based on the information such as the downloading speed, the downloading time and the like of the preset file returned by the upper nodes, sort the upper nodes and acquire data from the upper node with the first bit sequence. In the next probing period, the transmission quality of each upper node changes, so the bit sequence of each upper node after reordering changes.
That is to say, in the related art, when the upper nodes are sequenced in each probing cycle, the bit sequences of the upper nodes fluctuate frequently, and there may be a situation that the upper nodes with the first bit sequence after each sequencing are different, so that the upper nodes selected by the edge node each time are different, which will cause that once the upper nodes selected by the edge node do not store the required data, the upper nodes need to further request the required data from the upper nodes, and then return to the edge node one by one, which increases the data acquisition flow, and prolongs the data acquisition time.
For example, in a previous detection period of the current detection period, the upper node a is located in the first order, the upper node B is located in the second order, data required by the edge node is stored in the upper node a, and data required by the edge node is not stored in the upper node B, so that the edge node can directly obtain the required data from the upper node a located in the first order; in the current detection period, due to the fluctuation of the bit sequence, the upper node B is arranged to the first bit sequence, and the upper node a is arranged to the second bit sequence, when the edge node acquires data from the upper node B located in the first bit sequence, since the upper node B does not store the data required by the edge node, the upper node B needs to further request the required data from the upper node B (i.e., download the cold file), and then return the required data layer by layer.
In addition, in the CDN in the related art, upper nodes with large differences in data transmission indexes can be distinguished, but upper nodes with small differences in data transmission indexes are difficult to distinguish, and upper nodes with similar data transmission indexes need to be manually separated by a manual method, which increases the operation cost of the CND provider.
Method example 1
Referring to this, as shown in fig. 2, an embodiment of the present invention provides a data obtaining method, which may be applied to an edge node in a CDN network, and of course, may also be applied to other types of devices having a server function, where the method may include the following steps:
s101, determining first data transmission indexes of all upper nodes in the current detection period.
In the embodiment of the present invention, an edge node is taken as an example for description. The edge node can be configured with a plurality of available upper layer node IPs, and when a user needs to acquire data, if the edge node does not have the cached required data, the edge node can acquire the required data to the upper layer node. The edge node may refer to a cache server located near a user, and is usually deployed at a network edge of the entire CDN, and is used to obtain data from an upper node and cache the data; the upper node may refer to an origin server, that is, a server storing origin data, and is typically deployed in a data center of the entire CDN hierarchically to store data.
The edge node may detect the original data transmission indicator of each upper node, for example, periodically send a detection request to each upper node through a self-installed detection program, and each upper node returns a preset file after receiving the detection request, where the size of the preset file is usually several KB to several tens of KB, and the preset file is used for analyzing the transmission speed of the link. The upper node determines an original data transmission index of each upper node, namely the first data transmission index in the embodiment of the invention, based on the information such as the download speed and the download time of the preset file returned by each upper node.
The above-described detection period may be, for example, 10 seconds, 1 minute, 3 minutes, or the like. Taking 1 minute as an example, the edge node may send a probe request to each upper node every 1 minute, thereby determining the first data transmission index of each upper node every one minute. Of course, a server administrator may flexibly set the detection period according to actual service needs, and the embodiment of the present invention is not described herein again. The current probing period may be one of the probing periods currently referred to in the plurality of probing periods.
Wherein the first data transmission index may include: the transmission time of the data. It is easy to understand that if the transmission time of data is small, the edge node can take less time to acquire the required data, and therefore the data transmission index is high, which plays a positive role in improving the user experience. Of course, other indicators than the transmission time of the data, which change with the change of the transmission time of the data, may be used to evaluate the first data transmission indicator, for example, the transmission speed of the data. This is because, as the transmission time of data is shortened, the transmission speed of data is increased. Of course, other than the implementations shown in the examples given, ways of implementing this feature are within the scope of the embodiments of the invention.
S102, aiming at each upper layer node in each upper layer node, preprocessing and stabilizing the first data transmission index of the upper layer node to obtain a second data transmission index of the upper layer node.
In the embodiment of the invention, after the original data transmission indexes of each upper node, namely the first data transmission indexes of each upper node, are obtained, the first data transmission indexes can be preprocessed and subjected to stability processing, so that the new data transmission indexes obtained after processing, namely the second data transmission indexes, have smaller volatility, namely have higher stability. Illustratively, the preprocessing may include two parts of normalization processing and accumulation processing of the data.
S103, sorting the upper nodes based on the size of the second data transmission index of each upper node.
In the steps of the embodiment of the present invention, after the second data transmission indexes of the upper nodes are obtained, the sizes of the second data transmission indexes of the upper nodes are different, so that the upper nodes can be sorted according to the order of the sizes of the second data transmission indexes.
For example, if the obtained second data transmission index of the upper node a is a, the obtained second data transmission index of the upper node B is B, the obtained second data transmission index of the upper node C is C, and a > B > C, the above three upper nodes may be sorted as follows: upper node a-upper node B-upper node C, where upper node a is in a first order, upper node B is in a second order, and upper node C is in a third order.
And S104, sending a data acquisition request to the upper node with the first bit sequence in the sequenced upper nodes so as to enable the upper node with the first bit sequence to return request data corresponding to the data acquisition request.
After the upper nodes are sequenced, the edge node can determine the upper node with the first bit sequence, and further can send a data acquisition request to the upper node. After receiving the data acquisition request, the upper node with the first bit order may return request data corresponding to the data acquisition request to the edge node. The overall analysis shows that the stability of the second data transmission index is higher than that of the first data transmission index, so that after the upper nodes are sequenced at each time, the bit sequences of the upper nodes are more stable, the upper nodes of the first bit sequences are more difficult to change, the probability that the edge nodes acquire required data from the same upper node is increased, and the occurrence of cold file downloading is reduced.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 3, the step S102 specifically includes:
and S1021, performing normalization processing on the first data transmission index of the upper node to obtain a third data transmission index of the upper node in the current detection period.
After the edge node determines the first data transmission index of each upper node, normalization processing may be performed on the determined first data transmission index, that is, a dimensional expression is converted into a dimensionless expression after being transformed, so as to simplify processing, and the normalization processing may be a part of the preprocessing.
Illustratively, when the first data transmission index is a transmission time of data, it is a dimensional value, and the dimensional first data transmission index can be converted into a dimensionless third data transmission index by a normalization process.
Specifically, the first data transmission index of each upper node may be divided by a value having the same dimension, so as to eliminate the dimension and obtain a dimensionless value. Of course, for other examples of the first data transmission index in the embodiments, the above method for eliminating the dimension may be adopted to obtain the third data transmission index of each upper node.
As an optional implementation manner of the embodiment of the present invention, normalization processing may be performed on a first data transmission index of an upper node based on a first preset expression;
wherein the first preset expression is as follows:
in the formula (I), the compound is shown in the specification,
a third data transmission index indicating an ith upper node among the respective upper nodes; t is t
iA first data transmission index representing an ith upper node; t is t
minIndicating a first data transmission index at which the first data transmission index is smallest among all upper nodes.
S1022, performing accumulation processing on all third data transmission indexes of the upper node within the preset time duration to obtain a fourth data transmission index of the upper node; the preset time length comprises a current detection period and a plurality of historical detection periods.
As can be seen from the foregoing, the edge node may periodically probe each upper node, that is, after each probing, the first data transmission indicator corresponding to each upper node may be determined, so as to obtain a third data transmission indicator. Then, within a preset time length, a plurality of third data transmission indexes of each upper node can be obtained.
Therefore, all the third data transmission indexes of the upper nodes within the preset time length can be accumulated to obtain the fourth data transmission indexes of the upper nodes, and the accumulation process can be a part of the preprocessing.
For example, the detection period is 1 minute, the preset time length is 90 minutes, and for the upper node a, 90 third data transmission indexes can be obtained, and through accumulation processing on the 90 third data transmission indexes, in the accumulation processing process, each third data transmission index can be used as an index of a preset parameter, so as to obtain a fourth data transmission index.
As can be seen from the above example, the preset time length may include one current detection period and a plurality of historical detection periods, for example, within 90 minutes of the preset time length, there are 1 current detection period and 89 historical detection periods. Of course, the server administrator may flexibly set the preset time length according to the actual service requirement, for example, the preset time length may also be set to 60 minutes or 120 minutes, which is not described herein again in the embodiments of the present invention.
Through accumulation processing of the third data transmission indexes, the calculated fourth data transmission indexes are linked with all the third data transmission indexes in the preset time length, and therefore the fourth data transmission indexes have smaller fluctuation trend compared with the first data transmission indexes.
As an optional implementation manner of the embodiment of the present invention, all third data transmission indexes of each upper node within a preset time length may be accumulated through a second preset expression;
wherein the second preset expression is:
in the formula (I), the compound is shown in the specification,
a fourth data transmission index indicating an ith upper node among the respective upper nodes; period represents a preset time length, for example, 90 min; j represents the number of detection cycles included in the preset time length, for example, 90; α represents a first preset parameter, e.g. 1.7, the parameter being adjustable;
a third data transmission index representing an ith upper node; i is an integer greater than 0.
And S1023, performing stability processing on the fourth data transmission index of the upper node to obtain a second data transmission index of the upper node.
In the embodiment of the present invention, after the fourth data transmission indexes of each upper node are obtained, the stability processing may be continuously performed on the fourth data transmission indexes of each upper node, so as to further reduce the fluctuation range of the numerical value. In the stability processing process, the fourth data transmission index may be used as a true number of the preset logarithm function, so as to obtain a second data transmission index.
After the stability processing, the size range of the second data transmission index is smaller than that of the fourth data transmission index, so that compared with the fourth data transmission index, the second data transmission index has smaller volatility, that is, the second data transmission index has higher stability.
As an optional implementation manner of the embodiment of the present invention, stability processing may be performed on the fourth data transmission index of each upper node through a third preset expression;
wherein the third preset expression is:
in the formula (I), the compound is shown in the specification,
a second data transmission index representing an ith upper node among the respective upper nodes; x represents a preset base number which can be 2, a natural constant e or 10;
a fourth data transmission index representing an ith upper node; i is an integer greater than 0.
In the data acquisition method provided by the embodiment of the invention, after the first data transmission indexes of all upper nodes in the current detection period are determined, the second data transmission index is obtained by preprocessing and stabilizing the first data transmission index, since the second data transmission indicator is less prone to fluctuations than the first data transmission indicator, and, therefore, after each upper node is sequenced, the bit sequence of each upper node is more stable, thereby increasing the possibility that the edge node acquires the required data from the same upper node and avoiding the phenomenon that after the upper node is switched, because the switched upper node does not store the required data, the upper node needs to further request the required data from the upper node, and then the data are transmitted back to the edge nodes layer by layer, so that the data acquisition process is reduced, the data acquisition time is shortened, and the data acquisition cost is reduced.
Method example 2
As shown in fig. 4, an embodiment of the present invention further provides a data obtaining method, which may be applied to an edge node in a CDN network, and certainly may also be applied to other types of devices having a server function, where the method may include the following steps:
s201, determining first data transmission indexes of each upper-layer node of the current detection period.
In the embodiment of the present invention, an edge node is taken as an example for description. The edge node can be configured with a plurality of available upper layer node IPs, and when a user needs to acquire data, if the edge node does not have the cached required data, the edge node can acquire the required data to the upper layer node. The edge node may refer to a cache server located near a user, and is usually deployed at a network edge of the entire CDN, and is used to obtain data from an upper node and cache the data; the upper node may refer to an origin server, that is, a server storing origin data, and is typically deployed in a data center of the entire CDN hierarchically to store data.
The edge node may detect the data transmission indicator of each upper node, for example, periodically send a probe request to each upper node through a probe program installed in the edge node, and each upper node returns a preset file after receiving the probe request, where the preset file has a size of usually tens of KB to several MB, for example, 2MB, and is used for analyzing the transmission speed of the link. The upper node determines a data transmission index of each upper node, namely the first data transmission index in the embodiment of the invention, based on the information such as the download speed and the download time of the preset file returned by each upper node.
The above-described detection period may be, for example, 10 seconds, 1 minute, 3 minutes, or the like. Taking 1 minute as an example, the edge node may send a probe request to each upper node every 1 minute, thereby determining the first data transmission index of each upper node every one minute. Of course, a server administrator may flexibly set the detection period according to actual service needs, and the embodiment of the present invention is not described herein again. The current probing period may be one of the probing periods currently referred to in the plurality of probing periods.
Wherein the first data transmission index may include: the transmission time of the data. It is easy to understand that if the transmission time of data is small, the edge node can take less time to acquire the required data, and therefore the data transmission index is high, which plays a positive role in improving the user experience. Of course, other indicators than the transmission time of the data, which change with the change of the transmission time of the data, may be used to evaluate the first data transmission indicator, for example, the transmission speed of the data. This is because, as the transmission time of data is shortened, the transmission speed of data is increased. Of course, other than the implementations shown in the examples given, ways of implementing this feature are within the scope of the embodiments of the invention.
S202, aiming at each upper layer node in each upper layer node, preprocessing and stabilizing the first data transmission index of the upper layer node to obtain a second data transmission index of the upper layer node.
In the embodiment of the invention, after the original data transmission indexes of each upper node, namely the first data transmission indexes of each upper node, are obtained, the first data transmission indexes can be preprocessed and subjected to stability processing, so that the new data transmission indexes obtained after processing, namely the second data transmission indexes, have smaller volatility, namely have higher stability. Illustratively, the preprocessing may include two parts of normalization processing and accumulation processing of the data.
S203, judging whether the upper node is in the first bit sequence in the sequence of each upper node in the previous detection period of the current detection period.
Before sequencing each upper node, the embodiment of the invention can firstly judge whether the upper node is in the first order in the sequencing of each upper node in the previous detection period of the current detection period, and can carry out different processing according to the judgment result.
And S204, under the condition that the upper node is not located in the first order, performing weighting processing on the second data transmission index obtained by the upper node in the current detection period to obtain the weighted second data transmission index.
For nodes not located in the first order in the previous probing cycle of the current probing cycle, the difference of the second data transmission indicator between the nodes not located in the first order and the nodes located in the first order in the previous probing cycle may be increased by weighting in the calculation of the current cycle. For example, the second data transmission indicator may be multiplied by a weighting factor greater than 1, which may be considered a penalty factor.
As an optional implementation manner of the embodiment of the present invention, a fourth preset expression may be used to perform weighting processing on second data transmission indexes of upper nodes that are not located in the first bit sequence in the sequence of each upper node in the previous detection period of the current detection period;
the fourth preset expression is:
wherein m represents a weighting coefficient; countiRepresenting the times of the ith upper node in each upper node in the first bit sequence within a preset time length; count*Representing the total times of sequencing upper nodes positioned in the first bit sequence into the first bit sequence in the previous detection period of the current detection period within a preset time length; beta represents a second preset parameter, for example, 1.4, the parameter is adjustable; gamma represents a third preset parameter, for example, 1.4, the parameter is adjustable, wherein as beta and gamma become larger, the sequencing stability is increased and the sensitivity is reduced; i is an integer greater than 0.
And S205, under the condition that the upper node is located in the first order, keeping a second data transmission index obtained by the upper node in the current detection period.
For an upper node located in the first bit sequence in a previous probing period of the current probing period, the second data transmission indicator obtained by the upper node in the current probing period may be retained. Through the above operation, if an upper node is located in the first order in the previous probing period of the current probing period, the probability that the upper node is located in the first order in the current probing period is higher than the probability of other upper nodes, that is, the stability of the upper node originally located in the first order in the subsequent probing period is further improved.
S206, based on the size of the second data transmission index of each upper node, sequencing each upper node.
In the steps of the embodiment of the present invention, after the second data transmission indexes of the upper nodes are obtained, the sizes of the second data transmission indexes of the upper nodes are different, so that the upper nodes can be sorted according to the order of the sizes of the second data transmission indexes.
Illustratively, if the obtained second data transmission index of the upper node a is a, the obtained second data transmission index of the upper node B is B, the obtained second data transmission index of the upper node C is C, and C > B > a, when the smaller the value is, the better the detection quality is, the above three upper nodes may be sorted: upper node a-upper node B-upper node C, where upper node a is in a first order, upper node B is in a second order, and upper node C is in a third order. Of course, when the values of a, b and c are larger, the detection quality is better, the sequencing principle is the same, and the description is omitted here.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 5, the step S206 may specifically include:
s2061, determining the size relation of the specified data transmission indexes in each upper node.
In the embodiment of the present invention, the designated data transmission index in the upper node may be: the weighted second data transmission indicator or the retained second data transmission indicator is obtained as a plurality of weighted second data transmission indicators and one retained second data transmission indicator, so that the magnitude relationship between them can be determined.
S2062, sequencing the upper nodes according to the determined size relationship.
Each second data transmission index can correspond to one upper node, so that the upper nodes can be sequenced according to the determined magnitude relation among the second data transmission indexes.
And S207, sending a data acquisition request to the upper node with the first bit sequence in the sequenced upper nodes, so that the upper node with the first bit sequence returns request data corresponding to the data acquisition request.
After the upper nodes are sequenced, the edge node can determine the upper node with the first bit sequence, and further can send a data acquisition request to the upper node. After receiving the data acquisition request, the upper node with the first bit order may return request data corresponding to the data acquisition request to the edge node. The overall analysis shows that the stability of the second data transmission index is higher than that of the first data transmission index, so that after the upper nodes are sequenced at each time, the bit sequence of each upper node is more stable, the upper nodes of the first bit sequence are more difficult to change, the probability that the edge nodes acquire required data from the same upper node is increased, and the occurrence of cold file downloading is reduced.
In the data acquisition method provided in the embodiment of the present invention, after determining whether an upper node is located in the sequence of each upper node in a previous detection period of a current detection period after a first order, if the upper node is not located in the first order, a second data transmission index obtained by the upper node in the current detection period is weighted, so as to increase a difference between the second data transmission index in the previous detection period between the upper node not located in the first order and the upper node located in the first order; and under the condition that the upper node is positioned in the first bit sequence, a second data transmission index obtained by the upper node in the current detection period is reserved, so that the stability of the upper node which is originally positioned in the first bit sequence in the subsequent detection period is further improved, and the possibility that the edge node acquires the required data from the same upper node is further increased.
Apparatus example 1
Corresponding to the above method embodiment, the embodiment of the present invention also provides a corresponding device embodiment.
As shown in fig. 6, an embodiment of the present invention provides a data acquisition apparatus, including:
a determining module 301, configured to determine a first data transmission indicator of each upper node of the current probing period.
The processing module 302 is configured to, for each upper node in each upper node, perform preprocessing and stability processing on the first data transmission indicator of the upper node to obtain a second data transmission indicator of the upper node.
The sorting module 303 is configured to sort each upper node based on the size of the second data transmission indicator of each upper node.
A sending module 304, configured to send a data obtaining request to an upper node with a first bit order in the sorted upper nodes, so that the upper node with the first bit order returns request data corresponding to the data obtaining request.
As shown in fig. 7, the processing module 302 includes:
the normalization processing submodule 3021 is configured to perform normalization processing on the first data transmission indicator of the upper node, so as to obtain a third data transmission indicator of the upper node in the current detection period.
The accumulation processing submodule 3022 is configured to perform accumulation processing on all third data transmission indexes of the upper node within a preset time length to obtain a fourth data transmission index of the upper node; the preset time length comprises a current detection period and a plurality of historical detection periods.
The stability processing submodule 3023 is configured to perform stability processing on the fourth data transmission indicator of the upper node to obtain a second data transmission indicator of the upper node.
The normalization processing submodule 3021 is configured to:
based on a first preset expression, carrying out normalization processing on a first data transmission index of an upper node;
wherein the first preset expression is as follows:
in the formula (I), the compound is shown in the specification,
a third data transmission index indicating an ith upper node among the respective upper nodes; t is t
iA first data transmission index representing an ith upper node; t is t
minA first data transmission index indicating that the first data transmission index is minimum in all upper nodes; i is an integer greater than 0.
The accumulation processing sub-module 3022 is specifically configured to:
accumulating all third data transmission indexes of the upper node within a preset time length through a second preset expression;
wherein the second preset expression is:
in the formula (I), the compound is shown in the specification,
a fourth data transmission index indicating an ith upper node among the respective upper nodes; period represents a preset time length; j represents the number of detection periods contained in the preset time length; alpha represents a first preset parameter;
a third data transmission index representing an ith upper node; i is an integer greater than 0.
The stability processing submodule 3023 is specifically configured to:
performing stability processing on a fourth data transmission index of the upper node through a third preset expression;
the third preset expression is:
in the formula (I), the compound is shown in the specification,
a second data transmission index representing an ith upper node among the respective upper nodes; x represents a preset base number;
a fourth data transmission index representing an ith upper node; i is an integer greater than 0.
In the data acquisition apparatus provided in the embodiment of the present invention, after determining the first data transmission indicator of each upper node in the current probing period, the second data transmission index is obtained by preprocessing and stabilizing the first data transmission index, since the second data transmission indicator is less prone to fluctuations than the first data transmission indicator, and, therefore, after each upper node is sequenced, the bit sequence of each upper node is more stable, thereby increasing the possibility that the edge node acquires the required data from the same upper node and avoiding the phenomenon that after the upper node is switched, because the switched upper node does not store the required data, the upper node needs to further request the required data from the upper node, and then the data are transmitted back to the edge nodes layer by layer, so that the data acquisition process is reduced, the data acquisition time is shortened, and the data acquisition cost is reduced.
Apparatus example 2
An embodiment of the present invention further provides a data obtaining apparatus, and on the basis of the structure of the embodiment shown in fig. 6, as shown in fig. 8, the data obtaining apparatus may further include:
a determining module 401, configured to determine whether an upper node is located in a first order in an order of each upper node in a previous detection period of a current detection period;
a weighting processing module 402, configured to perform weighting processing on a second data transmission indicator obtained by an upper node in a current probing period under the condition that the upper node is not located in the first order, to obtain a weighted second data transmission indicator;
a retaining module 403, configured to retain the second data transmission indicator obtained by the upper node in the current probing period when the upper node is located in the first order.
As shown in fig. 9, the sorting module 303 includes:
a determining submodule 3031, configured to determine a size relationship of specified data transmission indexes in each upper node; the designated data transmission indexes in the upper nodes are as follows: a weighted second data transmission indicator or a retained second data transmission indicator.
And the sorting submodule 3052 is configured to sort, according to the determined size relationship, each upper node.
The weighting processing module 402 is configured to:
weighting second data transmission indexes of upper nodes which are not positioned in the first bit sequence in the sequence of each upper node in the previous detection period of the current detection period through a fourth preset expression;
wherein the fourth preset expression is:
wherein m represents a weighting coefficient; countiRepresenting the times of the ith upper node in each upper node in the first bit sequence within a preset time length; count*Representing the total times of sequencing upper nodes positioned in the first bit sequence into the first bit sequence in the previous detection period of the current detection period within a preset time length; beta represents a second preset parameter; gamma represents a third preset parameter; i is an integer greater than 0.
In the data acquisition apparatus provided in the embodiment of the present invention, after determining whether an upper node is located in the sequence of each upper node in a previous detection period of a current detection period after a first order, if the upper node is not located in the first order, a second data transmission index obtained by the upper node in the current detection period is weighted, so that a difference between the second data transmission index and the second data transmission index between the upper node not located in the first order and the upper node located in the first order in the previous detection period can be increased; and under the condition that the upper node is positioned in the first bit sequence, a second data transmission index obtained by the upper node in the current detection period is reserved, so that the stability of the upper node which is originally positioned in the first bit sequence in the subsequent detection period is further improved, and the possibility that the edge node acquires the required data from the same upper node is further increased.
An embodiment of the present invention further provides a server, which may specifically be a server, as shown in fig. 10, where the device 500 includes a processor 501 and a machine-readable storage medium 502, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to implement the steps of any one of the foregoing data acquisition methods, and optionally, may implement the following steps:
determining a first data transmission index of each upper node of a current detection period;
for each upper node in each upper node, preprocessing and stabilizing the first data transmission index of the upper node to obtain a second data transmission index of the upper node;
sequencing the upper nodes based on the size of the second data transmission index of each upper node;
and sending a data acquisition request to the upper node with the first bit sequence in the sequenced upper nodes so as to enable the upper node with the first bit sequence to return request data corresponding to the data acquisition request.
The machine-readable storage medium may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
After the server provided by the embodiment of the invention determines the first data transmission indexes of each upper node of the current detection period, the second data transmission index is obtained by preprocessing and stabilizing the first data transmission index, since the second data transmission indicator is less prone to fluctuations than the first data transmission indicator, and, therefore, after each upper node is sequenced, the bit sequence of each upper node is more stable, thereby increasing the possibility that the edge node acquires the required data from the same upper node and avoiding the phenomenon that after the upper node is switched, because the switched upper node does not store the required data, the upper node needs to further request the required data from the upper node, and then the data are transmitted back to the edge nodes layer by layer, so that the data acquisition process is reduced, the data acquisition time is shortened, and the data acquisition cost is reduced.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program is configured to execute the steps of any one of the data acquisition methods, and optionally, the following steps may be executed:
determining a first data transmission index of each upper node of a current detection period;
for each upper node in each upper node, preprocessing and stabilizing the first data transmission index of the upper node to obtain a second data transmission index of the upper node;
sequencing the upper nodes based on the size of the second data transmission index of each upper node;
and sending a data acquisition request to the upper node with the first bit sequence in the sequenced upper nodes so as to enable the upper node with the first bit sequence to return request data corresponding to the data acquisition request.
In the computer-readable storage medium provided in an embodiment of the present invention, after determining the first data transmission indicator of each upper node in the current probe period, the second data transmission index is obtained by preprocessing and stabilizing the first data transmission index, since the second data transmission indicator is less prone to fluctuations than the first data transmission indicator, and, therefore, after each upper node is sequenced, the bit sequence of each upper node is more stable, thereby increasing the possibility that the edge node acquires the required data from the same upper node and avoiding the phenomenon that after the upper node is switched, because the switched upper node does not store the required data, the upper node needs to further request the required data from the upper node, and then the data are transmitted back to the edge nodes layer by layer, so that the data acquisition process is reduced, the data acquisition time is shortened, and the data acquisition cost is reduced.
Embodiments of the present invention further provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of any of the above data acquisition methods, and optionally, may perform the following steps:
determining a first data transmission index of each upper node of a current detection period;
for each upper node in each upper node, preprocessing and stabilizing the first data transmission index of the upper node to obtain a second data transmission index of the upper node;
sequencing the upper nodes based on the size of the second data transmission index of each upper node;
and sending a data acquisition request to the upper node with the first bit sequence in the sequenced upper nodes so as to enable the upper node with the first bit sequence to return request data corresponding to the data acquisition request.
The computer program product including instructions according to the embodiments of the present invention obtains a second data transmission index by preprocessing and stabilizing the first data transmission index after determining the first data transmission index of each upper node in the current probing period, and since the second data transmission index is less likely to fluctuate than the first data transmission index, the bit sequence of each upper node is more stable after each upper node is sequenced, thereby increasing the possibility that the edge node acquires the required data from the same upper node, and avoiding the occurrence of a situation that the upper node needs to further request the required data from the upper node and then transmits the data back to the edge node layer by layer due to the fact that the upper node is switched and the required data is not stored in the switched upper node, thereby reducing the data acquisition flow and the data acquisition time, and the data acquisition cost is reduced.
An embodiment of the present invention further provides a computer program, which when running on a computer, causes the computer to execute the steps of any one of the data acquisition methods described above, and optionally, may execute the following steps:
determining a first data transmission index of each upper node of a current detection period;
for each upper node in each upper node, preprocessing and stabilizing the first data transmission index of the upper node to obtain a second data transmission index of the upper node;
sequencing the upper nodes based on the size of the second data transmission index of each upper node;
and sending a data acquisition request to the upper node with the first bit sequence in the sequenced upper nodes so as to enable the upper node with the first bit sequence to return request data corresponding to the data acquisition request.
In the computer program including instructions according to the embodiment of the present invention, after determining the first data transmission indicator of each upper node in the current probe period, the second data transmission index is obtained by preprocessing and stabilizing the first data transmission index, since the second data transmission indicator is less prone to fluctuations than the first data transmission indicator, and, therefore, after each upper node is sequenced, the bit sequence of each upper node is more stable, thereby increasing the possibility that the edge node acquires the required data from the same upper node and avoiding the phenomenon that after the upper node is switched, because the switched upper node does not store the required data, the upper node needs to further request the required data from the upper node, and then the data are transmitted back to the edge nodes layer by layer, so that the data acquisition process is reduced, the data acquisition time is shortened, and the data acquisition cost is reduced.
For the device/server/storage medium embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to part of the description of the method embodiment.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.