IP Library › Granted Patent US 11,954,530
Granted Patent B2
US 11,954,530 · App. 17/425,636 · Granted Apr 9, 2024

Method and system of processing data based on QUIC protocol stack, device and storage medium

Inventors: Sheng Wang (Shanghai, CN); Quan Zhou (Shanghai, CN); Shangzhi Cai (Shanghai, CN)
Assignee: SHANGHAI BILIBILI TECHNOLOGY CO., LTD.
G06F9/5027H04L69/02H04L69/16
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,954,530
App. No.
17/425,636
Granted
Apr 9, 2024
Kind
B2
Abstract

The present disclosure provides a method of processing data based on QUIC protocol stack, the method including: obtaining a connection identifier of a data packet; determining a server program used for processing the data packet, wherein the server program comprises a plurality of worker threads, wherein QUIC protocol stacks run in the plurality of worker threads; determining a corresponding worker thread from the multiple worker threads based on the connection identifier; and distributing the data packet to the corresponding worker thread to make the QUIC protocol stack on the corresponding worker thread process the data packet. The disclosure further provides a system, a computing device and a computer-readable storage medium of processing data based on QUIC protocol stack.

Claims (69)

1. A method of processing data based on QUIC (Quick UDP Internet Connection) protocol stack, comprising:

obtaining a connection identifier of a data packet among a plurality of data packets;

determining a server program used for processing the plurality of data packets, wherein the server program comprises a plurality of worker threads, and a plurality of QUIC protocol stacks run in the plurality of worker threads, respectively;

determining a corresponding worker thread among the plurality of worker threads based on the connection identifier; and

distributing the data packet to the corresponding worker thread and processing the data packet by one of the plurality of QUIC protocol stacks running in the corresponding worker thread.

2. The method of claim 1 , wherein the determining a corresponding worker thread among the plurality of worker threads based on the connection identifier comprises:

determining a thread number of the plurality of worker threads; and

determining the corresponding worker thread among the plurality of worker threads based on the connection identifier and the thread number.

3. The method of claim 2 , wherein the determining the corresponding worker thread among the plurality of worker threads based on the connection identifier and the thread number comprises:

performing a modulo operation on the connection identifier and the thread number to obtain a modulo result; and

determining the corresponding worker thread among the plurality of worker threads based on the modulo result.

4. The method of claim 1 , wherein the determining a corresponding worker thread among the plurality of worker threads based on the connection identifier comprises:

querying whether the connection identifier corresponds to any one of the plurality of worker threads; and

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads.

5. The method of claim 4 , wherein the in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads comprises:

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining a number of a first data packet distributed to each of the plurality of worker threads to obtain a plurality of numbers of the first data packet;

determining a number of the first data packet with a smallest value among the plurality of the numbers of the first data packet; and

determining the corresponding worker thread among the plurality of worker threads based on the number of the first data packet with the smallest value.

6. The method of claim 4 , wherein the in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads comprises:

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, obtaining a predetermined weight of each of the plurality of worker threads to obtain a plurality of predetermined weights;

determining a number of a second data packet distributed to each of the plurality worker threads to obtain a plurality of numbers of the second data packet; and

determining the corresponding worker thread among the plurality of worker threads based on the plurality of the predetermined weights and the plurality of the numbers of the second data packet.

7. The method of claim 1 , further comprising:

parsing or packaging the data packet based on a QUIC protocol by the one of the plurality of QUIC protocol stacks running in the corresponding worker thread.

8. A computing device, comprising a memory, a processor, and computer programs stored in the memory and operable on the processor, wherein the computer programs upon execution by the processor cause the processor to perform operations comprising:

obtaining a connection identifier of a data packet among a plurality of data packets;

determining a server program used for processing the plurality of data packets, wherein the server program comprises a plurality of worker threads, and a plurality of QUIC protocol stacks run in the plurality of worker threads, respectively;

determining a corresponding worker thread among the plurality of worker threads based on the connection identifier; and

distributing the data packet to the corresponding worker thread and processing the data packet by one of the plurality of QUIC protocol stacks running in the corresponding worker thread.

9. The computing device of claim 8 , wherein the determining a corresponding worker thread among the plurality of worker threads based on the connection identifier comprises:

determining a thread number of the plurality of worker threads; and

determining the corresponding worker thread among the plurality of worker threads based on the connection identifier and the thread number.

