Udp message distribution method, udp message distribution apparatus, electronic device and computer readable storage medium
US-2024089352-A1 · Mar 14, 2024 · US
US12120203B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-12120203-B2 |
| Application number | US-202318506048-A |
| Country | US |
| Kind code | B2 |
| Filing date | Nov 9, 2023 |
| Priority date | May 20, 2022 |
| Publication date | Oct 15, 2024 |
| Grant date | Oct 15, 2024 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
In response to there being multiple process groups for one application service concurrently, each of the multiple process groups has an independent EBPF resource, and the EBPF resource is used to store information of an FD of each process in each of the multiple process groups. After a UDP message is received, a server is configured to determine a target process group from multiple process groups of a reuseport group according to a quadruple of the UDP message, select a target FD from the FD of each process of the target process group, and receive and transmit data by using the target FD. In this way, since each of the multiple process groups has an independent EBPF resource, the processes belong to different process groups do not preempt the same FD, which ensures that the UDP message is not distributed in disorder.
Opening claim text (preview).
The invention claimed is: 1. A user datagram protocol (UDP) message distribution method, comprising: receiving a UDP message from a terminal device; determining a target process group from a plurality of process groups of a reuseport group according to a quadruple carried by the UDP message, wherein the plurality of process groups are created in sequence for an application service, and each of the plurality of process groups has an extended Berkeley packet filter (EBPF) resource independent from each other; selecting a target file handle (FD) from FDs of a plurality of processes of the target process group; and distributing the UDP message using the target FD. 2. The UDP message distribution method according to claim 1 , wherein before determining the target process group from the plurality of process groups of the reuseport group according to the quadruple carried by the UDP message, the method further comprises: in response to creating each of the plurality of process groups, creating, by a master process, a second process group, wherein a first process group and the second process group are created in sequence in the plurality of process groups, and the first process group corresponds to a first group of FDs; generating, for the second process group, a second group of FDs; and setting the second group of FDs to standby resources in a resource set to obtain the EBPF resource, wherein the standby resources are pre-created and stored in the resource set, a first number of the standby resources in the resource set is the same as a maximum number of the process groups of the reuseport group, and a second number of the process groups in the plurality of process groups is less than or equal to the first number. 3. The UDP message distribution method according to claim 2 , wherein in before generating, for the second process group, the second group of FDs, the method further comprises: in response the application service being hot-updated to create the second process group, filtering out an FD in a listening structure of the first process group, wherein the first process group and the second process group are both created by a first master process. 4. The UDP message distribution method according to claim 2 , further comprising: in response to each of the plurality of the process groups being created, storing the EBPF resource of the process group created this time in a dynamic array as an element; and in response to a number of the element in the dynamic array being greater than or equal to the first number, storing the EBPF resource of the process group created this time in the dynamic array after the element of the process group created at first according to the sequence in which the plurality of process groups are created. 5. The UDP message distribution method according to claim 2 , wherein before generating, for the second process group, the second group of FDs, the method further comprises: in response to upgrading the application service to create the second process group, transferring, by a first master process, an environment variable to a second master process, wherein the first master process is a master process before the application service is upgraded, and the second master process is a master process after the application service is upgraded; and in response to an FD carrying a preset identifier existing in the environment variable, closing the FD carrying the preset identifier. 6. The UDP message distribution method according to claim 5 , further comprising: in response to each of the plurality of the process groups being created, invoking a resource recovery interface to clean the EBPF resource of the first process group. 7. The UDP message distribution method according to claim 5 , further comprising: creating, by the first master process, a third process group in response to the application services failing to be upgraded; closing an FD in a listening structure of the third process group; generating, for the third process group, a third group of FDs; and creating the EBPF resource corresponding to the third process group according to the third group of FDs. 8. The UDP message distribution method according to claim 1 , further comprising: determining that an abnormal process exists in a process group newly created in the plurality of process groups; and creating, for the newly created process group, a new worker process, wherein an FD of the worker process is an FD of the abnormal process. 9. The UDP message distribution method according to claim 1 , wherein in response to a plurality of IP protocols being bound on a UDP port corresponding to the reuseport group, the UDP port simultaneously serves the plurality of IP protocols. 10. The UDP message distribution method according to claim 1 , wherein the EBPF resource is configured to store information of a file handle of an FD of each process in a corresponding process group. 11. An electronic device, comprising a processor, a memory, wherein a computer program is stored on the memory and is operatable on the processor, the computer program, when being executed by the processor, causes the electronic device to implements the method according to claim 1 . 12. The electronic device according to claim 11 , further comprising a communication component and a bus, wherein the processor, the memory, and the communication component are connected via the bus. 13. A non-transitory computer readable storage medium storing therein a computer program, wherein the computer program, when being executed by a processor, causes the method according to claim 1 to be implemented. 14. A user datagram protocol (UDP) message distribution apparatus, comprising at least one processor and memory storing therein computer program instructions, which, when executed by the at least one processor, cause the at least one processor to provide software modules including: a receiving module configured to receive a UDP message from a terminal device; a processing module configured to determine a target process group from a plurality of process groups of a reuseport group according to a quadruple carried by the UDP message, wherein the plurality of process groups are created in sequence for an application service, and each of the plurality of process groups has an EBPF resource independent from each other; a selecting module configured to select a target FD from FDs of a plurality of processes of the target process group; and a distributing module configured to distribute the UDP message using the target FD. 15. The UDP message distribution apparatus according to claim 14 , wherein before the target process group is determined by the processing module from the multiple process groups of the reuseport group according to the quadruple carried by the UDP message, the processing module is further configured to create, by a master process, a second process group in response to creating each of the plurality of process groups, and generate a second group of FDs for the second process group, wherein a first process group and the second process group are created in sequence in the plurality of process groups, and the first process group corresponds to a first group of FDs. 16. The UDP message distribution apparatus according to claim 15 , wherein before the second group of FDs is generated by the processing module for the second process group, the processing module is further configured to filter out FDs in a listening structure of the first process group, and the first process group and the second process group are both created by a first master process
Adaptation for transition between two IP versions, e.g. between IPv4 and IPv6 (translation of Internet protocol [IP] addresses H04L61/2503) · CPC title
Adaptation or special uses of UDP protocol · CPC title
Updates (security arrangements therefor G06F21/57) · CPC title
considering the load · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.