Traffic distribution method, file download method, controller, and storage medium

By combining the controller and flow table group, traffic allocation and P2P downloading of edge cloud nodes are realized, which solves the problems of network congestion and high cost caused by limited resources of edge cloud nodes, and improves download efficiency and security.

CN116800836BActive Publication Date: 2026-04-07CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Edge cloud nodes have limited resources, and downloading image files leads to central network congestion, redundant traffic, and high costs. Existing download methods cannot meet security and cost requirements.

Method used

The controller acquires download requests from edge sites, uses flow tables and group tables to allocate traffic, enables P2P traffic bypass and segmented downloads, and combines the OpenFlow protocol for traffic control and load balancing.

Benefits of technology

Reduce network congestion, lower bandwidth consumption, improve security and compliance, simplify system complexity, and reduce costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116800836B_ABST
    Figure CN116800836B_ABST
Patent Text Reader

Abstract

This application discloses a traffic allocation method, a file download method, a controller, an electronic device, a chip, and a computer-readable storage medium. The traffic allocation method is applied to a controller and includes: acquiring a first download request sent by a first edge site to a central cloud; extracting first download information for a first target file from the first download request; acquiring a first flow table and a first group table issued by the central cloud; forwarding the first download request to a first target edge site using the first flow table and the first group table to obtain the first target file; and sending the first target file to the first edge site. This application's solution extracts download information from the request using the controller and then allocates the request using flow table rules and group tables, allowing P2P traffic to bypass the central cloud. This enables traffic control, supports segmented downloads, and ensures security and compliance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of edge cloud technology, and in particular to a traffic allocation method, a file download method, a controller, and a storage medium. Background Technology

[0002] When providing services, edge clouds require service image files to generate virtual machines or containers. However, the current situation regarding image distribution and download is as follows: Edge nodes, due to limited resources, need to be able to flexibly deploy services and therefore do not pre-deploy services. Therefore, related service images are not pre-deployed but distributed on demand; images are generally large, ranging from several GB to tens of GB, and a single service may depend on multiple images; with large images and a large number of edge nodes, the central network's unified on-demand distribution can be slow, causing central network congestion; typically, the same service is distributed to multiple edge clouds simultaneously, and these edge clouds use the same image, resulting in a large amount of redundant network traffic and redundant images; due to the security requirements of edge clouds, the management plane generally cannot directly connect to the Internet or Content Delivery Network (CDN) and can only connect to other edge clouds or the central cloud on demand.

[0003] Currently, image files are typically downloaded via direct download, traditional CDN download, or traditional P2P download. However, these methods do not fully meet the requirements of edge clouds and the goal of cost savings. The main problems are: direct download is too slow, placing excessive pressure on central cloud servers and networks; the cost of building and using inter-cloud networks is high, and image downloads consume significant bandwidth and resources; CDN construction is complex and requires substantial resources; ordinary P2P download methods may be abused, are insecure, and P2P interconnection is not enabled in SDN networks, requiring special configuration and network connectivity, making them unmanageable by the SDN network, and necessitating compliance with cloud security and compliance requirements, resulting in complex modifications. Summary of the Invention

[0004] This application provides a traffic allocation method, a file download method, a controller, an electronic device, a chip, and a computer-readable storage medium.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] In a first aspect, embodiments of this application provide a traffic allocation method applied to a controller, the method comprising:

[0007] Obtain the first download request sent from the first edge site to the central cloud;

[0008] Extract the first download information for the first target file from the first download request;

[0009] Retrieve the first-order table and the first group of tables issued by the central cloud;

[0010] The first download request is forwarded to the first target edge site to obtain the first target file through the first flow table and the first group of tables, and the first target file is sent to the first edge site; wherein, the first download information is obtained by the first edge site based on the file index table of the central cloud.

[0011] Secondly, embodiments of this application provide a file download method applied to edge sites, including:

[0012] Retrieve the index of the third target file from the central cloud;

[0013] Based on the index of the third target file, a third download request for the third target file is sent to the central cloud;

[0014] The third target file is received from the central cloud; wherein the third target file is obtained by the controller located in the central cloud by forwarding the third download request to the third target edge site through the first flow table and the first group table based on the third download information for the third target file in the third download request.

[0015] Thirdly, embodiments of this application provide a controller, including:

[0016] Acquisition Unit: Used to acquire the first download request sent by the first edge site to the central cloud; also used to acquire the first flow table and the first set of tables issued by the central cloud;

[0017] Extraction unit: used to extract first download information for the first target file from the first download request; wherein, the first download information is obtained by the first edge site based on the file index table of the central cloud;

[0018] Sending unit: used to forward the first download request to the first target edge site to obtain the first target file through the first flow table and the first group of tables, and to send the first target file to the first edge site.

[0019] Fourthly, this application provides an electronic device, including: a processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute any of the traffic allocation methods or file download methods provided in the embodiments of this application.

[0020] Fifthly, this application provides a chip, including: a processor, configured to call and run a computer program from a memory, causing a device equipped with the chip to execute any of the traffic allocation methods or file download methods provided in the embodiments of this application.

