A method and device for preventing ports from being occupied

Through port pre-occupation and takeover operations, the problem of port occupied by other programs after cloud host is started is solved, the port usage rights are transferred and the normal service provision of target programs is realized, and the probability of service interruption is reduced.

CN112667404BActive Publication Date: 2024-12-13GUANGZHOU ENERGY CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011645071.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2024-12-13
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

The time when the cloud host starts and listens to the IP port of the service program is unpredictable, which may cause the port to be occupied by other programs, resulting in the cloud host service program being unable to provide services normally.

Method used

Through a series of operations that pre-occupation, takeover and release at the right time, ensure that the port usage rights are passed between programs, avoiding the port being occupied by other programs, and ensuring that the target program can use the port normally to provide services to the outside. The specific steps include running the port pre-occupation program to occupy the specified port, the cloud host daemon performs preparation steps and obtains the port, and then starting the cloud host service program after releasing the port.

Benefits of technology

It effectively reduces the probability that the cloud host service program cannot provide services, ensures the smooth transmission and use of ports between programs, and ensures that the target program can provide services normally.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112667404B_ABST
    Figure CN112667404B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for preventing ports from being occupied, which realizes the transfer of port usage rights between programs through a series of operations such as pre-occupation, takeover, and release of ports at the right time, thereby preventing ports from being occupied by other programs and ensuring that the target program using the port can use the port normally to provide services externally, thereby reducing the probability that the cloud host service program cannot provide services. Compared with the prior art, since the port is not occupied as soon as possible after the cloud host is turned on, there is a possibility that the port is used by other programs. The present invention uses a port pre-occupancy program and a port takeover method to occupy the designated port as soon as the cloud host is turned on, and can allow the designated port to be transferred and used between programs, ensuring that the target program can use the port normally to provide services to users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud gaming technology, and in particular to a method and device for preventing a port from being occupied. Background Art

[0002] In the related art, cloud games provide services to the outside world through cloud host service programs. A series of steps are required from the start of the cloud host to the normal provision of services by the cloud host service program. Figure 1 As shown, Figure 1 It is mainly divided into two large process blocks, which correspond to the operation processes of two different programs. The first block is before starting the cloud host service program: this part is the startup process of the cloud host daemon. The process involves program updates, logging in to the cloud host management background and other operations. If these operations are unsuccessful, a limited number of retries will be performed, and the time required is unpredictable. The second block is after starting the cloud host service program: this part is the startup process of the cloud host service program. It can be seen that the startup of the cloud host service program depends on the normal startup of the cloud host daemon. Therefore, the time from the cloud host startup to the cloud host service program listening to the IP port is also unpredictable. Two of the key startup steps are described as follows:

[0003] Step 1: The cloud host daemon runs automatically after the cloud host is turned on;

[0004] Step 2: The cloud host service program is started and run by the cloud host daemon.

[0005] However, the above-mentioned related technologies have the following shortcomings:

[0006] The time from when the cloud host is turned on to when the cloud gaming service program monitors the IP port may be very long. During this process, other programs that are started up (such as game accelerators, etc.) may use the port to connect to the network, and there is a certain probability that the port to be used by the cloud host service program will be occupied, resulting in the cloud host service program being unable to provide gaming services normally. Summary of the invention

[0007] The purpose of the present invention is to solve at least one of the technical problems existing in the prior art, and to provide a method and device for preventing ports from being occupied. Through a series of operations such as pre-occupation, takeover and release of ports at an appropriate time, the port usage rights are transferred between programs, thereby preventing the ports from being occupied by other programs and ensuring that the target program using the ports can use the ports normally to provide services externally.

[0008] In a first aspect, an embodiment of the present invention provides a method for preventing a port from being occupied, the method being applied to a cloud host. After the cloud host is powered on, the method includes:

[0009] Running a port pre-occupancy program and occupying a preset designated port through the port pre-occupancy program;

[0010] Run the cloud host daemon and perform preset preparation steps through the cloud host daemon;

[0011] After executing the preparation step, the cloud host daemon obtains the designated port occupied by the port pre-occupancy program;

[0012] The cloud host daemon process releases the designated port and starts the cloud host service program after releasing the designated port.

[0013] In some embodiments, the preparation step specifically includes:

[0014] The cloud host daemon checks whether the cloud host service program needs to be upgraded;

[0015] The cloud host daemon performs corresponding upgrade operations based on the inspection results.

