Port multiplexing method based on cloud game server, processing device and storage medium
By pre-binding ports on cloud gaming servers and determining service programs based on protocol information, port reuse is achieved, solving the problem of high resource consumption and improving server operating speed.
Patent Information
- Application Number
- CN202211359646.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-01
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-11-01
AI Technical Summary
In existing technologies, cloud gaming servers allocate separate ports to each service program, resulting in high resource consumption and slowing down the running speed.
By pre-binding a port to receive initial data from the client, determining the application layer protocol type based on the protocol information in the data, and calling the corresponding service program to communicate, port reuse is achieved.
It reduced server resource consumption and improved running speed.
Smart Images

Figure CN115842849B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud server technology, and specifically to a port multiplexing method, processing device, and storage medium based on a cloud gaming server. Background Technology
[0002] Cloud gaming is a gaming method that places the computation in the cloud. Simply put, it involves moving the game's computation, rendering, and storage operations, which would normally be performed on the client, to a cloud gaming server, and then transmitting the completed game audio and video back to the client in real time over the network.
[0003] Cloud gaming servers provide network services by relying on TCP / UDP (TCP stands for Transmission Control Protocol; UDP stands for User Datagram Protocol) ports. Typically, one port corresponds to one application-layer service program, used to receive client connection requests or send / receive data. If multiple services are provided, multiple ports will be used. For example, HTTP (Hypertext Transfer Protocol), HTTPS (Hypertext Transfer Protocol over Secure Socket Layer), SSH (Secure Shell), RTMP (Real Time Messaging Protocol), RTSP (Real Time Streaming Protocol), WebRTC (Web Real-Time Communications), and VNC (Virtual Network Console) require at least one corresponding service port for each service.
[0004] Regarding the aforementioned technologies, the inventors believe that providing a corresponding port for each service program would consume a significant amount of server resources and slow down the operation of cloud gaming servers. Summary of the Invention
[0005] To address the aforementioned problems in the prior art, this invention proposes a port multiplexing method, processing device, and storage medium based on a cloud gaming server, which reduces the consumption of server resources and improves server operating speed.
[0006] In a first aspect, the present invention proposes a port multiplexing method based on a cloud gaming server, the method comprising:
[0007] Receive the first initial data sent by the first client through the pre-bound port;
[0008] The first protocol type of the application layer is determined based on the protocol information contained in the first initial data;
[0009] Based on the first protocol type, the corresponding first service program is invoked to communicate with the first client.
[0010] Preferably, the pre-bound port is a UDP port;
[0011] The step of receiving the first initial data sent by the first client through the pre-bound port includes:
[0012] The first initial data sent by the first client is received through the UDP port.
[0013] Preferably, the first protocol type includes: HTTP, WebRTC, or WebSocket (a protocol for full-duplex communication over a single TCP connection).
[0014] Preferably, the pre-bound port is a TCP port;
[0015] The first initial data includes: connection requests and service requests;
[0016] The step of receiving the first initial data sent by the first client through the pre-bound port includes:
[0017] Listening on the aforementioned TCP port;
[0018] Receive the connection request sent by the first client through the TCP port;
[0019] Establish a TCP connection based on the connection request;
[0020] Receive the service request sent by the first client.
[0021] Preferably, determining the first protocol type of the application layer based on the protocol information contained in the first initial data includes:
[0022] The first protocol type is determined based on the protocol information contained in the service request.
[0023] Preferably, the first protocol type includes: HTTP or STCP (Scalable TCP, a type of TCP congestion control protocol).
[0024] Preferably, if the first four bytes of the retrieved first initial data are 0x43, 0x47, 0x50 and 0x4B, then the first protocol type is STCP;
[0025] If the first initial data contains an HTTP request method field, then the first protocol type is HTTP;
[0026] The HTTP request methods include: GET, POST, HEAD, PUT, DELETE, OPTIONS, TRACE, or CONNECT.
[0027] Preferably, the method further includes:
[0028] Receive the second initial data sent by the second client through the pre-bound port;
[0029] The second protocol type of the application layer is determined based on the protocol information contained in the second initial data;
[0030] According to the second protocol type, the corresponding second service program is invoked to communicate with the second client;
[0031] The first client may be the same as or different from the second client;
[0032] The first protocol type may be the same as or different from the second protocol type.
[0033] In a second aspect, the present invention provides a processing apparatus including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described above.
[0034] In a third aspect, the present invention provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as described above.
[0035] This invention proposes a port reuse method based on a cloud gaming server. The server pre-binds a port and receives initial data from a first client through this port. Based on the protocol information contained in the initial data, the application layer's first protocol type is determined, and the corresponding first service program is invoked to communicate with the first client. If second initial data is received from a second client, the same method is used: the second protocol type is determined based on the protocol information contained in the second initial data, and the corresponding second service program is invoked to communicate with the second client. This method allows communication between multiple service programs to be completed using a single port, achieving port reuse, reducing server resource consumption, and improving server operating speed. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the main steps of a first embodiment of the port multiplexing method based on a cloud gaming server of the present invention;
[0037] Figure 2 This is a schematic diagram of the main steps of Embodiment 2 of the port multiplexing method based on cloud gaming server of the present invention;
[0038] Figure 3 This is a schematic diagram of the main steps of Embodiment 3 of the port multiplexing method based on cloud gaming server of the present invention;
[0039] Figure 4 This is a schematic diagram of the main steps of Embodiment 4 of the port multiplexing method based on cloud gaming server of the present invention. Detailed Implementation
[0040] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0041] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0042] It should be noted that in the description of this invention, the terms "first" and "second" are used merely for ease of description and do not indicate or imply the relative importance of the described devices, elements, or parameters, and therefore should not be construed as limiting the invention. Furthermore, the term "and / or" in this invention merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0043] Figure 1 This is a schematic diagram illustrating the main steps of an embodiment of the port multiplexing method based on a cloud gaming server according to the present invention. Figure 1 As shown, the port multiplexing method in this embodiment includes steps A10-A30:
[0044] Step A10: Receive the first initial data sent by the first client through the pre-bound port.
[0045] Step A20: Determine the first protocol type of the application layer based on the protocol information contained in the first initial data.
[0046] Step A30: Based on the first protocol type, invoke the corresponding first service program to communicate with the first client.
[0047] Figure 2 This is a schematic diagram illustrating the main steps of a second embodiment of the port multiplexing method based on a cloud gaming server according to the present invention. In this embodiment, the pre-bound port is a UDP port, such as... Figure 2 As shown, the port multiplexing method in this embodiment includes steps B10-B30:
[0048] Step B10: Receive the first initial data sent by the first client through the pre-bound UDP port.
[0049] Step B20: Determine the first protocol type of the application layer based on the protocol information contained in the first initial data.
[0050] The first protocol type includes HTTP, WebRTC, or WebSocket, etc.
[0051] Step B30: Based on the first protocol type, invoke the corresponding first service program to communicate with the first client.
[0052] Figure 3 This is a schematic diagram of the main steps of Embodiment 3 of the port multiplexing method based on a cloud gaming server of the present invention. In this embodiment, the pre-bound port is a TCP port, and the first initial data includes: connection request and service request. Figure 3 As shown, the port multiplexing method in this embodiment includes steps C10-C60:
[0053] Step C10: Listen on the pre-bound TCP port.
[0054] Step C20: Receive the connection request sent by the first client through the TCP port.
[0055] Step C30: Establish a TCP connection based on the connection request.
[0056] Step C40: Receive the service request sent by the first client through the TCP port.
[0057] Step C50: Determine the first protocol type based on the protocol information contained in the service request.
[0058] The first protocol type includes HTTP or STCP, etc.
[0059] For example, if the first four bytes of the first initial data are found to be 0x43, 0x47, 0x50, and 0x4B, then the first protocol type is determined to be STCP.
[0060] For example, if the first initial data contains an HTTP request method field, then the first protocol type is determined to be HTTP.
[0061] The HTTP request methods include: GET, POST, HEAD, PUT, DELETE, OPTIONS, TRACE, or CONNECT.
[0062] Step C60: Based on the first protocol type, invoke the corresponding first service program to communicate with the first client.
[0063] Figure 4 This is a schematic diagram illustrating the main steps of Embodiment 4 of the port multiplexing method based on a cloud gaming server according to the present invention. Figure 4 As shown, the port multiplexing method in this embodiment includes steps D10-D60:
[0064] Step D10: Receive the first initial data sent by the first client through the pre-bound port.
[0065] Step D20: Determine the first protocol type of the application layer based on the protocol information contained in the first initial data.
[0066] Step D30: Based on the first protocol type, invoke the corresponding first service program to communicate with the first client.
[0067] Step D40: Receive the second initial data sent by the second client through the pre-bound port.
[0068] Step D50: Determine the second protocol type of the application layer based on the protocol information contained in the second initial data.
[0069] Step D60: Based on the second protocol type, invoke the corresponding second service program to communicate with the second client.
[0070] The first client and the second client can be the same or different. When the pre-bound port is a UDP port, the first protocol type and the second protocol type are different; when the pre-bound port is a TCP port, the first protocol type and the second protocol type can be the same or different.
[0071] For example, a UDP port 9000 can be used for both WebRTC RTSP (RTSP stands for Real Time Streaming Protocol) push streaming and for receiving HTTP requests.
[0072] Although the steps in the above embodiments are described in the above order, those skilled in the art will understand that, in order to achieve the effect of this embodiment, different steps do not necessarily need to be executed in this order. They can be executed simultaneously (in parallel) or in a reverse order, and these simple variations are all within the protection scope of this invention. For example, steps D10-D30 and steps D40-D60 in Embodiment 4 can be executed in parallel.
[0073] Furthermore, the present invention also provides an embodiment of a processing device, the processing device of which includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the methods described above.
[0074] Furthermore, the present invention also provides an embodiment of a computer-readable storage medium, wherein the storage medium of this embodiment stores a computer program that can be loaded by a processor and execute the methods described above.
[0075] The computer-readable storage medium includes, for example, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0076] Those skilled in the art will recognize that the method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of electronic hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the invention.
[0077] The technical solution of the present invention has now been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions resulting from these changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A port multiplexing method based on a cloud gaming server, characterized in that, The method includes: Receive the first initial data sent by the first client through the pre-bound port; The first protocol type of the application layer is determined based on the protocol information contained in the first initial data; When the pre-bound port is a UDP port: receiving the first initial data sent by the first client through the pre-bound port includes: receiving the first initial data sent by the first client through the UDP port, wherein the first protocol type includes: HTTP, WebRTC or WebSocket; According to the first protocol type, the corresponding first service program is invoked to communicate with the first client; Receive the second initial data sent by the second client through the pre-bound port; The second protocol type of the application layer is determined based on the protocol information contained in the second initial data; According to the second protocol type, the corresponding second service program is invoked to communicate with the second client; in, The first client may be the same as or different from the second client; When the pre-bound port is a UDP port, the first protocol type is different from the second protocol type; When the pre-bound port is a TCP port, the first protocol type may be the same as or different from the second protocol type.
2. The port multiplexing method based on a cloud gaming server according to claim 1, characterized in that, When the pre-bound port is a TCP port: The first initial data includes: connection requests and service requests; The step of receiving the first initial data sent by the first client through the pre-bound port includes: Listening on the aforementioned TCP port; Receive the connection request sent by the first client through the TCP port; establish a TCP connection according to the connection request; The service request sent by the first client is received through the TCP port.
3. The port multiplexing method based on a cloud gaming server according to claim 2, characterized in that, The step of determining the first protocol type of the application layer based on the protocol information contained in the first initial data includes: The first protocol type is determined based on the protocol information contained in the service request.
4. The port multiplexing method based on a cloud gaming server according to claim 3, characterized in that, The first protocol type includes: HTTP or STCP.
5. The port multiplexing method based on a cloud gaming server according to claim 4, characterized in that, If the first four bytes of the first initial data are 0x43, 0x47, 0x50 and 0x4B, then the first protocol type is STCP; If the first initial data contains an HTTP request method field, then the first protocol type is HTTP; The HTTP request methods include: GET, POST, HEAD, PUT, DELETE, OPTIONS, TRACE, or CONNECT.
6. A processing apparatus, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed as described in any one of claims 1-5.
7. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and execute the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Message processing method and device, computing equipment and readable storage medium
CN112615822A