[0021] Sixthly, this application provides a computer-readable storage medium for storing a computer program that causes a computer to execute any of the traffic allocation methods or file download methods provided in the embodiments of this application.

[0022] The traffic allocation method provided in this application, applied to a controller, acquires a first download request sent from a first edge site to a central cloud; extracts first download information for a first target file from the first download request; acquires a first flow table and a first group table issued by the central cloud; forwards the first download request to a first target edge site to obtain the first target file using the first flow table and the first group table, and sends the first target file to the first edge site; wherein the first download information is obtained by the first edge site based on the file index table of the central cloud. Thus, for file download requests from the edge cloud, the solution of this application extracts the download information from the request through the controller, and then allocates the request through flow table rules and group tables, allowing P2P traffic to bypass the central cloud, thereby controlling traffic and supporting segmented downloads, ensuring security and compliance. Attached Figure Description

[0023] Figure 1 A schematic diagram of the implementation process of a traffic allocation method provided in this application embodiment. Figure 1 ;

[0024] Figure 2 A schematic diagram of the implementation process of a traffic allocation method provided in this application embodiment. Figure 2 ;

[0025] Figure 3 A schematic diagram of the network physical connection architecture of the central cloud, edge cloud, and SDN controller provided in the embodiments of this application;

[0026] Figure 4 A schematic diagram of the P2P logical network connection between the central cloud, edge cloud, and SDN controller provided in an embodiment of this application;

[0027] Figure 5 This is a schematic diagram of the structure of a controller provided in an embodiment of this application;

[0028] Figure 6 A schematic structural diagram of an electronic device provided in the embodiments of this application;

[0029] Figure 7 This is a schematic structural diagram of the chip provided in an embodiment of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0031] It should be noted that, in the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, in the embodiments of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0032] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.

[0033] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and they all fall within the protection scope of the embodiments of this application.

[0034] Cloud computing is an internet-based computing approach that allows shared hardware and software resources and information to be provided to computers and other devices on demand.

[0035] Edge computing refers to providing services to the nearest point of contact by using an open platform that integrates network, computing, storage, and application capabilities, located close to the source of the data or equipment. Edge cloud, on the other hand, refers to small-scale cloud computing environments deployed near customers. Unlike public clouds deployed in centralized data centers, edge clouds are characterized by small individual data centers, numerous data centers, and a highly dispersed geographical distribution, providing users with convenient, localized cloud computing services.

[0036] OpenFlow is a protocol within the Software Defined Network (SDN) concept. Its function is to separate packet forwarding and forwarding policies on a switch. Typically, a dedicated controller manages the network forwarding policies. This separates the packet forwarding function (implemented by a hardware chip) and the packet forwarding policies (various software protocols) from those originally located on a single switch device, placing them on different hardware devices. While the packet forwarding function remains on the switch, the packet forwarding policies are implemented on the controller. One controller can manage multiple OpenFlow switches, thus achieving unified forwarding plane management and more efficient network control.

[0037] Peer-to-Peer (P2P) technology, also known as peer-to-peer networking, is a new network technology that relies on the computing power and bandwidth of participants in the network, rather than concentrating the resources on a few servers. P2P technology has various applications, including data communication in real-time media services. PointQuant's P2P distribution acceleration products can speed up downloads and save bandwidth, making them ideal for resource distribution in areas such as online games and large file distribution.

[0038] To gain a more detailed understanding of the features and technical content of this application, the implementation of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit this application.

[0039] Figure 1 A schematic diagram of the implementation process of a traffic allocation method provided in this application embodiment. Figure 1 ,like Figure 1 As shown in the figure, this application provides a traffic allocation method applied to a controller, the method including the following steps:

[0040] Step 101: Obtain the first download request sent from the first edge site to the central cloud.

[0041] Here, when a customer at the first edge site needs to use the first target file, but the first edge site does not currently store the first target file, it needs to send a first download request for the first target file to the central cloud. The controller receives the first download request sent by the first edge site to the central cloud.

[0042] Step 102: Extract the first download information for the first target file from the first download request; wherein the first download information is obtained by the first edge site based on the file index table of the central cloud.

[0043] In practical applications, the file index table includes: file address, file hash value, a list of edge sites allowed for P2P downloads, download priority of each edge site, and maximum traffic limit for each edge site. Here, the file hash value can be a hash value based on the MD5 Message-Digest Algorithm, and the hash value can be 128 bits. The list of edge sites allowed for P2P downloads refers to all edge sites that are permitted to perform P2P downloads on a specific file; the IP address of each edge site can be used as its identifier. The download priority of each edge site is pre-configured. As a preferred embodiment, the priority of an edge site can be represented by a 4-bit number, ranging from 0 to 15, with a larger number indicating that it can handle more P2P download services. Furthermore, in practical applications, the priority value of each edge site can be updated periodically based on its idle resource level. The maximum traffic limit for each edge site refers to the maximum traffic limit of the download network channel provided by the edge site.

