UDP protocol port convergence forwarding method and device, electronic equipment and medium
By introducing edge proxy between UDP client and high-performance core proxy for data encryption and encapsulation, the security and performance problems of convergence forwarding of UDP microservice ports in the prior art are solved, and efficient and secure UDP data forwarding is achieved.
Patent Information
- Application Number
- CN202411681549.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-11-22
AI Technical Summary
The prior art is difficult to realize port convergence and forwarding of UDP microservices without changing the client and server business logic, resulting in security and performance problems.
By introducing edge agents between the client and the high-performance core agent, data encryption, encapsulation and forwarding are carried out, and convergence and forwarding of UDP data is achieved without modifying the UDP client and server business logic.
The minimum number of UDP ports is realized to be exposed to the outside world, which improves the security and transmission performance of UDP data forwarding without modifying client and server code.
Smart Images

Figure CN119788755A_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. The microservice cluster built on UDP must expose multiple UDP ports. The more UDP ports the system exposes, the greater the security risk. For some enterprises and projects with high security and isolation requirements, the exposed ports must be limited. The current mainstream approach is to integrate multiple services into a single application, but this will result in a bloated single application and poor performance. Forcibly integrating unrelated functional modules into one 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 one single application.
[0003] In view of the above situation, an architectural design solution is needed to expose a very small number (or even one) port of many UDP microservices of the service provider to the outside world without changing the client and server, and the solution needs to take into account both security and high performance.
[0004] Terminology explanation:
[0005] UDP (User Datagram Protocol): is a datagram mode that provides packet switching computer communications in a group of interconnected computer network environments. The protocol assumes the use of IP as the underlying protocol and works 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 and 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 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] On the one hand, an embodiment of the present invention provides a UDP protocol port convergence forwarding method, comprising the following steps:
[0021] Sending the first request data and the corresponding target UDP server address to the edge proxy corresponding to the UDP client through the UDP client;
[0022] The first request data and the target UDP server address are encrypted and encapsulated by the edge proxy to obtain second request data, and then the second request data is forwarded to the high-performance core proxy;
[0023] Receive the second request data forwarded by multiple edge agents through the high-performance core agent, decode and decrypt each of the second request data to obtain the first request data and the corresponding target UDP server address;
[0024] Each of the 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] Further, 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 the 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 first request data and the target UDP server address are stored in the shared memory pool through the recording module, and the corresponding shared memory address is sent to the lock-free ring queue;
[0029] Acquire the 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;
[0030] The shared memory address is obtained from the lock-free ring queue by the encoding module, and the first encrypted data and the target UDP server address in the shared memory pool are encapsulated 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] Further, in one embodiment of the present invention, the decoding and decrypting of each of the 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] Further, in one embodiment of the present invention, 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:
[0038] Determine the UDP server and the 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, including:
[0042] A data sending module, used to send the first request data and the corresponding target UDP server address to the edge proxy 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 the second request data forwarded by multiple edge proxies through the high-performance core proxy, 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 proxy forwarding module is used to forward each of the first request data to the corresponding UDP server according to the target UDP server address through the high-performance core proxy.
[0046] On the other hand, an embodiment of the present invention 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 realizing connection and communication between the processor and the memory, wherein the program, when executed by the processor, realizes the UDP protocol port convergence and forwarding method as described above.
[0047] On the other hand, an embodiment of the present invention also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage, and 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 beneficial effects of the present invention will be partly given in the following description, partly become apparent from the following description, or be understood through the practice of the present invention:
[0049] The embodiment of the present invention sends the first request data and the corresponding target UDP server address to the edge agent corresponding to the UDP client through the UDP client, encrypts and encapsulates the first request data and the target UDP server address through the edge agent to obtain the second request data, and then forwards the second request data to the high-performance core agent, 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 the convergence forwarding of UDP data while exposing the 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 solution 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 solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0051] Figure 1 A flow chart of the steps of the UDP protocol port convergence and forwarding method provided by an embodiment of the present invention;
[0052] Figure 2 A schematic diagram of data flow of a UDP protocol port convergence and forwarding method provided by an embodiment of the present invention;
[0053] Figure 3 A schematic diagram of data flow of an edge proxy provided by an embodiment of the present invention;
[0054] Figure 4 A step flow chart 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 of a high-performance core agent provided by an embodiment of the present invention;
[0057] Figure 7 A step flow chart of step S103 provided in an embodiment of the present invention;
[0058] Figure 8 A step flow chart of step S104 provided in an embodiment of the present invention;
[0059] Fig. 9 A schematic diagram of the structure of a UDP protocol port convergence and forwarding device provided in an embodiment of the present invention;
[0060] Fig.10 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention;
[0061] Fig.11 A schematic diagram of the structure of a storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0062] 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 having 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 cannot be understood as limitations on the present application. It should be noted that, although the functional module division is performed in the system schematic diagram 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 from the module division in the system schematic diagram or the flow chart. For the step numbers in the following embodiments, they are only set for the convenience of explanation, and the order between the steps is not limited in any way. 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 the first or the second, it is only for the purpose of distinguishing the technical features, and it cannot be understood as indicating or implying the 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 technicians in the technical field of this application. The terms used in this document are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0064] The UDP protocol port convergence and forwarding method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the 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 a server cluster or distributed system composed of multiple physical servers, and can also be configured 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, multiprocessor 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, etc. 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 through 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 each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0067] like Figure 1 FIG. 1 is a flow chart showing a method for convergence and forwarding of UDP protocol ports according to an embodiment of the present invention. Figure 1 The embodiment of the present invention provides a UDP protocol port convergence forwarding method, which specifically includes the following steps:
[0068] S101, sending the first request data and the corresponding target UDP server address to the edge proxy corresponding to the UDP client through the UDP client;
[0069] S102, 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;
[0070] S103, receiving the second request data forwarded by multiple edge agents through the high-performance core agent, decoding and decrypting each second request data to obtain the first request data and the corresponding target UDP server address;
[0071] S104. Forward each first request data to the corresponding UDP server according to the target UDP server address through a high-performance core proxy.
[0072] like Figure 2 The figure shows a data flow diagram of the UDP protocol port convergence and forwarding method provided by an embodiment of the present invention. The present invention requires the installation of an edge proxy Proxy_Agent (penetrating the bastion host) on the client. The client sends data to the edge proxy Proxy_Agent, which encrypts, encapsulates and forwards the data. The present invention requires a high-performance UDP multi-channel forwarding core proxy HProxy. The HProxy 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 will decode, decrypt and forward the data to a specific UDP microservice in the intranet, thereby completing a client request response.
[0073] like Figure 3 The data flow diagram of the edge proxy 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 flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 4 As an optional implementation, the first request data and the target UDP server address are encrypted and encapsulated by the edge proxy to obtain the second request data, and then the second request data is forwarded to the high-performance core proxy, which specifically includes:
[0075] S1021, forwarding the first request data and the target UDP server address to the recording module through the first selection module;
[0076] S1022, storing the first request data and the target UDP server address in a shared memory pool through a recording module, and sending the corresponding shared memory address to a lock-free ring queue;
[0077] S1023. Obtain a shared memory address from the lock-free ring queue through an 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, among which:
[0081] 1) Selector: A cross-platform asynchronous reactive server model is built based on IO multiplexing technology. 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 are processed. Each module operates a client's data through a shared memory address.
[0083] 3) Recorder: Obtains user data and stores it in a shared memory pool, and then puts 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 the shared memory pool and lock-free queue, the ring queue only stores the shared memory address of the data, and the actual data operations are performed in the shared memory pool, thereby achieving zero-copy operation.
[0085] 5)Handler: Handler is the actual data processor, which consists of Encrypter, Encoder and Dispatcher.
[0086] 6) Encrypter: The encryption module will encrypt the client's data in the shared memory pool, and the encryption algorithm can be dynamically configured.
[0087] 7) Encoder: The data is encrypted and encapsulated through a private protocol.
[0088] 8) Dispatcher: The high-performance forwarding module obtains the shared memory address in the lock-free queue, forwards the private protocol data to the target HProxy, and then marks the data area in the shared memory pool as available to release resources.
[0089] like Figure 5 The figure is a schematic diagram of the encapsulation format of the second request data provided by an embodiment of the present invention, which specifically includes:
[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 the AES encryption algorithm, and 0002 is the DES encryption algorithm;
[0093] 4) Target address: The address of the target server, which occupies 32 bits and is converted from dotted decimal to binary;
[0094] 5) Target port: the port of the target server, occupying 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: occupies 2 bits, fixed to 10.
[0098] like Figure 6 The data flow diagram of the high-performance core agent provided by the embodiment of the present invention is shown in FIG. Figure 6 , further as an optional implementation, the high-performance core agent includes a second selection module and multiple second processors, and the second processor includes a decoding module, a decryption module and a second forwarding module.
[0099] like Figure 7 FIG. 1 is a flow chart of step S103 provided in an embodiment of the present invention, referring to FIG. Figure 7 As an optional implementation, each second request data is decoded and decrypted to obtain the first request data and the corresponding target UDP server address, which specifically includes:
[0100] S1031, forwarding the plurality of second request data to each second processor respectively through a second selection module;
[0101] S1032, decoding the second request data through a decoding module to obtain the first encrypted data and the target UDP server address;
[0102] S1033. Decrypt the first encrypted data by using a decryption module to obtain first request data.
[0103] like Figure 8 FIG. 1 is a flowchart of step S104 provided in an embodiment of the present invention, referring to FIG. Figure 8 As an optional implementation, each first request data is forwarded to the corresponding UDP server according to the target UDP server address by a high-performance core agent, which specifically includes:
[0104] S1041, determining the UDP server and the target port according to the target UDP server address;
[0105] S1042. Forward the first request data to the target port of the corresponding UDP server through the second forwarding module.
[0106] Specifically, the high-performance core proxy includes Selector and multiple Handlers. Handlers include Decoder, Decryptor, and Dispatcher, among which:
[0107] 1) Selector: Build a cross-platform asynchronous response server model based on IO multiplexing technology, and forward Proxy_Agent data to multiple Handlers 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 transmitted 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: Dispatcher sends the decrypted data to the address and port of the target UDP server, and exchanges data with the UDP server to complete a 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 is a description of the method steps of the embodiment of the present invention. It can be appreciated that the embodiment of the present invention realizes the convergence forwarding of UDP data while exposing the 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.
[0115] Compared with the prior art, the embodiments of the present invention also have the following advantages:
[0116] 1) Without modifying any client and server code, the intranet only needs to expose one server port to the outside world to undertake the forwarding and processing of multiple servers.
[0117] 2) Network forwarding and transmission are very safe. 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, 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 HProxy 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, 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), too many ports exposed to the outside of the intranet will undoubtedly reduce the security of the system. For some old versions of the system or systems integrated with third parties, the system is closed source. It is very difficult to integrate and connect to these systems with strict requirements on security and confidentiality. By adopting the solution proposed in the present invention, these third-party components and services can be integrated in the simplest and cheapest way without modifying the current system, and the performance and confidentiality functions are good, with high application value.
[0123] like Fig. 9 FIG. 1 is a schematic diagram of the structure of a UDP protocol port convergence and forwarding device provided by an embodiment of the present invention, referring to FIG. Fig. 9 The embodiment of the present invention provides a UDP protocol port convergence and forwarding device, including:
[0124] A data sending module, used to send the first request data and the corresponding target UDP server address to the edge proxy 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, used for receiving second request data forwarded by multiple edge proxies through a high-performance core proxy, decoding and decrypting 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] The embodiment of the present invention also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned UDP protocol port convergence and forwarding method. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0130] like Fig.10 FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention, referring to FIG. Fig.10 , an embodiment of the present invention provides an electronic device, including:
[0131] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in 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 solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the UDP protocol port convergence and forwarding method of the embodiment of the present invention;
[0133] Input / output interface 1003, used to implement information input and output;
[0134] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0135] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the 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 Fig.11 FIG. 1 is a schematic diagram of a storage medium according to an embodiment of the present invention. Fig.11 The embodiment of the present invention also 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 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 disposed 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 a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are 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 executes Figure 1 The method shown.
[0140] In some selectable 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 by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0141] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, 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 a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. 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, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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 codes.
[0143] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0144] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.
[0145] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated 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, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. 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 one or more embodiments or examples in a suitable manner.
[0147] Although 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 present invention, and that the scope of the present 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 may 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 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 proxy corresponding to the UDP client through the UDP client; The first request data and the target UDP server address are encrypted and encapsulated by the edge proxy to obtain second request data, and then the second request data is forwarded to the high-performance core proxy; Receive the second request data forwarded by multiple edge agents through the high-performance core agent, decode and decrypt each of the second request data to obtain the first request data and the corresponding target UDP server address; Each of the first request data is forwarded to the corresponding UDP server according to the target UDP server address through the high-performance core agent.
2. A 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, and 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 first request data and the target UDP server address are stored in the shared memory pool through the recording module, and the corresponding shared memory address is sent to the lock-free ring queue; Acquire the 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; The shared memory address is obtained from the lock-free ring queue by the encoding module, and the first encrypted data and the target UDP server address in the shared memory pool are encapsulated 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. A 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 of the 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 of the first request data to the corresponding UDP server according to the target UDP server address by the high-performance core agent specifically includes: Determine the UDP server and the 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, used to send the first request data and the corresponding target UDP server address to the edge proxy 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 the second request data forwarded by multiple edge proxies through the high-performance core proxy, 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 proxy forwarding module is used to forward each of the first request data to the corresponding UDP server according to the target UDP server address through the high-performance core proxy.
9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory. When the program is executed by the processor, the steps of the UDP protocol port convergence forwarding method as described in any one of claims 1 to 7 are realized.
10. A storage medium, the storage medium being a computer-readable storage medium, 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 as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Software defined network boundary implementation method and device, equipment and storage medium
CN117675361A
A method and a user agent for load balancing within several proxies in a SIP network comprising a router applying network address translation
EP2741460A1
Application access method, cloud proxy assembly, node proxy assembly, device and medium
WO2023173720A1