Method and apparatus for converging forwarding of udp protocol port, electronic device and medium
Through the encryption encapsulation of the UDP client and edge proxy, as well as the decoding and decryption of the high-performance core proxy, the convergence and forwarding of UDP data is achieved, solving the security and performance issues of the UDP microservice cluster, ensuring security and high performance while reducing the number of exposed ports.
Patent Information
- Application Number
- CN202411681549.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-11-22
AI Technical Summary
In existing technologies, UDP microservice clusters expose too many UDP ports to the outside world, resulting in high security risks. In addition, integrating multiple services into a single application will lead to poor performance and violate the isolation principle of software specifications.
The UDP client sends the request data to the edge proxy for encryption and encapsulation, and uses the high-performance core proxy for decoding and decryption. Finally, the minimum number of UDP ports are exposed on the server side for data forwarding, and the edge proxy and high-performance core proxy are used for data convergence and forwarding.
It improves the security and transmission performance of UDP data forwarding, while reducing the number of exposed ports to meet security and high performance requirements.
Smart Images

Figure CN119788755B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology, and in particular to a UDP protocol port convergence and forwarding method, device, electronic equipment and medium. Background Art
[0002] UDP is a stateless protocol. Each UDP server is bound to a unique UDP port. Microservice clusters built on UDP must expose multiple UDP ports. The more UDP ports a system exposes, the greater the security risk. For enterprises and projects with high security and isolation requirements, it is necessary to limit the number of exposed ports. The current mainstream approach is to integrate multiple services into a single monolithic application, but this will result in a bloated monolith and poor performance. Forcibly integrating unrelated functional modules into a single service does not comply with the isolation and single-function design principles in the software specification. In addition, for some privately deployed cloud systems, the system itself is designed based on multiple services, and it is impossible for private system providers to integrate multiple services into a single monolith.
[0003] In view of the above situation, an architectural design solution is needed to expose a very small number (or even one) ports of the service provider's many UDP microservices to the outside world without changing the client and server, and this solution needs to take into account both security and high performance.
[0004] Explanation of terms:
[0005] UDP (User Datagram Protocol) is a datagram protocol that provides packet-switched computer communications within an interconnected computer network. It assumes the use of IP as the underlying protocol and operates at the transport layer according to the OSI model. UDP provides a process for applications to send messages to other programs with minimal protocol mechanisms. The protocol is transaction-oriented and does not guarantee delivery or duplicate protection.
[0006] Proxy_Agent (edge proxy): used to encapsulate and process client data at the edge (client) and forward data packets to the target gateway on behalf of the client.
[0007] HProxy (High Performance Proxy): acts as a gateway and needs to be used in conjunction with Porxy_Agent.
[0008] Selector (selection module): The server is used to receive and forward client requests.
[0009] Recorder (recording module): A module used for high-performance forwarding in the edge proxy, used to set up shared memory and lock-free queues.
[0010] Encrypter (encryption module): used to encrypt client transmission data.
[0011] Encoder (encoding module): Encodes the encrypted client data into a specific format.
[0012] Dispatcher (forwarding module): forwards data to the target.
[0013] Handler: The module that actually processes the request data.
[0014] Decoder (decoding module): used to parse the encoded data in a specific format.
[0015] Decryptor (decryption module): used to decrypt encrypted client data. Summary of the Invention
[0016] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.
[0017] To this end, one purpose of an embodiment of the present invention is to provide a UDP protocol port convergence and forwarding method, which realizes the convergence and forwarding of UDP data while exposing a minimum number of UDP ports to the outside and without modifying the business logic of the UDP client and server, thereby improving the security and transmission performance of UDP data forwarding.
[0018] Another object of an embodiment of the present invention is to provide a UDP protocol port convergence and forwarding device.
[0019] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:
[0020] In one aspect, an embodiment of the present invention provides a UDP protocol port convergence and forwarding method, comprising the following steps:
[0021] Sending the first request data and the corresponding target UDP server address to the edge agent corresponding to the UDP client through the UDP client;
[0022] Encrypting and encapsulating the first request data and the target UDP server address through the edge proxy to obtain second request data, and then forwarding the second request data to the high-performance core proxy;
[0023] Receive, by the high-performance core proxy, the second request data forwarded by the plurality of edge proxies, and decode and decrypt each of the second request data to obtain the first request data and the corresponding target UDP server address;
[0024] Each first request data is forwarded to the corresponding UDP server according to the target UDP server address through the high-performance core agent.
[0025] Furthermore, in one embodiment of the present invention, the edge agent includes a first selection module, a shared memory pool, a recording module, a lock-free ring queue, and a first processor, and the first processor includes an encryption module, an encoding module, and a first forwarding module.
[0026] Furthermore, in one embodiment of the present invention, encrypting and encapsulating the first request data and the target UDP server address by the edge proxy to obtain second request data, and then forwarding the second request data to the high-performance core proxy, specifically includes:
[0027] forwarding the first request data and the target UDP server address to the recording module through the first selection module;
[0028] The recording module stores the first request data and the target UDP server address in the shared memory pool, and sends the corresponding shared memory address to the lock-free ring queue;
[0029] Obtaining the shared memory address from the lock-free circular queue by the encryption module, and encrypting the first request data in the shared memory pool according to the shared memory address to obtain first encrypted data;
[0030] Obtaining the shared memory address from the lock-free ring queue through the encoding module, and encapsulating the first encrypted data and the target UDP server address in the shared memory pool according to the shared memory address to obtain the second request data;
[0031] The shared memory address is obtained from the lock-free ring queue through the first forwarding module, and the second request data is read from the shared memory pool according to the shared memory address, and then the second request data is forwarded to the high-performance core agent.
[0032] Furthermore, in one embodiment of the present invention, the high-performance core agent includes a second selection module and a plurality of second processors, and the second processors include a decoding module, a decryption module, and a second forwarding module.
[0033] Furthermore, in one embodiment of the present invention, decoding and decrypting each second request data to obtain the first request data and the corresponding target UDP server address specifically includes:
[0034] forwarding the plurality of second request data to each of the second processors respectively through the second selection module;
[0035] Decoding the second request data by the decoding module to obtain the first encrypted data and the target UDP server address;
[0036] The first encrypted data is decrypted by the decryption module to obtain the first request data.
[0037] Furthermore, in one embodiment of the present invention, forwarding each first request data to a corresponding UDP server according to the target UDP server address by the high-performance core agent specifically includes:
[0038] Determine the UDP server and target port according to the target UDP server address;
[0039] The first request data is forwarded to the corresponding target port of the UDP server through the second forwarding module.
[0040] Furthermore, in one embodiment of the present invention, the high-performance core agent only exposes one UDP port to the outside, and each of the second forwarding modules forwards data through the UDP port.
[0041] On the other hand, an embodiment of the present invention provides a UDP protocol port convergence and forwarding device, comprising:
[0042] A data sending module is used to send the first request data and the corresponding target UDP server address to the edge agent corresponding to the UDP client through the UDP client;
[0043] an edge proxy processing module, configured to encrypt and encapsulate the first request data and the target UDP server address through the edge proxy to obtain second request data, and then forward the second request data to a high-performance core proxy;
[0044] a core proxy processing module, configured to receive, through the high-performance core proxy, the second request data forwarded by the plurality of edge proxies, and decode and decrypt each of the second request data to obtain the first request data and the corresponding target UDP server address;
[0045] The core agent forwarding module is used to forward each first request data to the corresponding UDP server according to the target UDP server address through the high-performance core agent.
[0046] On the other hand, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, a program stored on the memory and runnable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the UDP protocol port convergence and forwarding method as described above is realized.
[0047] On the other hand, an embodiment of the present invention also provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the UDP protocol port convergence forwarding method as described above.
[0048] The advantages and benefits of the present invention will be described in part in the following description and will become apparent from the following description or learned through practice of the present invention:
[0049] In an embodiment of the present invention, a UDP client sends first request data and a corresponding target UDP server address to an edge agent corresponding to the UDP client, encrypts and encapsulates the first request data and the target UDP server address through the edge agent to obtain second request data, and then forwards the second request data to a high-performance core agent, which receives the second request data forwarded by multiple edge agents through the high-performance core agent, decodes and decrypts each second request data to obtain the first request data and the corresponding target UDP server address, and forwards each first request data to the corresponding UDP server according to the target UDP server address through the high-performance core agent. The embodiment of the present invention realizes convergent forwarding of UDP data while exposing a minimum number of UDP ports to the outside and without modifying the business logic of the UDP client and server, thereby improving the security and transmission performance of UDP data forwarding. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative work.
[0051] Figure 1 A flowchart of a method for convergence and forwarding UDP protocol ports provided by an embodiment of the present invention;
[0052] Figure 2 A schematic diagram of data flow for the UDP protocol port convergence and forwarding method provided by an embodiment of the present invention;
[0053] Figure 3 A schematic diagram of the data flow of an edge agent provided by an embodiment of the present invention;
[0054] Figure 4 A flowchart of step S102 provided in an embodiment of the present invention;
[0055] Figure 5 A schematic diagram of the encapsulation format of the second request data provided by an embodiment of the present invention;
[0056] Figure 6 A schematic diagram of data flow for a high-performance core agent provided by an embodiment of the present invention;
[0057] Figure 7 A flowchart of step S103 provided in an embodiment of the present invention;
[0058] Figure 8 A flowchart of step S104 provided in an embodiment of the present invention;
[0059] Figure 9 A schematic diagram of the structure of a UDP protocol port convergence and forwarding device provided by an embodiment of the present invention;
[0060] Figure 10 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention;
[0061] Figure 11 A schematic diagram of the structure of a storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limitations on the present application. It should be noted that, although the functional modules are divided in the system schematic and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than the module division in the system schematic or the order in the flow chart. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and no limitation is placed on the order between the steps. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0063] In the description of the present invention, the meaning of "a plurality" is two or more. If there is a description of "first" or "second", it is only used to distinguish technical features and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features. In addition, unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this document are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0064] The UDP protocol port convergence and forwarding method provided in the embodiments of the present application can be applied to a terminal, can be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the UDP protocol port convergence and forwarding method, etc., but is not limited to the above forms.
[0065] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0066] It should be noted that in various specific embodiments of the present application, when relevant processing needs to be performed according to user information, user behavior data, user history data, and user location information, and other data related to the identity or characteristics of the user, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or by jumping to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for enabling the embodiments of the present application to function normally will be obtained.
[0067] As shown in Figure 1 Figure 1 is a step flowchart of a UDP protocol port convergence forwarding method provided by an embodiment of the present application. Referring to Figure 1 , the embodiment of the present application provides a UDP protocol port convergence forwarding method, which specifically includes the following steps:
[0068] S101, sending first request data and a corresponding target UDP server address to a corresponding edge agent of a UDP client through a UDP client;
[0069] S102, encrypting and encapsulating the first request data and the target UDP server address through the edge agent to obtain second request data, and then forwarding the second request data to a high-performance core agent;
[0070] S103, receiving second request data forwarded by multiple edge agents through the high-performance core agent, decoding and decrypting each second request data to obtain first request data and a corresponding target UDP server address;
[0071] S104, forwarding each first request data to a corresponding UDP server according to the target UDP server address through the high-performance core agent.
[0072] As shown in Figure 2 Figure 2 is a data flow diagram of a UDP protocol port convergence forwarding method provided by an embodiment of the present application. The present application needs to install an edge agent Proxy_Agent (penetration bastion host) on the client, and the client sends data to the edge agent Proxy_Agent, which encrypts, encapsulates, and forwards the data through the edge agent Proxy_Agent. The present application needs a high-performance UDP multi-forwarding core agent HProxy, which only exposes one UDP port to the outside, and communicates with external clients through the unique UDP port. After receiving the client data, the HProxy decodes, decrypts, and forwards the data to a specific UDP micro-service in the internal network, thereby completing a client request response.
[0073] like Figure 3 The data flow diagram of the edge agent provided by the embodiment of the present invention is shown in FIG. Figure 3 , further as an optional implementation, the edge agent includes a first selection module, a shared memory pool, a recording module, a lock-free ring queue and a first processor, and the first processor includes an encryption module, an encoding module and a first forwarding module.
[0074] like Figure 4 FIG. 1 is a flowchart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 4 As an optional implementation, the edge proxy encrypts and encapsulates the first request data and the target UDP server address to obtain the second request data, and then forwards the second request data to the high-performance core proxy, which specifically includes:
[0075] S1021. Forward the first request data and the target UDP server address to the recording module through the first selection module;
[0076] S1022. The recording module stores the first request data and the target UDP server address in a shared memory pool, and sends the corresponding shared memory address to the lock-free ring queue.
[0077] S1023. Obtain a shared memory address from the lock-free ring queue through the encryption module, and encrypt the first request data in the shared memory pool according to the shared memory address to obtain first encrypted data;
[0078] S1024. Obtain a shared memory address from the lock-free ring queue through the encoding module, and encapsulate the first encrypted data and the target UDP server address in the shared memory pool according to the shared memory address to obtain second request data;
[0079] S1025 . Obtain a shared memory address from the lock-free ring queue through the first forwarding module, read the second request data from the shared memory pool according to the shared memory address, and then forward the second request data to the high-performance core agent.
[0080] Specifically, the edge agent includes Selector, shared memory pool, Recorder, lock-free ring queue, and Handler. Handler includes Encrypter, Encoder, and Dispatcher.
[0081] 1) Selector: A cross-platform asynchronous reactive server model is built based on IO reuse technology. The Selector forwards received user requests and data to the Recorder module for processing.
[0082] 2) Shared memory pool: A high-performance memory pool where all data from clients is processed. Each module operates on a client's data through a shared memory address.
[0083] 3) Recorder: Obtains user data and stores it in a shared memory pool, then places the user data address into a high-performance lock-free ring queue.
[0084] 4) Lock-free Ring Queue: A key to high-performance forwarding lies in data copying. Based on a shared memory pool and a lock-free queue, the ring queue only stores the shared memory address of the data. Actual data operations are performed in the shared memory pool, thus achieving zero-copy operations.
[0085] 5)Handler: Handler is the actual data processor, and Handler consists of Encrypter, Encoder and Dispatcher.
[0086] 6) Encrypter: The encryption module encrypts the client's data in the shared memory pool. The encryption algorithm can be dynamically configured.
[0087] 7) Encoder: Data is encrypted and encapsulated using a private protocol.
[0088] 8) Dispatcher: The high-performance forwarding module forwards the private protocol data to the target HProxy by obtaining the shared memory address in the lock-free queue, and then marks the data area in the shared memory pool as available to release resources.
[0089] like Figure 5 FIG. 1 is a schematic diagram of the encapsulation format of the second request data provided by an embodiment of the present invention, specifically including:
[0090] 1) Protocol header: occupies 2 bits, fixed to 01;
[0091] 2) Magic number: occupies 4 bits and is fixed at 2077;
[0092] 3) Encryption algorithm type: occupies 4 bits to support multiple encryption algorithms, for example, 0001 is AES encryption algorithm, 0002 is DES encryption algorithm;
[0093] 4) Target address: The target server's address, which occupies 32 bits and is converted from dotted decimal to binary.
[0094] 5) Target port: the port of the target server, which occupies 16 bits;
[0095] 6) Data length: occupies 32 bits and is used to mark the length of encrypted data;
[0096] 7) data content: encrypted content;
[0097] 8) data end: occupying 2 bits, fixed as 10.
[0098] As Figure 6 shown is a data flow direction schematic diagram of the high-performance core agent provided by the embodiment of the application, referring to Figure 6 , further as an optional implementation, the high-performance core agent comprises a second selection module and a plurality of second processors, and the second processor comprises a decoding module, a decryption module and a second forwarding module.
[0099] As Figure 7 shown is a step flow chart of step S103 provided by the embodiment of the application, referring to Figure 7 , further as an optional implementation, the second request data is decoded and decrypted to obtain the first request data and the corresponding target UDP server address, which specifically comprises:
[0100] S1031, forwarding the plurality of second request data to the second processor respectively through the second selection module;
[0101] S1032, decoding the second request data through the decoding module to obtain the first encrypted data and the target UDP server address;
[0102] S1033, decrypting the first encrypted data through the decryption module to obtain the first request data.
[0103] As Figure 8 shown is a step flow chart of step S104 provided by the embodiment of the application, referring to Figure 8 , further as an optional implementation, the high-performance core agent forwards the first request data to the corresponding UDP server according to the target UDP server address, which specifically comprises:
[0104] S1041, determining the UDP server and the target port according to the target UDP server address;
[0105] S1042, forwarding the first request data to the target port of the corresponding UDP server through the second forwarding module.
[0106] Specifically, the high-performance core agent comprises Selector and a plurality of Handler, and the Handler comprises Decoder, Decryptor and Dispatcher, wherein:
[0107] 1) Selector: based on IO multiplexing technology, a cross-platform asynchronous reaction server model is constructed, and the Proxy_Agent data is forwarded to the Handler for processing.
[0108] 2) Handler: The core data processing module, consisting of Decoder, Decryptor and Dispatcher.
[0109] 3) Decoder: The decoder will determine whether the incoming data is legal and complies with the rules. If the data complies with the rules, the decoder will parse the data in the protocol.
[0110] 4) Decryptor: Decryptor will decrypt the data according to the type of encryption algorithm parsed
[0111] 5) Dispatcher: The dispatcher sends the decrypted data to the address and port of the target UDP server and exchanges data with the UDP server to complete the client request processing.
[0112] As a further optional implementation method, the high-performance core agent only exposes one UDP port to the outside, and each second forwarding module forwards data through the UDP port.
[0113] Specifically, the high-performance core agent of the embodiment of the present invention only exposes one UDP port to the outside, and communicates with the external client through the unique UDP port.
[0114] The above describes the method steps of the embodiment of the present invention. It can be seen that the embodiment of the present invention achieves convergent forwarding of UDP data while exposing a minimum number of UDP ports and without modifying the business logic of the UDP client and server, thereby improving the security and transmission performance of UDP data forwarding.
[0115] Compared with the prior art, the embodiments of the present invention also have the following advantages:
[0116] 1) Without modifying any client or server code, the intranet only needs to expose one server port to the outside world to handle forwarding and processing from multiple servers.
[0117] 2) Network forwarding and transmission are very secure. Due to the use of "edge proxy", all encryption and decryption as well as data encoding and decoding are completed in the proxy, which is highly controllable.
[0118] 3) High performance: Using native IO multiplexing system calls, combined with synchronization components such as lock-free and shared memory, it can maximize forwarding efficiency, reduce copying, and fully utilize the system's IO capabilities.
[0119] 4) High availability and configurability, easy deployment. The client only needs to deploy an Agent and then modify some IP pointing configurations to complete the deployment. The server does not need to do anything and only needs to deploy another HProxy.
[0120] 5) It can be horizontally expanded. When one HProxy is not enough, multiple HProxys can be deployed. One of the HProxy arbitrators can coordinate and load balance the client traffic to different HProxys to resist the impact of large traffic.
[0121] 6) For multiple different network environments, the Agent can be used as a bastion host to penetrate the intranet without completely opening the port protocol, which provides better isolation.
[0122] It should be recognized that in order to improve transmission performance, other services such as video cloud services often use UDP for data transmission. For some systems with strict regulations on security and confidentiality (such as state-owned systems), exposing too many ports to the outside world on the intranet will undoubtedly reduce the security of the system. For some old versions of systems or systems integrated through third-party cooperation, their systems are closed source, and it is very difficult to integrate and connect to these systems with strict security and confidentiality requirements. The solution proposed in the present invention can use the simplest and cheapest way to integrate these third-party components and services without modifying the current system, and the performance and confidentiality functions are good, with high application value.
[0123] like Figure 9 The diagram shows the structure of the UDP protocol port convergence and forwarding device provided by the embodiment of the present invention, referring to Figure 9 The embodiment of the present invention provides a UDP protocol port convergence and forwarding device, comprising:
[0124] A data sending module is used to send the first request data and the corresponding target UDP server address to the edge agent corresponding to the UDP client through the UDP client;
[0125] The edge proxy processing module is used to encrypt and encapsulate the first request data and the target UDP server address through the edge proxy to obtain the second request data, and then forward the second request data to the high-performance core proxy;
[0126] A core proxy processing module is configured to receive second request data forwarded by multiple edge proxies through a high-performance core proxy, and decode and decrypt each second request data to obtain the first request data and the corresponding target UDP server address;
[0127] The core proxy forwarding module is used to forward each first request data to the corresponding UDP server according to the target UDP server address through a high-performance core proxy.
[0128] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0129] An embodiment of the present invention further provides an electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the program is executed by the processor, the aforementioned UDP protocol port convergence and forwarding method is implemented. The electronic device can be any intelligent terminal, including a tablet computer and an in-vehicle computer.
[0130] like Figure 10 FIG2 is a schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention, referring to FIG2 Figure 10 , an embodiment of the present invention provides an electronic device, including:
[0131] The processor 1001 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention.
[0132] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called by the processor 1001 to execute the UDP protocol port convergence and forwarding method of the embodiments of the present invention.
[0133] Input / output interface 1003, used to implement information input and output;
[0134] Communication interface 1004, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0135] Bus 1005 , which transmits information between various components of the device (e.g., processor 1001 , memory 1002 , input / output interface 1003 , and communication interface 1004 );
[0136] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .
[0137] like Figure 11 FIG2 is a schematic diagram of the structure of the storage medium provided by the embodiment of the present invention, referring to FIG2 Figure 11 An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs 1101, and the one or more programs 1101 can be executed by one or more processors to implement the above-mentioned UDP protocol port convergence and forwarding method.
[0138] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0139] The embodiment of the present invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs Figure 1 The method shown.
[0140] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided in an exemplary manner for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operation and logic flow presented herein. Optional embodiments are contemplated in which the order of the various operations is changed and the sub-operations described as a part of a larger operation are performed independently.
[0141] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. More specifically, given the properties, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the module will be understood within the routine skills of an engineer. Therefore, a person skilled in the art can implement the present invention set forth in the claims using ordinary skills without undue experimentation. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0142] If the above functions are implemented in the form of 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0143] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0144] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable media on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0145] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0146] In the above description of this specification, reference to the terms "one embodiment / example," "another embodiment / example," or "certain embodiments / examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0147] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.
[0148] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A UDP protocol port convergence and forwarding method, characterized in that: The following steps are involved: Sending the first request data and the corresponding target UDP server address to the edge agent corresponding to the UDP client through the UDP client; Encrypting and encapsulating the first request data and the target UDP server address through the edge proxy to obtain second request data, and then forwarding the second request data to the high-performance core proxy; Receive, by the high-performance core proxy, the second request data forwarded by the plurality of edge proxies, and decode and decrypt each of the second request data to obtain the first request data and the corresponding target UDP server address; Each first request data is forwarded to the corresponding UDP server according to the target UDP server address through the high-performance core agent.
2. The UDP protocol port convergence and forwarding method according to claim 1, characterized in that: The edge agent includes a first selection module, a shared memory pool, a recording module, a lock-free ring queue and a first processor, wherein the first processor includes an encryption module, an encoding module and a first forwarding module.
3. A UDP protocol port convergence and forwarding method according to claim 2, characterized in that: The step of encrypting and encapsulating the first request data and the target UDP server address by the edge proxy to obtain the second request data, and then forwarding the second request data to the high-performance core proxy specifically includes: forwarding the first request data and the target UDP server address to the recording module through the first selection module; The recording module stores the first request data and the target UDP server address in the shared memory pool, and sends the corresponding shared memory address to the lock-free ring queue; Obtaining the shared memory address from the lock-free circular queue by the encryption module, and encrypting the first request data in the shared memory pool according to the shared memory address to obtain first encrypted data; Obtaining the shared memory address from the lock-free ring queue through the encoding module, and encapsulating the first encrypted data and the target UDP server address in the shared memory pool according to the shared memory address to obtain the second request data; The shared memory address is obtained from the lock-free ring queue through the first forwarding module, and the second request data is read from the shared memory pool according to the shared memory address, and then the second request data is forwarded to the high-performance core agent.
4. The UDP protocol port convergence and forwarding method according to claim 1, characterized in that: The high-performance core agent includes a second selection module and a plurality of second processors, wherein the second processors include a decoding module, a decryption module and a second forwarding module.
5. A UDP protocol port convergence and forwarding method according to claim 4, characterized in that: The decoding and decrypting of each second request data to obtain the first request data and the corresponding target UDP server address specifically includes: forwarding the plurality of second request data to each of the second processors respectively through the second selection module; Decoding the second request data by the decoding module to obtain the first encrypted data and the target UDP server address; The first encrypted data is decrypted by the decryption module to obtain the first request data.
6. A UDP protocol port convergence and forwarding method according to claim 4, characterized in that: The step of forwarding each first request data to a corresponding UDP server according to the target UDP server address through the high-performance core agent specifically includes: Determine the UDP server and target port according to the target UDP server address; The first request data is forwarded to the corresponding target port of the UDP server through the second forwarding module.
7. A UDP protocol port convergence and forwarding method according to any one of claims 4 to 6, characterized in that: The high-performance core agent only exposes one UDP port to the outside, and each of the second forwarding modules forwards data through the UDP port.
8. A UDP protocol port convergence and forwarding device, characterized in that: include: A data sending module is used to send the first request data and the corresponding target UDP server address to the edge agent corresponding to the UDP client through the UDP client; an edge proxy processing module, configured to encrypt and encapsulate the first request data and the target UDP server address through the edge proxy to obtain second request data, and then forward the second request data to a high-performance core proxy; a core proxy processing module, configured to receive, through the high-performance core proxy, the second request data forwarded by the plurality of edge proxies, and decode and decrypt each of the second request data to obtain the first request data and the corresponding target UDP server address; The core agent forwarding module is used to forward each first request data to the corresponding UDP server according to the target UDP server address through the high-performance core agent.
9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the UDP protocol port convergence and forwarding method as described in any one of claims 1 to 7 are realized.
10. A storage medium, which is a computer-readable storage medium and is used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the UDP protocol port convergence and forwarding method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Software defined network boundary implementation method and device, equipment and storage medium
CN117675361A
Application access method, cloud proxy assembly, node proxy assembly, device and medium
WO2023173720A1