[0044] The first download request includes first download information for the first target file. This first download information includes at least one of the following: the address of the first target file, the hash value of the first target file, and a first parameter. Here, the address of the first target file indicates its location in the central cloud, the hash value serves as its identifier, and the method provided in this embodiment supports segmented downloading. The first parameter indicates the range of the first target file to be downloaded in the first request. It is understood that when the first target file needs to be downloaded in segments, the first edge station sends multiple first download requests for the first target file to the central cloud. The first parameter in the first download information of each first download request represents the range of the first target file to be downloaded. The smaller files downloaded from the multiple first download requests for the first target file are integrated at the first edge station to obtain the final first target file. To illustrate, when a 6000-byte file needs to be downloaded in segments, if it is divided into two parts, bytes 1-3000 and bytes 3100-6000, then two download requests for the file need to be sent to the central cloud. The first parameter of one download request indicates that bytes 1-3000 of the file should be downloaded, and the first parameter of the other download request indicates that bytes 3001 to 6000 of the file should be downloaded. As a preferred embodiment of this application, the first download request is a request based on the Hypertext Transfer Protocol (HTTP), and correspondingly, the first parameter in the first download request is the range parameter.

[0045] Based on this, an embodiment of the present application provides a traffic allocation method, wherein the file index table includes: file address, file hash value, a list of edge sites that are allowed to use P2P download, download priority of each edge site, and maximum traffic limit value of each edge site;

[0046] The first download information includes at least one of the following: the address of the first target file, the hash value of the first target file, and a first parameter; the first parameter is used to indicate the range of the first target file to be downloaded when downloading in segments.

[0047] Step 103: Obtain the first flow table and the first group of tables issued by the central cloud.

[0048] One embodiment of this application provides a flow allocation method, wherein the first flow table includes: a first entry, a second entry, a third entry, and a fourth entry; wherein...

[0049] The first entry includes: a first table field indicating the flow table value of the first entry in the first flow table; a first Priority field indicating the matching priority of the first entry; a first MatchFields field indicating the first matching condition of the first entry; and a first Instructions field indicating the first action of the first entry; wherein the first matching condition includes at least one of the following: the request is an HTTP message, the request contains a hash value, and the request contains a range parameter; the first action includes: modifying the metadata field based on the hash value in the request and sending the input request to the third entry;

[0050] The second entry includes: a second table field indicating the flow table value of the second entry in the first flow table; a second Priority field indicating the matching priority of the first entry; a second MatchFields field indicating the second matching condition of the second entry; and a second Instructions field indicating the second action of the second entry; wherein the second matching condition includes at least one of the following: the request is an HTTP message, or the request contains a hash value; the second action includes: modifying the metadata field based on the hash value in the request, and sending the input request to the central cloud file distribution center;

[0051] The third table entry includes: a third table field indicating the flow table value of the first table entry in the first flow table; a third Match Fields field indicating the third matching condition of the third table entry; and a third Instructions field indicating the third action of the third table entry; wherein the third matching condition includes: matching the hash value portion in the metadata field; and the third action includes: setting a preset traffic threshold, discarding requests exceeding the traffic threshold, and sending requests that do not exceed the traffic threshold to the first set of tables;

[0052] The first set of tables is used to send the request sent by the third table entry to the first target edge site;

[0053] The fourth entry includes a third table field indicating the flow table value of the fourth entry in the first flow table; a fourth Match Fields field indicating the fourth matching condition of the fourth entry; and a fourth Instructions field indicating the fourth action of the fourth entry; wherein the fourth matching condition includes: the request is an HTTP message; and the fourth action includes: discarding the request.

[0054] The values ​​of the first, second, third, and fourth table fields are related as follows: first table field = second table field < third table field < fourth table field; the values ​​of the first priority field and the second priority field are related as follows: first priority field > second priority field.

[0055] Here, the central cloud sends OpenFlow flow table rules to the controller. The first entry primarily handles file download requests that require segmented downloads. The metadata field is a custom matching field in the OpenFlow protocol, which can be passed between flow tables and supports fuzzy mask matching. In practical applications, the flexibility of the metadata field can be utilized as an identifier for file transfer in the flow table. The metadata field can be modified to include part of the target file's hash value as the file identifier. Alternatively, other parameters can be added to the metadata field based on the hash value, such as increasing the priority of edge sites. The second entry primarily handles file download requests that do not require segmented downloads. After modifying the metadata field, the request is sent to the central cloud's file distribution center for download, without needing allocation through group tables. In the third entry, a rate-limiting table can be used to limit request traffic, preventing large-scale malicious attacks and viruses, and ensuring the security of the central cloud. Download requests reaching the fourth entry, targeting files in the central cloud's index table, are all discarded.

[0056] Furthermore, the first set of tables is used to send requests sent by the third table entry to the first target edge site. The first target edge site is allocated according to a pre-set allocation rule through the first set of tables. The higher the priority of the configured edge site, the more download traffic it will handle. In practical applications, the type of the first set of tables can be group; action buckets include multiple buckets, each bucket corresponding to a forwarding exit, which can correspond to all edge sites that are allowed to download the target file via P2P; at the same time, the DSCP value of the IP packet is rewritten to the download priority value corresponding to each edge site; bucket weight: each bucket has a weight value, which is used to determine the weight ratio during download in load balancing. This value is set to be equal to the download priority value of its corresponding edge site, so that edge sites with higher download priority can handle more download traffic tasks.

