Search

CN-122001806-A - Data forwarding method, device, computer equipment, computer readable storage medium and program product of multicast gateway

CN122001806ACN 122001806 ACN122001806 ACN 122001806ACN-122001806-A

Abstract

The present application relates to a data forwarding method, apparatus, computer device, computer readable storage medium and computer program product for a multicast gateway. The method comprises the steps of responding to a multicast request, obtaining multicast data messages and multicast member lists, dividing the multicast member lists into a plurality of member sub-lists according to the number of the members of the multicast member lists and the available number of candidate forwarding threads, determining message characteristics of the multicast data messages, determining target forwarding threads corresponding to the member sub-lists from the candidate forwarding threads according to the message characteristics, distributing the multicast data messages and the member sub-lists to target forwarding threads corresponding to the member sub-lists, and forwarding the multicast data messages to multicast members corresponding to the member sub-lists through the target forwarding threads according to the received member sub-lists. The method can improve the efficiency of multicast forwarding.

Inventors

  • KONG WEIZHENG

Assignees

  • 天翼云科技有限公司

Dates

Publication Date
20260508
Application Date
20251205

Claims (10)

  1. 1. A data forwarding method for a multicast gateway, the method comprising: Responding to the multicast request, obtaining a multicast data message and a multicast member list; dividing the multicast member list into a plurality of member sub-lists according to the number of members of the multicast member list and the available number of candidate forwarding threads; Determining message characteristics of the multicast data message, and determining target forwarding threads corresponding to each member sub-list from the candidate forwarding threads according to the message characteristics; distributing the multicast data message and the member sub-list to the target forwarding thread corresponding to the member sub-list; And forwarding the multicast data message to the multicast member corresponding to the member sub-list through each target forwarding thread according to the received member sub-list.
  2. 2. The method of claim 1, wherein the dividing the multicast member list into a plurality of member sub-lists according to the number of members of the multicast member list and the available number of candidate forwarding threads comprises: Calculating initial split granularity according to the number of the members and the available number; Comparing the initial resolution granularity with a preset minimum resolution granularity; If the initial splitting granularity is larger than or equal to the minimum splitting granularity, dividing the multicast member list according to the initial splitting granularity; And if the initial splitting granularity is smaller than the minimum splitting granularity, dividing the multicast member list according to the minimum splitting granularity.
  3. 3. The method according to claim 1, wherein the determining the message characteristics of the multicast data message, and determining the target forwarding threads corresponding to the member sub-lists from the candidate forwarding threads according to the message characteristics, includes: carrying out hash calculation on the message characteristics to obtain a hash value; Determining a starting forwarding thread from the plurality of forwarding threads based on the hash value and the number of forwarding threads; And sequentially distributing different target forwarding threads to each member sub-list according to a preset distribution strategy by taking the starting forwarding thread as a starting point.
  4. 4. The method of claim 3, wherein the message characteristic includes a communication characteristic of the multicast data message, the predetermined sequential allocation policy includes a polling policy or a weighted polling policy, and the sequentially allocating different target forwarding threads to each member sub-list with the starting forwarding thread as a starting point according to a predetermined allocation policy includes: When the sequence allocation policy is a polling policy, sequentially allocating different target segment forwarding threads for each member sub-list from the candidate forwarding threads according to a polling sequence by taking the initial forwarding thread as a starting point; When the sequence allocation strategy is a weighted polling strategy, the starting forwarding thread is taken as a starting point, different target segmented forwarding threads are sequentially allocated to each member sub-list according to the weight allocated to each candidate forwarding thread, and the weight of each candidate forwarding thread is determined according to the current processing performance of the thread.
  5. 5. The method of claim 1, wherein said distributing the multicast data message and the member sub-list to each of the target forwarding threads comprises: copying the multicast data message to obtain a plurality of copies of the same number as the member sub-list; Binding each copy of the copying message with a corresponding member sub-list to form a plurality of forwarding tasks; and respectively sending each forwarding task to a receiving queue of the corresponding target forwarding thread.
  6. 6. The method of claim 5, wherein prior to said obtaining a multicast data message and a list of multicast members in response to a multicast request, the method further comprises: configuring one or more distributing threads and configuring a plurality of candidate forwarding threads, wherein the number of the candidate forwarding threads is more than that of the distributing threads; And copying the multicast data message through the distribution thread to obtain a plurality of copies of the same number as the member sub-list, binding each copy of the copies of the multicast data message with a corresponding member sub-list to form a plurality of forwarding tasks, and respectively sending each forwarding task to a receiving queue of a corresponding target forwarding thread.
  7. 7. A data forwarding device of a multicast gateway, the device comprising: The acquisition module is used for responding to the multicast request and acquiring a multicast data message and a multicast member list; The dividing module is used for dividing the multicast member list into a plurality of member sub-lists according to the member number of the multicast member list and the available number of the candidate forwarding threads; the determining module is used for determining the message characteristics of the multicast data message, and determining the target forwarding threads corresponding to each member sub-list from the candidate forwarding threads according to the message characteristics; The distribution module is used for distributing the multicast data message and the member sub-list to the target forwarding thread corresponding to the member sub-list; and the forwarding module is used for forwarding the multicast data message to the multicast member corresponding to the member sub-list according to the received member sub-list through each target forwarding thread.
  8. 8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
  9. 9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
  10. 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.

