Data distribution method, device, electronic device and storage medium

By constructing a target distribution tree and determining terminal identification, the data distribution path is optimized, which solves the problems of server bandwidth pressure and data transmission delay, and improves data distribution efficiency and business response speed.

CN115065636BActive Publication Date: 2024-09-20BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202210473058.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2024-09-20
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

In the existing technology, the data distribution method based on the client/server structure leads to problems such as high server bandwidth pressure, long data transmission delay, low data distribution efficiency, and resource waste.

Method used

By constructing a target distribution tree based on the data cache range of multiple preset terminals, the target terminal identification is determined and sent to the terminal to obtain data, optimizing the data distribution path, reducing server bandwidth pressure, and improving data distribution efficiency.

Benefits of technology

Effectively slow down data transmission delays, improve data distribution efficiency and business response speed, avoid resource waste, and improve the timeliness of data distribution and scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115065636B
    Figure CN115065636B
Patent Text Reader

Abstract

The present disclosure relates to a data distribution method, device, electronic device and storage medium, the method comprising: responding to a data distribution request of a first terminal, determining a target terminal identifier in a parent node corresponding to the first terminal based on a target distribution tree, the target distribution tree being a tree constructed based on a data cache range of a plurality of preset terminals, with the terminal identifiers of the plurality of preset terminals as nodes; the plurality of preset terminals including the first terminal; sending the target terminal identifier to the first terminal, the target terminal identifier being used to instruct the first terminal to obtain the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identifier. The embodiment of the present disclosure can be used to quickly locate a target terminal capable of distributing data to the first terminal, thereby effectively caching the bandwidth pressure of the server data distribution, greatly improving the timeliness and efficiency of data distribution scheduling, and thereby improving the response speed of the corresponding service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and in particular to a data distribution method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of Internet technology, the demand for various Internet-based business services is increasing, and large-scale business data distribution based on the Internet has become a severe challenge facing business services.

[0003] In the related technology, data distribution is often performed based on the client / server structure, that is, relevant business data is distributed to the client through the server; however, with the increase in client nodes and the increase in transmitted data traffic, huge bandwidth pressure is brought to the server, resulting in data transmission delays and low data distribution efficiency, which in turn also leads to slow business response speed and waste of resources caused by stacking a large number of machines on the server to bear the bandwidth pressure. Summary of the invention

[0004] The present disclosure provides a data distribution method, device, electronic device and storage medium to at least solve the problems of high server bandwidth pressure, data transmission delay, low data distribution efficiency, slow business response speed and resource waste in the related technology. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a data distribution method, comprising:

[0006] In response to a data distribution request of a first terminal, determining a target terminal identifier in a parent node corresponding to the first terminal based on a target distribution tree, wherein the target distribution tree is a tree constructed based on data cache ranges of a plurality of preset terminals and has terminal identifiers of the plurality of preset terminals as nodes, and the plurality of preset terminals include the first terminal;

[0007] The target terminal identifier is sent to the first terminal, where the target terminal identifier is used to instruct the first terminal to obtain the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identifier.

[0008] In an optional embodiment, current data cache ranges of the plurality of preset terminals and terminal identification sets corresponding to the plurality of preset terminals are acquired;

[0009] Acquire a first terminal identifier with the largest data cache range corresponding to the terminal identifier set as a root node of a first distribution tree;

[0010] sequentially acquiring second terminal identifiers from the terminal identifier set, where the second terminal identifiers are terminal identifiers that are not added to the first distribution tree in the terminal identifier set and whose corresponding data cache range is the largest;

[0011] In the first distribution tree, searching for a target node whose data cache range meets a preset condition, wherein the preset condition is that the data cache range corresponding to the second terminal identifier overlaps, and an upper limit of the data cache range is greater than an upper limit of the data cache range corresponding to the second terminal identifier;

[0012] When the target node is found, adding the second terminal identifier as a child node of the target node to the first distribution tree;

[0013] When the terminal identifiers in the terminal identifier set are added to the first distribution tree, the first distribution tree is used as the target distribution tree.

[0014] In an optional embodiment, searching, in the first distribution tree, for a target node whose data cache range satisfies a preset condition comprises:

[0015] Searching for a current node from the first distribution tree, where the current node is a node with the largest corresponding data cache range among the nodes that have not been searched;

[0016] When the data cache range corresponding to the current node meets the preset condition, the current node is used as the target node.

[0017] In an optional embodiment, when the data cache range corresponding to the current node satisfies the preset condition, taking the current node as the target node includes:

[0018] When the data cache range corresponding to the current node meets the preset condition, determining the number of child nodes of the current node;

[0019] When the number of child nodes is less than a preset threshold, the current node is used as the target node.

[0020] In an optional embodiment, the method further includes:

[0021] When the number of child nodes is not less than the preset threshold, the process jumps to the step of searching the first distribution tree for the current node.

[0022] In an optional embodiment, the method further includes:

[0023] When the data cache range corresponding to the current node does not satisfy the preset condition, the process jumps to the step of searching the first distribution tree for the current node.

[0024] In an optional embodiment, the method further includes:

[0025] When there is no target node satisfying the preset condition in the first distribution tree, a root node of a second distribution tree is constructed according to the second terminal identifier.

[0026] In an optional embodiment, the second terminal identifier is a terminal identifier having the largest corresponding data cache range among the terminal identifiers that have not joined the first distribution tree or the second distribution tree;

[0027] In the first distribution tree, searching for a target node whose data cache range meets a preset condition includes:

[0028] In the first distribution tree and the second distribution tree, searching for a target node whose data cache range satisfies the preset condition;

[0029] In the case where the terminal identifier in the terminal identifier set is added to the first distribution tree, taking the first distribution tree as the target distribution tree comprises:

[0030] When the terminal identifiers in the terminal identifier set are added to the first distribution tree or the second distribution tree, the first distribution tree and the second distribution tree are used as the target distribution trees.

[0031] In an optional embodiment, the method further includes:

[0032] According to the lower limits of the data cache ranges of the plurality of preset terminals, the terminal identification set is sorted in descending order to obtain an initial terminal identification sequence;

[0033] According to the upper limits of the data cache ranges of the plurality of preset terminals, the terminal identifiers in the initial terminal identifier sequence are sorted in descending order to obtain a terminal identifier sequence;

[0034] The step of obtaining the first terminal identifier with the largest data cache range corresponding to the terminal identifier set as the root node of the first distribution tree includes:

[0035] The terminal identifier that is sorted first in the terminal identifier sequence is used as the first terminal identifier;

[0036] A root node of the first distribution tree is constructed according to the first terminal identifier.

[0037] In an optional embodiment, the method further includes:

[0038] When the data cache range of any preset terminal among the plurality of preset terminals is updated, updating the target distribution tree based on the data cache range of the second terminal;