[0057] In practical applications, the first, second, third, and fourth entries can be set in the following format:

[0058] The first entry: "table=0, matching priority 65535, matching: HTTP message, and the HTTP has the query parameter: __hash=H1, and the HTTP header has the range parameter; action: modify metadata=H2 (H2=the first 60 bits of the file hash value + 4 bits of the edge site priority value), forward to table=1".

[0059] The second entry: "table=0, matching priority 65534, matching: HTTP message, and the HTTP message contains the query parameter: __hash=H1; action: modify metadata=H2 (H2=the first 60 bits of the file hash value + 4 bits of the edge site priority value); action: forward to the central cloud file distribution center."

[0060] The third entry is: "table=1, matches metadata=H2 / 0xFFFFFFFFFFFFFFFF0", action: meter_id=rate limit table, forward to the first table group". Here, 0xFFFFFFFFFFFFFFFF0 is a mask, indicating that only the first 60 bits of H2 are matched, that is, the file hash value part, excluding the download priority part. Since the download priority part is constantly updated, it can be ignored to save entries.

[0061] Fourth entry: "table=2, matches HTTP message, action: discard".

[0062] Step 104: Forward the first download request to the first target edge site through the first flow table and the first group table to obtain the first target file, and send the first target file to the first edge site.

[0063] In practical applications, the controller can be an SDN controller. The downloaded file is sent to the first edge site through the controller, and the P2P traffic is bypassed through the central cloud, so as not to cause network congestion.

[0064] In another embodiment of this application, the traffic allocation method for multiple newly established edge sites further includes:

[0065] Receive the second download request sent by the newly established second edge site;

[0066] The second download request is cached, and the second download information for the second target file in the second download request is saved to a hash dictionary; wherein, the second download information includes: the file name and file segment of the second target file and the port of the second edge station; the key-value pairs in the hash dictionary include: key name, used to indicate the file name and file segment; value list, used to indicate the edge station port of the request message;

[0067] A preset request caching time is set. For at least one new download request sent by other newly established edge sites within the second download request caching time, all edge site ports corresponding to all new download requests whose file names and file segments are the same as those in the second download request are added to the value list corresponding to the second request in the hash dictionary.

[0068] When the message cache time is reached, the first field of the cached second download request is changed to a first preset value, and then the modified second download request is sent to the first group table. The modified second download request is sent to the second target edge site through the first group table to obtain the second target file. When the second target file is returned to the controller, the second field is configured to the second preset value by the second target edge site. The first preset value is used to instruct the second target edge site to configure the second field to the second preset value when returning the second target file, and the second preset value is used to indicate the file name and file segmentation of the second target file.

[0069] Obtain the third flow table and the second set of tables issued by the central cloud. Based on the second preset value, distribute the second target file to all edge site ports in the value list corresponding to the second download request in the hash dictionary through the third flow table and the second set of tables.

[0070] In practical applications, the message caching time can be set as needed, such as 5 seconds, 6 seconds, 8 seconds, etc., and this application does not limit this. Here, the first preset value is used to instruct the second target edge site to configure the second field to the second preset value when returning the second target file. When the second target edge site recognizes that the first field in the download request is the first preset value, it configures the second field to the second preset value when replying with the file. As a preferred embodiment of this application, the download request is a request based on the HTTP protocol, the first field is the Referer field, the first preset value is SDN, the second field is the Cache-Control field, and the second preset value is set to filename + file segment.

[0071] The third flow table includes: a fifth entry, including a fifth table value, indicating the flow table value of the fifth entry in the third flow table; a fifth Match Fields field, indicating the fifth matching condition of the fifth entry; and a fifth Instructions field, indicating the fifth action of the fifth entry; wherein the fifth matching condition includes at least one of the following: an HTTP message, or a second field in the message having a second preset value; and the fifth action includes: sending to the second set of tables.

[0072] In practical applications, the fifth table entry can be set to "table=1, match HTTP message, Cache-Control field is: file name + file segment, action: send to the second table".

[0073] The second set of tables is defined as: a list of edge sites to which the request is sent. Here, the second set of tables finds all edge site ports in the hash dictionary corresponding to the target file based on the second preset value, and distributes the target file to each edge site port.

[0074] Furthermore, the second edge site can send the second download request to the controller based on the second flow table issued by the central cloud. Specifically, the second flow table includes: a sixth entry, including a sixth table value and a flow table value indicating the sixth entry in the second flow table; a sixth Match Fields field, indicating the sixth matching condition of the sixth entry; and a sixth Instructions field, indicating the sixth action of the sixth entry; wherein the sixth matching condition includes at least one of the following: an HTTP message, or a third field in the message having a third preset value; the sixth action includes: sending to the controller.

[0075] When the second edge cloud sends the second download request, the third field in the configuration request is set to the third preset value. In this way, the second download request is sent to the controller through the second set of tables.