Description

Data forwarding method, device, computer equipment, computer readable storage medium and program product of multicast gateway Technical Field The present application relates to the field of network communications technologies, and in particular, to a data forwarding method, apparatus, computer device, computer readable storage medium and computer program product for a multicast gateway. Background With the development of cloud computing and network virtualization technologies, a multicast gateway technology based on software definition appears, and the technology can efficiently realize point-to-multipoint data distribution in a virtual private cloud (VPC, virtual Private Cloud)) environment, and supports value added services such as online live broadcast, video conference and the like. In conventional multicast gateway implementations, run-to-Completion (RTC) processing mode is typically employed. In this mode, a multicast data message is fixedly dispatched to a certain CPU core according to its five-tuple hash value. And then, the CPU core independently completes all processing work of the message, including querying a complete multicast member list, copying the message for multiple copies, and finally forwarding to all members in the list. However, this conventional approach at present has a problem in that when the number of members of a certain multicast group is very large, all heavy replication and forwarding tasks are concentrated on a single CPU core. This very easily causes the CPU core to become a performance bottleneck, not only causes its own load to be too high, but also makes other CPU cores unable to participate in sharing, eventually causes unbalanced system CPU utilization, and because a large number of forwarding tasks need serial processing, the message receiving delay of part of multicast members is significantly increased. Disclosure of Invention In view of the foregoing, it is desirable to provide a data forwarding method, apparatus, computer device, computer readable storage medium, and computer program product for a multicast gateway capable of improving multicast efficiency. In a first aspect, the present application provides a data forwarding method of a multicast gateway, where the method includes: Responding to the multicast request, obtaining a multicast data message and a multicast member list; dividing the multicast member list into a plurality of member sub-lists according to the number of members of the multicast member list and the available number of candidate forwarding threads; Determining message characteristics of the multicast data message, and determining target forwarding threads corresponding to each member sub-list from the candidate forwarding threads according to the message characteristics; distributing the multicast data message and the member sub-list to the target forwarding thread corresponding to the member sub-list; And forwarding the multicast data message to the multicast member corresponding to the member sub-list through each target forwarding thread according to the received member sub-list. In some embodiments, the dividing the multicast member list into a plurality of member sub-lists according to the number of members of the multicast member list and the available number of candidate forwarding threads includes: Calculating initial split granularity according to the number of the members and the available number; Comparing the initial resolution granularity with a preset minimum resolution granularity; If the initial splitting granularity is larger than or equal to the minimum splitting granularity, dividing the multicast member list according to the initial splitting granularity; And if the initial splitting granularity is smaller than the minimum splitting granularity, dividing the multicast member list according to the minimum splitting granularity. In some embodiments, the determining the message characteristics of the multicast data message, determining, according to the message characteristics, the target forwarding threads corresponding to the member sub-lists from the candidate forwarding threads, includes: carrying out hash calculation on the message characteristics to obtain a hash value; Determining a starting forwarding thread from the plurality of forwarding threads based on the hash value and the number of forwarding threads; And sequentially distributing different target forwarding threads to each member sub-list according to a preset distribution strategy by taking the starting forwarding thread as a starting point. In some embodiments, the message characteristics include communication characteristics of the multicast data message, the predetermined sequential allocation policy includes a polling policy or a weighted polling policy, and the sequentially allocating different target forwarding threads to each member sub-list with the starting forwarding thread as a starting point according to a predetermined allocation policy includ