[0039] The second terminal is a preset terminal whose data cache range is updated among the multiple preset terminals.

[0040] In an optional embodiment, the method further includes:

[0041] When the data cache range of the newly added terminal is received, the target distribution tree is updated based on the data cache range of the newly added terminal.

[0042] In an optional embodiment, the method further includes:

[0043] When the data cache range of any preset terminal among the multiple preset terminals expires, deleting the data cache range of a third terminal among the data cache ranges of the multiple preset terminals to obtain an updated data cache range; the third terminal is the preset terminal whose data cache range expires;

[0044] Based on the update data cache range, the target distribution tree is updated.

[0045] a target terminal identification determination module, configured to execute, in response to a data distribution request of a first terminal, determining, based on a target distribution tree, a target terminal identification in a parent node corresponding to the first terminal, wherein the target distribution tree is constructed based on data cache ranges of a plurality of preset terminals and has terminal identifications of the plurality of preset terminals as nodes, wherein the plurality of preset terminals include the first terminal;

[0046] 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 to instruct the first terminal to obtain the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identification.

[0047] According to a second aspect of an embodiment of the present disclosure, there is provided a data distribution device, including:

[0048] a target terminal identification determination module, configured to execute, in response to a data distribution request of a first terminal, determining, based on a target distribution tree, a target terminal identification in a parent node corresponding to the first terminal, wherein the target distribution tree is constructed based on data cache ranges of a plurality of preset terminals and has terminal identifications of the plurality of preset terminals as nodes, wherein the plurality of preset terminals include the first terminal;

[0049] 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 to instruct the first terminal to obtain the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identification.

[0050] In an optional embodiment, the device further comprises:

[0051] A data cache range acquisition module, configured to execute acquisition of data cache ranges of the plurality of preset terminals and terminal identification sets corresponding to the plurality of preset terminals;

[0052] A first root node building module is configured to execute acquisition of a first terminal identifier with the largest data cache range corresponding to the terminal identifier set as a root node of a first distribution tree;

[0053] A second terminal identification acquisition module is configured to sequentially acquire second terminal identifications from the terminal identification set, where the second terminal identifications are terminal identifications that are not added to the first distribution tree in the terminal identification set and whose corresponding data cache range is the largest;

[0054] a target node search module configured to execute in the first distribution tree, and search for a target node whose data cache range meets a preset condition, wherein the preset condition is that there is an overlap between the data cache range corresponding to the second terminal identifier, and an upper limit of the data cache range is greater than an upper limit of the data cache range corresponding to the second terminal identifier;

[0055] a child node adding module, configured to add the second terminal identifier as a child node of the target node to the first distribution tree when the target node is found;

[0056] The target distribution tree determination module is configured to execute, when a terminal identifier in the terminal identifier set is added to the first distribution tree, taking the first distribution tree as the target distribution tree.

[0057] In an optional embodiment, the target node search module includes:

[0058] A current node search unit is configured to search for a current node from the first distribution tree, where the current node is a node with the largest corresponding data cache range among the nodes that have not been searched;

[0059] The target node determination unit is configured to execute, when the data cache range corresponding to the current node meets the preset condition, taking the current node as the target node.

[0060] In an optional embodiment, the target node determination unit includes:

[0061] A subnode number determination unit, configured to determine the number of subnodes of the current node when the data cache range corresponding to the current node meets the preset condition;

[0062] The target node determination subunit is configured to execute, when the number of the child nodes is less than a preset threshold, taking the current node as the target node.

[0063] In an optional embodiment, the device further comprises:

[0064] The first jump module is configured to execute, when the number of the child nodes is not less than the preset threshold, the step of jumping to the step of searching the first distribution tree for the current node.

[0065] In an optional embodiment, the device further comprises:

[0066] The second jump module is configured to construct a root node of a second distribution tree according to the second terminal identifier when there is no target node satisfying the preset condition in the first distribution tree.

[0067] In an optional embodiment, the device further comprises:

[0068] The second root node construction module is configured to execute, when there is no target node satisfying the preset condition in the first distribution tree, construction of a root node of the second distribution tree according to the second terminal identifier.

[0069] In an optional embodiment, the second terminal identifier is a terminal identifier having the largest corresponding data cache range among the terminal identifiers that have not joined the first distribution tree or the second distribution tree;

[0070] The target node search module is further configured to execute in the first distribution tree and the second distribution tree, searching for a target node whose data cache range satisfies the preset condition;

[0071] The target distribution tree module is further configured to execute, when a terminal identifier in the terminal identifier set is added 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.

[0072] In an optional embodiment, the device further comprises:

[0073] A first sorting module is configured to perform descending sorting of the terminal identification set according to a lower limit of the data cache range of the plurality of preset terminals to obtain an initial terminal identification sequence;

[0074] A second sorting module is configured to perform descending sorting of the terminal identifiers in the initial terminal identifier sequence according to the upper limits of the data cache ranges of the plurality of preset terminals to obtain a terminal identifier sequence;

[0075] The first root node construction module includes:

[0076] A first terminal identification determination unit is configured to execute the first terminal identification in the terminal identification sequence as the first terminal identification;

[0077] The root node construction unit is configured to construct a root node of the first distribution tree according to the first terminal identifier.

[0078] In an optional embodiment, the device further comprises:

[0079] A first target distribution tree updating module is configured to update the target distribution tree based on the data cache range of the second terminal when the data cache range of any preset terminal among the plurality of preset terminals is updated;

[0080] The second terminal is a preset terminal whose data cache range is updated among the multiple preset terminals.

[0081] In an optional embodiment, the device further comprises:

[0082] The second target distribution tree updating module is configured to update the target distribution tree based on the data cache range of the newly added terminal when receiving the data cache range of the newly added terminal sent by the newly added terminal.

[0083] In an optional embodiment, the device further comprises:

[0084] a cache range updating module configured to execute, when a data cache range of any preset terminal among the plurality of preset terminals expires, deleting a data cache range of a third terminal among the data cache ranges of the plurality of preset terminals to obtain an updated data cache range; the third terminal is the preset terminal whose data cache range expires;

[0085] The third target distribution tree updating module is configured to update the target distribution tree based on the update data cache range.

[0086] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method as described in any one of the above-mentioned first aspects.

[0087] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any method described in the first aspect of the embodiment of the present disclosure.

[0088] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any one of the methods described in the first aspect of the embodiment of the present disclosure.

[0089] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0090] During the data distribution process, in combination with a target distribution tree constructed based on the data cache range of multiple preset terminals and with the terminal identifiers of multiple preset terminals as nodes, the target terminal identifier of the target terminal that can distribute data to the first terminal currently requesting data can be quickly located, thereby alleviating the bandwidth pressure of server data distribution while effectively avoiding the waste of resources caused by bandwidth pressure, greatly improving the timeliness of data distribution scheduling, and effectively reducing data transmission delays, improving data distribution efficiency, and thus also improving the response speed of corresponding services.