10. The computing device of claim 9 , wherein the determining the corresponding worker thread among the plurality of worker threads based on the connection identifier and the thread number comprises:

performing a modulo operation on the connection identifier and the thread number to obtain a modulo result; and

determining the corresponding worker thread among the plurality of worker threads based on the modulo result.

11. The computing device of claim 8 , wherein the determining a corresponding worker thread among the plurality of worker threads based on the connection identifier comprises:

querying whether the connection identifier corresponds to any one of the plurality of worker threads; and

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads.

12. The computing device of claim 11 , wherein the in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads comprises:

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining a number of a first data packet distributed to each of the plurality of worker threads to obtain a plurality of numbers of the first data packet;

determining a number of the first data packet with a smallest value among the plurality of the numbers of the first data packet; and

determining the corresponding worker thread among the plurality of worker threads based on the number of the first data packet with the smallest value.

13. The computing device of claim 11 , wherein the in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads comprises:

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, obtaining a predetermined weight of each of the plurality of worker threads to obtain a plurality of predetermined weights;

determining a number of a second data packet distributed to each of the plurality worker threads to obtain a plurality of numbers of the second data packet; and

determining the corresponding worker thread among the plurality of worker threads based on the plurality of the predetermined weights and the plurality of the numbers of the second data packet.

14. A non-transitory computer-readable storage medium, storing computer-readable instructions, wherein the computer-readable instructions upon execution by a processor cause the processor to perform operations comprising:

obtaining a connection identifier of a data packet among a plurality of data packets;

determining a server program used for processing the plurality of data packets, wherein the server program comprises a plurality of worker threads, and a plurality of QUIC protocol stacks nm in the plurality of worker threads, respectively;

determining a corresponding worker thread among the plurality of worker threads based on the connection identifier; and

distributing the data packet to the corresponding worker thread and processing the data packet by one of the plurality of QUIC protocol stacks running in the corresponding worker thread.

15. The non-transitory computer-readable storage media of claim 14 , wherein the determining a corresponding worker thread among the plurality of worker threads based on the connection identifier comprises:

determining a thread number of the plurality of worker threads; and

determining the corresponding worker thread among the plurality of worker threads based on the connection identifier and the thread number.

16. The non-transitory computer-readable storage media of claim 15 , wherein the determining the corresponding worker thread among the plurality of worker threads based on the connection identifier and the thread number comprises:

performing a modulo operation on the connection identifier and the thread number to obtain a modulo result; and

determining the corresponding worker thread among the plurality of worker threads based on the modulo result.

17. The non-transitory computer-readable storage media of claim 14 , wherein the determining a corresponding worker thread among the plurality of worker threads based on the connection identifier comprises:

querying whether the connection identifier corresponds to any one of the plurality of worker threads; and

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads.

18. The non-transitory computer-readable storage media of claim 17 , wherein the in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads comprises:

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining a number of a first data packet distributed to each of the plurality of worker threads to obtain a plurality of numbers of the first data packet; determining a number of the first data packet with a smallest value among the plurality of the numbers of the first data packet; and

determining the corresponding worker thread among the plurality of worker threads based on the number of the first data packet with the smallest value.

19. The non-transitory computer-readable storage media of claim 17 , wherein the in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, determining the corresponding worker thread among the plurality of worker threads comprises:

in response to determining that the connection identifier does not correspond to any one of the plurality of worker threads, obtaining a predetermined weight of each of the plurality of worker threads to obtain a plurality of predetermined weights;

determining a number of a second data packet distributed to each of the plurality worker threads to obtain a plurality of numbers of the second data packet; and

determining the corresponding worker thread among the plurality of worker threads based on the plurality of the predetermined weights and the plurality of the numbers of the second data packet.

20. The computing device of claim 8 , the operations further comprising:

parsing or packaging the data packet based on a QUIC protocol by the one of the plurality of QUIC protocol stacks running in the corresponding worker thread.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 6, 2021
From: WANG, SHENG; ZHOU, QUAN; CAI, SHANGZHI
To: SHANGHAI BILIBILI TECHNOLOGY CO., LTD.
Reel/Frame 057109/0875 →
Priority Claims (1)
CN 201910074772.2 · Jan 25, 2019 · national
Continuity (1)
Related Publication 20220091892A1 · Mar 24, 2022