[0076] In practical applications, the third field can be the same as the first field, set to the Referer field, and the third preset value can be set to CanMerge. Correspondingly, the sixth table entry can be set to "table=1, match HTTP message, Referer field is: CanMerge, action: send to controller".

[0077] Another embodiment of this application provides a traffic allocation method, including:

[0078] Record the mapping relationship between the third stream table, the second set of tables, and the size of the second target file;

[0079] The packet statistics of the third flow table are polled. If the packet size exceeds the size of the second target file corresponding to the third flow table, the third flow table and its corresponding second group of tables are deleted.

[0080] Specifically, there is a one-to-one correspondence between the second target file, the third flow table, and the second group table. The controller records the correspondence between them and polls the packet statistics information of the third flow table. If the packet size exceeds the file size of the second target file corresponding to the third flow table, the third flow table and its corresponding second group table are deleted.

[0081] This application also provides a file download method, applied to an edge site, including:

[0082] Retrieve the index of the third target file from the central cloud;

[0083] Based on the index of the third target file, a third download request for the third target file is sent to the central cloud;

[0084] The third target file is received from the central cloud; wherein the third target file is obtained by the controller located in the central cloud by forwarding the third download request to the third target edge site through the first flow table and the first group table based on the third download information for the third target file in the third download request.

[0085] Here, the first download information, the first stream table, and the first group table are the same as in the previous embodiments, and the relevant descriptions can be referred to in the previous embodiments, which will not be repeated here.

[0086] Another embodiment of the file download method provided in this application further includes, after receiving the third target file forwarded by the controller:

[0087] The system checks whether the third target file is complete. If it is complete, the third target file is saved to a specific directory of the third edge site, and third information is sent to the central cloud. This third information is used to notify the central cloud to update the file index table so that the downloaded third target file can be made available for download by other edge sites.

[0088] When the third target file needs to be downloaded in segments, before detecting whether the third target file is complete, the method further includes: concatenating all the file blocks downloaded in segments into a large file.

[0089] Here, the integrity of a file can be determined by comparing its size and hash value, or other methods can be used; this application does not limit this to any particular method.

[0090] refer to Figure 2 , Figure 2 This is a schematic diagram of the implementation flow of a traffic allocation method provided in another embodiment of this application. Figure 2 ,like Figure 2As shown, the traffic allocation method provided in this embodiment includes the following steps: Step 201: The central cloud establishes an "image file distribution management platform" and prepares an image file index table; Step 202: The central cloud distributes OpenFlow flow tables to the global SDN controller; Step 203: When the edge cloud downloads a target file, it obtains the index of the target file from the central cloud; Step 204: The edge cloud adds the parameter _hash to the request to request P2P image file download; Step 205: After the file download is completed, the edge cloud performs a file integrity comparison; Step 2051: When the file is incomplete, it returns to step 204 and resends the download request for the target file; Step 2052: When the file is complete, it saves the target file to a specific directory; Step 206: A third message is sent to the central cloud to notify the central cloud to update the image file index table; Step 207: End.

[0091] Here, some central clouds may not have P2P capabilities. In this case, it is necessary to establish a mirror distribution management platform to enable the central cloud to support P2P functionality. After the central cloud updates the index table, the group table can be updated according to the updated content to ensure the accuracy of file download information. It is understood that the download of mirror files can be achieved through the traffic allocation method and file download method provided in this application. Any large file or file requiring large-scale concurrent download can be downloaded using the traffic allocation method and file download method provided in the embodiments of this application.

[0092] refer to Figure 3 , Figure 3 This is a schematic diagram of the network physical connection architecture of the central cloud, edge cloud, and SDN controller provided in one embodiment of this application. (Reference) Figure 4 , Figure 4 This is a schematic diagram of the P2P logical network connection between the central cloud, edge cloud and SDN controller provided in another embodiment of this application.

[0093] The traffic allocation and file download methods provided in this application embodiment extract download requests sent from the edge cloud to the central cloud through a controller, extract parameters from the download requests, and perform P2P distribution and load balancing processing using special flow table rules. This eliminates the need to install dedicated P2P client and server software on all clouds and servers, significantly reducing system complexity. With the controller involved in parameter awareness and forwarding, a file's traffic can be distributed through a group table instead of being transmitted multiple times across the network from the client's initial transmission, saving network bandwidth. After the file is downloaded from the edge cloud, the central cloud is notified to update the file index table, and then the group table is dynamically refreshed, forming an on-demand connection for file downloads between the central and edge clouds, reducing bandwidth consumption. Through OpenFlow flow table and rate limiting table control, rate limiting can be supported to prevent large-scale downloads from impacting servers and networks, increasing the security and controllability of P2P distribution. Matching the first 60 bits of H2 using a mask can significantly reduce the number of flow table rules and improve table efficiency. This application improves resource utilization and facilitates flow table management. The embodiments redefine and utilize the Referer and Cache-Control fields to mark whether to merge request message caches, thereby reducing resource usage, fully utilizing the existing HTTP protocol to solve problems, and reducing the workload of modifying the entire system. Simultaneously, since multiple edge cloud download requests are initiated at similar times, the controller is fully utilized to cache and merge multiple HTTP requests, save associated key information, compress multiple requests, and reduce network load. When file blocks are returned, the Cache-Control field and the associated key information saved during the request are used to simultaneously copy and distribute the data across multiple ports, reducing bandwidth costs. By using the file block size value saved during the request and the packet statistics method in the flow table rules polled by the SDN controller, it can be determined whether the requested file block has been fully distributed, and flow table resources can be released in a timely manner. This eliminates the need to modify the server-side HTTP response header to explicitly notify SDN that transmission is complete.