[0091] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0093] Figure 1 is a schematic diagram of a data distribution system according to an exemplary embodiment;

[0094] Figure 2 is a flow chart of a data distribution method according to an exemplary embodiment;

[0095] Figure 3 is a flowchart showing a method of constructing a target distribution tree according to an exemplary embodiment;

[0096] Figure 4 is a schematic diagram of a data cache range of multiple preset terminals provided according to an exemplary embodiment;

[0097] Figure 5 It is a flowchart showing a method of using a current traversal identifier as 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 exemplary embodiment;

[0098] Figure 6 is a schematic diagram of constructing a target distribution tree according to an exemplary embodiment;

[0099] Figure 7 is a schematic diagram of a target distribution tree before and after updating according to an exemplary embodiment;

[0100] Figure 8 is a block diagram of a data distribution device according to an exemplary embodiment;

[0101] Fig. 9 is a block diagram of an electronic device for data distribution according to an exemplary embodiment;

[0102] Fig.10 It is a block diagram of an electronic device for data distribution according to an exemplary embodiment. DETAILED DESCRIPTION

[0103] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0104] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0105] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0106] See also Figure 1 , Figure 1 is a schematic diagram of a data distribution system according to an exemplary embodiment. Figure 1 As shown, the data distribution system may include multiple terminals 100 and a server 200 .

[0107] In a specific embodiment, multiple terminals 100 can be clients that provide business services to users. Optionally, the terminal can include but is not limited to electronic devices such as smart phones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc., and can also be software running on the above electronic devices, such as applications. Optionally, the operating system running on the electronic device can include but is not limited to Android system, IOS system, Linux, Windows, etc.

[0108] In an optional embodiment, the server 200 may provide background services for multiple terminals 100. Specifically, the server 200 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0109] In addition, it should be noted that Figure 1 What is shown is only one application environment provided by the present disclosure. In actual application, other application environments may also be included, for example, more terminals may be included.

[0110] In the embodiments of this specification, the above-mentioned multiple terminals 100 and the server 200 may be directly or indirectly connected via wired or wireless communication, which is not limited in this disclosure.

[0111] Figure 2 is a flow chart of a data distribution method according to an exemplary embodiment. Figure 2 As shown, the data distribution method can be applied to a server, and includes the following steps.

[0112] In step S201, in response to a data distribution request of a first terminal, a target terminal identifier in a parent node corresponding to the first terminal is determined based on a target distribution tree.

[0113] In a specific embodiment, the target distribution tree can be constructed based on the data cache ranges of multiple preset terminals, with the terminal identifiers of multiple preset terminals as nodes; and the hierarchical relationship between the nodes in the target distribution tree can represent the data distribution relationship between the preset terminals corresponding to the nodes. Specifically, the data cache range corresponding to any parent node in the target distribution tree overlaps with the data cache range corresponding to the child node of the parent node, and the upper limit of the data cache range corresponding to the parent node is greater than the upper limit of the data cache range corresponding to the child node of the parent node, thereby ensuring that the terminal corresponding to the parent node includes the data that the terminal corresponding to the child node needs to request. Optionally, the target distribution tree can include one or more distribution trees.

[0114] In an optional embodiment, any node except the root node in the target distribution tree corresponds to a parent node, thereby effectively ensuring load balancing of the terminal and improving the stability and reliability of the entire distribution system.

[0115] In a specific embodiment, the plurality of preset terminals include a first terminal; the first terminal may be a terminal currently requesting data from the server. The plurality of preset terminals may be multiple terminals requesting the same data from the server. Optionally, the data in the server may be different depending on the actual business scenario. For example, in a model transmission scenario, the data in the server may be a model; in a streaming media transmission scenario, the data in the server may be streaming media.

[0116] In actual applications, due to the limited cache capacity of each terminal, it is impossible to cache all the data required from the server locally at one time. Accordingly, data can be requested from the server in batches, and when the data in the cache exceeds the cache capacity, the historical cache data in the cache can be overwritten based on the new data obtained from the server. Accordingly, the data cache range of any of the above-mentioned preset terminals can be the range corresponding to the data stored in the cache (the cache of the preset terminal) at the current time. Specifically, the terminal can request data in sequence according to the time when the data is stored in the server; optionally, the data can be identified in combination with the time when the data is stored in the server, and accordingly, the above-mentioned data cache range can be the timestamp (the time when the data is stored in the server) interval corresponding to the data stored in the cache at the current time; optionally, a preset character can be set in combination with the time when the data is stored in the server to identify the data, and optionally, the numerical value of the preset character is positively correlated with the time sequence, for example, 0001, 0002, 0003, etc. in order from the first to the last time, and accordingly, the above-mentioned data cache range can be the character interval corresponding to the data stored in the cache at the current time.

[0117] In a specific embodiment, the preset terminal may report the data cache range to the server after a certain interval or after obtaining data from the server a certain number of times. Accordingly, the above current time may be the time when the preset terminal reports the data cache range to the server.

[0118] In a specific embodiment, the data distribution request may include the terminal identifier of the first terminal. Accordingly, the server may determine the parent node corresponding to the first terminal from the target distribution tree in combination with the terminal identifier of the first terminal, and use the terminal identifier in the parent node as the target terminal identifier.

[0119] In an optional embodiment, the above method may further include: a step of constructing a target distribution tree, such as Figure 3As shown, the steps of constructing the target distribution tree may include:

[0120] In step S301, data cache ranges of multiple preset terminals and terminal identification sets corresponding to the multiple preset terminals are obtained.

[0121] In a specific embodiment, when the data cache range in the server is updated, the server may reconstruct the target distribution tree in combination with the updated data cache range. The terminal identification set may include terminal identifications of respective multiple preset terminals.

[0122] In step S303, the first terminal identifier corresponding to the largest data cache range in the terminal identifier set is obtained as the root node of the first distribution tree.

[0123] In a specific embodiment, the size of the data cache range can be determined in combination with the upper and lower limits of the data cache range. Specifically, the larger the lower limit, the larger the data cache range; in the case of the same lower limit, the larger the corresponding upper limit, the larger the data cache range. Optionally, the terminal identifiers in the terminal identifier set can be sorted in combination with the data cache range, and the first terminal identifier can be determined in combination with the sorted terminal identifier sequence. Accordingly, the above method can also include:

[0124] According to the lower limits of the data cache ranges of the plurality of preset terminals, the terminal identification set is sorted in descending order to obtain an initial terminal identification sequence;

[0125] According to upper limits of data cache ranges of multiple preset terminals, the terminal identifiers in the initial terminal identifier sequence are sorted in descending order to obtain a terminal identifier sequence;

