Bandwidth acquisition method and device, computing equipment, storage medium and product
By setting tags between the CDN node and the client and the back source node according to the service type and streaming media protocol, the problem that the bandwidth acquisition method in the prior art cannot distinguish the streaming media protocol, and the refined bandwidth acquisition and reasonable traffic allocation are achieved.
Patent Information
- Application Number
- CN202510032981.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2045-01-08
AI Technical Summary
The bandwidth acquisition method in the prior art cannot distinguish between streaming media protocols, resulting in the inability to accurately control bandwidth during scheduling, which in turn makes the traffic allocation unreasonable enough.
When establishing a link between the CDN node and the client and the return source node, link marks are set according to the service type and streaming protocol and other scenario-related information, the traffic corresponding to each mark is collected, and the bandwidth of each service is calculated.
It realizes refined bandwidth acquisition for different service types and streaming media protocols, ensuring that bandwidth can be accurately controlled during scheduling, and reasonable traffic allocation can be achieved, and bandwidth waste can be avoided.
Smart Images

Figure CN119865641A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and specifically to a bandwidth acquisition method, apparatus, computing device, storage medium and product. Background Art
[0002] In business scenarios such as on-demand and live broadcast, bandwidth resources are usually deployed in an independent deployment mode or a hybrid deployment mode. In the case of a hybrid deployment mode, bandwidth resources can be used to meet live broadcast needs first, and the remaining bandwidth resources can be used to process on-demand services. This deployment method helps to reduce the waste of bandwidth resources. In order to reduce playback freezes and improve the user's viewing experience, it is necessary to collect the real-time bandwidth of the computer room or network card, and consider whether the bandwidth of the computer room or network card is overloaded in the business scheduling decision. There are multiple streaming media protocols in CDN services, and different streaming media protocols represent different scenarios. However, in the case of hybrid deployment, the bandwidth collection method in the existing technology cannot distinguish between streaming media protocols, resulting in the inability to accurately control the bandwidth during scheduling, making the traffic distribution unreasonable. Summary of the invention
[0003] In view of the above problems, the present application proposes a bandwidth acquisition method, apparatus, computing device, storage medium and product to solve the following problems: the bandwidth acquisition method in the prior art cannot distinguish the streaming media protocol, resulting in the inability to accurately control the bandwidth during scheduling.
[0004] According to one aspect of an embodiment of the present application, a bandwidth acquisition method is provided, including:
[0005] Step 1: establishing a first link between a CDN node and a client according to a data acquisition request for video data of any service;
[0006] Step 2, determine whether the CDN node stores video data; if so, execute step 4; if not, execute step 3;
[0007] Step 3, establishing a second link between the CDN node and the back-to-source node, obtaining video data from the back-to-source node, and setting a tag for the second link according to the scene-related information of the second link, and then executing step 4; wherein the scene-related information includes a service type and a streaming media protocol;
[0008] Step 4, sending the video data to the client, and setting a tag of the first link according to the scene related information of the first link;
[0009] Step 5: Collect the traffic corresponding to each tag, and calculate the bandwidth of each service based on the traffic corresponding to each tag.
[0010] Furthermore, the scene-related information also includes: data transmission direction.
[0011] Further, the first link and the second link are socket links;
[0012] Setting the tag of the first link according to the scene-related information of the first link further includes: determining the tag of the first link according to the scene-related information of the first link, and setting the tag of the first link in the socket option of the first link;
[0013] Setting the tag of the second link according to the scene-related information of the second link further includes: determining the tag of the second link according to the scene-related information of the second link, and setting the tag of the second link in the socket option of the second link.
[0014] Furthermore, the invention also includes:
[0015] The first link and the second link are stored in a link tracking module.
[0016] Furthermore, collecting the traffic corresponding to each tag and calculating the bandwidth of each service according to the traffic corresponding to each tag further includes:
[0017] The proxy service collects the traffic corresponding to each tag through a preset command line tool;
[0018] The traffic corresponding to each tag is classified and counted according to the scene-related information to obtain the bandwidth of each service under each category.
[0019] Furthermore, after calculating the bandwidth of each service according to the traffic corresponding to each tag, the method further includes:
[0020] The bandwidth of each business is provided to the scheduling service of each business for use.
[0021] According to another aspect of an embodiment of the present application, a bandwidth acquisition device is provided, including: an establishment module, a judgment module, a return-to-source module, a sending module, and a calculation module;
[0022] The establishing module is adapted to: establish a first link between the CDN node and the client according to a data acquisition request for video data of any service;
[0023] The judgment module is adapted to: judge whether the CDN node stores video data; if so, trigger the sending module; if not, trigger the back-to-source module;
[0024] The back-to-source module is adapted to: establish a second link between the CDN node and the back-to-source node, obtain video data from the back-to-source node, set a tag for the second link according to scene-related information of the second link, and then trigger the sending module; wherein the scene-related information includes a service type and a streaming media protocol;
[0025] The sending module is adapted to: send the video data to the client, and set a mark of the first link according to the scene related information of the first link;
[0026] The calculation module is suitable for: collecting the traffic corresponding to each tag, and calculating the bandwidth of each service according to the traffic corresponding to each tag.
[0027] According to another aspect of the embodiment of the present application, there is provided a computing device, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0028] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above bandwidth acquisition method.
[0029] According to another aspect of the embodiments of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned bandwidth acquisition method.
[0030] According to another aspect of the embodiments of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the above-mentioned bandwidth acquisition method.
[0031] According to the technical solution provided in the embodiment of the present application, in the process of processing data acquisition requests, a link is established between the CDN node and the client. In the case that the video data is not stored in the CDN node, a link needs to be established between the CDN node and the source node. Corresponding tags are set for the links according to scenario-related information such as the business type and streaming media protocol, and the traffic corresponding to each tag is collected. The bandwidth of each business can be accurately calculated based on the traffic corresponding to each tag, so that bandwidth collection can not only distinguish different business types, but also distinguish different streaming media protocols, thereby realizing refined bandwidth collection, and then accurately controlling the bandwidth during scheduling, and realizing reasonable distribution of traffic.
[0032] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation method of the embodiment of the present application is listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the embodiments of the present application. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0034] Figure 1 A schematic diagram of a process of a bandwidth acquisition method according to an embodiment of the present application is shown;
[0035] Figure 2a A schematic diagram showing a flow chart of a bandwidth acquisition method according to another embodiment of the present application is shown;
[0036] Figure 2b A schematic diagram of a bandwidth acquisition method is shown;
[0037] Figure 3 A structural block diagram of a bandwidth acquisition device according to an embodiment of the present application is shown;
[0038] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0039] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0040] First, the terms involved in one or more embodiments of the present application are explained.
[0041] Independent deployment mode: refers to using the bandwidth resources of the computer room to serve only one type of business, such as on-demand business or live broadcast business.
[0042] Hybrid deployment mode: refers to using the bandwidth resources of the computer room to serve multiple services, such as on-demand services and live broadcast services.
[0043] iptables: is a command line tool used to configure IPv4 packet filtering and NAT (Network Address Translation) in Linux systems. It allows system administrators to define rules to control network traffic in and out of the system, thereby implementing firewall functions, routing selection, and other advanced network operations.
[0044] Conntrack (Connection Tracking): is an important module in the Linux kernel, used to track and maintain the status of network links, and to establish a link information database based on the link status. It is mainly used to implement stateful firewalls, NAT (Network Address Translation) and load balancing functions. Through Conntrack, the system can record and manage all active network links, allowing for more complex network management and security policy applications.
[0045] Socket: It is an abstraction of the endpoint for two-way communication between application processes on different hosts in the network. A socket is one end of the process communication on the network, providing a mechanism for application layer processes to exchange data using network protocols. A socket can be regarded as the endpoint of a communication link, through which programs can send and receive data to achieve network communication.
[0046] http-flv (Flash Video) protocol: is a streaming media protocol; because the files it forms are extremely small and load very quickly, it makes it possible to watch video files on the Internet. Its appearance effectively solves the problem that after the video files are imported into Flash, the exported SWF files become huge in size and cannot be used well on the Internet.
[0047] HLSv3 protocol: is a streaming media protocol; it breaks the entire stream into multiple small HTTP-based file fragments and then distributes them through a standard web server.
[0048] HLSv7 protocol: It is a streaming protocol based on HLS and fmp4. It divides the stream into small HTTP-based file segments, each of which contains a short length of playable content, and the client only needs to download a part of the segments at a time. The advantage of this protocol is that it uses the standard HTTP protocol to transmit data and realizes adaptive bit rate.
[0049] RTMP protocol: is a protocol designed for transmitting audio, video and data on the Internet. It is mainly used for real-time streaming media, especially live broadcast business, because it provides low-latency data transmission and can handle multimedia content well.
[0050] So_mark: A socket option that Linux sockets support setting.
[0051] Figure 1 A schematic diagram of a bandwidth acquisition method according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:
[0052] Step S101: establishing a first link between a CDN node and a client according to a data acquisition request for video data of any service.
[0053] The multiple services may include live broadcast services and on-demand services. When a user wants to watch video data of any of the multiple services, a data acquisition request for the video data may be sent through the client. In step S101, a first link is established between a CDN node and a client according to the data acquisition request, so as to acquire the requested video data from the CDN node. The CDN node refers to a node currently used for the data acquisition request.
[0054] Step S102, determining whether video data is stored in the CDN node; if so, executing step S104; if not, executing step S103.
[0055] Determine whether the video data is stored in the CDN node; if the video data is stored, it means that there is no need to return to the source, then execute step S104 to return the video data to the client; if the video data is not stored, it means that it needs to be returned to the source, then execute step S103 to return the video data to the source.
[0056] Step S103, establishing a second link between the CDN node and the back-to-source node, obtaining video data from the back-to-source node, and setting a tag for the second link according to scene-related information of the second link; and then executing step S104.
[0057] If it is determined in step S102 that the CDN node does not store the video data, the CDN node needs to make a request to the upstream to obtain the video data from the source node. Specifically, a second link is established between the CDN node and the source node; the video data is obtained from the source node through the second link, and the video data is counted in the second link.
[0058] In order to achieve refined bandwidth collection that distinguishes service types and streaming protocols, in an embodiment of the present application, a mark of the second link is set according to the scene-related information of the second link, and the scene-related information includes the service type and streaming protocol. In addition, the scene-related information may also include data transmission direction, etc. Specifically, service types include: live broadcast service and on-demand service; streaming protocols include various protocols existing in live broadcast service and on-demand service; data transmission direction refers to the transmission direction of video data relative to the CDN node.
[0059] Step S104: sending the video data to the client, and setting a mark of the first link according to the scene related information of the first link.
[0060] When it is determined in step S102 that video data is stored in the CDN node and when the video data is obtained from the source node in step S103, the video data can be sent to the client through the first link established in step S101, and the video data will also be counted in the first link; in order to achieve refined bandwidth collection, it is also necessary to set a mark for the first link according to the scene-related information of the first link.
[0061] Step S105 , collecting the traffic corresponding to each tag, and calculating the bandwidth of each service according to the traffic corresponding to each tag.
[0062] In specific applications, the traffic corresponding to each tag can be collected through preset command line tools such as iptables. Since the tag is set according to scenario-related information such as business type and streaming media protocol, the tag can effectively identify which business and streaming media protocol the traffic belongs to. Therefore, the bandwidth of each business can be accurately calculated based on the traffic corresponding to each tag, realizing refined bandwidth collection, which in turn enables accurate bandwidth control during scheduling and achieves reasonable distribution of traffic.
[0063] According to the bandwidth collection method provided in the embodiment of the present application, in the process of processing the data acquisition request, a link is established between the CDN node and the client. In the case that the video data is not stored in the CDN node, a link needs to be established between the CDN node and the source node. Corresponding tags are set for the links according to scene-related information such as the service type and the streaming media protocol, and the traffic corresponding to each tag is collected. The bandwidth of each service can be accurately calculated based on the traffic corresponding to each tag, so that the bandwidth collection can not only distinguish different service types, but also distinguish different streaming media protocols, thereby realizing refined bandwidth collection, and then accurately controlling the bandwidth during scheduling, and realizing reasonable distribution of traffic.
[0064] Figure 2a FIG. 4 shows a flow chart of a bandwidth acquisition method according to another embodiment of the present application. Figure 2a As shown, the method comprises the following steps:
[0065] Step S201: Establish a first link between a CDN node and a client according to a data acquisition request for video data of any service, and store the first link in a link tracking module.
[0066] The multiple services may include live broadcast services and on-demand services. When a user wants to watch video data of any of the multiple services, a data acquisition request for the video data may be sent through the client. According to the data acquisition request, a first link between the CDN node and the client is established, and the first link is stored in a link tracking module. Each link is tracked and managed through the link tracking module. The link tracking module may be a Conntrack module, and the first link may be a socket link.
[0067] Step S202, determine whether the CDN node stores video data; if so, execute step S204; if not, execute step S203.
[0068] The data acquisition request includes information such as user ID, video ID of video data, request time, etc. The CDN node is queried to see whether it stores the video data corresponding to the video ID; if the video data is stored, it means that it does not need to be returned to the source, and step S204 is executed; if the video data is not stored, it means that it needs to be returned to the source, and step S203 is executed.
[0069] Step S203, establish a second link between the CDN node and the back-to-source node, store the second link in the link tracking module, obtain video data from the back-to-source node, and set a tag for the second link according to scene-related information of the second link; then execute step S204.
[0070] In the case that it is determined in step S202 that the CDN node does not store the video data, the CDN node needs to request the video data from the upstream back-to-source node, so a link is established upstream. Specifically, a second link is established between the CDN node and the back-to-source node, and the second link can be a socket link; after the second link is successfully established, the second link is stored in the link tracking module for management; through the second link, the video data returned by the back-to-source node is obtained, and the video data will be counted in the second link, and the tag of the second link is set according to the scene-related information of the second link.
[0071] Among them, the scene-related information includes the service type, streaming media protocol and data transmission direction. Specifically, the service types include: live broadcast service and on-demand service; streaming media protocols include: http-flv protocol, hlsv3 protocol, hlsv7 protocol, rtmp protocol, etc.; data transmission direction may include data input direction (can be referred to as in) and data output direction (can be referred to as out). In the embodiment of the present application, the data input direction reflects the input of video data from the source node to the CDN node, and the data output direction reflects the output of video data from the CDN node to the client.
[0072] Step S204: sending the video data to the client, and setting a mark of the first link according to the scene related information of the first link.
[0073] When it is determined in step S202 that the video data is stored in the CDN node and when the video data is obtained from the source node in step S203, the video data can be sent to the client through the first link established in step S201, and the video data will also be counted in the first link, and the mark of the first link is set according to the scene-related information of the first link. The setting method of the mark of the first link is the same as the setting method of the mark of the second link.
[0074] In the embodiment of the present application, there is a correspondence between the relevant information of each scene and the mark, and different combinations of relevant information of different scenes correspond to different marks. Table 1 shows the correspondence between the relevant information of each scene and the mark. As shown in Table 1, when the service type is a live broadcast service, the data transmission direction is out, and the streaming media protocol is the rtmp protocol, the mark is set to 0x0001; when the service type is a live broadcast service, the data transmission direction is in, and the streaming media protocol is the rtmp protocol, the mark is set to 0x0002; and so on, for various combinations of service type, data transmission direction and streaming media protocol, set corresponding marks; in addition, considering that there may be a situation where the service type is unknown and the data transmission direction is out, the mark is set to 0x0000.
[0075] Table 1 Correspondence between relevant information and tags of each scene
[0076] Business Type Data transmission direction Streaming Protocol mark Live broadcast business out rtmp protocol 0x0001 Live broadcast business in rtmp protocol 0x0002 Live broadcast business out http-flv protocol 0x0003 Live broadcast business in http-flv protocol 0x0004 Live broadcast business out HLSv3 protocol 0x0005 Live broadcast business in HLSv3 protocol 0x0006 Live broadcast business out HLSv7 protocol 0x0007 Live broadcast business in HLSv7 protocol 0x0008 On-demand service out http protocol 0x1001 On-demand service in http protocol 0x1002 On-demand service out quic protocol 0x1003 On-demand service in quic protocol 0x1004 unknown out 0x0000
[0077] Considering that the socket supports setting a socket option, which can be specifically So_mark, the socket option is used in the embodiment of the present application to complete the setting of the mark. Specifically, according to the scene-related information of the first link, the mark of the first link is determined, and the mark of the first link is set in the socket option of the first link; according to the scene-related information of the second link, the mark of the second link is determined, and the mark of the second link is set in the socket option of the second link.
[0078] Step S205 , the proxy service collects the traffic corresponding to each tag through a preset command line tool, classifies and counts the traffic corresponding to each tag according to scenario-related information, and obtains the bandwidth of each service under each classification.
[0079] Among them, the CDN node may include a proxy service and preset command line tools such as iptables. Iptables can be used to count the inbound and outbound traffic. Then in step S205, the proxy service can collect the traffic corresponding to each tag through iptables. After collecting the traffic corresponding to each tag, since there is a corresponding relationship between the relevant information of each scene and the tag, a classification can be set for each business type according to different streaming media protocols in different data transmission directions. According to the classification, the traffic corresponding to each tag is classified and counted, so as to obtain the bandwidth of each business under each classification, so that bandwidth collection can not only distinguish different business types, but also distinguish different streaming media protocols for each business type and the bandwidth of these protocols in different data transmission directions, thereby realizing more refined bandwidth collection.
[0080] Step S206: providing the bandwidth of each service to the scheduling service of each service for use.
[0081] Specifically, the CDN node can report the bandwidth of each service in each category to the central node, and the central node will provide the bandwidth of each service in each category to the scheduling service of each service. For example, the bandwidth of different streaming media protocols of the live service in different data transmission directions can be provided to the live scheduling service for use, and the bandwidth of different streaming media protocols of the on-demand service in different data transmission directions can be provided to the on-demand scheduling service for use.
[0082] Figure 2b A schematic diagram of a bandwidth acquisition method is shown in FIG. Figure 2b As shown in the figure, the CDN node includes proxy service, on-demand service, live service, Conntrack module, iptables and network card. The following takes the video data of a live broadcast service that a user wants to watch as an example to explain the bandwidth collection method:
[0083] 1. The user sends a live broadcast service request to the CDN node, establishes a first link between the CDN node and the client, and stores the first link in the Conntrack module;
[0084] 2. When the live broadcast service needs to request video data from the upstream back-source node, a second link is established between the CDN node and the back-source node, the second link is stored in the Conntrack module, the video data is obtained from the back-source node, and the tag of the second link is set according to the scene-related information of the second link, for example, the tag of the second link is 0x0002;
[0085] 3. Send the video data to the user's client, set the tag of the first link according to the scene-related information of the first link, and the tag of the first link is different from the tag of the second link to distinguish the traffic in the data transmission direction. For example, the tag of the first link is 0x0001;
[0086] 4. The proxy service collects traffic corresponding to each tag through iptables;
[0087] 5. The proxy service classifies and counts the traffic corresponding to each tag based on the scenario-related information, obtains the bandwidth of each service under each category, and reports the bandwidth of each service under each category to the central node;
[0088] 6. The central node provides the bandwidth of the reported live broadcast service under each category to the live broadcast scheduling service for processing, and provides the bandwidth of the reported on-demand service under each category to the on-demand scheduling service for processing.
[0089] According to the bandwidth collection method provided in the embodiment of the present application, in the process of processing the data acquisition request, a link is established between the CDN node and the client. In the case that the video data is not stored in the CDN node, a link needs to be established between the CDN node and the back-to-source node. According to the service type, streaming media protocol and data transmission direction corresponding to the established link, the link tag is determined and the setting of the tag is conveniently completed using the socket option, so that it is convenient to distinguish and count by tags, so that bandwidth collection can not only distinguish different service types, but also distinguish different streaming media protocols for each service type and the bandwidth of these protocols in different data transmission directions, thereby realizing more refined bandwidth collection. Through refined bandwidth collection, the scheduling has the ability of mixed scheduling of a single CDN node, and the bandwidth can be accurately controlled during scheduling, thereby realizing reasonable distribution of traffic. Under the premise of ensuring service quality, it can effectively avoid bandwidth waste and reduce bandwidth costs. It can also quickly and accurately locate the service to which the traffic belongs, thereby facilitating the investigation of the cause of abnormal traffic.
[0090] Figure 3 FIG. 4 shows a structural block diagram of a bandwidth acquisition device according to an embodiment of the present application. Figure 3 As shown, the device includes: an establishment module 310, a judgment module 320, a return module 330, a sending module 340 and a calculation module 350.
[0091] The establishing module 310 is adapted to establish a first link between the CDN node and the client according to a data acquisition request for video data of any service.
[0092] The determination module 320 is adapted to: determine whether video data is stored in the CDN node; if so, trigger the sending module 340; if not, trigger the back-to-source module 330.
[0093] The back-to-source module 330 is adapted to: establish a second link between the CDN node and the back-to-source node, obtain video data from the back-to-source node, set a tag for the second link according to scene-related information of the second link, and then trigger the sending module 340; wherein the scene-related information includes service type and streaming media protocol.
[0094] The sending module 340 is adapted to: send video data to the client, and set a tag of the first link according to the scene related information of the first link.
[0095] The calculation module 350 is adapted to collect the traffic corresponding to each tag, and calculate the bandwidth of each service according to the traffic corresponding to each tag.
[0096] Optionally, the scene-related information also includes: data transmission direction.
[0097] Optionally, the first link and the second link are socket links; the sending module 340 is further adapted to: determine the tag of the first link based on the scene-related information of the first link, and set the tag of the first link in the socket option of the first link; the back-to-source module 330 is further adapted to: determine the tag of the second link based on the scene-related information of the second link, and set the tag of the second link in the socket option of the second link.
[0098] Optionally, the device is further adapted to: store the first link and the second link in a link tracking module.
[0099] Optionally, the calculation module 350 is further adapted to: collect the traffic corresponding to each tag by the proxy service through a preset command line tool; classify and count the traffic corresponding to each tag according to scenario-related information to obtain the bandwidth of each service under each classification.
[0100] Optionally, the calculation module 350 is further adapted to: provide the bandwidth of each service to the scheduling service of each service for use.
[0101] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.
[0102] According to the bandwidth acquisition device provided in the embodiment of the present application, in the process of processing the data acquisition request, a link is established between the CDN node and the client. In the case that the video data is not stored in the CDN node, a link needs to be established between the CDN node and the back-to-source node. According to the service type, streaming media protocol and data transmission direction corresponding to the established link, the link tag is determined and the setting of the tag is conveniently completed using the socket option, so that it is convenient to distinguish and count by tags, so that bandwidth acquisition can not only distinguish different service types, but also distinguish different streaming media protocols for each service type and the bandwidth of these protocols in different data transmission directions, thereby realizing more refined bandwidth acquisition. Through refined bandwidth acquisition, the scheduling has the ability of mixed scheduling of a single CDN node, and the bandwidth can be accurately controlled during scheduling, thereby realizing reasonable distribution of traffic. Under the premise of ensuring service quality, it can effectively avoid bandwidth waste and reduce bandwidth costs. It can also quickly and accurately locate the service to which the traffic belongs, thereby facilitating the investigation of the cause of abnormal traffic.
[0103] An embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the bandwidth acquisition method in any of the above method embodiments.
[0104] An embodiment of the present application provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the bandwidth acquisition method in any of the above method embodiments.
[0105] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.
[0106] like Figure 4 As shown, the computing device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .
[0107] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the above-mentioned bandwidth collection method embodiment for computing devices.
[0108] Specifically, the program 410 may include program codes, which include computer operation instructions.
[0109] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0110] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0111] The program 410 can be specifically used to enable the processor 402 to execute the bandwidth acquisition method in any of the above method embodiments. The specific implementation of each step in the program 410 can refer to the corresponding descriptions in the corresponding steps and units in the above bandwidth acquisition embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiments, which will not be repeated here.
[0112] The algorithm and display provided herein are not inherently related to any specific computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present application embodiment described herein, and the above description of specific languages is to disclose the best mode of implementation of the present application embodiment.
[0113] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0114] Similarly, it should be understood that in order to streamline the present disclosure and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed embodiments of the present application require more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the embodiment of the present application.
[0115] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0116] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the embodiments of the present application and to form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0117] The various component embodiments of the embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The embodiments of the present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the embodiments of the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0118] It should be noted that the above embodiments illustrate rather than limit the embodiments of the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The embodiments of the present application may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
Claims
1. A bandwidth acquisition method, comprising: Step 1: establishing a first link between a CDN node and a client according to a data acquisition request for video data of any service; Step 2, determining whether the video data is stored in the CDN node; if so, executing step 4; if not, executing step 3; Step 3, establishing a second link between the CDN node and the back-to-source node, obtaining the video data from the back-to-source node, and setting a tag of the second link according to the scene-related information of the second link, and then executing step 4; wherein the scene-related information includes a service type and a streaming media protocol; Step 4, sending the video data to the client, and setting a tag of the first link according to the scene related information of the first link; Step 5: Collect the traffic corresponding to each tag, and calculate the bandwidth of each service based on the traffic corresponding to each tag.
2. According to the method of claim 1, the scene-related information further comprises: Data transmission direction.
3. The method according to claim 1 or 2, wherein the first link and the second link are socket links; The step of setting the mark of the first link according to the scene-related information of the first link further comprises: Determining a tag of the first link according to the scene related information of the first link, and setting the tag of the first link in a socket option of the first link; Setting the tag of the second link according to the scene-related information of the second link further includes: determining the tag of the second link according to the scene-related information of the second link, and setting the tag of the second link in the socket option of the second link.
4. The method according to any one of claims 1 to 3, further comprising: The first link and the second link are stored in a link tracking module.
5. According to the method according to any one of claims 1 to 4, collecting the traffic corresponding to each mark and calculating the bandwidth of each service according to the traffic corresponding to each mark further comprises: The proxy service collects the traffic corresponding to each tag through a preset command line tool; The traffic corresponding to each tag is classified and counted according to the scene-related information to obtain the bandwidth of each service under each category.
6. According to the method according to any one of claims 1 to 5, after calculating the bandwidth of each service according to the flow corresponding to each tag, the method further comprises: The bandwidth of each business is provided to the scheduling service of each business for use.
7. A bandwidth acquisition device, comprising: Establishing module, judging module, returning module, sending module and calculating module; The establishing module is adapted to: establish a first link between the CDN node and the client according to a data acquisition request for video data of any service; The determination module is adapted to: determine whether the video data is stored in the CDN node; if so, trigger the sending module; if not, trigger the return-to-source module; The back-to-source module is adapted to: establish a second link between the CDN node and the back-to-source node, obtain the video data from the back-to-source node, set a tag of the second link according to scene-related information of the second link, and then trigger the sending module; wherein the scene-related information includes a service type and a streaming media protocol; The sending module is adapted to: send the video data to the client, and set a mark of the first link according to the scene related information of the first link; The calculation module is suitable for: collecting the traffic corresponding to each mark, and calculating the bandwidth of each service according to the traffic corresponding to each mark.
8. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the bandwidth acquisition method according to any one of claims 1 to 6.
9. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the bandwidth acquisition method according to any one of claims 1 to 6.
10. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the bandwidth acquisition method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for obtaining service data and converged CDN system
CN110392094A
Multi-source station channel automatic back-to-source method and device
CN114501056A
Intelligent playing monitoring method based on CDN call ticket
CN115580473A
Data transmission method and device, electronic equipment and storage medium
CN117997799A
Machine room bandwidth acquisition method and device and computing equipment
CN119996781A