[0094] In addition, for P2P services, the method provided in this application embodiment can be implemented using a pure HTTP protocol and port, without using a special P2P protocol and multiple special ports, which is simple and convenient. For segmented download requests, the request is divided into multiple parts, and the request message is sent to multiple edge clouds through a group table load balancing method. Then, edge clouds with different load priorities return different file blocks, achieving the purpose of load balancing in reverse. This can better avoid the inability of OpenFlow group tables to simultaneously achieve broadcasting and load balancing of a single file.

[0095] This application embodiment also provides a controller 500; Figure 5 This is a schematic diagram of the controller 500 provided in the embodiments of this application, as shown below. Figure 5As shown, the controller 500 provided in this embodiment includes:

[0096] Acquisition unit 501: used to acquire the first download request sent by the first edge site to the central cloud; also used to acquire the first flow table and the first set of tables issued by the central cloud;

[0097] Extraction unit 502: used to extract first download information for the first target file from the first download request; wherein, the first download information is obtained by the first edge site based on the file index table of the central cloud;

[0098] Sending unit 503: is used to forward the first download request to the first target edge site to obtain the first target file through the first flow table and the first group of tables, and to send the first target file to the first edge site.

[0099] In other embodiments of this application, the file index table includes: file address, file hash value, a list of edge sites allowed to use P2P download, download priority of each edge site, and maximum traffic limit value of each edge site; the first download information includes at least one of the following: the address of the first target file, the hash value of the first target file, and a first parameter; the first parameter is used to indicate the range of the first target file to be downloaded when downloading in segments.

[0100] In other embodiments of this application, the first flow table includes: a first entry, a second entry, a third entry, and a fourth entry; wherein,

[0101] The first entry includes: a first table field indicating the flow table value of the first entry in the first flow table; a first Priority field indicating the matching priority of the first entry; a first MatchFields field indicating the first matching condition of the first entry; and a first Instructions field indicating the first action of the first entry; wherein the first matching condition includes at least one of the following: the request is an HTTP message, the request contains a hash value, and the request contains a first parameter; the first action includes: modifying the metadata field based on the hash value in the request and sending the input request to the third entry;

[0102] The second entry includes: a second table field indicating the flow table value of the second entry in the first flow table; a second Priority field indicating the matching priority of the first entry; a second MatchFields field indicating the second matching condition of the second entry; and a second Instructions field indicating the second action of the second entry; wherein the second matching condition includes at least one of the following: the request is an HTTP message, or the request contains a hash value; the second action includes: modifying the metadata field based on the hash value in the request, and sending the input request to the central cloud file distribution center;

[0103] The third table entry includes: a third table field indicating the flow table value of the first table entry in the first flow table; a third Match Fields field indicating the third matching condition of the third table entry; and a third Instructions field indicating the third action of the third table entry; wherein the third matching condition includes: matching the hash value portion in the metadata field; and the third action includes: setting a preset traffic threshold, discarding requests exceeding the traffic threshold, and sending requests that do not exceed the traffic threshold to the first set of tables;

[0104] The first set of tables is used to send the request sent by the third table entry to the first target edge site;

[0105] The fourth entry includes a third table field for indicating the flow table value of the fourth entry in the first flow table; a fourth Match Fields field for indicating the fourth matching condition of the fourth entry; and a fourth Instructions field for indicating the fourth action of the fourth entry; wherein the fourth matching condition includes: the request is an HTTP message; and the fourth action includes: discarding the request.

[0106] The values ​​of the first, second, third, and fourth table fields are related as follows: first table field = second table field < third table field < fourth table field; the values ​​of the first priority field and the second priority field are related as follows: first priority field > second priority field.

[0107] In other embodiments of this application, the controller further includes a receiving unit 504 for receiving a second download request sent by a newly established second edge station; a caching unit 505 for caching the second download request and saving the second download information for the second target file in the second download request into a hash dictionary; wherein the second download information includes: the filename and file segment of the second target file and the port of the second edge station; the key-value pairs in the hash dictionary include: a key name for indicating the filename and file segment; and a value list for indicating the edge station port of the request message; and a setting unit 506 for preset request caching time, and for at least one new download request sent by other newly established edge stations within the second download request caching time, adding all edge station ports corresponding to all new download requests whose filenames and file segments are the same as those in the second download request to the value list corresponding to the second request in the hash dictionary. The sending unit 503 is further configured to, when the message buffering time is reached, change the first field of the cached second download request to a first preset value, and then send the modified second download request to the first group table. The modified second download request is sent to the second target edge station through the first group table to obtain the second target file. When the second target file is returned to the controller, the second field is configured by the second target edge station to the second preset value. The first preset value is used to instruct the second target edge station to configure the second field to the second preset value when returning the second target file. The second preset value is used to indicate the file name and file segment of the second target file. The obtaining unit 501 is further configured to obtain the third flow table and the second group table issued by the central cloud, and based on the second preset value, distribute the second target file to all edge station ports in the value list corresponding to the second download request in the hash dictionary through the third flow table and the second group table.