[0126] Correspondingly, the above-mentioned acquisition of the first terminal identifier with the largest data cache range in the terminal identifier set as the root node of the first distribution tree may include: taking the terminal identifier sorted first in the terminal identifier sequence as the first terminal identifier; and constructing the root node of the first distribution tree according to the first terminal identifier.

[0127] In actual applications, due to the differences in data reading capabilities and cache capacities of different preset terminals, the data cache ranges of different preset terminals are often different; optionally, the terminal identifiers in the terminal identifier set can be sorted in descending order based on the lower limits of the data cache ranges of multiple preset terminals to obtain an initial terminal identifier sequence; then, the terminal identifiers in the initial terminal identifier sequence can be sorted in descending order based on the upper limits of the data cache ranges of multiple preset terminals to obtain a terminal identifier sequence, and the terminal identifiers of preset terminals with faster cache progress can be placed in front, and the terminal identifiers corresponding to the same upper limit can also be sorted in combination with the corresponding lower limit.

[0128] In a specific embodiment, the terminal identifier that is ranked first in the above terminal identifier sequence may be the terminal identifier with the largest corresponding data cache range (i.e., the first terminal identifier). Optionally, the terminal identifier set may also be sorted in ascending order in combination with the upper and lower limits of the data cache range of multiple preset terminals, and accordingly, the terminal identifier that is ranked last in the terminal identifier sequence corresponding to the ascending order may be the terminal identifier with the largest corresponding data cache range.

[0129] In a specific embodiment, Figure 4 As shown, Figure 4 The invention is a schematic diagram of data cache ranges of multiple preset terminals according to an exemplary embodiment. Specifically, the terminal identifications in the terminal identification set may include C1, C2, C3, C4, C5, C6, C7 and C8, and the range corresponding to the data that multiple preset terminals need to obtain from the server is 0-100, wherein the data cache range corresponding to C1 is 70-100 (where 70 is the lower limit and 100 is the upper limit); the data cache range corresponding to C2 is 40-90; the data cache range corresponding to C3 is 36-60; the data cache range corresponding to C4 is 32-55; the data cache range corresponding to C5 is 27-50; the data cache range corresponding to C6 is 20-45; the data cache range corresponding to C7 is 12-21; the data cache range corresponding to C8 is 0-15; accordingly, after combining the lower limit and upper limit of the data cache range corresponding to C1, C2, C3, C4, C5, C6, C7 and C8 and sorting them in descending order, a terminal identification sequence can be obtained: C1, C2, C3, C4, C5, C6, C7, C8.

[0130] In the above embodiment, the lower limits and upper limits in the data cache range of multiple preset terminals are combined successively to sort the terminal identification sets corresponding to the multiple preset terminals in descending order. The terminal identifications corresponding to the same upper limit can be sorted in combination with the corresponding lower limit, and the terminal identifications can be sorted according to the data cache progress, which is convenient for the subsequent construction of the target distribution tree according to the data cache progress, greatly improving the rationality and effectiveness of the constructed target distribution tree, and thus improving the data distribution efficiency.

[0131] In step S305, second terminal identifiers are sequentially acquired from the terminal identifier set.

[0132] In a specific embodiment, the second terminal identifier may be a terminal identifier in the terminal identifier set that is not added to the first distribution tree and has the largest corresponding data cache range. Specifically, in combination with the data cache range, the terminal identifier with the largest corresponding data cache range may be obtained from the terminal identifiers that are not added to the first distribution tree in sequence as the currently obtained second terminal identifier.

[0133] In a specific embodiment, the second terminal identifier may be acquired from the terminal identifier set in sequence in combination with the sorting information of the multiple terminal identifiers in the terminal identifier sequence.

[0134] In step S307, in the first distribution tree, a target node whose data cache range meets a preset condition is searched.

[0135] In a specific embodiment, the preset condition may be that there is overlap between the data cache ranges corresponding to the second terminal identifier, and the upper limit of the data cache range is greater than the upper limit of the data cache range corresponding to the second terminal identifier.

[0136] In an optional embodiment, if Figure 5 As shown, in the first distribution tree, searching for a target node whose data cache range meets a preset condition may include the following steps:

[0137] In step S3071, the current node is searched from the first distribution tree.

[0138] In a specific embodiment, the current node may be a node with the largest corresponding data cache range among the nodes that have not been searched.

[0139] In step S3073, when the data cache range corresponding to the current node meets the preset conditions, the current node is used as the target node.

[0140] In a specific embodiment, the overlap of the data cache range corresponding to the current node and the second terminal identifier, as well as the upper limit, can be compared. Optionally, if there is an overlap between the data cache range 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, it can be determined that the data cache range corresponding to the current node meets the preset conditions. Specifically, if the data cache range corresponding to the current node meets the preset conditions, it can be determined whether the terminal corresponding to the current node includes the data that the terminal corresponding to the current traversal identifier needs to request.

[0141] In the above embodiment, in combination with the data cache range, the current node is searched from the first distribution tree, so that the child nodes can be mounted according to the cache progress from fast to slow, and when the data cache range corresponding to the current node meets the preset conditions, the current node is used as the target node that can be mounted by the second terminal identifier, which can ensure that the terminal corresponding to the parent node includes the data that the terminal corresponding to the child node needs to request, thereby improving the effectiveness and reliability of data distribution scheduling based on the distribution tree.

[0142] In an optional embodiment, in order to better improve the load balancing of the data distribution system, when the data cache range corresponding to the current node meets the preset conditions, taking the current node as the target node may include:

[0143] When the data cache range corresponding to the current node meets the preset conditions, determine the number of child nodes of the current node;

[0144] When the number of child nodes is less than a preset threshold, the current node is used as the target node.

[0145] In a specific embodiment, the preset threshold value may be the upper limit of the number of child nodes that can be mounted on the node. Specifically, the number of child nodes of the current node may be the number of child nodes that have been mounted on the current node. Accordingly, when the number of child nodes of the current node is less than the preset threshold value, it can be determined that the number of nodes that have been mounted on the current node has not reached the upper limit, and accordingly, the current node can be used as the target node.

[0146] In an optional embodiment, the above method may further include:

[0147] When the number of child nodes is not less than the preset threshold, the process jumps to the step of searching the current node from the first distribution tree.

[0148] In a specific embodiment, when the number of child nodes is not less than a preset threshold, it can be determined that the number of child nodes that can be mounted on the current node has reached the upper limit, and the current node can be re-determined from the first distribution tree.

