CN115065636B - Data distribution method, device, electronic equipment and storage medium - Google Patents
Data distribution method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN115065636B CN115065636B CN202210473058.2A CN202210473058A CN115065636B CN 115065636 B CN115065636 B CN 115065636B CN 202210473058 A CN202210473058 A CN 202210473058A CN 115065636 B CN115065636 B CN 115065636B
- Authority
- CN
- China
- Prior art keywords
- terminal
- data
- target
- distribution tree
- node
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 230000004044 response Effects 0.000 claims abstract description 10
- 230000000875 corresponding effect Effects 0.000 claims description 169
- 230000003139 buffering effect Effects 0.000 claims description 34
- 238000010276 construction Methods 0.000 claims description 17
- 230000009191 jumping Effects 0.000 claims description 10
- 230000002596 correlated effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 17
- 238000004590 computer program Methods 0.000 description 9
- 230000005540 biological transmission Effects 0.000 description 5
- 239000002699 waste material Substances 0.000 description 4
- 230000006978 adaptation Effects 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/48—Routing tree calculation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The method comprises the steps of responding to a data distribution request of a first terminal, determining a target terminal identification in a father node corresponding to the first terminal based on a target distribution tree, wherein the target distribution tree is constructed based on data caching ranges of a plurality of preset terminals, and takes the terminal identifications of the plurality of preset terminals as nodes; the plurality of preset terminals comprise first terminals; and sending the target terminal identification to the first terminal, wherein the target terminal identification is used for indicating the first terminal to obtain target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identification. By utilizing the embodiment of the disclosure, the target terminal capable of distributing data to the first terminal can be rapidly positioned, so that the timeliness and the data distribution efficiency of data distribution scheduling can be greatly improved while the bandwidth pressure of server data distribution is effectively buffered, and the response speed of corresponding services can be further improved.
Description
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to a data distribution method, a data distribution device, electronic equipment and a storage medium.
Background
With the rapid development of internet technology, the demand for various business services based on the internet is increasing, and the large-scale business data distribution based on the internet is a serious challenge for business services.
In the related art, data distribution is often performed based on a client/server structure, that is, related service data is distributed to a client through a server; however, with the increase of client nodes and the increase of transmitted data traffic, huge bandwidth pressure is brought to the server, so that data transmission delay is caused, data distribution efficiency is low, further, the service response speed is slow, and the server stacks a large number of machines to bear the problems of resource waste and the like caused by the bandwidth pressure.
Disclosure of Invention
The disclosure provides a data distribution method, a device, electronic equipment and a storage medium, which at least solve the problems of large server bandwidth pressure, data transmission delay, low data distribution efficiency, low service response speed, resource waste and the like in the related technology. The technical scheme of the present disclosure is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided a data distribution method, including:
Responding to a data distribution request of a first terminal, and determining a target terminal identifier in a father node corresponding to the first terminal based on a target distribution tree, wherein the target distribution tree is constructed based on data cache ranges of a plurality of preset terminals, and the terminals of the plurality of preset terminals are used as the tree of the nodes, and the plurality of preset terminals comprise the first terminal;
And sending the target terminal identifier to the first terminal, wherein the target terminal identifier is used for indicating the first terminal to obtain target service data corresponding to the data distribution request from a target terminal corresponding to the target terminal identifier.
In an optional embodiment, acquiring current data caching ranges of the plurality of preset terminals and terminal identification sets corresponding to the plurality of preset terminals;
acquiring a first terminal identifier with the maximum data caching range corresponding to the terminal identifier set as a root node of a first distribution tree;
Sequentially acquiring second terminal identifiers from the terminal identifier set, wherein the second terminal identifiers are terminal identifiers which are not added into the first distribution tree in the terminal identifier set and have the largest corresponding data caching range;
Searching target nodes of which the data caching range meets preset conditions in the first distribution tree, wherein the preset conditions are that the data caching ranges corresponding to the second terminal identification are overlapped, and the upper limit of the data caching range is larger than that of the data caching range corresponding to the second terminal identification;
under the condition that the target node is found, the second terminal identifier is added into the first distribution tree as a child node of the target node;
and taking the first distribution tree as the target distribution tree under the condition that the terminal identifications in the terminal identification set are added into the first distribution tree.
In an optional embodiment, the searching for the target node in the first distribution tree, where the data cache range meets the preset condition, includes:
Searching a current node from the first distribution tree, wherein the current node is a node with the largest data caching range corresponding to a node which is not searched;
And under the condition that the data cache range corresponding to the current node meets the preset condition, taking the current node as the target node.
In an optional embodiment, when the data cache range corresponding to the current node meets the preset condition, the step of using the current node as the target node includes:
determining the number of child nodes of the current node under the condition that the data cache range corresponding to the current node meets the preset condition;
And under the condition that the number of the child nodes is smaller than a preset threshold value, taking the current node as the target node.
In an alternative embodiment, the method further comprises:
And under the condition that the number of the child nodes is not smaller than the preset threshold value, jumping to the step of searching the current node from the first distribution tree.
In an alternative embodiment, the method further comprises:
and under the condition that the data cache range corresponding to the current node does not meet the preset condition, jumping to the step of searching the current node from the first distribution tree.
In an alternative embodiment, the method further comprises:
and under the condition that the target node meeting the preset condition does not exist in the first distribution tree, constructing a root node of a second distribution tree according to the second terminal identifier.
In an optional embodiment, the second terminal identifier is a terminal identifier with the largest data buffering range, which is not added into the terminal identifier of the first distribution tree or the second distribution tree;
The searching for the target node with the data caching range meeting the preset condition in the first distribution tree comprises the following steps:
Searching target nodes of which the data caching range meets the preset condition in the first distribution tree and the second distribution tree;
the step of taking the first distribution tree as the target distribution tree when the terminal identifications in the terminal identification set are added to the first distribution tree comprises the following steps:
And in the case of adding the terminal identification in the terminal identification set to the first distribution tree or the second distribution tree, taking the first distribution tree and the second distribution tree as the target distribution tree.
In an alternative embodiment, the method further comprises:
According to the lower limit in the data cache range of the plurality of preset terminals, the terminal identification sets are ordered in a descending order to obtain an initial terminal identification sequence;
According to the upper limit in the data cache range of the plurality of preset terminals, the terminal identifications in the initial terminal identification sequence are ordered in a descending order to obtain a terminal identification sequence;
the obtaining the first terminal identifier with the maximum data buffering range corresponding to the terminal identifier set as the root node of the first distribution tree comprises:
Taking the terminal identifier with the forefront sequence in the terminal identifier sequence as the first terminal identifier;
and constructing a root node of the first distribution tree according to the first terminal identifier.
In an alternative embodiment, the method further comprises:
updating the target distribution tree based on the data cache range of the second terminal under the condition that the data cache range of any one of the plurality of preset terminals is updated;
The second terminal is a preset terminal for updating the data cache range in the plurality of preset terminals.
In an alternative embodiment, the method further comprises:
and under the condition that the data cache range of the new terminal sent by the new terminal is received, updating the target distribution tree based on the data cache range of the new terminal.
In an alternative embodiment, the method further comprises:
deleting the data cache range of a third terminal in the data cache ranges of the preset terminals under the condition that the data cache range of any one of the preset terminals is out of date, so as to obtain an updated data cache range; the third terminal is a preset terminal with the data caching range being outdated;
and updating the target distribution tree based on the updated data cache range.
A target terminal identification determining module configured to perform a data distribution request in response to a first terminal, and determine a target terminal identification in a parent node corresponding to the first terminal based on a target distribution tree, wherein the target distribution tree is constructed based on data cache ranges of a plurality of preset terminals, and the plurality of preset terminals include the first terminal;
And the target terminal identification sending module is configured to send the target terminal identification to the first terminal, wherein the target terminal identification is used for indicating the first terminal to obtain target service data corresponding to the data distribution request from a target terminal corresponding to the target terminal identification.
According to a second aspect of the embodiments of the present disclosure, there is provided a data distribution apparatus including:
A target terminal identification determining module configured to perform a data distribution request in response to a first terminal, and determine a target terminal identification in a parent node corresponding to the first terminal based on a target distribution tree, wherein the target distribution tree is constructed based on data cache ranges of a plurality of preset terminals, and the plurality of preset terminals include the first terminal;
And the target terminal identification sending module is configured to send the target terminal identification to the first terminal, wherein the target terminal identification is used for indicating the first terminal to obtain target service data corresponding to the data distribution request from a target terminal corresponding to the target terminal identification.
In an alternative embodiment, the apparatus further comprises:
The data cache range acquisition module is configured to acquire the data cache ranges of the plurality of preset terminals and terminal identification sets corresponding to the plurality of preset terminals;
The first root node construction module is configured to acquire a first terminal identifier with the largest data caching range corresponding to the terminal identifier set as a root node of a first distribution tree;
The second terminal identification acquisition module is configured to sequentially acquire second terminal identifications from the terminal identification set, wherein the second terminal identifications are terminal identifications which are not added into the first distribution tree in the terminal identification set and have the largest corresponding data caching range;
The target node searching module is configured to perform searching for target nodes, the data caching range of which meets a preset condition, in the first distribution tree, wherein the preset condition is that the data caching ranges corresponding to the second terminal identifiers are overlapped, and the upper limit of the data caching ranges is larger than that of the data caching ranges corresponding to the second terminal identifiers;
A child node adding module configured to perform adding the second terminal identification as a child node of the target node to the first distribution tree if the target node is found;
A target distribution tree determination module configured to perform, in a case where a terminal identification in the terminal identification set is added to the first distribution tree, the first distribution tree as the target distribution tree.
In an alternative embodiment, the target node search module includes:
the current node searching unit is configured to search a current node from the first distribution tree, wherein the current node is a node with the largest data caching range corresponding to a node which is not searched;
and the target node determining unit is configured to execute taking the current node as the target node under the condition that the data cache range corresponding to the current node meets the preset condition.
In an alternative embodiment, the target node determining unit comprises:
A child node number determining unit configured to determine the number of child nodes of the current node if the data cache range corresponding to the current node meets the preset condition;
a target node determining subunit configured to perform taking the current node as the target node if the number of child nodes is smaller than a preset threshold.
In an alternative embodiment, the apparatus further comprises:
and the first jump module is configured to execute the step of jumping to the step of searching the current node from the first distribution tree under the condition that the number of the child nodes is not smaller than the preset threshold value.
In an alternative embodiment, the apparatus further comprises:
and the second jump module is configured to execute the construction of a root node of a second distribution tree according to the second terminal identifier under the condition that no target node meeting the preset condition exists in the first distribution tree.
In an alternative embodiment, the apparatus further comprises:
And the second root node construction module is configured to construct a root node of a second distribution tree according to the second terminal identifier under the condition that no target node meeting the preset condition exists in the first distribution tree.
In an optional embodiment, the second terminal identifier is a terminal identifier with the largest data buffering range, which is not added into the terminal identifier of the first distribution tree or the second distribution tree;
The target node searching module is further configured to search target nodes, the data caching range of which meets the preset condition, in the first distribution tree and the second distribution tree;
the target distribution tree module is further configured to execute the first distribution tree and the second distribution tree as the target distribution tree in a case where a terminal identification in the terminal identification set is added to the first distribution tree or the second distribution tree.
In an alternative embodiment, the apparatus further comprises:
The first ordering module is configured to execute descending order ordering on the terminal identification sets according to the lower limit in the data cache range of the plurality of preset terminals to obtain an initial terminal identification sequence;
The second ordering module is configured to perform descending order ordering on the terminal identifications in the initial terminal identification sequence according to the upper limit in the data cache range of the plurality of preset terminals to obtain a terminal identification sequence;
The first root node construction module includes:
a first terminal identification determining unit configured to perform sorting of a terminal identification, which is the foremost in the terminal identification sequence, as the first terminal identification;
And a root node construction unit configured to construct a root node of the first distribution tree according to the first terminal identification.
In an alternative embodiment, the apparatus further comprises:
a first target distribution tree updating module configured to perform updating of the target distribution tree based on the data cache range of the second terminal in case of updating of the data cache range of any one of the plurality of preset terminals;
The second terminal is a preset terminal for updating the data cache range in the plurality of preset terminals.
In an alternative embodiment, the apparatus further comprises:
And a second target distribution tree updating module configured to perform updating of the target distribution tree based on the data cache range of the new terminal when the data cache range of the new terminal transmitted by the new terminal is received.
In an alternative embodiment, the apparatus further comprises:
The cache range updating module is configured to execute deleting the data cache range of a third terminal in the data cache ranges of the preset terminals under the condition that the data cache range of any preset terminal in the plurality of preset terminals is out of date, so as to obtain an updated data cache range; the third terminal is a preset terminal with the data caching range being outdated;
a third target distribution tree updating module configured to perform updating of the target distribution tree based on the updated data cache range.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of any of the first aspects above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of any one of the first aspects of embodiments of the present disclosure.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any one of the first aspects of embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
In the data distribution process, a target distribution tree which is constructed based on the data caching ranges of a plurality of preset terminals and takes the terminal identifiers of the plurality of preset terminals as nodes is combined, so that the target terminal identifiers of the target terminals which can distribute data to the first terminal which currently requests the data can be rapidly positioned, further, the bandwidth pressure of server data distribution is relieved, meanwhile, the resource waste caused by the bandwidth pressure is effectively avoided, the timeliness of data distribution scheduling is greatly improved, the data transmission delay is effectively reduced, the data distribution efficiency is improved, and the response speed of corresponding services is further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a schematic diagram of a data distribution system, shown in accordance with an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of data distribution according to an exemplary embodiment;
FIG. 3 is a flowchart illustrating one construction of a target distribution tree, according to an example embodiment;
FIG. 4 is a schematic diagram of a data buffering range of a plurality of preset terminals according to an exemplary embodiment;
FIG. 5 is a flowchart illustrating a child node of a target node in a first distribution tree based on a data cache range corresponding to a current traversal identifier, according to an example embodiment;
FIG. 6 is a schematic diagram of a build target distribution tree provided in accordance with an exemplary embodiment;
FIG. 7 is a schematic diagram of a target distribution tree before and after updating, provided in accordance with an exemplary embodiment;
FIG. 8 is a block diagram of a data distribution device according to an exemplary embodiment;
FIG. 9 is a block diagram of an electronic device for data distribution, shown in accordance with an exemplary embodiment;
Fig. 10 is a block diagram of an electronic device for data distribution, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a data distribution system according to an exemplary embodiment, which may include a plurality of terminals 100 and a server 200 as shown in fig. 1.
In a specific embodiment, the plurality of terminals 100 may be clients providing business services to users. Alternatively, the terminal may include, but is not limited to, a smart phone, a desktop computer, a tablet computer, a notebook computer, a smart speaker, a digital assistant, an augmented reality (augmentedreality, AR)/Virtual Reality (VR) device, a smart wearable device, or other type of electronic device, or may be software running on the electronic device, such as an application program, or the like. Alternatively, the operating system running on the electronic device may include, but is not limited to, an android system, an IOS system, linux, windows, and the like.
In an alternative embodiment, the server 200 may provide background services for a plurality of terminals 100. Specifically, the server 200 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server that provides a cloud computing service.
In addition, it should be noted that, fig. 1 is only an application environment provided by the present disclosure, and in practical application, other application environments may also be included, for example, may include more terminals.
In the embodiment of the present disclosure, the plurality of terminals 100 and the server 200 may be directly or indirectly connected through a wired or wireless communication manner, which is not limited herein.
Fig. 2 is a flowchart illustrating a data distribution method according to an exemplary embodiment, which may be applied to a server as shown in fig. 2, including the following steps.
In step S201, in response to a data distribution request of a first terminal, a target terminal identification in a parent node corresponding to the first terminal is determined based on a target distribution tree.
In a specific embodiment, the target distribution tree may be a tree constructed based on a data buffering range of a plurality of preset terminals, and the terminals of the plurality of preset terminals are identified as nodes; and the hierarchical relationship among the nodes in the target distribution tree can represent the data distribution relationship among the corresponding preset terminals of the nodes. Specifically, the data cache range corresponding to any father node in the target distribution tree coincides with the data cache range corresponding to the child node of the father node, and the upper limit of the data cache range corresponding to the father node is greater than the upper limit of the data cache range corresponding to the child node of the father node, so that it can be ensured that the terminal corresponding to the father node includes the data required to be requested by the terminal corresponding to the child node. Alternatively, the target distribution tree may comprise one or more distribution trees.
In an optional embodiment, any node except the root node in the target distribution tree corresponds to a father node, so that load balance of the terminal can be effectively ensured, and stability and reliability of the whole distribution system are improved.
In a specific embodiment, the plurality of preset terminals includes a first terminal; the first terminal may be a terminal that is currently requesting data from the server. The plurality of preset terminals may be a plurality of terminals that request the same data from the server. Optionally, the data in the server may be different in combination with the actual service scenario, for example, in the model transmission scenario, the data in the server may be a model; in the streaming scenario, the data in the server may be streaming.
In practical application, since the buffer capacity of each terminal is limited, all data required to be requested from the server cannot be buffered to the local at one time, correspondingly, data can be requested from the server in batches, and in case that the data in the buffer exceeds the buffer capacity, historical buffer data in the buffer can be covered based on new data acquired from the server. Accordingly, the data buffering range of any one of the preset terminals may be a range corresponding to data stored in a buffer (the buffer of the preset terminal) at the current time. Specifically, the terminal can sequentially perform data requests according to the time of storing the data in the server from first to second; alternatively, the data may be identified in conjunction with the time when the data is stored in the server, and accordingly, the above data buffering range may be a time stamp (time when the data is stored in the server) interval corresponding to the data stored in the buffer at the current time; optionally, a preset character may be set in combination with the time of storing the data in the server to identify the data, and optionally, the value of the preset character is positively correlated with the time, for example, 0001, 0002, 0003, etc. sequentially from first to last according to the time, and accordingly, the data cache range may be a character interval corresponding to the data stored in the cache at the current time.
In a specific embodiment, the preset terminal may report the data cache range to the server after a certain time interval or after a certain number of data are acquired from the server, and correspondingly, the current time may be the time of the preset terminal in the data cache range of the server.
In a specific embodiment, the data distribution request may include a terminal identifier of the first terminal, and accordingly, the server may determine, in association with the terminal identifier of the first terminal, a parent node corresponding to the first terminal from the target distribution tree, and use the terminal identifier in the parent node as the target terminal identifier.
In an alternative embodiment, the method may further include: the step of constructing the target distribution tree, as shown in fig. 3, may include:
In step S301, a data buffering range of a plurality of preset terminals and a terminal identification set corresponding to the plurality of preset terminals are obtained.
In a specific embodiment, in the event of an update of the data cache scope in the server, the server may reconstruct the target distribution tree in combination with the updated data cache scope. The terminal identification set may include terminal identifications of respective ones of a plurality of preset terminals.
In step S303, a first terminal identifier with the largest data buffering range corresponding to the terminal identifier set is obtained as a root node of the first distribution tree.
In a specific embodiment, the size of the data buffer range may be determined in combination with the upper and lower limits of the data buffer range, and specifically, the larger the lower limit, the larger the data buffer range; under the condition of the same lower limit, the larger the corresponding upper limit is, the larger the data caching range is. Optionally, the terminal identifiers in the terminal identifier set may be ordered by combining with the data buffering range, and the first terminal identifier is determined by combining with the ordered terminal identifier sequence, and accordingly, the method may further include:
According to the lower limit in the data cache range of a plurality of preset terminals, the terminal identification sets are ordered in a descending order to obtain an initial terminal identification sequence;
According to the upper limit in the data cache range of a plurality of preset terminals, the terminal identifications in the initial terminal identification sequence are ordered in a descending order to obtain a terminal identification sequence;
Correspondingly, the acquiring the first terminal identifier with the maximum data buffering range corresponding to the terminal identifier set as the root node of the first distribution tree may include: the terminal identification sequence is used as a first terminal identification; and constructing a root node of the first distribution tree according to the first terminal identifier.
In practical application, the data cache ranges of different preset terminals are often different due to the different data reading capacities and cache capacities of the different preset terminals; optionally, the terminal identifiers in the terminal identifier set may be sorted in descending order by combining the lower limits in the data buffer ranges of the plurality of preset terminals, so as to obtain an initial terminal identifier sequence; then, the terminal identifications in the initial terminal identification sequence are ordered in a descending order by combining the upper limits in the data caching ranges of the plurality of preset terminals to obtain a terminal identification sequence, so that the terminal identifications of the preset terminals with the faster caching progress can be ordered at the front position, and meanwhile, the terminal identifications corresponding to the same upper limits can be ordered by combining the corresponding lower limits.
In a specific embodiment, the terminal identifier with the highest ranking in the terminal identifier sequence may be the terminal identifier with the largest corresponding data buffering range (i.e. the first terminal identifier). Optionally, the ascending order of the terminal identifier sets may be performed by combining upper and lower limits in the data buffering ranges of the plurality of preset terminals, and correspondingly, the terminal identifier with the last ordering in the terminal identifier sequence corresponding to the ascending order may be the terminal identifier with the largest corresponding data buffering range.
In a specific embodiment, as shown in fig. 4, fig. 4 is a schematic diagram of a data buffering range of a plurality of preset terminals according to an exemplary embodiment. Specifically, the terminal identifiers in the terminal identifier set may include C1, C2, C3, C4, C5, C6, C7, and C8, and the range corresponding to the data that needs to be obtained from the server by the plurality of preset terminals is 0-100, where the data cache range corresponding to C1 is 70-100 (where 70 is a lower limit and 100 is an upper limit); the data caching range corresponding to C2 is 40-90; the data caching range corresponding to C3 is 36-60; the data cache range corresponding to C4 is 32-55; the data caching range corresponding to C5 is 27-50; the data caching range corresponding to C6 is 20-45; the data caching range corresponding to C7 is 12-21; the data caching range corresponding to C8 is 0-15; correspondingly, after descending order sequencing is sequentially performed on the lower limit and the upper limit of the data cache range corresponding to C1, C2, C3, C4, C5, C6, C7 and C8, a terminal identification sequence can be obtained: c1, C2, C3, C4, C5, C6, C7, C8.
In the above embodiment, the lower limit and the upper limit in the data buffering ranges of the plurality of preset terminals are sequentially combined, the terminal identifiers corresponding to the terminal identifiers of the plurality of preset terminals are sorted in descending order, the terminal identifiers corresponding to the same upper limit are sorted by combining with the corresponding lower limit, and the terminal identifiers can be sorted according to the data buffering progress, so that the target distribution tree can be conveniently constructed according to the data buffering progress, the rationality and the effectiveness of the constructed target distribution tree are greatly improved, and the data distribution efficiency is further improved.
In step S305, the second terminal identifications are sequentially acquired from the terminal identification set.
In a specific embodiment, the second terminal identifier may be a terminal identifier that is not added to the first distribution tree in the terminal identifier set and has the largest corresponding data buffering range. Specifically, the terminal identifier with the largest data buffering range can be sequentially obtained from the terminal identifiers added into the first distribution tree in combination with the data buffering range, and the terminal identifier with the largest data buffering range is used as the second terminal identifier which is currently obtained.
In a specific embodiment, the second terminal identifier may be sequentially obtained from the terminal identifier set in combination with ordering information of the plurality of terminal identifiers in the terminal identifier sequence.
In step S307, in the first distribution tree, a target node whose data cache range satisfies a preset condition is searched.
In a specific embodiment, the preset condition may be that there is a coincidence between the data buffering ranges corresponding to the second terminal identifier, and an upper limit of the data buffering ranges is greater than an upper limit of the data buffering ranges corresponding to the second terminal identifier.
In an alternative embodiment, as shown in fig. 5, in the first distribution tree, searching for a target node whose data cache range meets a preset condition may include the following steps:
in step S3071, the current node is found from the first distribution tree.
In a specific embodiment, the current node may be a node with the largest data cache range corresponding to the unsearched node.
In step S3073, when the data cache range corresponding to the current node satisfies the preset condition, the current node is set as the target node.
In a specific embodiment, the coincidence condition and the upper limit of the data cache range corresponding to the current node and the second terminal identifier may be compared, optionally, there is coincidence between the data cache ranges corresponding to the current node and the second terminal identifier, and the upper limit of the data cache range corresponding to the current node is greater than the upper limit of the data cache range corresponding to the second terminal identifier, so that it may be determined that the data cache range corresponding to the current node meets the preset condition. Specifically, under the condition that the data cache range corresponding to the current node meets the preset condition, whether the terminal corresponding to the current node includes the data required to be requested by the terminal corresponding to the current traversal identifier or not can be determined.
In the above embodiment, in combination with the data cache range, the current node is searched from the first distribution tree, so that sub-node mounting can be performed from fast to slow according to the cache progress, and when the data cache range corresponding to the current node meets the preset condition, the current node is used as the target node for mounting the second terminal identifier, so that the data which needs to be requested by the terminal corresponding to the sub-node is included in the terminal corresponding to the father node, and further, the effectiveness and reliability of data distribution scheduling based on the distribution tree can be improved.
In an optional embodiment, in order to better promote load balancing of the data distribution system, in the case that the data cache range corresponding to the current node meets the preset condition, taking the current node as the target node may include:
determining the number of child nodes of the current node under the condition that the data cache range corresponding to the current node meets the preset condition;
And under the condition that the number of the child nodes is smaller than a preset threshold value, taking the current node as a target node.
In a specific embodiment, the preset threshold may be an upper limit on the number of node-mountable child nodes. Specifically, the number of child nodes of the current node may be the number of child nodes on which the current node has been mounted. Correspondingly, under the condition that the number of the child nodes of the current node is smaller than a preset threshold value, it can be determined that the mounted node of the current node does not reach the upper limit, and correspondingly, the current node can be used as the target node.
In an alternative embodiment, the method may further include:
And under the condition that the number of the child nodes is not smaller than a preset threshold value, jumping to the step of searching the current node from the first distribution tree.
In a specific embodiment, in a case that the number of child nodes is not less than the preset threshold, it may be determined that the number of mountable child nodes of the current node has reached the upper limit, and then the current node may be determined again from the first distribution tree.
In the above embodiment, in the process of determining that the second terminal identifies the target node to be mounted on the corresponding node, by combining with the judgment of whether the number of the child nodes of the current node is greater than the preset threshold, on the basis of ensuring that the parent node corresponding terminal includes the data to be requested by the terminal corresponding to the child node, the load balancing of the terminal can be ensured, the problem that the load of the terminal is excessive due to the fact that one terminal distributes data to a plurality of downstream terminals is avoided, and further the load balancing and the data distribution efficiency of the whole data distribution system can be better improved.
In an alternative embodiment, the method may further include:
And under the condition that the data caching range corresponding to the current node does not meet the preset condition, jumping to the step of searching the current node from the first distribution tree.
In a specific embodiment, in a case that the data cache range corresponding to the current node does not meet the preset condition, it may be determined that the terminal corresponding to the current node does not include the data requested by the terminal corresponding to the current traversal identifier, and correspondingly, the current node may be determined again from the first distribution tree.
In the above embodiment, when the data cache range corresponding to the current node does not meet the preset condition, the current node is determined again from the first distribution tree, so that the data which needs to be requested by the terminal corresponding to the child node is effectively ensured to be included in the terminal corresponding to the father node, and further the effectiveness and reliability of data distribution scheduling based on the distribution tree can be improved.
In step S309, in the case of finding the target node, the second terminal identification is added to the first distribution tree as a child node of the target node.
In a specific embodiment, when the first distribution tree finds that the corresponding data buffering range meets the target node of the preset jump, the currently acquired second terminal identifier may be added to the first distribution tree as a child node of the target node.
In step S311, in the case of adding the terminal identification in the terminal identification set to the first distribution tree, the first distribution tree is set as a target distribution tree.
In a specific embodiment, when the target node corresponding to the sequentially acquired second terminal identifier is found, adding the sequentially acquired second terminal identifier to the first distribution data using the first terminal identifier as the root node may be implemented, and correspondingly, when the terminal identifier in the terminal identifier set is added to the first distribution tree, the first distribution tree may be used as the target distribution tree.
In a specific embodiment, the terminal identifiers in the terminal identifier set include examples of C1, C2, C3, C4, C5, C6, C7 and C8, as shown in fig. 6, and fig. 6 is a schematic diagram of a construction target distribution tree according to an exemplary embodiment. Specifically, the data cache range corresponding to the terminal identifier may be constructed by using C1 as a root node, and then C2 may be used as a second terminal identifier currently acquired, where a node corresponding to C1 in the first distribution tree is used as a current node; further, in combination with the data cache range [40,90] corresponding to C2 and the data cache ranges [70,100] corresponding to C1, it can be determined that the node corresponding to C1 can be used as the target node of the node corresponding to C2; correspondingly, the child node of the node corresponding to C1 can be constructed based on C2; further, C3 may be used as the second terminal identifier currently acquired, a node corresponding to C1 in the first distribution tree may be used as the current node, further, in combination with the data cache range [36,60] corresponding to C3 and the data cache range [70,100] corresponding to C1, it may be determined that the node corresponding to C1 cannot be used as the target node of the node corresponding to C3 (because the data cache range corresponding to C3 and the data cache range corresponding to C1 do not coincide), and correspondingly, a node corresponding to C2 in the first distribution tree may be used as the current node, and in combination with the data cache range [36,60] corresponding to C3 and the data cache range [40,90] corresponding to C2, it may be determined that the node corresponding to C2 may be used as the target node of the node corresponding to C3; correspondingly, the child node of the node corresponding to C2 can be constructed based on C3; and sequentially updating the second terminal identifier which is currently acquired until the node corresponding to the C8 is added into the first distribution tree, and correspondingly, taking the first distribution tree comprising the node corresponding to the C8 as a target distribution tree. Specifically, as can be seen from fig. 6, the tree structure corresponding to the dashed box may be a distribution tree, and the terminal corresponding to the root node may request data from the server.
In the above embodiment, the size of the data cache ranges of the plurality of preset terminals is combined to construct the target distribution tree capable of representing the data distribution relationship among the plurality of preset terminals, so that the data required to be requested by the terminal corresponding to the child node in the terminal corresponding to the father node in the target distribution tree can be effectively ensured, and further, the data distribution bandwidth pressure of the server can be reduced, and meanwhile, the data distribution efficiency can be greatly improved.
In an alternative embodiment, the method may further include:
and under the condition that no target node meeting the preset condition exists in the first distribution tree, constructing a root node of the second distribution tree according to the second terminal identifier.
In a specific embodiment, if the target node whose corresponding data cache range meets the preset condition is not found in the first distribution tree, a second terminal identifier obtained currently may be used as a root node, and a distribution tree (second distribution tree) may be constructed. Optionally, in the case of constructing the second distribution tree, the second terminal identifier may be a terminal identifier with the largest data buffering range, which is not added into the terminal identifier of the first distribution tree or the second distribution tree;
In the foregoing first distribution tree, searching for the target node whose data cache range satisfies the preset condition may include: searching target nodes of which the data caching range meets preset conditions in the first distribution tree and the second distribution tree;
In the case of adding the terminal identifier in the terminal identifier set to the first distribution tree, the step of setting the first distribution tree as the target distribution tree may include: in the case of adding a terminal identifier in the terminal identifier set to the first distribution tree or the second distribution tree, the first distribution tree and the second distribution tree are set as target distribution trees.
Optionally, if the target node corresponding to the second terminal identifier with the largest data cache range and not added to the first distribution tree or the second distribution tree cannot be found in the process of constructing the target distribution tree, a new distribution tree can be constructed by combining the second terminal identifier, in the process of mounting the node of the subsequent distribution tree, the second terminal identifier is acquired by combining the newly constructed distribution tree, and the target node is found until the last second terminal identifier is acquired, and the new distribution tree is added into the constructed distribution tree, and the constructed distribution tree is used as the target distribution tree.
In the above embodiment, when the target node meeting the preset condition does not exist in the first distribution tree, the distribution tree is reconstructed by combining the currently acquired second terminal identifier, so that the data which needs to be requested by the terminal corresponding to the child node and included in the terminal corresponding to the built father node can be effectively ensured, and the effectiveness and reliability of data distribution scheduling based on the distribution tree are further improved; and in the subsequent distribution tree node mounting process, the second terminal identification is acquired by combining with the newly constructed distribution tree, and the target node is searched, so that the effectiveness of the finally obtained target distribution tree can be better improved.
In step S203, the target terminal identifier is transmitted to the first terminal.
In a specific embodiment, the target terminal identifier may be used to instruct the first terminal to obtain, from a target terminal corresponding to the target terminal identifier, target service data corresponding to the data distribution request. Specifically, the target service data may be data requested by a data distribution request.
In a specific embodiment, the first terminal may request, when receiving the target terminal identifier, the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identifier.
In an alternative embodiment, the method may further include:
under the condition that the data cache range of any one of a plurality of preset terminals is updated, updating the target distribution tree based on the data cache range of the second terminal;
In a specific embodiment, the second terminal is a preset terminal for updating a data buffering range in a plurality of preset terminals. Specifically, under the condition that the second terminal re-uploads the data cache range, the data cache range of the second terminal in the data cache ranges of the plurality of preset terminals stored in the server can be updated into the re-uploaded data cache range, and the target distribution tree is reconstructed by combining the updated data cache ranges of the plurality of preset terminals.
Specifically, the specific refinement of reconstructing the target distribution tree in combination with the updated data cache ranges of the plurality of preset terminals may be referred to the above-mentioned related step refinement of constructing the target distribution tree in combination with the data cache ranges of the plurality of preset terminals, which is not described herein.
In a specific embodiment, the terminal identifiers of the plurality of preset terminals include examples of C1, C2, C3, C4, C5, C6, C7 and C8, as shown in fig. 7, and fig. 7 is a schematic diagram before and after updating a target distribution tree according to an exemplary embodiment. Assuming that the second terminal is a terminal corresponding to C4, and the data cache range of the second terminal is updated from [32,55] to [32,72], then, the target distribution tree can be reconstructed by combining the updated data cache ranges of the plurality of preset terminals, and accordingly, the target distribution tree is updated from fig. 7a to fig. 7b.
In the above embodiment, under the condition that the data cache range of any one of the plurality of preset terminals is updated, the target distribution tree can be updated in combination with the updated data cache range, so that the dynamic adjustment of the target distribution tree can be realized, and on the basis of improving the data distribution efficiency, the effectiveness and reliability of the data distribution scheduling are greatly improved.
In an alternative embodiment, the method may further include:
and under the condition that the data cache range of the newly-added terminal sent by the newly-added terminal is received, updating the target distribution tree based on the data cache range of the newly-added terminal.
In a specific embodiment, the newly added terminal may be a newly added terminal, specifically, in a case that a certain terminal uploads a data cache range, if the terminal identifier of the terminal is not in a terminal identifier of a preset terminal in a data cache range stored in a server, the terminal may be determined to be the newly added terminal, and accordingly, the data cache range of the newly added terminal may be added to the data cache ranges of a plurality of preset terminals, so as to implement updating of the data cache range in the server, and accordingly, the target distribution tree may be reconstructed in combination with the updated data cache range.
Specifically, the specific refinement of reconstructing the target distribution tree in combination with the updated data cache range can be referred to the above related step refinement of constructing the target distribution tree in combination with the data cache ranges of the plurality of preset terminals, which is not described herein.
In the above embodiment, under the condition that the data cache range of the new terminal sent by the new terminal is received, the target distribution tree can be updated in combination with the data cache range of the new terminal, so that dynamic adjustment of the target distribution tree can be realized, and on the basis of improving the data distribution efficiency, the effectiveness and reliability of data distribution scheduling are greatly improved.
In an alternative embodiment, the method may further include:
Deleting the data cache range of a third terminal in the data cache ranges of the plurality of preset terminals under the condition that the data cache range of any one of the plurality of preset terminals is out of date, so as to obtain an updated data cache range;
the target distribution tree is updated based on the updated data cache range.
In a specific embodiment, the third terminal is a preset terminal whose data buffering range expires; optionally, the server may store an update time of the data cache range of each preset terminal, and if the data cache range of a certain preset terminal is not updated for more than a preset time period, it may be determined that the data cache range of the preset terminal is out of date, and correspondingly, the data cache range of the preset terminal may be deleted, so as to implement updating of the data cache range in the server.
In the above embodiment, under the condition that the data cache range of any one of the plurality of preset terminals expires, the expired data cache range may be deleted to update the data cache range, so that the updated data cache range may be combined to dynamically adjust the target distribution tree, and on the basis of improving the data distribution efficiency, the effectiveness and reliability of the data distribution scheduling are greatly improved.
In an alternative embodiment, if the node of the terminal identifier of the first terminal in the target distribution tree is the root node, the corresponding server may directly send the target service data to the first terminal.
As can be seen from the technical solutions provided in the embodiments of the present disclosure, in the data distribution process, the present disclosure is combined with a target distribution tree constructed based on the data buffering ranges of multiple preset terminals, and the target terminal identifiers of the target terminals that use the terminal identifiers of the multiple preset terminals as nodes can be quickly located, so that the target terminal identifiers of the target terminals that can distribute data to the first terminal that currently requests data can be quickly located, and further, while the bandwidth pressure of the server data distribution is relieved, the resource waste caused by the bandwidth pressure can be effectively avoided, the timeliness of the data distribution scheduling is greatly improved, the data transmission delay can be effectively slowed down, the data distribution efficiency is improved, and further, the response speed of the corresponding service can be improved.
Fig. 8 is a block diagram of a data distribution device according to an exemplary embodiment. Referring to fig. 8, the apparatus includes:
A target terminal identification determining module 810 configured to perform a determination of a target terminal identification in a parent node corresponding to a first terminal based on a target distribution tree, which is a tree constructed based on a data cache range of a plurality of preset terminals, the tree having terminal identifications of the plurality of preset terminals as nodes, the plurality of preset terminals including the first terminal, in response to a data distribution request of the first terminal;
The target terminal identifier sending module 820 is configured to send a target terminal identifier to the first terminal, where the target terminal identifier is used to instruct the first terminal to obtain target service data corresponding to the data distribution request from a target terminal corresponding to the target terminal identifier.
In an alternative embodiment, the apparatus further comprises:
The data cache range acquisition module is configured to acquire the data cache ranges of a plurality of preset terminals and terminal identification sets corresponding to the preset terminals;
the first root node construction module is configured to execute the first terminal identification with the maximum data caching range corresponding to the terminal identification set and serve as a root node of the first distribution tree;
The second terminal identification acquisition module is configured to sequentially acquire second terminal identifications from the terminal identification set, wherein the second terminal identifications are terminal identifications which are not added into the first distribution tree in the terminal identification set and have the largest corresponding data caching range;
The target node searching module is configured to search target nodes, the data caching range of which meets the preset condition, in the first distribution tree, wherein the preset condition is that coincidence exists between the data caching ranges corresponding to the second terminal identifiers, and the upper limit of the data caching ranges is larger than that of the data caching ranges corresponding to the second terminal identifiers;
The child node adding module is configured to execute adding the second terminal identifier serving as a child node of the target node into the first distribution tree under the condition that the target node is found;
The target distribution tree determination module is configured to execute taking the first distribution tree as a target distribution tree in a case of adding the terminal identifications in the terminal identification set to the first distribution tree.
In an alternative embodiment, the target node lookup module includes:
The current node searching unit is configured to search the current node from the first distribution tree, wherein the current node is the node with the largest data caching range corresponding to the node which is not searched;
The target node determining unit is configured to execute taking the current node as the target node when the data cache range corresponding to the current node meets the preset condition.
In an alternative embodiment, the target node determining unit comprises:
The child node quantity determining unit is configured to determine the child node quantity of the current node under the condition that the data cache range corresponding to the current node meets the preset condition;
and the target node determining subunit is configured to execute taking the current node as the target node in the case that the number of the child nodes is smaller than a preset threshold value.
In an alternative embodiment, the apparatus further comprises:
And the first jump module is configured to execute the step of jumping to find the current node from the first distribution tree under the condition that the number of the child nodes is not smaller than a preset threshold value.
In an alternative embodiment, the apparatus further comprises:
And the second jump module is configured to execute the construction of a root node of the second distribution tree according to the second terminal identifier under the condition that the target node meeting the preset condition does not exist in the first distribution tree.
In an alternative embodiment, the apparatus further comprises:
The second root node construction module is configured to construct a root node of the second distribution tree according to the second terminal identifier under the condition that no target node meeting the preset condition exists in the first distribution tree.
In an optional embodiment, the second terminal identifier is a terminal identifier with the largest data buffering range, which is not added into the terminal identifier of the first distribution tree or the second distribution tree;
the target node searching module is further configured to search target nodes with the data caching range meeting preset conditions in the first distribution tree and the second distribution tree;
The target distribution tree module is further configured to execute the first distribution tree and the second distribution tree as target distribution trees in case of adding the terminal identifications in the terminal identification set to the first distribution tree or the second distribution tree.
In an alternative embodiment, the apparatus further comprises:
the first ordering module is configured to execute descending order ordering on the terminal identification sets according to the lower limits in the data cache ranges of a plurality of preset terminals to obtain an initial terminal identification sequence;
The second ordering module is configured to execute descending order ordering on the terminal identifications in the initial terminal identification sequence according to the upper limit in the data cache range of the plurality of preset terminals to obtain a terminal identification sequence;
The first root node construction module includes:
a first terminal identification determining unit configured to perform sorting of the foremost terminal identifications in the terminal identification sequence as first terminal identifications;
And a root node construction unit configured to perform construction of a root node of the first distribution tree according to the first terminal identification.
In an alternative embodiment, the apparatus further comprises:
A first target distribution tree updating module configured to perform updating of the target distribution tree based on the data cache range of the second terminal in case of updating of the data cache range of any one of the plurality of preset terminals;
The second terminal is a preset terminal for updating the data cache range in a plurality of preset terminals.
In an alternative embodiment, the apparatus further comprises:
and the second target distribution tree updating module is configured to execute updating of the target distribution tree based on the data cache range of the new terminal under the condition that the data cache range of the new terminal sent by the new terminal is received.
In an alternative embodiment, the apparatus further comprises:
The cache range updating module is configured to execute deleting the data cache range of a third terminal in the data cache ranges of the plurality of preset terminals under the condition that the data cache range of any one of the plurality of preset terminals is out of date, so as to obtain an updated data cache range; the third terminal is a preset terminal with the data caching range being outdated;
And a third target distribution tree updating module configured to perform updating of the target distribution tree based on the updated data cache range.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 9 is a block diagram illustrating an electronic device for data distribution, which may be a terminal, according to an exemplary embodiment, and an internal structure diagram thereof may be as shown in fig. 9. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data distribution method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the electronic equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
Fig. 10 is a block diagram illustrating an electronic device for data distribution, which may be a server, according to an exemplary embodiment, and an internal structure diagram thereof may be as shown in fig. 10. The electronic device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data distribution method.
It will be appreciated by those skilled in the art that the structures shown in fig. 9 or 10 are merely block diagrams of portions of structures related to the disclosed aspects and do not constitute limitations of the electronic devices to which the disclosed aspects may be applied, and that a particular electronic device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an exemplary embodiment, there is also provided an electronic device including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement a data distribution method as in the embodiments of the present disclosure.
In an exemplary embodiment, a computer readable storage medium is also provided, which when executed by a processor of an electronic device, enables the electronic device to perform the data distribution method in the embodiments of the present disclosure.
In an exemplary embodiment, a computer program product containing instructions is also provided which, when run on a computer, cause the computer to perform the data distribution method in the embodiments of the present disclosure.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (24)
1. A data distribution method, comprising:
responding to a data distribution request of a first terminal, and determining a father node corresponding to the first terminal from a target distribution tree; taking the terminal identifier in the father node as a target terminal identifier, wherein the target distribution tree is constructed based on the data cache range of a plurality of preset terminals, and takes the terminal identifiers of the plurality of preset terminals as nodes, wherein the plurality of preset terminals comprise the first terminal, and the target distribution tree is constructed in the following way: acquiring the current data caching ranges of the plurality of preset terminals and terminal identification sets corresponding to the plurality of preset terminals; acquiring a first terminal identifier with the maximum data caching range corresponding to the terminal identifier set as a root node of a first distribution tree; the size of the data cache range is positively correlated with the lower limit of the data cache range; sequentially acquiring second terminal identifiers from the terminal identifier set, wherein the second terminal identifiers are terminal identifiers which are not added into the first distribution tree in the terminal identifier set and have the largest corresponding data caching range; searching target nodes of which the data caching range meets preset conditions in the first distribution tree, wherein the preset conditions are that the data caching ranges corresponding to the second terminal identification are overlapped, and the upper limit of the data caching range is larger than that of the data caching range corresponding to the second terminal identification; under the condition that the target node is found, the second terminal identifier is added into the first distribution tree as a child node of the target node; taking the first distribution tree as the target distribution tree under the condition that the terminal identifications in the terminal identification set are added into the first distribution tree;
And sending the target terminal identifier to the first terminal, wherein the target terminal identifier is used for indicating the first terminal to obtain target service data corresponding to the data distribution request from a target terminal corresponding to the target terminal identifier.
2. The method according to claim 1, wherein searching for a target node in the first distribution tree whose data cache range satisfies a preset condition includes:
Searching a current node from the first distribution tree, wherein the current node is a node with the largest data caching range corresponding to a node which is not searched;
And under the condition that the data cache range corresponding to the current node meets the preset condition, taking the current node as the target node.
3. The data distribution method according to claim 2, wherein, in the case where the data cache range corresponding to the current node satisfies the preset condition, the step of taking the current node as the target node includes:
determining the number of child nodes of the current node under the condition that the data cache range corresponding to the current node meets the preset condition;
And under the condition that the number of the child nodes is smaller than a preset threshold value, taking the current node as the target node.
4. A data distribution method according to claim 3, characterized in that the method further comprises:
And under the condition that the number of the child nodes is not smaller than the preset threshold value, jumping to the step of searching the current node from the first distribution tree.
5. The data distribution method according to claim 2, characterized in that the method further comprises:
and under the condition that the data cache range corresponding to the current node does not meet the preset condition, jumping to the step of searching the current node from the first distribution tree.
6. The data distribution method according to claim 5, characterized in that the method further comprises:
and under the condition that the target node meeting the preset condition does not exist in the first distribution tree, constructing a root node of a second distribution tree according to the second terminal identifier.
7. The data distribution method according to claim 6, wherein the second terminal identifier is a terminal identifier with a maximum data buffering range, which is not added to the terminal identifier of the first distribution tree or the second distribution tree;
The searching for the target node with the data caching range meeting the preset condition in the first distribution tree comprises the following steps:
Searching target nodes of which the data caching range meets the preset condition in the first distribution tree and the second distribution tree;
the step of taking the first distribution tree as the target distribution tree when the terminal identifications in the terminal identification set are added to the first distribution tree comprises the following steps:
And in the case of adding the terminal identification in the terminal identification set to the first distribution tree or the second distribution tree, taking the first distribution tree and the second distribution tree as the target distribution tree.
8. The data distribution method according to claim 1, characterized in that the method further comprises:
According to the lower limit in the data cache range of the plurality of preset terminals, the terminal identification sets are ordered in a descending order to obtain an initial terminal identification sequence; the data caching ranges of the plurality of preset terminals are different;
According to the upper limit in the data cache range of the plurality of preset terminals, the terminal identifications in the initial terminal identification sequence are ordered in a descending order to obtain a terminal identification sequence;
the obtaining the first terminal identifier with the maximum data buffering range corresponding to the terminal identifier set as the root node of the first distribution tree comprises:
Taking the terminal identifier with the forefront sequence in the terminal identifier sequence as the first terminal identifier;
and constructing a root node of the first distribution tree according to the first terminal identifier.
9. The data distribution method according to any one of claims 1 to 8, characterized in that the method further comprises:
updating the target distribution tree based on the data cache range of the second terminal under the condition that the data cache range of any one of the plurality of preset terminals is updated;
The second terminal is a preset terminal for updating the data cache range in the plurality of preset terminals.
10. The data distribution method according to any one of claims 1 to 8, characterized in that the method further comprises:
and under the condition that the data cache range of the new terminal sent by the new terminal is received, updating the target distribution tree based on the data cache range of the new terminal.
11. The data distribution method according to any one of claims 1 to 8, characterized in that the method further comprises:
deleting the data cache range of a third terminal in the data cache ranges of the preset terminals under the condition that the data cache range of any one of the preset terminals is out of date, so as to obtain an updated data cache range; the third terminal is a preset terminal with the data caching range being outdated;
and updating the target distribution tree based on the updated data cache range.
12. A data distribution apparatus, comprising:
A target terminal identification determining module configured to perform determining a parent node corresponding to a first terminal from a target distribution tree in response to a data distribution request of the first terminal; taking the terminal identification in the father node as a target terminal identification, wherein the target distribution tree is constructed based on the data cache range of a plurality of preset terminals, and takes the terminal identifications of the preset terminals as the tree of the nodes, and the preset terminals comprise the first terminal; the target distribution tree is constructed by adopting the following modules: the data cache range acquisition module is configured to acquire the current data cache ranges of the preset terminals and terminal identification sets corresponding to the preset terminals; the first root node construction module is configured to acquire a first terminal identifier with the largest data caching range corresponding to the terminal identifier set as a root node of a first distribution tree; the size of the data cache range is positively correlated with the lower limit of the data cache range; the second terminal identification acquisition module is configured to sequentially acquire second terminal identifications from the terminal identification set, wherein the second terminal identifications are terminal identifications which are not added into the first distribution tree in the terminal identification set and have the largest corresponding data caching range; the target node searching module is configured to perform searching for target nodes, the data caching range of which meets a preset condition, in the first distribution tree, wherein the preset condition is that the data caching ranges corresponding to the second terminal identifiers are overlapped, and the upper limit of the data caching ranges is larger than that of the data caching ranges corresponding to the second terminal identifiers; a child node adding module configured to perform adding the second terminal identification as a child node of the target node to the first distribution tree if the target node is found; a target distribution tree determination module configured to perform, in a case where a terminal identification in the terminal identification set is added to the first distribution tree, the first distribution tree as the target distribution tree;
And the target terminal identification sending module is configured to send the target terminal identification to the first terminal, wherein the target terminal identification is used for indicating the first terminal to obtain target service data corresponding to the data distribution request from a target terminal corresponding to the target terminal identification.
13. The data distribution apparatus according to claim 12, wherein the target node search module comprises:
the current node searching unit is configured to search a current node from the first distribution tree, wherein the current node is a node with the largest data caching range corresponding to a node which is not searched;
and the target node determining unit is configured to execute taking the current node as the target node under the condition that the data cache range corresponding to the current node meets the preset condition.
14. The data distribution apparatus according to claim 13, wherein the target node determination unit includes:
A child node number determining unit configured to determine the number of child nodes of the current node if the data cache range corresponding to the current node meets the preset condition;
a target node determining subunit configured to perform taking the current node as the target node if the number of child nodes is smaller than a preset threshold.
15. The data distribution device of claim 14, wherein the device further comprises:
and the first jump module is configured to execute the step of jumping to the step of searching the current node from the first distribution tree under the condition that the number of the child nodes is not smaller than the preset threshold value.
16. The data distribution device of claim 13, wherein the device further comprises:
And the second jump module is configured to execute the step of jumping to the step of searching the current node from the first distribution tree under the condition that the data cache range corresponding to the current node does not meet the preset condition.
17. The data distribution device of claim 16, wherein the device further comprises:
And the second root node construction module is configured to construct a root node of a second distribution tree according to the second terminal identifier under the condition that no target node meeting the preset condition exists in the first distribution tree.
18. The data distribution apparatus according to claim 17, wherein the second terminal identifier is a terminal identifier with a largest data buffering range, which is not added to the corresponding terminal identifier of the first distribution tree or the second distribution tree;
The target node searching module is further configured to search target nodes, the data caching range of which meets the preset condition, in the first distribution tree and the second distribution tree;
The target distribution tree determination module is further configured to execute the first distribution tree and the second distribution tree as the target distribution tree in a case where a terminal identification in the terminal identification set is added to the first distribution tree or the second distribution tree.
19. The data distribution device of claim 13, wherein the device further comprises:
The first ordering module is configured to execute descending order ordering on the terminal identification sets according to the lower limit in the data cache range of the plurality of preset terminals to obtain an initial terminal identification sequence; the data caching ranges of the plurality of preset terminals are different;
The second ordering module is configured to perform descending order ordering on the terminal identifications in the initial terminal identification sequence according to the upper limit in the data cache range of the plurality of preset terminals to obtain a terminal identification sequence;
The first root node construction module includes:
a first terminal identification determining unit configured to perform sorting of a terminal identification, which is the foremost in the terminal identification sequence, as the first terminal identification;
And a root node construction unit configured to construct a root node of the first distribution tree according to the first terminal identification.
20. A data distribution apparatus according to any one of claims 12 to 19, wherein the apparatus further comprises:
a first target distribution tree updating module configured to perform updating of the target distribution tree based on the data cache range of the second terminal in case of updating of the data cache range of any one of the plurality of preset terminals;
The second terminal is a preset terminal for updating the data cache range in the plurality of preset terminals.
21. A data distribution apparatus according to any one of claims 12 to 19, wherein the apparatus further comprises:
And a second target distribution tree updating module configured to perform updating of the target distribution tree based on the data cache range of the new terminal when the data cache range of the new terminal transmitted by the new terminal is received.
22. A data distribution apparatus according to any one of claims 12 to 19, wherein the apparatus further comprises:
The cache range updating module is configured to execute deleting the data cache range of a third terminal in the data cache ranges of the preset terminals under the condition that the data cache range of any preset terminal in the plurality of preset terminals is out of date, so as to obtain an updated data cache range; the third terminal is a preset terminal with the data caching range being outdated;
a third target distribution tree updating module configured to perform updating of the target distribution tree based on the updated data cache range.
23. An electronic device, comprising:
A processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data distribution method of any of claims 1 to 11.
24. A computer readable storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the data distribution method of any one of claims 1 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210473058.2A CN115065636B (en) | 2022-04-29 | 2022-04-29 | Data distribution method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210473058.2A CN115065636B (en) | 2022-04-29 | 2022-04-29 | Data distribution method, device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115065636A CN115065636A (en) | 2022-09-16 |
CN115065636B true CN115065636B (en) | 2024-09-20 |
Family
ID=83197115
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210473058.2A Active CN115065636B (en) | 2022-04-29 | 2022-04-29 | Data distribution method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115065636B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112395339A (en) * | 2020-11-11 | 2021-02-23 | 苏宁云计算有限公司 | Method and device for checking data access between systems, computer equipment and storage medium |
CN113641869A (en) * | 2021-10-13 | 2021-11-12 | 北京大学 | Digital object access method and system in man-machine-object fusion environment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE202015104126U1 (en) * | 2015-08-06 | 2015-11-11 | CompuGroup Medical AG | Data processing system |
US10178027B2 (en) * | 2016-01-27 | 2019-01-08 | Oracle International Corporation | System and method for supporting inter subnet partitions in a high performance computing environment |
CN111798558A (en) * | 2020-06-02 | 2020-10-20 | 完美世界(北京)软件科技发展有限公司 | Data processing method and device |
CN114270353A (en) * | 2020-07-10 | 2022-04-01 | 华为技术有限公司 | Data processing method, device and storage medium |
CN113271359A (en) * | 2021-05-19 | 2021-08-17 | 北京百度网讯科技有限公司 | Method and device for refreshing cache data, electronic equipment and storage medium |
CN113703873A (en) * | 2021-09-03 | 2021-11-26 | 腾讯科技(深圳)有限公司 | Client cold start method, apparatus, medium, device, and program product |
-
2022
- 2022-04-29 CN CN202210473058.2A patent/CN115065636B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112395339A (en) * | 2020-11-11 | 2021-02-23 | 苏宁云计算有限公司 | Method and device for checking data access between systems, computer equipment and storage medium |
CN113641869A (en) * | 2021-10-13 | 2021-11-12 | 北京大学 | Digital object access method and system in man-machine-object fusion environment |
Also Published As
Publication number | Publication date |
---|---|
CN115065636A (en) | 2022-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11277498B2 (en) | Method, apparatus and system for processing data | |
CN107786621B (en) | User information management method, access processing method, device and system | |
CN108011929A (en) | Data request processing method, apparatus, computer equipment and storage medium | |
WO2017167121A1 (en) | Method and device for determining and applying association relationship between application programs | |
CN107451853B (en) | Method, device and system for real-time red packet distribution and storage medium | |
CN112121413B (en) | Response method, system, device, terminal and medium for function service | |
CN113590576A (en) | Database parameter adjusting method and device, storage medium and electronic equipment | |
CN110830604A (en) | DNS scheduling method and device | |
CN112351088A (en) | CDN cache method, device, computer equipment and storage medium | |
CN108154024B (en) | Data retrieval method and device and electronic equipment | |
CN111274004B (en) | Process instance management method and device and computer storage medium | |
CN111176715A (en) | Information calling method and server | |
CN115065636B (en) | Data distribution method, device, electronic equipment and storage medium | |
CN112035760B (en) | Task allocation method and computer equipment | |
CN111708844B (en) | Data processing method, device and equipment based on block chain | |
CN111782428B (en) | Data calling system and method | |
US9727655B2 (en) | Searching system, method and P2P device for P2P device community | |
CN114765612A (en) | Service access method and device | |
TW201837742A (en) | Data collection and storage system and method thereof | |
US20140108420A1 (en) | Index creation method and system | |
CN115297175A (en) | Data distribution method and device, electronic equipment and storage medium | |
CN109962948B (en) | P2P task processing method and device | |
CN103973750A (en) | User authentication system of cloud computing system | |
CN114157710B (en) | Communication policy configuration method, device, storage medium and equipment | |
CN115277610B (en) | Message split sending method, device, equipment and medium based on dual-activity environment |
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 | ||
GR01 | Patent grant |