[0108] In other embodiments of this application, the controller further includes: a detection unit 507: used to record the mapping relationship between the third flow table, the second set of tables, and the file size of the second target file;

[0109] The packet statistics of the third flow table are polled. If the packet size exceeds the size of the second target file corresponding to the third flow table, the third flow table and its corresponding second group of tables are deleted.

[0110] Those skilled in the art should understand that Figure 5 The functions of each unit in the controller shown can be understood by referring to the relevant descriptions of the aforementioned methods. Figure 5 The functions of each unit in the controller shown can be implemented by a program running on a processor or by specific logic circuits.

[0111] Figure 6 This is a schematic structural diagram of an electronic device 600 provided in an embodiment of this application. Figure 6 The illustrated electronic device 600 includes a processor 610, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0112] Optionally, such as Figure 6 As shown, the electronic device 600 may further include a memory 620. The processor 610 can retrieve and run computer programs from the memory 620 to implement the methods described in the embodiments of this application.

[0113] The memory 620 can be a separate device independent of the processor 610, or it can be integrated into the processor 610.

[0114] Optionally, such as Figure 6 As shown, the electronic device 600 may also include a transceiver 630, which the processor 610 can control to communicate with other devices. Specifically, it can send information or data to other devices or receive information or data sent by other devices.

[0115] The transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include antennas, and the number of antennas may be one or more.

[0116] The electronic device 600 may specifically be a controller in the embodiments of this application, and the electronic device 600 may implement the corresponding processes implemented by the controller in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0117] Figure 7 This is a schematic structural diagram of the chip according to an embodiment of this application. Figure 7 The chip 700 shown includes a processor 710, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0118] Optionally, such as Figure 7 As shown, chip 700 may further include memory 720. Processor 710 can retrieve and run computer programs from memory 720 to implement the methods described in this embodiment.

[0119] The memory 720 can be a separate device independent of the processor 710, or it can be integrated into the processor 710.

[0120] Optionally, the chip 700 may also include an input interface 730. The processor 710 can control the input interface 730 to communicate with other devices or chips; specifically, it can acquire information or data sent by other devices or chips.

[0121] Optionally, the chip 700 may also include an output interface 740. The processor 710 can control the output interface 740 to communicate with other devices or chips, specifically, to output information or data to other devices or chips.

[0122] This chip can be applied to the controller in the embodiments of this application, and the chip can implement the corresponding processes implemented by the controller in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0123] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0124] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0125] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0126] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0127] This application also provides a computer-readable storage medium for storing a computer program. This computer-readable storage medium can be applied to a controller in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes implemented by the controller in the various methods of the embodiments of this application; for brevity, further details are omitted here.

[0128] This application also provides a computer program product, including computer program instructions. This computer program product can be applied to the controller in the embodiments of this application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the controller in the various methods of the embodiments of this application; for brevity, further details are omitted here.

[0129] This application also provides a computer program. This computer program can be applied to the controller in the embodiments of this application. When the computer program runs on a computer, it causes the computer to execute the corresponding processes implemented by the controller in the various methods of the embodiments of this application. For the sake of brevity, these will not be elaborated further here.

[0130] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0131] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0132] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0133] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0134] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0135] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0136] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A flow allocation method, characterized in that, Applied to a controller, the method includes: Obtain the first download request sent from the first edge site to the central cloud; Extract the first download information for the first target file from the first download request; wherein, the first download information is obtained by the first edge site based on the file index table of the central cloud; Retrieve the first-order table and the first group of tables issued by the central cloud; Based on the first download information, the first download request is forwarded to the first target edge site through the first flow table and the first group of tables to obtain the first target file, and the first target file is sent to the first edge site.

2. The flow allocation method according to claim 1, characterized in that, The file index table includes: file address, file hash value, list of edge sites that are allowed to use P2P download, download priority of each edge site, and maximum traffic limit value of each edge site; The first download information includes at least one of the following: the address of the first target file, the hash value of the first target file, and a first parameter; the first parameter is used to indicate the range of the first target file to be downloaded in the first download request during segmented download.