[0149] In the above embodiment, in the process of determining the target node that the node corresponding to the second terminal identifier needs to mount, combined with the judgment of whether the number of child nodes of the current node is greater than the preset threshold, it is possible to ensure that the terminal corresponding to the parent node includes the data that the terminal corresponding to the child node needs to request, thereby ensuring the load balancing of the terminal and avoiding the problem of excessive terminal load caused by one terminal distributing data to multiple downstream terminals, thereby better improving the load balancing and data distribution efficiency of the entire data distribution system.

[0150] In an optional embodiment, the above method may further include:

[0151] When the data cache range corresponding to the current node does not meet the preset condition, the process jumps to the step of searching the current node from the first distribution tree.

[0152] In a specific embodiment, when the data cache range corresponding to the current node does not meet the preset conditions, it can 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 accordingly, the current node can be re-determined from the first distribution tree.

[0153] In the above embodiment, when the data cache range corresponding to the current node does not meet the preset conditions, the current node is re-determined from the first distribution tree, which can effectively ensure that the terminal corresponding to the parent node includes the data that the terminal corresponding to the child node needs to request, thereby improving the effectiveness and reliability of data distribution scheduling based on the distribution tree.

[0154] In step S309, when the target node is found, the second terminal identifier is added to the first distribution tree as a child node of the target node.

[0155] In a specific embodiment, when a target node that satisfies a preset jump-to is found in the first distribution tree with a corresponding data cache range, the currently acquired second terminal identifier may be added to the first distribution tree as a child node of the target node.

[0156] In step S311, when the terminal identifier in the terminal identifier set is added to the first distribution tree, the first distribution tree is used as the target distribution tree.

[0157] In a specific embodiment, when the target node corresponding to the second terminal identifier obtained in sequence is found, the second terminal identifier obtained in sequence can be added to the first distribution data with the first terminal identifier as the root node. Accordingly, when the terminal identifier in the terminal identifier set is added to the first distribution tree, the first distribution tree can be used as the target distribution tree.

[0158] In a specific embodiment, in combination with the example in which the terminal identification set includes C1, C2, C3, C4, C5, C6, C7 and C8, as shown in FIG. Figure 6 As shown, Figure 6It is a schematic diagram of constructing a target distribution tree according to an exemplary embodiment. Specifically, the data cache range corresponding to the terminal identifier can first construct the first distribution tree with C1 as the root node, and then C2 can be used as the currently acquired second terminal identifier, and the node corresponding to C1 in the first distribution tree is used as the current node; further, combined with the data cache range [40,90] corresponding to C2 and the data cache range [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; accordingly, the child node of the node corresponding to C1 can be constructed based on C2; further, C3 can be used as the currently acquired second terminal identifier, and the node corresponding to C1 in the first distribution tree is used as the current node; further, combined with the data cache range [36,60] corresponding to C3 and the data cache range [36,60] corresponding to C1, According to the cache range [70,100], it can 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 overlap). Accordingly, the node corresponding to C2 in the first distribution tree can be used as the current node, and combined with the data cache range [36,60] corresponding to C3 and the data cache range [40,90] corresponding to C2, it can be determined that the node corresponding to C2 can be used as the target node of the node corresponding to C3; accordingly, the child node of the node corresponding to C2 can be constructed based on C3; and the currently acquired second terminal identifier is updated in sequence until the node corresponding to C8 is added to the first distribution tree. Accordingly, the first distribution tree including the node corresponding to C8 is used as the target distribution tree. Specifically, combined with Figure 6 It can be seen that the tree structure corresponding to the dotted box can be a distribution tree, and the terminal corresponding to the root node can request data from the server.

[0159] In the above embodiment, the data cache range sizes of multiple preset terminals are combined to construct a target distribution tree that can characterize the data distribution relationship between multiple preset terminals. This can effectively ensure that the terminal corresponding to the parent node in the target distribution tree includes the data that the terminal corresponding to the child node needs to request, thereby greatly improving the data distribution efficiency while reducing the server data distribution bandwidth pressure.

[0160] In an optional embodiment, the above method may further include:

[0161] When there is no target node satisfying the preset condition in the first distribution tree, a root node of the second distribution tree is constructed according to the second terminal identifier.

[0162] In a specific embodiment, if the target node whose corresponding data cache range meets the preset conditions is not found in the first distribution tree, a distribution tree (second distribution tree) can be constructed with the currently acquired second terminal identifier as the root node. Optionally, in the case of constructing the second distribution tree, the second terminal identifier can be the terminal identifier with the largest corresponding data cache range among the terminal identifiers that are not added to the first distribution tree or the second distribution tree;

[0163] The above-mentioned searching for a target node whose data cache range satisfies a preset condition in the first distribution tree may include: searching for a target node whose data cache range satisfies a preset condition in the first distribution tree and the second distribution tree;

[0164] In the case where the terminal identifier in the terminal identifier set is added to the first distribution tree, taking the first distribution tree as the target distribution tree may include: in the case where the terminal identifier in the terminal identifier set is added 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.

[0165] Optionally, if during the construction of the target distribution tree, the target node corresponding to the second terminal identifier that is not added to the first distribution tree or the second distribution tree and has the largest corresponding data cache range cannot be found from the first distribution tree and the second distribution tree, a new distribution tree can be constructed in combination with the second terminal identifier, and in the subsequent distribution tree node mounting process, the second terminal identifier can be acquired and the target node can be searched in combination with the newly constructed distribution tree until the last second terminal identifier is acquired and added to the constructed distribution tree, and the constructed distribution tree is used as the target distribution tree.

[0166] In the above embodiment, when there is no target node that meets the preset conditions in the first distribution tree, the distribution tree is rebuilt in combination with the currently acquired second terminal identifier, which can effectively ensure that the terminal corresponding to the constructed parent node includes the data that the terminal corresponding to the child node needs to request, thereby improving the effectiveness and reliability of data distribution scheduling based on the distribution tree; and in the subsequent distribution tree node mounting process, the acquisition of the second terminal identifier and the search for the target node in combination with the newly constructed distribution tree can better improve the effectiveness of the target distribution tree finally obtained.

[0167] In step S203, the target terminal identifier is sent to the first terminal.

[0168] In a specific embodiment, the target terminal identifier may be used to instruct the first terminal to obtain the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identifier. Specifically, the target service data may be the data requested by the data distribution request.

[0169] In a specific embodiment, when the first terminal receives the target terminal identifier, it may request the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identifier.

[0170] In an optional embodiment, the above method may further include:

[0171] When the data cache range of any preset terminal among the plurality of preset terminals is updated, updating the target distribution tree based on the data cache range of the second terminal;

[0172] In a specific embodiment, the second terminal is a preset terminal whose data cache range is updated among multiple preset terminals. Specifically, when the second terminal re-uploads the data cache range, the data cache range of the second terminal among the data cache ranges of multiple preset terminals stored in the server can be updated to the re-uploaded data cache range, and the target distribution tree can be rebuilt in combination with the updated data cache ranges of the multiple preset terminals.