[0016] In some embodiments, the performing of the preparation step specifically includes:

[0017] The cloud host daemon has completed the corresponding promotion and demotion operation; or

[0018] The cloud host daemon detection result shows that it does not need to be upgraded.

[0019] In some embodiments, the process of the host daemon program acquiring the designated port occupied by the port pre-occupancy program specifically includes:

[0020] The cloud host daemon program closes the port pre-occupancy program so that the designated port occupied by the port pre-occupancy program is released;

[0021] The cloud host daemon occupies the released designated port.

[0022] In some embodiments, after performing the preparation step and before the cloud host daemon obtains the designated port occupied by the port pre-occupancy program, the method further includes:

[0023] The cloud host daemon logs in to the cloud host management backend according to the preset configuration.

[0024] In some embodiments, the process of occupying a preset designated port by the port pre-occupancy program specifically includes:

[0025] Check whether the preset designated port is occupied;

[0026] When the preset designated port is occupied by the first program, closing the first program to release the occupied designated port;

[0027] The port pre-occupancy program occupies the released designated port;

[0028] The port pre-emption program starts the first program that was shut down.

[0029] In a second aspect, an embodiment of the present invention provides a device for preventing a port from being occupied, the device being applied to a cloud host. After the cloud host is powered on, the device includes:

[0030] A first occupying module, used for running a port pre-occupancy program and occupying a preset designated port through the port pre-occupancy program;

[0031] A preparation step execution module, used for running a cloud host daemon and executing preset preparation steps by running the cloud host daemon;

[0032] A port transfer module, used for obtaining the designated port occupied by the port pre-occupancy program through the cloud host daemon program after the cloud host daemon program executes the preparation step;

[0033] The service startup module is used for the cloud host daemon process to release the designated port and start the cloud host service program after releasing the designated port.

[0034] In some embodiments, the preparation step specifically includes:

[0035] The cloud host daemon checks whether the cloud host service program needs to be upgraded;

[0036] Based on the inspection results, the cloud host daemon performs the corresponding upgrade operations.

[0037] In some embodiments, the performing of the preparation step specifically includes:

[0038] The cloud host daemon has completed the corresponding promotion and demotion operation; or

[0039] The cloud host daemon detection result shows that it does not need to be upgraded.

[0040] In some embodiments, the first occupancy module is further configured to:

[0041] Closing the port pre-occupancy program through the cloud host daemon program so that the designated port occupied by the port pre-occupancy program is released;

[0042] The released designated port is occupied by the cloud host daemon.

[0043] In some embodiments, the device further includes a login module for logging into the cloud host management backend through the cloud host daemon according to a preset configuration.

[0044] In some embodiments, the first occupancy module is further configured to:

[0045] Check whether the preset designated port is occupied;

[0046] When the preset designated port is occupied by the first program, closing the first program to release the occupied designated port;

[0047] The port pre-occupancy program occupies the released designated port;

[0048] The port pre-emption program starts the first program that was shut down.

[0049] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute a method for preventing a port from being occupied as described in any one of the embodiments of the first aspect of the present invention.

[0050] Compared with the prior art, the present invention provides a method and device for preventing ports from being occupied, which have at least the following beneficial effects:

[0051] 1. The present invention provides a method and device for preventing ports from being occupied. Through a series of operations such as pre-occupation of ports, taking over and releasing them at an appropriate time, the port usage rights are transferred between programs, thereby preventing the ports from being occupied by other programs and ensuring that the target programs using the ports can use the ports normally to provide services externally, thereby reducing the probability that the cloud host service program cannot provide services.

[0052] 2. Compared with the prior art, since the port is not occupied as soon as possible after the cloud host is turned on, there is a possibility that the port is used by other programs. The present invention uses the port pre-occupancy program and port takeover method to occupy the designated port as soon as the cloud host is turned on, and can allow the designated port to be transferred between programs, ensuring that the target program can use the port normally to provide services to users.

[0053] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The present invention is further described below in conjunction with the accompanying drawings and embodiments;

[0055] Figure 1 A schematic diagram of the process of starting a cloud host in the related art;

[0056] Figure 2 A diagram of an application environment of a method for preventing ports from being occupied in one embodiment.

[0057] Figure 3 The figure is a flowchart of a method for preventing a port from being occupied in one embodiment.

[0058] Figure 4 A structural block diagram of a device for preventing a port from being occupied in one embodiment.