3. The flow allocation method according to claim 1, characterized in that, The first flow table includes: a first entry, a second entry, a third entry, and a fourth entry; wherein, The first entry includes: a first table field indicating the flow table value of the first entry in the first flow table; a first Priority field indicating the matching priority of the first entry; a first MatchFields field indicating the first matching condition of the first entry; and a first Instructions field indicating the first action of the first entry; wherein the first matching condition includes at least one of the following: the request is an HTTP message, the request contains a hash value, and the request contains a first parameter; the first action includes: modifying the metadata field based on the hash value in the request and sending the input request to the third entry; The second entry includes: a second table field indicating the flow table value of the second entry in the first flow table; a second Priority field indicating the matching priority of the first entry; a second MatchFields field indicating the second matching condition of the second entry; and a second Instructions field indicating the second action of the second entry; wherein the second matching condition includes at least one of the following: the request is an HTTP message, or the request contains a hash value; the second action includes: modifying the metadata field based on the hash value in the request, and sending the input request to the central cloud file distribution center; The third table entry includes: a third table field, used to indicate the flow table value of the third table entry in the first flow table; a third Match Fields field, used to indicate the third matching condition of the third table entry; and a third Instructions field, used to indicate the third action of the third table entry; wherein, the third matching condition includes: matching the hash value portion in the metadata field; the third action includes: setting a preset traffic threshold, discarding requests exceeding the traffic threshold, and sending requests that do not exceed the traffic threshold to the first group of tables; The first set of tables is used to send the request sent by the third table entry to the first target edge site; The fourth entry includes a fourth table field indicating the flowtable value of the fourth entry in the first flow table; a fourth Match Fields field indicating the fourth matching condition of the fourth entry; and a fourth Instructions field indicating the fourth action of the fourth entry; wherein the fourth matching condition includes: the request is an HTTP message; and the fourth action includes: discarding the request. The values ​​of the first table field, the second table field, the third table field, and the fourth table field are related as follows: first table field = second table field < third table field < fourth table field; the values ​​of the first priority field and the second priority field are related as follows: first priority field > second priority field.

4. The flow allocation method according to any one of claims 1-3, characterized in that, For multiple newly established edge sites, the method further includes: Receive the second download request sent by the newly established second edge site; The second download request is cached, and the second download information for the second target file in the second download request is saved to a hash dictionary; wherein, the second download information includes: the file name and file segment of the second target file and the port of the second edge station; the key-value pairs in the hash dictionary include: key name, used to indicate the file name and file segment; value list, used to indicate the edge station port of the request message; A preset request caching time is set. For at least one new download request sent by other newly established edge sites within the second download request caching time, all edge site ports corresponding to all new download requests whose file names and file segments are the same as those in the second download request are added to the value list corresponding to the second download request in the hash dictionary. When the message cache time is reached, the first field of the cached second download request is changed to a first preset value, and then the modified second download request is sent to the first group table. The modified second download request is sent to the second target edge station through the first group table to obtain the second target file. When the second target file is returned to the controller, the second field is configured to the second preset value by the second target edge station. The first preset value is used to instruct the second target edge station to configure the second field to the second preset value when returning the second target file, and the second preset value is used to indicate the file name and file segmentation of the second target file. Obtain the third flow table and the second set of tables issued by the central cloud. Based on the second preset value, distribute the second target file to all edge site ports in the value list corresponding to the second download request in the hash dictionary through the third flow table and the second set of tables.

5. The flow allocation method according to claim 4, characterized in that, include: Record the mapping relationship between the third stream table, the second set of tables, and the size of the second target file; The packet statistics of the third flow table are polled. If the packet size exceeds the size of the second target file corresponding to the third flow table, the third flow table and its corresponding second group of tables are deleted.

6. A file download method, characterized in that, Applied to edge sites, including: Retrieve the index of the third target file from the central cloud; Based on the index of the third target file, a third download request for the third target file is sent to the central cloud; The third target file is received from the central cloud; wherein the third target file is obtained by the controller located in the central cloud by forwarding the third download request to the third target edge site through the first flow table and the first group table based on the third download information for the third target file in the third download request.

7. The file download method according to claim 6, characterized in that, After receiving the third target file forwarded by the controller, the process also includes: The system checks whether the third target file is complete. If it is complete, the third target file is saved to a specific directory of the third edge site, and third information is sent to the central cloud. This third information is used to notify the central cloud to update the file index table so that the downloaded third target file can be made available for download by other edge sites. When the third target file needs to be downloaded in segments, before detecting whether the third target file is complete, the method further includes: Combine all the downloaded file segments into one large file.

8. A controller, characterized in that, include: Acquisition Unit: Used to acquire the first download request sent from the first edge site to the central cloud; It is also used to obtain the first-stream table and the first group of tables issued by the central cloud; Extraction unit: used to extract first download information for the first target file from the first download request; wherein, the first download information is obtained by the first edge site based on the file index table of the central cloud; Sending unit: Based on the first download information, forwards the first download request to the first target edge site through the first flow table and the first group of tables to obtain the first target file, and sends the first target file to the first edge site.

9. An electronic device, characterized in that, include: A processor and a memory, the memory for storing computer programs, the processor for calling and running the computer programs stored in the memory to perform the traffic allocation method as described in any one of claims 1-5 and the file download method as described in any one of claims 6-7.

10. A computer-readable storage medium, characterized in that, Used to store computer programs that cause a computer to perform the traffic allocation method as described in any one of claims 1-5 and the file download method as described in any one of claims 6-7.

Citation Information

Patent Citations

  • Network transmission acceleration method and device and computer readable storage medium

    CN111988154A

  • Mirror image file management method, device and system, computer equipment and storage medium

    CN112565325A