[0173] Specifically, the detailed details of reconstructing the target distribution tree in combination with the updated data cache ranges of the multiple preset terminals can be referred to the above-mentioned steps of constructing the target distribution tree in combination with the data cache ranges of the multiple preset terminals, which will not be repeated here.

[0174] In a specific embodiment, the terminal identifiers of the above-mentioned multiple preset terminals include examples of C1, C2, C3, C4, C5, C6, C7 and C8, such as Figure 7 As shown, Figure 7 is a schematic diagram of a target distribution tree before and after updating 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 in combination with the updated data cache ranges of multiple preset terminals. Accordingly, the target distribution tree is Figure 7 a is updated to Figure 7 b.

[0175] In the above embodiment, when the data cache range of any preset terminal among multiple preset terminals is updated, the target distribution tree can be updated in combination with the updated data cache range, thereby realizing dynamic adjustment of the target distribution tree, thereby greatly improving the effectiveness and reliability of data distribution scheduling while improving data distribution efficiency.

[0176] In an optional embodiment, the above method may further include:

[0177] When the data cache range of the newly added terminal is received from the newly added terminal, the target distribution tree is updated based on the data cache range of the newly added terminal.

[0178] In a specific embodiment, the newly added terminal can be a newly added terminal. Specifically, when a terminal uploads a data cache range, if the terminal identifier of the terminal is not in the terminal identifier of the preset terminal in the data cache range stored in the server, it can be determined that the terminal is a newly added terminal. Accordingly, the data cache range of the newly added terminal can be added to the data cache range of multiple preset terminals to implement the update of the data cache range in the server. Accordingly, the target distribution tree can be rebuilt in combination with the updated data cache range.

[0179] Specifically, the detailed details of reconstructing the target distribution tree in combination with the updated data cache range can refer to the detailed steps of constructing the target distribution tree in combination with the data cache ranges of multiple preset terminals, which will not be repeated here.

[0180] In the above embodiment, when the data cache range of the newly added terminal is received from the newly added terminal, the target distribution tree can be updated in combination with the data cache range of the newly added terminal, thereby realizing dynamic adjustment of the target distribution tree, thereby greatly improving the effectiveness and reliability of data distribution scheduling while improving data distribution efficiency.

[0181] In an optional embodiment, the above method may further include:

[0182] When the data cache range of any preset terminal among the multiple preset terminals expires, deleting the data cache range of a third terminal among the data cache ranges of the multiple preset terminals to obtain an updated data cache range;

[0183] Update the target distribution tree based on the updated data cache range.

[0184] In a specific embodiment, the third terminal is a preset terminal whose data cache range has expired; optionally, the server may store the update time of the data cache range of each preset terminal. If the data cache range of a preset terminal has not been updated for more than a preset period of time, it can be determined that the data cache range of the preset terminal has expired. Accordingly, the data cache range of the preset terminal can be deleted to implement the update of the data cache range in the server.

[0185] In the above embodiment, when the data cache range of any preset terminal among multiple preset terminals expires, the data cache range can be updated by deleting the expired data cache range, and then the target distribution tree can be dynamically adjusted in combination with the updated data cache range, thereby greatly improving the effectiveness and reliability of data distribution scheduling while improving data distribution efficiency.

[0186] In an optional embodiment, if the node whose terminal identifier is the first terminal in the target distribution tree is a root node, the corresponding server may directly send the target service data to the first terminal.

[0187] It can be seen from the technical solutions provided in the above embodiments of this specification that, during the data distribution process, this specification, in combination with a target distribution tree constructed based on the data cache range of multiple preset terminals and with the terminal identifiers of multiple preset terminals as nodes, can quickly locate the target terminal identifier of the target terminal that can distribute data to the first terminal currently requesting data, thereby alleviating the bandwidth pressure of server data distribution while effectively avoiding the waste of resources caused by bandwidth pressure, greatly improving the timeliness of data distribution scheduling, and effectively reducing data transmission delays, improving data distribution efficiency, and thereby also improving the response speed of corresponding services.

[0188] Figure 8 FIG. 1 is a block diagram of a data distribution device according to an exemplary embodiment. Figure 8 , the device comprises:

[0189] The target terminal identification determination module 810 is configured to execute, in response to the data distribution request of the first terminal, determining the target terminal identification in the parent node corresponding to the first terminal based on the target distribution tree, wherein the target distribution tree is constructed based on the data cache range of multiple preset terminals and has the terminal identifications of the multiple preset terminals as nodes, and the multiple preset terminals include the first terminal;

[0190] The target terminal identifier sending module 820 is configured to send the target terminal identifier to the first terminal, where the target terminal identifier is used to instruct the first terminal to obtain the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identifier.

[0191] In an optional embodiment, the above device further includes:

[0192] A data cache range acquisition module is configured to execute acquisition of data cache ranges of multiple preset terminals and terminal identification sets corresponding to the multiple preset terminals;

[0193] A first root node construction module is configured to execute acquisition of a first terminal identifier with the largest data cache range corresponding to the terminal identifier set as a root node of the first distribution tree;

[0194] A second terminal identification acquisition module is configured to sequentially acquire second terminal identifications from the terminal identification set, where the second terminal identifications are terminal identifications that are not added to the first distribution tree in the terminal identification set and whose corresponding data cache range is the largest;

[0195] a target node search module configured to execute in the first distribution tree, and search for a target node whose data cache range meets a preset condition, wherein the preset condition is that there is an overlap between the data cache ranges corresponding to the second terminal identifier, and an upper limit of the data cache range is greater than an upper limit of the data cache range corresponding to the second terminal identifier;

[0196] A child node adding module is configured to add the second terminal identifier as a child node of the target node to the first distribution tree when the target node is found;

[0197] The target distribution tree determination module is configured to execute, when the terminal identifier in the terminal identifier set is added to the first distribution tree, taking the first distribution tree as the target distribution tree.

[0198] In an optional embodiment, the target node search module includes:

[0199] A current node search unit is configured to search for a current node from the first distribution tree, where the current node is a node with the largest corresponding data cache range among the nodes that have not been searched;

[0200] The target node determination unit is configured to take the current node as the target node when the data cache range corresponding to the current node meets a preset condition.

[0201] In an optional embodiment, the target node determination unit includes:

[0202] A subnode number determination unit is configured to determine the number of subnodes of the current node when a data cache range corresponding to the current node meets a preset condition;

[0203] The target node determination subunit is configured to take the current node as the target node when the number of child nodes is less than a preset threshold.

[0204] In an optional embodiment, the above device further includes:

[0205] The first jump module is configured to execute the step of jumping to searching the current node from the first distribution tree when the number of child nodes is not less than a preset threshold.

[0206] In an optional embodiment, the above device further includes:

[0207] The second jump module is configured to construct a root node of the second distribution tree according to the second terminal identifier when there is no target node that meets the preset condition in the first distribution tree.

[0208] In an optional embodiment, the above device further includes:

[0209] The second root node construction module is configured to execute, when there is no target node satisfying a preset condition in the first distribution tree, to construct a root node of the second distribution tree according to the second terminal identifier.

[0210] In an optional embodiment, the second terminal identifier is a terminal identifier having the largest corresponding data cache range among the terminal identifiers that are not added to the first distribution tree or the second distribution tree;

[0211] The target node search module is further configured to execute in the first distribution tree and the second distribution tree, searching for a target node whose data cache range meets a preset condition;

[0212] The target distribution tree module is further configured to execute, when the terminal identifier in the terminal identifier set is added to the first distribution tree or the second distribution tree, taking the first distribution tree and the second distribution tree as target distribution trees.

[0213] In an optional embodiment, the above device further includes:

[0214] A first sorting module is configured to sort the terminal identification set in descending order according to the lower limit of the data cache range of multiple preset terminals to obtain an initial terminal identification sequence;

[0215] A second sorting module is configured to perform descending sorting of the terminal identifiers in the initial terminal identifier sequence according to upper limits in the data cache range of the plurality of preset terminals to obtain a terminal identifier sequence;

[0216] The first root node building blocks include:

[0217] A first terminal identification determination unit is configured to execute the terminal identification that is ranked first in the terminal identification sequence as the first terminal identification;

[0218] The root node construction unit is configured to construct a root node of the first distribution tree according to the first terminal identifier.

[0219] In an optional embodiment, the above device further includes:

[0220] A first target distribution tree updating module is configured to update the target distribution tree based on the data cache range of the second terminal when the data cache range of any preset terminal among the plurality of preset terminals is updated;

[0221] The second terminal is a preset terminal whose data cache range is updated among the multiple preset terminals.

[0222] In an optional embodiment, the above device further includes:

[0223] The second target distribution tree updating module is configured to update the target distribution tree based on the data cache range of the newly added terminal when receiving the data cache range of the newly added terminal sent by the newly added terminal.

[0224] In an optional embodiment, the above device further includes:

[0225] a cache range updating module configured to execute, when a data cache range of any preset terminal among the multiple preset terminals expires, deleting a data cache range of a third terminal among the data cache ranges of the multiple preset terminals to obtain an updated data cache range; the third terminal is the preset terminal whose data cache range expires;

[0226] The third target distribution tree updating module is configured to update the target distribution tree based on the updated data cache range.

[0227] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0228] Fig. 9 is a block diagram of an electronic device for data distribution according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile 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 the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a data distribution method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0229] Fig.10 is a block diagram of an electronic device for data distribution according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as shown in FIG. Fig.10As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile 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 the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data distribution method is implemented.

[0230] Those skilled in the art will understand that Fig. 9 or Fig.10 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0231] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the data distribution method as in the embodiment of the present disclosure.

[0232] In an exemplary embodiment, a computer-readable storage medium is also provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data distribution method in the embodiment of the present disclosure.

[0233] In an exemplary embodiment, a computer program product containing instructions is also provided. When the computer program product is run on a computer, the computer is enabled to execute the data distribution method in the embodiment of the present disclosure.

[0234] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (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).

[0235] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0236] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data distribution method, characterized in that: include: In response to a data distribution request from a first terminal, determining a parent node corresponding to the first terminal from a target distribution tree; The terminal identifier in the parent node is used as the target terminal identifier. The target distribution tree is constructed based on the data cache ranges of multiple preset terminals, and the terminal identifiers of the multiple preset terminals are used as nodes. The multiple preset terminals include the first terminal. The target distribution tree is constructed in the following manner: obtaining the current data cache ranges of the multiple preset terminals and the terminal identifier sets corresponding to the multiple preset terminals; obtaining the first terminal identifier with the largest data cache range in the terminal identifier set as the root node of the first distribution tree; the size of the data cache range is positively correlated with the lower limit of the data cache range; sequentially obtaining second terminal identifiers from the terminal identifier set, the second terminal identifier being a terminal identifier in the terminal identifier set that is not added to the first distribution tree and has the largest corresponding data cache range; in the first distribution tree, searching for a target node whose data cache range meets a preset condition, wherein the preset condition is that the data cache range corresponding to the second terminal identifier overlaps, and the upper limit of the data cache range is greater than the upper limit of the data cache range corresponding to the second terminal identifier; When the target node is found, adding the second terminal identifier as a child node of the target node to the first distribution tree; When the terminal identifier in the terminal identifier set is added to the first distribution tree, the first distribution tree is used as the target distribution tree; The target terminal identifier is sent to the first terminal, where the target terminal identifier is used to instruct the first terminal to obtain the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identifier.

2. The data distribution method according to claim 1, wherein: In the first distribution tree, searching for a target node whose data cache range meets a preset condition includes: Searching for a current node in the first distribution tree, where the current node is a node with the largest corresponding data cache range among the nodes that have not been searched; When the data cache range corresponding to the current node meets the preset condition, the current node is used as the target node.

3. The data distribution method according to claim 2, wherein: When the data cache range corresponding to the current node meets the preset condition, taking the current node as the target node includes: When the data cache range corresponding to the current node meets the preset condition, determining the number of child nodes of the current node; When the number of the child nodes is less than a preset threshold, the current node is used as the target node.

4. The data distribution method according to claim 3, wherein: The method further comprises: If the number of child nodes is not less than the preset threshold, the process jumps to the step of searching for the current node in the first distribution tree.

5. The data distribution method according to claim 2, wherein: The method further comprises: When the data cache range corresponding to the current node does not meet the preset condition, the process jumps to the step of searching for the current node in the first distribution tree.

6. The data distribution method according to claim 5, characterized in that: The method further comprises: When there is no target node meeting the preset condition in the first distribution tree, a root node of a second distribution tree is constructed 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 the largest corresponding data cache range among the terminal identifiers that have not joined the first distribution tree or the second distribution tree; In the first distribution tree, searching for a target node whose data cache range meets a preset condition includes: Searching for a target node whose data cache range satisfies the preset condition in the first distribution tree and the second distribution tree; In the case where the terminal identifier in the terminal identifier set is added to the first distribution tree, taking the first distribution tree as the target distribution tree includes: When the terminal identifiers in the terminal identifier set are added to the first distribution tree or the second distribution tree, the first distribution tree and the second distribution tree are used as the target distribution trees.