[0059] Figure 5 The figure is a flowchart of a method for preventing a port from being occupied in one embodiment.

[0060] Figure 6 The figure is a flow chart of a port pre-occupancy program occupying a designated port in one embodiment.

[0061] Figure 7 The figure is a flowchart of a method for preventing a port from being occupied in one embodiment.

[0062] Figure 8 FIG. 4 is a structural block diagram of a computer device in one embodiment.

[0063] Reference numerals:

[0064] 100, user end; 200, cloud host; 201, first occupation module; 202, preparation step execution module; 203, port transfer module; 204, service startup module. DETAILED DESCRIPTION

[0065] This section will describe in detail the specific embodiments of the present invention. The preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the accompanying drawings is to supplement the description of the text part of the specification with graphics, so that people can intuitively and vividly understand each technical feature and the overall technical solution of the present invention, but it cannot be understood as a limitation on the scope of protection of the present invention.

[0066] In order to facilitate those skilled in the art to understand the present invention, the technical terms involved in the embodiments of the present invention are briefly described below.

[0067] Cloud gaming: Games rendered in the cloud and displayed and controlled on the terminal. The user's gaming device does not require any high-end processors and graphics cards, only basic video decompression capabilities.

[0068] Cloud host: A server that runs games and provides game screen video streaming services and signaling control services. It can be a physical machine or a virtual machine.

[0069] Cloud host daemon: The daemon of the cloud host service program. Responsible for starting, restarting, and upgrading the cloud host service program.

[0070] Cloud host service program: A program that runs on a cloud host and provides cloud gaming video streaming, remote control and other services to Internet users.

[0071] Cloud host management background: a background management system used to uniformly manage and control cloud hosts.

[0072] Port pre-occupancy program: A program that can occupy a specified IP port according to the configuration after startup.

[0073] Game accelerator: A program that provides network acceleration for games.

[0074] TCP / UDP: Network transmission protocol based on the Client-Server model.

[0075] Figure 2 FIG. 1 is an application environment diagram of a method for preventing ports from being occupied in one embodiment. Figure 2 , the method for avoiding port occupation is applied to a cloud gaming platform. The cloud gaming platform includes a user terminal 100 and a cloud host 200. The user terminal 100 and the cloud host 200 are connected via a network. The user terminal 100 can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The cloud host 200 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0076] like Figure 2 As shown, an embodiment of the present invention provides a method for preventing a port from being occupied, and the method is run on a cloud host 200. After the cloud host 200 is turned on, the method includes the following steps:

[0077] Step S101: the cloud host 200 runs a port pre-occupancy program and occupies a preset designated port through the port pre-occupancy program.

[0078] It should be noted that the process of occupying a preset designated port through the port pre-occupancy program specifically includes:

[0079] Step S1011: the port pre-occupancy program detects whether the preset designated port is occupied;

[0080] Step S1012: when the preset designated port is occupied by the first program, the port pre-occupancy program closes the first program to release the occupied designated port;

[0081] Step S1013: the port pre-occupancy program occupies the released designated port;

[0082] Step S1014: The port pre-occupancy program starts the closed first program.

[0083] Specifically, Figure 5 As shown, in one example, the key steps of the port pre-occupancy program to occupy the port are described as follows:

[0084] Step 1: The cloud host 200 automatically runs the port pre-occupancy program when it is turned on.

[0085] Step 2: Determine which running programs occupy the ports used by the cloud host service program, and close the programs occupying the ports.

[0086] Step 3: The port pre-occupancy program occupies the port to be used by the cloud host service program.

[0087] Step 4: Restart the programs that were closed in step 2.

[0088] It is understandable that through steps S1011 to S1014, the port pre-occupancy program can close the first program occupying the designated port when the designated port is occupied and restart the first program after the first program releases the port, which can further ensure that all designated ports are not occupied by other programs and that the programs occupying the designated ports can run normally. It is understandable that the first program can be a game accelerator or other program running on the cloud host.

[0089] Step S102: the cloud host 200 runs a cloud host daemon and executes preset preparation steps through the cloud host daemon.

[0090] It should be noted that the preparation steps specifically include:

[0091] Step S1021: the cloud host daemon checks whether the cloud host service program needs to be upgraded;

[0092] Step S1022: The cloud host daemon performs corresponding upgrade operations according to the inspection results.

[0093] like Figure 7 As shown, the preparation steps include program updates, logging in to the cloud host management backend, etc. If these operations are unsuccessful, they will be retried a limited number of times, and the time required is difficult to predict.