8. The data distribution method according to claim 1, wherein: The method further comprises: sorting the terminal identification set in descending order according to lower limits of the data cache ranges of the plurality of preset terminals to obtain an initial terminal identification sequence; wherein the data cache ranges of the plurality of preset terminals are different; sorting the terminal identifiers in the initial terminal identifier sequence in descending order according to upper limits of the data cache ranges of the plurality of preset terminals to obtain a terminal identifier sequence; The acquiring of the first terminal identifier having the largest data cache range corresponding to the terminal identifier set as the root node of the first distribution tree includes: The terminal identifier that is sorted first in the terminal identifier sequence is used as the first terminal identifier; Construct 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: When the data cache range of any one of the plurality of preset terminals is updated, updating the target distribution tree based on the data cache range of the second terminal; The second terminal is a preset terminal whose data cache range is updated among the multiple preset terminals.

10. The data distribution method according to any one of claims 1 to 8, characterized in that: The method further comprises: When the data cache range of the newly added terminal is received, the target distribution tree is updated based on the data cache range of the newly added terminal.

11. The data distribution method according to any one of claims 1 to 8, characterized in that: The method further comprises: When a data cache range of any preset terminal among the multiple preset terminals expires, deleting a data cache range of a third terminal among the data cache ranges of the multiple preset terminals to obtain an updated data cache range; the third terminal is the preset terminal whose data cache range has expired; The target distribution tree is updated based on the updated data cache range.

12. A data distribution device, characterized in that: include: a target terminal identification determination module configured to execute, in response to a data distribution request of a first terminal, determining a parent node corresponding to the first terminal from a target distribution tree; The terminal identifier in the parent node is used as the target terminal identifier. The target distribution tree is constructed based on the data cache ranges of multiple preset terminals, with the terminal identifiers of the multiple preset terminals as nodes, and the multiple preset terminals include the first terminal. The target distribution tree is constructed using the following modules: a data cache range acquisition module, configured to execute acquisition of the current data cache ranges of the multiple preset terminals and the terminal identifier sets corresponding to the multiple preset terminals; a first root node construction module, configured to execute acquisition of the first terminal identifier with the largest data cache range corresponding to the terminal identifier set, as the root node of the first distribution tree; the size of the data cache range is positively correlated with the lower limit of the data cache range; a second terminal identification acquisition module configured to sequentially acquire second terminal identifications from the terminal identification set, wherein the second terminal identification is a terminal identification in the terminal identification set that is not included in the first distribution tree and has a corresponding largest data cache range; a target node search module configured to search the first distribution tree for a target node whose data cache range meets a preset condition, wherein the preset condition is that the data cache range corresponding to the second terminal identification overlaps, and an upper limit of the data cache range is greater than an upper limit of the data cache range corresponding to the second terminal identification; a child node adding module configured to, when the target node is found, add the second terminal identifier as a child node of the target node to the first distribution tree; a target distribution tree determining module, configured to, when a terminal identifier in the terminal identifier set is added to the first distribution tree, use the first distribution tree as the target distribution tree; The target terminal identification sending module is configured to send the target terminal identification to the first terminal, where the target terminal identification is used to instruct the first terminal to obtain the target service data corresponding to the data distribution request from the target terminal corresponding to the target terminal identification.

13. The data distribution device according to claim 12, wherein: The target node search module includes: a current node search unit configured to search for a current node in the first distribution tree, the current node being a node with the largest corresponding data cache range among the nodes that have not been searched; The target node determination unit is configured to execute, when the data cache range corresponding to the current node meets the preset condition, taking the current node as the target node.

14. The data distribution device 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; The target node determination subunit is configured to, when the number of the child nodes is less than a preset threshold, use the current node as the target node.

15. The data distribution device according to claim 14, wherein: The device further comprises: The first jump module is configured to execute the step of jumping to the step of searching the first distribution tree for the current node when the number of the child nodes is not less than the preset threshold.

16. The data distribution device according to claim 13, wherein: The device further comprises: The second jump module is configured to execute the step of jumping to the step of searching for the current node in the first distribution tree when the data cache range corresponding to the current node does not meet the preset condition.

17. The data distribution device according to claim 16, wherein: The device further comprises: The second root node construction module is configured to construct a root node of a second distribution tree according to the second terminal identifier when there is no target node meeting the preset condition in the first distribution tree.

18. The data distribution device according to claim 17, wherein: The second terminal identifier is a terminal identifier with the largest corresponding data cache range among the terminal identifiers that have not joined the first distribution tree or the second distribution tree; The target node search module is further configured to search for a target node whose data cache range meets the preset condition in the first distribution tree and the second distribution tree; The target distribution tree determination module is further configured to, when a terminal identifier in the terminal identifier set is added to the first distribution tree or the second distribution tree, use the first distribution tree and the second distribution tree as the target distribution tree.

19. The data distribution device according to claim 13, wherein: The device further comprises: a first sorting module configured to sort the terminal identification set in descending order according to a lower limit of a data cache range of the plurality of preset terminals to obtain an initial terminal identification sequence; wherein the data cache ranges of the plurality of preset terminals are different; a second sorting module configured to sort the terminal identifiers in the initial terminal identifier sequence in descending order according to upper limits of the data cache ranges of the plurality of preset terminals to obtain a terminal identifier sequence; The first root node construction module includes: A first terminal identifier determining unit is configured to use the terminal identifier that is sorted first in the terminal identifier sequence as the first terminal identifier; The root node construction unit is configured to construct a root node of the first distribution tree according to the first terminal identifier.

20. The data distribution device according to any one of claims 12 to 19, characterized in that: The device further comprises: A first target distribution tree updating module is configured to update the target distribution tree based on the data cache range of the second terminal when the data cache range of any preset terminal among the plurality of preset terminals is updated; The second terminal is a preset terminal whose data cache range is updated among the multiple preset terminals.

21. The data distribution device according to any one of claims 12 to 19, characterized in that: The device further comprises: The second target distribution tree updating module is configured to update the target distribution tree based on the data cache range of the newly added terminal when receiving the data cache range of the newly added terminal sent by the newly added terminal.

22. The data distribution device according to any one of claims 12 to 19, characterized in that: The device further comprises: a cache range updating module configured to, when a data cache range of any preset terminal among the plurality of preset terminals expires, delete a data cache range of a third terminal from the data cache ranges of the plurality of preset terminals to obtain an updated data cache range; the third terminal being the preset terminal whose data cache range has expired; The third target distribution tree updating module is configured to update the target distribution tree based on the update data cache range.

23. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data distribution method according to any one of claims 1 to 11.

24. A computer-readable storage medium, characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data distribution method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data processing method and device

    CN111798558A

  • Inter-system data admission verification method and device, computer equipment and storage medium

    CN112395339A

  • Method and device for refreshing cache data, electronic equipment and storage medium

    CN113271359A

  • Digital object access method and system in man-machine-object fusion environment

    CN113641869A

  • Cold start method and device for client, medium, equipment and program product

    CN113703873A