[0094] Step S103: After executing the preparation step, the cloud host daemon obtains the designated port occupied by the port pre-occupancy program.

[0095] The execution of the preparation step specifically includes:

[0096] The cloud host daemon has completed the corresponding promotion and demotion operation; or

[0097] The cloud host daemon detection result shows that it does not need to be upgraded.

[0098] After executing the preparation step and before the cloud host daemon acquires the designated port occupied by the port pre-occupancy program, the method further includes:

[0099] Step S1031: The cloud host daemon logs into the cloud host management backend according to the preset configuration.

[0100] The process of the host daemon program acquiring the designated port occupied by the port pre-occupancy program specifically includes:

[0101] Step S1032: The cloud host daemon program closes the port pre-occupancy program so that the designated port occupied by the port pre-occupancy program is released.

[0102] Step S1033: The cloud host daemon occupies the released designated port.

[0103] Step S104: the cloud host daemon process releases the designated port and starts the cloud host service program after releasing the designated port.

[0104] The present invention provides a method for preventing ports from being occupied. Through a series of operations including pre-occupation of ports, taking over and releasing the ports at an appropriate time, the port usage right is transferred between programs, thereby preventing the ports from being occupied by other programs and ensuring that the target programs using the ports can use the ports normally to provide services externally, thereby reducing the probability that the cloud host service program cannot provide services.

[0105] like Figure 5 and Figure 7 As shown, the present invention provides a preferred embodiment of a method for preventing a port from being occupied, such as Figure 5 As shown, this embodiment includes the following steps:

[0106] Step 1: The cloud host 200 starts up and starts the port pre-occupancy program to occupy the service port required by the cloud host service program.

[0107] Step 2: The cloud host 200 is powered on and the cloud host daemon is started, and the program performs operations such as upgrades.

[0108] Step 3: After the cloud host daemon completes the program upgrade operation, it will shut down the port pre-occupancy program and take over the port that needs to be occupied.

[0109] Step 4: Before starting the cloud host service program, the cloud host daemon will release the occupied port, and then start the cloud host service program. The cloud host service program normally uses the designated port to provide cloud gaming services.

[0110] specific, and Figure 1Compared with the related technologies in , the cloud host service program startup process is improved to complete the port takeover and release operations. Figure 7 As shown, the improvement mainly adds two key steps, which are described as follows:

[0111] Step 1: The cloud host daemon actively closes the port pre-occupying program and immediately occupies the port occupied by the port pre-occupying program inside the cloud host daemon. At this time, the port has completed the transfer from the port pre-occupying program to the cloud host daemon.

[0112] Step 2: Before the cloud host daemon starts the cloud host service program, first release the port needed by the cloud host service program so that the cloud host service program can use the port to provide services normally after it is started.

[0113] Compared with the prior art, since the port is not occupied as soon as possible after the cloud host is turned on, there is a possibility that the port is used by other programs. The present invention uses the port pre-occupancy program and port takeover method to occupy the designated port as soon as the cloud host is turned on, and can allow the designated port to be transferred between programs, ensuring that the target program can use the port normally to provide services to users.

[0114] In a second aspect, an embodiment of the present invention provides a device for preventing a port from being occupied, the device being applied to a cloud host. After the cloud host is powered on, the device includes:

[0115] The first occupation module 201 is used to run a port pre-occupancy program and occupy a preset designated port through the port pre-occupancy program;

[0116] A preparation step execution module 202 is used to run a cloud host daemon and execute preset preparation steps by running the cloud host daemon;

[0117] The port transfer module 203 is used to obtain the designated port occupied by the port pre-occupancy program through the cloud host daemon program after the cloud host daemon program executes the preparation step;

[0118] The service startup module 204 is used for the cloud host daemon process to release the designated port and start the cloud host service program after releasing the designated port.

[0119] In some embodiments, the preparation step specifically includes:

[0120] The cloud host daemon checks whether the cloud host service program needs to be upgraded;

[0121] Based on the inspection results, the cloud host daemon performs the corresponding upgrade operations.

[0122] In some embodiments, the performing of the preparation step specifically includes:

[0123] The cloud host daemon has completed the corresponding promotion and demotion operation; or

[0124] The cloud host daemon detection result shows that it does not need to be upgraded.

[0125] In some embodiments, the first occupancy module 201 is further configured to:

[0126] Closing the port pre-occupancy program through the cloud host daemon program so that the designated port occupied by the port pre-occupancy program is released;

[0127] The released designated port is occupied by the cloud host daemon.

[0128] In some embodiments, the device further includes a login module for logging into the cloud host management backend through the cloud host daemon according to a preset configuration.

[0129] In some embodiments, the first occupancy module 201 is further configured to:

[0130] Check whether the preset designated port is occupied;

[0131] When the preset designated port is occupied by the first program, closing the first program to release the occupied designated port;

[0132] The port pre-occupancy program occupies the released designated port;

[0133] The port pre-emption program starts the first program that was shut down.

[0134] It can be understood that the device embodiment of the present invention and the above-mentioned method embodiment are based on the same inventive concept, so the device embodiment will not be described in detail here.

[0135] Figure 6 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 2 The cloud host 200 in Figure 6 As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor may implement a method to avoid the port being occupied. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor may implement a method to avoid the port being occupied. Those skilled in the art will understand that Figure 8The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0136] In one embodiment, the device for preventing a port from being occupied provided by the present application can be implemented in the form of a computer program. The computer program can be used in a computer program such as Figure 8 The computer device shown in the figure is run. The memory of the computer device may store various program modules constituting a device for preventing a port from being occupied, for example, Figure 4 The first occupation module 201, the preparation step execution module 202, the port transfer module 203 and the service start module 204 are shown. The computer program composed of various program modules enables the processor to execute the steps of a method for preventing a port from being occupied in various embodiments of the present application described in this specification.

[0137] For example, Figure 8 The computer device shown can be Figure 3 The first occupation module 201 in the device for preventing port occupation is shown to execute the steps of running a port pre-occupancy program and occupying a preset designated port through the port pre-occupancy program. The preparation step execution module 202 executes the steps of running a cloud host daemon and executing preset preparation steps through running the cloud host daemon.

[0138] In one embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to cause a computer to execute the steps of the method for disabling a Windows system browser described above. The steps of disabling a Windows system browser described here may be the steps of the method for disabling a Windows system browser described in each of the above embodiments.

[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRA), memory bus (Rambus) direct RAM (RDRA), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0140] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A method for preventing a port from being occupied, characterized in that: The method is applied to a cloud host. After the cloud host is powered on, the method includes: Run the port pre-occupancy program and detect whether the preset designated port is occupied; When the preset designated port is occupied by the first program, closing the first program to release the occupied designated port; The port pre-occupancy program occupies the released designated port; The port pre-occupancy program starts the first program that was shut down; Run the cloud host daemon and use the cloud host daemon to check whether the cloud host service program needs to be upgraded; After the inspection results indicate that no upgrade is required, or After determining that the result of the check is that an upgrade is required and the cloud host daemon program has completed the corresponding upgrade operation, the cloud host daemon program is run to close the port pre-occupancy program so that the designated port occupied by the port pre-occupancy program is released; The cloud host daemon occupies the released designated port; The cloud host daemon process releases the designated port and starts the cloud host service program after releasing the designated port.

2. A method for preventing a port from being occupied according to claim 1, characterized in that: After determining that the result of the check is that an upgrade is not required, or determining that the result of the check is that an upgrade is required, and the cloud host daemon program has completed the corresponding upgrade operation, and before running the cloud host daemon program to close the port pre-occupancy program, the method further includes: The cloud host daemon logs in to the cloud host management backend according to the preset configuration.

3. A device for preventing a port from being occupied, characterized in that: The device is applied to a cloud host. After the cloud host is turned on, the device includes: A first occupation module, used for running a port pre-occupancy program and detecting whether a preset designated port is occupied; When the preset designated port is occupied by the first program, closing the first program to release the occupied designated port; The port pre-occupancy program occupies the released designated port; The port pre-occupancy program starts the first program that was shut down; A preparation step execution module is used to run the cloud host daemon and check whether the cloud host service program needs to be upgraded by running the cloud host daemon; The port transfer module is used to determine that the inspection result does not need to be upgraded, or After determining that the result of the check is that an upgrade is required and the cloud host daemon program has completed the corresponding upgrade operation, the cloud host daemon program is run to close the port pre-occupancy program so that the designated port occupied by the port pre-occupancy program is released; The cloud host daemon occupies the released designated port; The service startup module is used for the cloud host daemon process to release the designated port and start the cloud host service program after releasing the designated port.