WO2022017070A1 - 图像处理方法、装置、服务器及介质 - Google Patents

图像处理方法、装置、服务器及介质 Download PDF

Info

Publication number
WO2022017070A1
WO2022017070A1 PCT/CN2021/100026 CN2021100026W WO2022017070A1 WO 2022017070 A1 WO2022017070 A1 WO 2022017070A1 CN 2021100026 W CN2021100026 W CN 2021100026W WO 2022017070 A1 WO2022017070 A1 WO 2022017070A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
game
container
image
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/100026
Other languages
English (en)
French (fr)
Inventor
赵新达
龚志鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to JP2022548779A priority Critical patent/JP7464732B2/ja
Priority to KR1020227017638A priority patent/KR102737061B1/ko
Priority to EP21845550.9A priority patent/EP4120065A4/en
Publication of WO2022017070A1 publication Critical patent/WO2022017070A1/zh
Priority to US17/731,170 priority patent/US12121807B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • A63F13/352Details of game servers involving special game server arrangements, e.g. regional servers connected to a national server or a plurality of servers managing partitions of the game world
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • A63F13/355Performing operations on behalf of clients with restricted processing capabilities, e.g. servers transform changing game scene into an encoded video stream for transmitting to a mobile phone or a thin client
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Definitions

  • the present application relates to the field of Internet technologies, in particular to the field of image processing technologies, and in particular, to an image processing method, an image processing device, a server, and a computer storage medium.
  • cloud gaming also known as gaming on demand
  • Computing is an Internet-based computing method.
  • Cloud gaming technology enables client devices with relatively limited graphics processing and data computing capabilities to run high-quality games.
  • the game does not run on the player user's game client, but on the cloud server; the cloud server renders the game scene into a video and audio stream, and transmits it to the player user's game client through the network for playback.
  • the game client of the player user does not need to have powerful graphics computing and data processing capabilities, but only needs to have the basic streaming media playback ability and the ability to obtain and send the input command of the player user to the cloud server.
  • the time consumed by the game running is an important indicator to measure the running speed of cloud games. If the time consumed in the game running process is longer, the running speed of the cloud game will be slower; if the time consumed during the game running process is shorter, the running speed of the cloud game will be faster. Based on this, how to reduce the time consumed by cloud games in the running process to improve the running speed of cloud games has become a research hotspot.
  • the embodiments of the present application provide an image processing method, device, server and medium, which can effectively save the compilation time of the target coloring code, thereby effectively improving the running speed of the target game.
  • an embodiment of the present application provides an image processing method, and the image processing method includes:
  • the target compilation result of the target coloring code is obtained from game resources, the game resources include at least one of the following: a game image of the target game, and a target between the target container and an associated container of the target container a shared directory, where the target shared directory includes a first compilation result obtained by the associative container compiling at least one shader code during the game running process;
  • Graphic processing is performed according to the target compilation result to obtain a feedback image corresponding to the operation event.
  • an embodiment of the present application provides an image processing apparatus, and the image processing apparatus includes:
  • an acquisition unit used for acquiring the target coloring code corresponding to the operation event in response to the operation event for the target game running in the target container;
  • the obtaining unit is further configured to obtain a target compilation result of the target coloring code from game resources, where the game resources include at least one of the following: a game image of the target game, and the target container and the target a target shared directory between the associated containers of the container, the target shared directory includes a first compilation result obtained by compiling at least one shader code by the associated container during the game running process;
  • a processing unit configured to perform graphics processing according to the target compilation result to obtain a feedback image corresponding to the operation event.
  • an embodiment of the present application provides a server, where the server includes an input interface and an output interface, and the server further includes:
  • a processor configured to load one or more instructions stored in the computer storage medium and perform the following steps:
  • the target compilation result of the target coloring code is obtained from game resources, the game resources include at least one of the following: a game image of the target game, and a target between the target container and an associated container of the target container a shared directory, where the target shared directory includes a first compilation result obtained by the associative container compiling at least one shader code during the game running process;
  • Graphic processing is performed according to the target compilation result to obtain a feedback image corresponding to the operation event.
  • an embodiment of the present application provides a computer storage medium, where the computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and performing the following steps:
  • the target compilation result of the target coloring code is obtained from game resources, the game resources include at least one of the following: a game image of the target game, and a target between the target container and an associated container of the target container a shared directory, where the target shared directory includes a first compilation result obtained by the associative container compiling at least one shader code during the game running process;
  • Graphic processing is performed according to the target compilation result to obtain a feedback image corresponding to the operation event.
  • FIG. 1a is a system architecture diagram of a cloud game system provided by an embodiment of the present application.
  • FIG. 1b is a schematic diagram of a connection between an edge server and multiple game clients provided by an embodiment of the present application
  • 1c is a schematic diagram of transmitting a game screen to a game client for display according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • 3a is a schematic diagram of making a game mirror provided by an embodiment of the present application.
  • 3b is a schematic diagram of a mount target shared directory provided by an embodiment of the present application.
  • 3c is a schematic diagram of another mount target shared directory provided by an embodiment of the present application.
  • FIG. 3d is a schematic diagram of another mount target shared directory provided by an embodiment of the present application.
  • 3e is a schematic diagram of another mount target shared directory provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an image processing method provided by another embodiment of the present application.
  • 5a is a schematic diagram of a mount target shared directory provided by another embodiment of the present application.
  • 5b is a schematic diagram of another mount target shared directory provided by another embodiment of the present application.
  • 5c is a schematic diagram of another mount target shared directory provided by another embodiment of the present application.
  • 5d is a schematic diagram of another mount target shared directory provided by another embodiment of the present application.
  • 5e is a schematic diagram of a cache target compilation result provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • an embodiment of the present application proposes a cloud game environment.
  • multiple operating systems can be run on an independent server (such as a server using ARM architecture/x86 architecture) by running system containers, and related images can be transmitted through video streaming.
  • the ARM architecture is a 32-bit/or 64-bit reduced instruction set processor architecture
  • the x86 architecture (The X86 architecture) is a computer language instruction set executed by a microprocessor.
  • Containers refer to a type of operating system-level virtualization.
  • Containers can be used to host operating systems; they can be implemented through isolation mechanisms (such as namespaces): in kernel state, multiple operating systems (ie server operating systems and devices) Operating systems) share the same kernel; in user mode, multiple operating systems remain independent of each other.
  • the server operating system here refers to a general operating system in the server, such as a Linux operating system, etc.; the host where the server operating system is located may be referred to as a server host (ie, a host host).
  • the device operating system refers to the operating system in the container, such as the Android (Android) operating system, the IOS operating system, and the like.
  • a system container refers to an instance of a container, which can run based on a server operating system (such as a Linux operating system); for example, the system container can be an Android container running on an open-source Linux operating system, a Linux operating system. You can run multiple Android containers at the same time.
  • the Android container loads an Android game image.
  • the so-called Android game image refers to an image file that contains both basic Android-related files and game-related files; the so-called image is a form of file storage.
  • the files are combined into a single image file, which facilitates the distribution and use of the files.
  • system container mentioned in the embodiments of the present application is not limited to the Android container; for example, if the IOS operating system supports open source research and development, the system container may also be an IOS container, and so on. It can be seen that in the cloud game environment proposed by the embodiments of the present application, a large number of system containers can be deployed on an independent server to make full use of the powerful Central Processing Unit (CPU) capabilities and graphics processing capabilities of the server.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit, GPU
  • the cloud game system may include at least one edge server 11 and multiple game clients 12 .
  • the edge server 11 refers to the server used to run the system container; the server can be any independent physical server, or can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication , middleware services, domain name services, security services, Content Delivery Network (CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.
  • At least one system container can be deployed in each edge server 11, and each system container can be connected with at least one game client 12, as shown in FIG. 1b.
  • each system container can be used to run one or more games, and during the process of running any game, each system container can transmit the game screen of any game to the connected game client 12 for display.
  • the game client 12 can be any terminal device (terminal for short) with basic capabilities such as basic streaming media playback capabilities, human-computer interaction capabilities, and communication capabilities, such as smart phones, tablet computers, notebook computers, desktop computers, and smart TVs. etc.; or the game client 12 may be an application (application, APP) running in the terminal device.
  • FIG. 1a is only an exemplary system architecture representing the cloud game system, and does not limit the specific architecture of the cloud game system; mirror servers, etc.
  • any cloud game can be run.
  • the operation principle of any cloud game is as follows: after the game image of the cloud game is created, the game image of the cloud game can be deployed to the edge server, so that the edge server can start the corresponding system by loading the game image container.
  • the edge server may allocate a corresponding system container to establish a connection with the game client. After the allocated system container and the game client are successfully connected, the allocated system container can run the cloud game and render the game screen of the cloud game in real time, and then transmit the rendered game screen to the game client by means of video streaming shown in Figure 1c.
  • the game client can send the operation events of the player and user on the game screen to the corresponding system container by means of data stream.
  • the system container may be responsible for capturing and rendering the render buffer image corresponding to the operation event (ie, the feedback image corresponding to the operation event), and returning the feedback image corresponding to the operation event to the game client for display.
  • the embodiment of the present application proposes a shared GPU shader cache mechanism for the stage of image coloring processing, so as to save the time consumed by the image coloring processing, thereby shortening the rendering time required for rendering the feedback image, thereby reducing the running time of the game.
  • the GPU shader GPU shader
  • the GPU driver can compile the GPU shader code (shading code) written by the user into object code that the GPU can execute.
  • the principle of the GPU shader cache mechanism is as follows: For a single system container, the compilation result obtained by compiling the GPU shader code by the single system container is cached, so that when the single system container continues to run the cloud game or re-runs the cloud game, if the If you need to compile the same GPU shader code, you can skip the compilation process and use the compilation result directly.
  • the principle of the shared GPU shader cache mechanism is to share the compilation result of the GPU shader code cached by a single system container with other system containers, so that other system containers can skip the compilation of the same GPU shader code when they need to compile the same GPU shader code.
  • the compilation process directly uses the compilation results obtained by sharing.
  • the shared GPU shader cache mechanism proposed by the embodiments of this application may mainly include the following two mechanisms:
  • the static shared GPU shader cache mechanism here refers to a sharing mechanism in which the second compilation result of at least one GPU shader code is added to the game image, so that each system container that loads the game image can share the second compilation result.
  • the principle of the static shared GPU shader cache mechanism is roughly as follows: in making a game image of a cloud game, the cloud game can be pre-run; and during the running process of the cloud game, at least one GPU shader code is compiled to obtain a second compilation As a result, the second compilation result is then added to the game image of the cloud game.
  • the second compilation results can be included in each system container that loads the game image. ;
  • each system container needs to compile a certain GPU shader code
  • the game image already contains the second compilation result of the GPU shader code the corresponding second compilation result can be directly obtained from the game image to perform subsequent processing.
  • the static shared GPU shader cache mechanism since the second compilation result of the GPU shader code already exists in the game image, there is no need to mount an additional shared directory into the system container to solve some of the same games. The problem of sharing the compilation results.
  • the dynamic shared GPU shader cache mechanism here refers to a sharing mechanism that can share the compilation results of the same GPU shader code among multiple system containers through a shared directory during the running of the game.
  • the principle of the dynamic shared GPU shader cache mechanism is roughly as follows: in the process of each system container running, a shared directory can be mounted to each system container as the GPU shader compilation cache directory, so that each system container can run in the game.
  • the first compilation result of each GPU shader code compiled in the process can be stored in the shared directory synchronously.
  • the dynamic shared GPU shader cache mechanism since the shared directory can be mounted with multiple system containers, the compilation result of the GPU shader code newly generated by a single system container in the current game process is cached in the shared directory, so that the compilation The results can be dynamically shared and used by multiple system containers in real time. By effectively utilizing the first compilation result of the GPU shader code compiled by a single system container during the game running process, the running speed of the same or different cloud games in other multiple system containers can be accelerated. It can be seen that the dynamic shared GPU shader cache mechanism proposed in the embodiment of the present application can not only solve the problem of sharing compilation results between some of the same games, but also solve the problem of sharing the GPU shader cache between some different games.
  • two shared GPU shader cache mechanisms such as the static shared GPU shader cache mechanism and the dynamic shared GPU shader cache mechanism proposed in the embodiments of the present application, can both solve the compilation result sharing among various system containers to a certain extent.
  • the code compilation time can be effectively saved, thereby accelerating the running speed of cloud games.
  • the two shared GPU shader cache mechanisms proposed in the embodiments of the present application may be used independently or in combination, which are not limited in the embodiments of the present application.
  • an embodiment of the present application proposes an image processing method; the image processing method can be executed by the target container running in the target edge server in the cloud game system mentioned above , the target edge server here is any edge server in the cloud game system, and the target container is any system container run by the server operating system based on the target edge server.
  • the image processing method may include the following steps S201-S203:
  • the operation event is detected in the game screen of the target game displayed by the target game client connected to the target container.
  • the target container may send the game screen of the target game to the target game client for display by means of video streaming.
  • the target game client can detect whether there is an operation event for the target game; the operation event here may include but is not limited to: by operating a physical control component (such as a mouse, a keyboard, etc.) Input events, events input by controlling the movement of a gravity sensing device (such as a gyroscope), events input by finger touching any screen content in the game screen, and so on.
  • the target game client can transmit the operation event to the target container by means of data stream; correspondingly, after receiving the operation event, the target container can obtain the target corresponding to the operation event coloring code.
  • the game resource may include at least one of the following: a game image of the target game, and a target shared directory between the target container and an associated container of the target container.
  • the game image of the target game can be obtained based on the above-mentioned static shared GPU shader cache mechanism; the game image of the target game can include the first shading code (that is, the GPU shader code) compiled by running the target game in advance. Two compilation results, and each second compilation result is added to the game image when the game image is produced.
  • the target shared directory between the target container and the associative container can be obtained based on the above-mentioned dynamic shared GPU shader cache mechanism; the target shared directory may include the associative container in the game running process, compile at least one shader code to obtain the first.
  • a compilation result It should be understood that the target shared directory is not limited to only include the first compilation result of the associative container, but may also include the first compilation result obtained by compiling at least one shader code in the target container during the game running process.
  • the associative container refers to a system container that runs an associated game associated with the target game; the associated game here may include: the target game or a game using the same game engine as the target game.
  • step S202 may be: if the game image of the target game includes the second compilation result of the target coloring code, then directly obtain the second compilation result of the target coloring code from the game image of the target game As the target compilation result; otherwise, compile the target shader code to obtain the target compilation result.
  • step S202 may be: if the target shared directory includes the first compilation result of the target coloring code, then directly obtain the first compilation result of the target coloring code from the target shared directory as the target compilation result ; otherwise, compile the target shader code to obtain the target compilation result.
  • the first compilation result of the target coloring code may be obtained by the associative container compiling the target coloring code in the process of running the associated game; it may also be obtained by the target container in the historical process of running the target game.
  • the coloring code is obtained by compiling, which is not limited in this embodiment of the present application.
  • the game resources can include the game image of the target game and the target shared directory.
  • the specific implementation of step S202 may be: in the game image of the target game, first detect whether there is a second compilation result of the target shading code; if so, obtain the second compiling result of the target shading code from the game image The compilation result is used as the target compilation result. If it does not exist, the first compilation result is obtained from the target shared directory between the target container and the associated container of the target container as the target compilation result of the target coloring code.
  • the target container can compile the target shader code to obtain the target compilation result.
  • S203 Perform graphics processing according to the target compilation result to obtain a feedback image corresponding to the operation event.
  • the image processing method may further include: displaying the feedback image in the target game client.
  • the target container can call the GPU to perform a series of graphics processing according to the target compilation result, so as to obtain the feedback image corresponding to the operation event.
  • the graphics processing may include, but is not limited to, alpha channel combining processing, pixel value coordinate adjustment processing, and the like.
  • the target container can send the feedback image to the target game client in the form of a video stream, so that the target game client displays the feedback image.
  • the compilation process of the target coloring code can be skipped, and the target coloring code can be directly compiled from the game image or the target container and the target container.
  • graphics processing can be performed according to the target compilation result to obtain a feedback image corresponding to the operation event; and the feedback image can be displayed in the target game client.
  • a base image of the device operating system (such as an Android base image) may be loaded first.
  • the target game can be installed to trigger the compilation of the GPU shader code of the first part related to the target game to obtain the compilation result of the first part; and the compilation result of the first part can be added to the game image of the target game.
  • the compilation result of the first part and the GPU shader code of the first part can be directly added to the game image of the target game; in another embodiment, the compilation result of the first part and the The index value of a part of the GPU shader code is correspondingly added to the game image of the target game; the index value here can be obtained by hashing the GPU shader code.
  • the target game can be run and the simulated operation event for the target game can be input to trigger the compilation of the GPU shader code of the second part corresponding to the simulated operation event to obtain the compilation result of the second part;
  • the compiled result is added to the game image of the target game.
  • the compilation result of the second part and the GPU shader code of the second part can be directly added to the game image of the target game; in another embodiment, the compilation result of the second part can be added to the game image of the target game; The result and the index value of the GPU shader code of the second part are correspondingly added to the game image of the target game.
  • the target edge server can select the target shared directory.
  • the target shared directory can be mounted to the target container and the associated container, so that during the running process of the respective games in the target container and the associated container, the first compilation results of the compiled GPU shader codes can be cached synchronously to the in the target shared directory.
  • the target edge server can generate a directory mount instruction carrying the target shared directory; and send the directory mount instruction to the target container and the associated container respectively, so that the target container can mount the target shared directory to the dynamic directory in the target container. cache directory, and cause the associative container to mount the target shared directory to a preset directory in the associative container.
  • the associative container After the target shared directory is successfully mounted to the target container and the associative container, if the associative container compiles at least one GPU shader code during the process of running the associative container and obtains the corresponding first compilation result, the associative container can be compiled The obtained first compilation result is added to the target shared directory. Similarly, if the target container compiles at least one GPU shader code in the process of running the target container to obtain the first compilation result, the first compilation result obtained by compiling the target container can be added to the target shared directory.
  • the target shared directory can support two selection methods:
  • Selection method 1 Select the target shared directory (for example: /home/shadercache) on the server host (that is, the Host host) where the server operating system of the target edge server is located, for use by all system containers running on the target edge server; That is, in this selection mode, the target shared directory is located on the server host where the server operating system is located.
  • the system container will generate the first compilation result of the corresponding GPU shader code in the process of running different types of cloud games, the data of the first compilation result of the GPU shader code accumulated by multiple system containers The amount is usually relatively large.
  • the server host can determine the number of shared directories to be provided according to the number of types of cloud games run by each system container in the target edge server.
  • the server host can only provide one shared directory, so that the various types of cloud games in the target edge server All system containers are mounted with this shared directory.
  • the target edge server can use the shared directory provided by the server host as the target shared directory between the target container and the associated container; that is, in this implementation manner, the target container mounts the target shared directory. See Figure 3b. And it can be seen from Figure 3b that since the server host only includes the target shared directory, the target shared directory can not only be used to mount the target container and the associated container of the target container, but also can be used with the target edge server in the target container-independent system. The container is mounted.
  • each system container in the target edge server runs many types of cloud games (that is, when the number of types of cloud games is greater than or equal to the number threshold)
  • the server host can provide multiple shared directories.
  • these related system containers may use the same GPU shader code because these related system containers are more likely to use the same GPU shader code. Mount with the same shared directory.
  • these unrelated system containers can be mounted with other shared directories on the server host.
  • the target edge server can randomly select a shared directory from the multiple shared directories provided by the server host as the target shared directory between the target container and the associated container; that is, in this implementation manner, the target container mounts
  • a schematic diagram of the target shared directory can be seen in Figure 3c.
  • the server host since the server host includes not only the target shared directory, but also other shared directories except the target shared directory; therefore, the target shared directory can only be used to mount the target container and the associated container of the target container, Other shared directories on the server host can be used to mount system containers on the target edge server that are not related to the target container.
  • the server host can also provide only one shared directory if the indicator of the time consumed to find the compilation result of the relevant GPU shader code in the target shared directory is ignored.
  • Option 2 Select the target shared directory (for example: 192.168.10.10:/mnt/share) in the network file system on the Internet for use by each system container in all edge servers on the network; the network file system It is independent of each edge server in the cloud game system, and allows the system containers in each edge server to access. That is, in this selection mode, the target shared directory is located in the network file system.
  • the network file system can also The number of cloud game types running in the container determines the number of shared directories that need to be provided.
  • the network file system can only provide one shared directory, so that Each system container in the cloud game system is mounted to this shared directory.
  • the target edge server can use the shared directory provided by the network file system as the target shared directory between the target container and the associated container; that is, in this implementation manner, the target container mounts the target shared directory
  • the target shared directory can not only be used to mount the target container and the associated container of the target container, but also can be used to mount the target container in the cloud game system irrelevant to the target container.
  • the system container is mounted.
  • the network file system can provide multiple shared directories .
  • these related system containers may use the same GPU shader code because these related system containers are more likely to use the same GPU shader code. Mount with the same shared directory.
  • these unrelated system containers can be mounted with other shared directories on the network file system.
  • the target edge server may randomly select a shared directory from the multiple shared directories provided by the network file system as the target shared directory between the target container and the associated container; that is, in this implementation manner, the target container is linked to the
  • the schematic diagram of loading the target shared directory can be seen in Figure 3e.
  • the network file system includes not only the target shared directory, but also other shared directories other than the target shared directory; therefore, the target shared directory can only be used to mount the target container and the associated container of the target container.
  • other shared directories in the network file system can be used to mount the system containers in the cloud game system that are not related to the target container. It should be understood that in the case of a large number of cloud games, if the time consumed to find the compilation result of the relevant GPU shader code in the target shared directory is ignored, the network file system can also provide only one shared directory. .
  • the target edge server can choose any one of the above two selection methods to determine the target shared directory. Further, since the first selection method is to select the target shared directory from the server host, and both the target shared directory and the target container exist on the target edge server, the target container can ensure access to each first compilation result in the target shared directory. speed. However, since the second option is to select the target shared directory from the network file system, the network file system and the target edge server are independent of each other, so the target container may not change the first compilation results in the target shared directory due to factors such as network congestion. Access is slow. Based on this, the target edge server can select a selection method from the above two selection methods according to the actual situation of the access speed of the network file system to determine the target shared directory. Specifically, when the access speed of the network file system is not guaranteed, the first embodiment can be selected to determine the target shared directory; when the access speed of the network file system is guaranteed, the second embodiment can be selected to determine the target Shared directory.
  • the embodiments of the present application merely illustrate that the selection of the selection mode can be implemented according to the parameter of the access speed of the network file system, and is not exhaustive; that is, in other embodiments, the selection method can also be selected according to other parameters. Realize the selection of the selection method. For example, since the first selection method is to select the target shared directory from the server host, each first compilation result in the target shared directory cannot be accessed by system containers in other edge servers. Since the second selection method is to select the target shared directory from the network file system, each first compilation result in the target shared directory can be accessed by system containers in other edge servers. Based on this, the target edge server can select one selection method from the above two selection methods according to the actual game deployment requirements to determine the target shared directory.
  • the first implementation mode can be selected to determine the target shared directory; if the game deployment requirements indicate that mutual sharing of compilation results between different edge servers is required, then The second embodiment is selected to determine the target shared directory.
  • an embodiment of the present application also provides a schematic flowchart of a more specific image processing method.
  • the embodiments of the present application mainly take the combined use of the static shared GPU shader cache mechanism and the dynamic shared GPU shader cache mechanism as an example for description.
  • the container executes; the target container is started by loading a game image of the target game, and the game image of the target game may at least include a second compilation result of at least one shader code compiled by pre-running the target game.
  • the image processing method may include the following steps S401-S407:
  • S401 Receive a directory mount instruction sent by a target edge server, where the directory mount instruction carries a target shared directory.
  • S402 Specify a dynamic cache directory in the target container, and mount the target shared directory to the dynamic cache directory.
  • a directory can be arbitrarily designated as the dynamic cache directory in the target container; that is, in this implementation manner, the dynamic cache directory may be the same as or different from the storage directory of the second compilation result in the game image.
  • the container directory mounting implementation method when the target shared directory is mounted to the inside of the target container, the files in the corresponding directory inside the target container and the target shared directory will be emptied. . Therefore, in order to prevent the second compilation result in the game image from being emptied, two different environment variables can be used inside the target container to specify the dynamic cache directory where the target shared directory is mounted and the storage of the second compilation result in the game image. directory, so as to realize the separation of the dynamic cache directory and the storage directory of the second compilation result. So that when the target shared directory is mounted to the dynamic cache directory, only the files in the dynamic cache directory are cleared, and the second compilation result in the storage directory is not affected.
  • the dynamic cache directory may be specified by using a first environment variable; the first environment variable may include, but is not limited to, the "MESA_GLSL_CACHE_DIR” environment variable in the Mesa code.
  • the storage directory of the second compilation result in the game image may be specified by a second environment variable; specifically, the second environment variable may include, but is not limited to, the "MESA_GLSL_CACHE_DIR_STATIC” environment variable in the Mesa code.
  • Mesa here is an open source computer graphics library; Mesa can be used to implement the application program interface of opengl/opengles.
  • the opengl here is mainly a cross-platform application programming interface API for rendering 3D graphics, while opengles is a subset of the opengl API, which is mainly used in embedded devices (such as smartphones, etc.).
  • the target shared directory can be mounted to the dynamic cache directory, so that data synchronization is maintained between the target shared directory and the dynamic cache directory.
  • the target shared directory is also mounted in the preset directory of the associative container to cache the first compilation result obtained by the associative container compiling at least one shader code in the process of running the associative game.
  • the mounting diagram of the target shared directory can be seen in Figure 5a; if the server host includes the target shared directory and other shared directories , the schematic diagram of the mounting of the target shared directory can be seen in Figure 5b.
  • the target shared directory when the target shared directory is located on the network file system, if the network file system only includes the target shared directory, a schematic diagram of the mounting of the target shared directory can be seen in Figure 5c; if the network file system includes the target shared directory. and other shared directories, the schematic diagram of the mounting of the target shared directory can be seen in Figure 5d.
  • the game image may at least include the second compilation result of at least one shader code compiled by running the target game in advance.
  • the game image may further include shading codes corresponding to each second compilation result; in this embodiment, it may be directly detected whether the game image of the target game includes the target shading codes. If the target shading code is included, it can be determined that the second compilation result of the target shading code exists in the game image; if the target shading code is not included, it can be determined that the second compilation result of the target shading code does not exist in the game image.
  • the game image may further include at least one index value of the shading code, and one index value corresponds to a second compilation result. Then, in this implementation manner, a hash operation can be performed on the target shading code to obtain the target index value of the target shading code; and then it is detected whether the game image includes the target index value. If the game image includes the target index value, it can be determined that the second compilation result of the target shading code exists in the game image; if the game image does not include the target index value, it can be determined that the second compilation result of the target shading code does not exist in the game image. result.
  • step S405 may be executed; if it is determined that the second compilation result of the target shading code does not exist in the game image, step S406 may be executed.
  • the target shared directory may include at least one first compilation result of the shader code, and each first compilation result may correspond to an index value.
  • step S406 can be referred to as shown in FIG. 5e.
  • the target container can search whether there is a target index value in the target shared directory. If it exists, the code compilation process is skipped, and the first compilation result corresponding to the target index value is directly obtained as the target compilation result.
  • the target shading code can be compiled to obtain the target compilation result; and the target compilation result is cached in the dynamic cache directory to synchronize the target compilation result to In the target shared directory, when the associative container needs to compile the target coloring code, it directly obtains the target compilation result from the target shared directory.
  • the target index value of the target shading code can also be cached in the dynamic cache directory, so as to synchronize the target index value to the target shared directory.
  • step S407 performing graphics processing according to the target compilation result to obtain a feedback image corresponding to the operation event.
  • the image processing method may further include: displaying a feedback image in the target game client.
  • the compilation process of the target coloring code can be skipped, and the target coloring code can be directly compiled from the game image or the target container and the target container.
  • graphics processing can be performed according to the target compilation result to obtain a feedback image corresponding to the operation event; and the feedback image can be displayed in the target game client.
  • the embodiments of the present application further disclose an image processing apparatus, and the image processing apparatus may be a computer program (including program code) running in the above-mentioned target edge server .
  • the image processing apparatus may execute the method shown in FIG. 2 or FIG. 4 . Referring to Fig. 6, the image processing apparatus can run the following units:
  • the obtaining unit 601 is configured to obtain the target coloring code corresponding to the operation event in response to the operation event for the target game running in the target container; the operation event is displayed on the target game client connected to the target container detected in the game screen of the target game;
  • the obtaining unit 601 is further configured to obtain the target compilation result of the target coloring code from game resources, where the game resources include at least one of the following: a game image of the target game, and the target container and the a target shared directory between the associated containers of the target container, the target shared directory includes a first compilation result obtained by compiling at least one shader code by the associated container during the game running process;
  • the processing unit 602 is configured to perform graphics processing according to the target compilation result to obtain a feedback image corresponding to the operation event; and display the feedback image in the target game client.
  • the game resource includes the game image and the target shared directory;
  • the game image includes a second compilation result of at least one shader code compiled by pre-running the target game, and each The second compilation results are all added to the game image when the game image is produced; correspondingly, when the acquiring unit 601 is used to acquire the target compilation result of the target coloring code from the game resource, the specific Used for:
  • the first compilation result is obtained from the target shared directory between the target container and the associated container of the target container as the target compilation result of the target coloring code.
  • the game image further includes an index value of the at least one coloring code, and one index value corresponds to a second compilation result; correspondingly, the obtaining unit 601 is used in the target game for the index value.
  • the game image when detecting whether there is a second compilation result of the target coloring code, it can be specifically used to:
  • the game image includes the target index value, determining that there is a second compilation result of the target shading code in the game image;
  • the game image does not include the target index value, it is determined that the second compilation result of the target shading code does not exist in the game image.
  • the target game is a cloud game in a cloud game system
  • the cloud game system includes at least one edge server and multiple game clients; at least one system container is deployed in each edge server, and each edge server a system container is connected to at least one game client;
  • Each system container is used to run one or more games, and each system container transmits the game screen of any game to the connected game client for display during the process of running any game ;
  • the target container is any system container based on the server operating system of the target edge server, and the target edge server is any edge server in the cloud game system;
  • processing unit 602 may also be used to:
  • the target shared directory is also mounted in the preset directory of the associative container, so as to cache the first image obtained by the associative container compiling at least one shader code in the process of running the associative game. compile result.
  • the dynamic cache directory is specified by a first environment variable
  • the storage directory of the second compilation result in the game image is specified by a second environment variable
  • the target shared directory is located in a server host where the server operating system is located; or,
  • the shared directory is located in a network file system, which is independent of each edge server in the cloud game system and allows system containers in each edge server to access.
  • the server host further includes other shared directories other than the target shared directory, and the other shared directories in the server host use Mounting on a system container unrelated to the target container in the target edge server;
  • the network file system further includes other shared directories other than the target shared directory, and the other shared directories in the network file system are used to communicate with the The system container in the cloud game system that is not related to the target container is mounted.
  • the game resource does not include the target compilation result of the target coloring code; correspondingly, the processing unit 602 may also be used to:
  • each step involved in the method shown in FIG. 2 or FIG. 4 may be performed by each unit in the image processing apparatus shown in FIG. 6 .
  • steps S201 to S202 shown in FIG. 2 can all be performed by the acquiring unit 601 shown in FIG. 6
  • step S203 can be performed by the processing unit 602 shown in FIG. 6 .
  • steps S401-S402 shown in FIG. 4 and steps S407 can be executed by the processing unit 602 shown in FIG. 6
  • steps S403-S406 can be executed by the obtaining unit 601 shown in FIG. 6 .
  • each unit in the image processing apparatus shown in FIG. 6 may be respectively or all combined into one or several other units to form, or some of the unit(s) may be disassembled. It is divided into a plurality of units with smaller functions, which can realize the same operation without affecting the realization of the technical effects of the embodiments of the present application.
  • the above units are divided based on logical functions.
  • the function of one unit may also be implemented by multiple units, or the functions of multiple units may be implemented by one unit.
  • the image-based processing apparatus may also include other units. In practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by cooperation of multiple units.
  • a general-purpose computing device such as a computer
  • a general-purpose computing device may be implemented on a general-purpose computing device including a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and other processing elements and storage elements.
  • CPU central processing unit
  • RAM random access storage medium
  • ROM read-only storage medium
  • Run a computer program capable of executing the steps involved in the corresponding method as shown in FIG. 2 or FIG. 4 to construct an image processing apparatus as shown in FIG. image processing method.
  • the computer program can be recorded on, for example, a computer-readable storage medium, loaded into the above-mentioned computing device through the computer-readable storage medium, and executed therein.
  • the compilation process of the target coloring code can be skipped, and the target coloring code can be directly compiled from the game image or the target container and the target container.
  • graphics processing can be performed according to the target compilation result to obtain a feedback image corresponding to the operation event; and the feedback image can be displayed in the target game client.
  • an embodiment of the present application further provides a server; the server may be the aforementioned target edge server.
  • the server at least includes a processor 701 , an input interface 702 , an output interface 703 and a computer storage medium 704 .
  • the processor 701 , the input interface 702 , the output interface 703 and the computer storage medium 704 in the server may be connected through a bus or other means.
  • the computer storage medium 704 is a memory device in the server for storing programs and data. It can be understood that the computer storage medium 704 here may include both a built-in storage medium in the server, and of course, an extended storage medium supported by the server. Computer storage medium 704 provides storage space that stores the server's operating system. In addition, one or more instructions suitable for being loaded and executed by the processor 701 are also stored in the storage space, and these instructions may be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-transitory memory), such as at least one disk memory; it can also be at least one computer located far away from the aforementioned processor storage medium.
  • the processor 701 (or called a central processing unit (CPU)) is the computing core and the control core of the server, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions so as to Implement the corresponding method process or corresponding function.
  • CPU central processing unit
  • one or more instructions stored in the computer storage medium 704 can be loaded and executed by the processor 701 to implement the corresponding method steps in the above-mentioned image processing method embodiment shown in FIG. 2 or FIG. 4 ; specifically In implementation, one or more instructions in the computer storage medium 704 are loaded by the processor 701 and perform the following steps:
  • the operation event In response to the operation event for the target game running in the target container, obtain the target coloring code corresponding to the operation event; the operation event is the target game displayed on the target game client connected to the target container. detected in the game screen;
  • the target compilation result of the target coloring code is obtained from game resources, the game resources include at least one of the following: a game image of the target game, and a target between the target container and an associated container of the target container a shared directory, where the target shared directory includes a first compilation result obtained by the associative container compiling at least one shader code during the game running process;
  • the game resource includes the game image and the target shared directory;
  • the game image includes a second compilation result of at least one shader code compiled by pre-running the target game, and each The second compilation results are all added to the game image when the game image is produced; correspondingly, when the target compilation result of the target shader code is obtained from the game resource, the one or more instructions It can be loaded by the processor 701 and specifically executed:
  • the first compilation result is obtained from the target shared directory between the target container and the associated container of the target container as the target compilation result of the target coloring code.
  • the game image further includes an index value of the at least one coloring code, and one index value corresponds to a second compilation result; correspondingly, in the game image of the target game, it is detected whether When there is a second compilation result of the target shader code, the one or more instructions can be loaded by the processor 701 and specifically executed:
  • the game image includes the target index value, determining that there is a second compilation result of the target shading code in the game image;
  • the game image does not include the target index value, it is determined that the second compilation result of the target shading code does not exist in the game image.
  • the target game is a cloud game in a cloud game system
  • the cloud game system includes at least one edge server and multiple game clients; at least one system container is deployed in each edge server, and each edge server a system container is connected to at least one game client;
  • Each system container is used to run one or more games, and each system container transmits the game screen of any game to the connected game client for display during the process of running any game ;
  • the target container is any system container based on the server operating system of the target edge server, and the target edge server is any edge server in the cloud game system;
  • the one or more instructions may also be loaded and executed by the processor 701:
  • the target shared directory is also mounted in the preset directory of the associative container, so as to cache the first image obtained by the associative container compiling at least one shader code in the process of running the associative game. compile result.
  • the dynamic cache directory is specified by a first environment variable
  • the storage directory of the second compilation result in the game image is specified by a second environment variable
  • the target shared directory is located in a server host where the server operating system is located; or,
  • the shared directory is located in a network file system, which is independent of each edge server in the cloud game system and allows system containers in each edge server to access.
  • the server host further includes other shared directories other than the target shared directory, and the other shared directories in the server host use Mounting on a system container unrelated to the target container in the target edge server;
  • the network file system further includes other shared directories other than the target shared directory, and the other shared directories in the network file system are used to communicate with the The system container in the cloud game system that is not related to the target container is mounted.
  • the game resource does not include the target compilation result of the target shader code; correspondingly, the one or more instructions can also be loaded and executed by the processor 701:
  • the compilation process of the target coloring code can be skipped, and the target coloring code can be directly compiled from the game image or the target container and the target container.
  • graphics processing can be performed according to the target compilation result to obtain a feedback image corresponding to the operation event; and the feedback image can be displayed in the target game client.
  • a computer program product or computer program where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the image processing method embodiment shown in FIG. 2 or FIG. Methods.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Generation (AREA)
  • Information Transfer Between Computers (AREA)
  • Processing Or Creating Images (AREA)

Abstract

一种图像处理方法、装置、服务器及介质,其中该方法包括:响应针对目标容器内运行的目标游戏的操作事件,获取与操作事件对应的目标着色代码(S201);从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:目标游戏的游戏镜像,及目标容器和目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果(S202);根据目标编译结果进行图形处理,得到操作事件对应的反馈图像(S203)。

Description

图像处理方法、装置、服务器及介质
本申请要求于2020年7月21日提交中国专利局、申请号为202010704005.8、发明名称为“图像处理方法、装置、服务器及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及互联网技术领域,具体涉及图像处理技术领域,尤其涉及一种图像处理方法、一种图像处理装置、一种服务器及一种计算机存储介质。
发明背景
随着互联网技术的发展,云游戏(Cloud gaming)受到了广泛关注;所谓的云游戏又可称为游戏点播(gaming on demand),是一种以云计算为基础的游戏方式,此处的云计算是一种基于互联网的计算方式。云游戏技术使图形处理与数据运算能力相对有限的客户端设备能运行高品质游戏。在云游戏场景下,游戏并不在玩家用户的游戏客户端,而是在云端服务器中运行;由云端服务器将游戏场景渲染为视频音频流,通过网络传输给玩家用户的游戏客户端进行播放。玩家用户的游戏客户端无需拥有强大的图形运算与数据处理能力,仅需拥有基本的流媒体播放能力以及获取并发送玩家用户的输入指令至云端服务器的能力即可。
针对云游戏而言,游戏运行过程中所消耗的时长是衡量云游戏的运行速度的一个重要指标。若游戏运行过程中所消耗的时长越长,则会导致云游戏的运行速度较慢;若游戏运行过程中所消耗的时长越短,则可使得云游戏的运行速度较快。基于此,如何减少云游戏在运行过程中所消耗的时长,以提升云游戏的运行速度成为了一个研究热点。
发明内容
本申请实施例提供了一种图像处理方法、装置、服务器及介质,可以有效节省目标着色代码的编译时间,从而有效提升目标游戏的运行速度。
一方面,本申请实施例提供了一种图像处理方法,该图像处理方法包括:
响应针对目标容器内运行的目标游戏的操作事件,获取与所述操作事件对应的目标着色代码;
从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:所述目标游戏的游戏镜像,及所述目标容器和所述目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果;
根据所述目标编译结果进行图形处理,得到所述操作事件对应的反馈图像。
另一方面,本申请实施例提供了一种图像处理装置,该图像处理装置包括:
获取单元,用于响应针对目标容器内运行的目标游戏的操作事件,获取与所述操作事件对应的目标着色代码;
所述获取单元,还用于从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:所述目标游戏的游戏镜像,及所述目标容器和所述目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果;
处理单元,用于根据所述目标编译结果进行图形处理,得到所述操作事件对应的反馈图像。
再一方面,本申请实施例提供了一种服务器,所述服务器包括输入接口和输出接口,所述 服务器还包括:
计算机存储介质,用于存储有一条或多条指令;
处理器,用于加载所述计算机存储介质存储的一条或多条指令并执行如下步骤:
响应针对目标容器内运行的目标游戏的操作事件,获取与所述操作事件对应的目标着色代码;
从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:所述目标游戏的游戏镜像,及所述目标容器和所述目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果;
根据所述目标编译结果进行图形处理,得到所述操作事件对应的反馈图像。
再一方面,本申请实施例提供了一种计算机存储介质,所述计算机存储介质存储有一条或多条指令,所述一条或多条指令适于由处理器加载并执行如下步骤:
响应针对目标容器内运行的目标游戏的操作事件,获取与所述操作事件对应的目标着色代码;
从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:所述目标游戏的游戏镜像,及所述目标容器和所述目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果;
根据所述目标编译结果进行图形处理,得到所述操作事件对应的反馈图像。
附图简要说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1a是本申请实施例提供的一种云游戏系统的系统架构图;
图1b是本申请实施例提供的一种边缘服务器与多个游戏客户端之间的连接示意图;
图1c是本申请明实施例提供的一种传输游戏画面至游戏客户端进行显示的示意图;
图2是本申请实施例提供的一种图像处理方法的流程示意图;
图3a是本申请实施例提供的一种制作游戏镜像的示意图;
图3b是本申请实施例提供的一种挂载目标共享目录的示意图;
图3c是本申请实施例提供的另一种挂载目标共享目录的示意图;
图3d是本申请实施例提供的另一种挂载目标共享目录的示意图;
图3e是本申请实施例提供的另一种挂载目标共享目录的示意图;
图4是本申请另一实施例提供的一种图像处理方法的流程示意图;
图5a是本申请另一实施例提供的挂载目标共享目录的示意图;
图5b是本申请另一实施例提供的另一种挂载目标共享目录的示意图;
图5c是本申请另一实施例提供的另一种挂载目标共享目录的示意图;
图5d是本申请另一实施例提供的另一种挂载目标共享目录的示意图;
图5e是本申请实施例提供的缓存目标编译结果的示意图;
图6是本申请实施例提供的一种图像处理装置的结构示意图;
图7是本申请实施例提供的一种服务器的结构示意图。
实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
为了更好地运行云游戏,本申请实施例提出了一种云游戏环境。在该云游戏环境下,可通过运行系统容器的方式,将多个操作系统运行在一个独立的服务器(如采用ARM架构/x86等 架构的服务器)上,并通过视频流的方式将相关图像传递至远端接收程序进行处理。其中,ARM架构是一种32位/或64位精简指令集的处理器架构,x86架构(The X86 architecture)是微处理器执行的计算机语言指令集。容器是指操作系统级虚拟化的一种类型,容器可用于承载操作系统;其通过隔离机制(例如namespace(命名空间))可实现:在内核态,多个操作系统(即服务器操作系统和设备操作系统)共用同一内核;在用户态,多个操作系统保持相互独立。此处的服务器操作系统是指服务器内的通用操作系统,如Linux操作系统等等;服务器操作系统所在的主机可称为服务器主机(即Host主机)。设备操作系统是指容器内的操作系统,如Android(安卓)操作系统、IOS操作系统等。
相应的,系统容器是指容器的一种实例,其可基于服务器操作系统(如Linux操作系统)运行;例如该系统容器可以是在已开源的Linux操作系统上运行的Android容器,一个Linux操作系统上可同时运行多个Android容器。Android容器加载的是Android游戏镜像,所谓的Android游戏镜像是指既包含了基本的Android相关文件,又包含了游戏相关文件的镜像文件;所谓的镜像是一种文件存储形式,通过镜像将多个文件合并成一个镜像文件,可便于文件的分发和使用。应理解的是,本申请实施例所提及的系统容器并不局限于Android容器;例如,若IOS操作系统支持开源研发,则该系统容器还可以是IOS容器,等等。可见,在本申请实施例所提出的云游戏环境下,可通过在一台独立的服务器上部署大量的系统容器,充分利用服务器端强大的中央处理器(Central Processing Unit,CPU)能力以及图形处理器(Graphics Processing Unit,GPU)能力,实现高并发地执行系统操作,提升云游戏的运行速度。
基于上述所提及的云游戏环境,本申请实施例提出了一种云游戏系统;参见图1a所示,该云游戏系统可包括至少一个边缘服务器11以及多个游戏客户端12。其中,边缘服务器11是指用于运行系统容器的服务器;该服务器可以是独立的任一物理服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。每个边缘服务器11内可部署有至少一个系统容器,每个系统容器可与至少一个游戏客户端12相连接,如图1b所示。其中,每个系统容器可用于运行一个或多个游戏,且每个系统容器在运行任一游戏的过程中,可传输任一游戏的游戏画面至相连接的游戏客户端12中进行显示。游戏客户端12可以是具有基本的流媒体播放能力、人机交互能力以及通信能力等基本能力的任一终端设备(简称终端),例如,智能手机、平板电脑、笔记本电脑、台式计算机、智能电视等;或者该游戏客户端12可以是运行于终端设备中的应用程序(application,APP)。应理解的是,图1a只是示例性的表征云游戏系统的系统架构,并不对云游戏系统的具体架构进行限定;例如在其他实施例中,云游戏系统中还可包括用于制作游戏镜像的镜像服务器,等等。
基于上述的云游戏系统,可实现一个或多个云游戏的运行。其中,任一云游戏的运行原理如下:在制作完成云游戏的游戏镜像后,可将该云游戏的游戏镜像部署至边缘服务器中,以使得边缘服务器可通过加载该游戏镜像以启动对应的系统容器。当接收到游戏客户端发送的关于云游戏的连接请求时,边缘服务器可分配相应的系统容器与该游戏客户端建立连接。在被分配的系统容器和游戏客户端成功建立连接后,被分配的系统容器可运行云游戏并实时渲染云游戏的游戏画面,然后采用视频流的方式将渲染得到的游戏画面传输到游戏客户端中进行显示,如图1c所示。游戏客户端在显示游戏画面的过程中,可通过数据流的方式将玩家用户针对游戏画面的操作事件,发送给相应的该系统容器。相应的,系统容器可负责抓取渲染与该操作事件相对应的渲染缓冲区图像(即操作事件对应的反馈图像),并将该操作事件对应的反馈图像返回给游戏客户端进行显示。
其中,系统容器在渲染操作事件对应的反馈图像时,通常会涉及图像着色处理、纹理处理、变形处理等多个阶段的图像处理。基于此,本申请实施例针对图像着色处理这一阶段,提出了一种共享GPU shader cache机制,以节省图像着色处理所消耗的时间,从而缩短渲染反馈图像所需的渲染时长,进而减少游戏运行过程所消耗的总时长,以加速云游戏的运行速度。其中,GPU着色器(GPU shader)是GPU硬件功能的一部分;在软件实现上,GPU的驱动程序可将用户编写的GPU shader代码(着色代码)编译成GPU可以执行的目标代码。GPU shader cache机制的原理如下:针对单个系统容器而言,通过缓存该单个系统容器编译GPU shader代码所得到的编译结果,以在该单个系统容器在继续运行云游戏或重新运行云游戏时,若需编译相同的 GPU shader代码,则可跳过编译过程而直接使用编译结果。相应的,共享GPU shader cache机制的原理则是:将单个系统容器已缓存的GPU shader代码的编译结果,共享给其他系统容器,使得其他系统容器在需编译相同的GPU shader代码时,可跳过编译过程而直接使用通过共享得到的编译结果。
在具体实现中,本申请实施例所提出的共享GPU shader cache机制可主要包括以下两部分机制:
(一)静态共享GPU shader cache机制
此处的静态共享GPU shader cache机制是指:将至少一个GPU shader代码的第二编译结果添加在游戏镜像中,从而使得加载该游戏镜像的各个系统容器均可共享该第二编译结果的共享机制。具体的,该静态共享GPU shader cache机制的原理大致如下:在制作云游戏的游戏镜像中,可预先运行云游戏;并在云游戏的运行过程中,编译至少一个GPU shader代码以得到第二编译结果,然后将第二编译结果添加至云游戏的游戏镜像中。这样可使得当部署云游戏的游戏镜像到不同的边缘服务器中的系统容器中,或者同一边缘服务器中的不同系统容器中时,加载该游戏镜像的各个系统容器中均可包含这些第二编译结果;进而使得各个系统容器在需编译某GPU shader代码时,若游戏镜像中已包含该GPU shader代码的第二编译结果,则可直接从游戏镜像中获取相应的第二编译结果以执行后续的处理,以实现加速游戏运行。由此可见,在静态共享GPU shader cache机制下,由于GPU shader代码的第二编译结果已经存在于游戏镜像中了,因此无需挂载额外的共享目录进系统容器,便可解决一部分相同游戏之间的编译结果共享的问题。
(二)动态共享GPU shader cache机制
此处的动态共享GPU shader cache机制是指:在游戏运行的过程中,通过共享目录实现可在多个系统容器之间共享同一个GPU shader代码的编译结果的共享机制。在具体实现中,该动态共享GPU shader cache机制的原理大致如下:在各个系统容器运行的过程中,可挂载一个共享目录至各个系统容器作为GPU shader编译缓存目录,使得各个系统容器在游戏运行过程中所编译的各个GPU shader代码的第一编译结果均可同步保存到该共享目录中。这样可使得在某系统容器a在需编译某GPU shader代码时,若该GPU shader代码已被其他系统容器编译且相应的第一编译结果已缓存在目标共享目录中,则该系统容器a便可直接从目标共享目录中获取该第一编译结果以执行后续的处理,从而实现加速游戏运行。
在动态共享GPU shader cache机制中,由于共享目录可以和多个系统容器进行挂载,因此将单个系统容器在当前游戏过程中新生成的GPU shader代码的编译结果缓存至共享目录中,使得该编译结果可以动态地被多个系统容器实时共享并使用。通过有效利用单个系统容器在游戏运行过程中所编译的GPU shader代码的第一编译结果,可为其他的多个系统容器中相同或不同云游戏的运行速度起到加速效果。由此可见,本申请实施例所提出的动态共享GPU shader cache机制不仅可以解决一部分相同游戏之间的编译结果共享的问题,还可解决一部分不同游戏之间的GPU shader cache共享的问题。
基于上述描述可知,本申请实施例所提出的静态共享GPU shader cache机制和动态共享GPU shader cache机制等两种共享GPU shader cache机制,均可在一定程度上解决各个系统容器之间的编译结果共享的问题;通过利用已缓存的编译结果直接进行后续的处理,跳过GPU shader代码的编译过程,可有效节省代码编译时间,从而加速云游戏的运行速度。应理解的是,在实际应用中,本申请实施例所提出的两种共享GPU shader cache机制可独立使用,也可以组合使用,本申请实施例对此不作限制。
基于上述两种共享GPU shader cache机制的相关描述,本申请实施例提出一种图像处理方法;该图像处理方法可以由上述所提及的云游戏系统中的目标边缘服务器内所运行的目标容器执行,此处的目标边缘服务器为云游戏系统中的任一边缘服务器,目标容器是基于目标边缘服务器的服务器操作系统所运行的任一系统容器。请参见图2,该图像处理方法可包括以下步骤S201-S203:
S201,响应针对目标容器内运行的目标游戏的操作事件,获取与操作事件对应的目标着色代码。
其中,操作事件是在与目标容器相连接的目标游戏客户端显示的目标游戏的游戏画面中检 测到的。在具体实现中,目标容器在运行目标游戏的过程中,可采用视频流的方式将目标游戏的游戏画面发送至目标游戏客户端进行显示。相应的,目标游戏客户端在显示游戏画面的过程中,可检测是否存在针对目标游戏的操作事件;此处的操作事件可包括但不限于:通过操作物理控制组件(如鼠标、键盘等)所输入的事件,通过控制重力感应装置(如陀螺仪)运动所输入的事件,通过手指触摸游戏画面中的任一画面内容所输入的事件,等等。目标游戏客户端在检测到该操作事件后,可采用数据流的方式将该操作事件传输至目标容器中;相应的,目标容器在接收到该操作事件后,可获取与该操作事件对应的目标着色代码。
S202,从游戏资源中获取目标着色代码的目标编译结果。
在本申请实施例中,游戏资源可包括以下至少一项:目标游戏的游戏镜像,及目标容器和目标容器的关联容器之间的目标共享目录。其中,目标游戏的游戏镜像可基于上述所提及的静态共享GPU shader cache机制得到;该目标游戏的游戏镜像中可包括预先运行目标游戏所编译的至少一个着色代码(即GPU shader代码)的第二编译结果,且各第二编译结果均是在制作该游戏镜像时被添加至游戏镜像中的。目标容器和关联容器之间的目标共享目录可基于上述所提及的动态共享GPU shader cache机制得到;该目标共享目录中可包括关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果。应理解的是,目标共享目录中并不局限于只包括关联容器的第一编译结果,还可包括目标容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果。其中,关联容器是指运行与目标游戏相关联的关联游戏的系统容器;此处的关联游戏可包括:目标游戏或者与目标游戏使用同一个游戏引擎的游戏。
由前述可知,本申请实施例可单独使用或组合使用前述所提及的静态共享GPU shader cache机制和动态共享GPU shader cache机制。那么,当单独使用静态共享GPU shader cache机制时,游戏资源中便可只包括目标游戏的游戏镜像。在此情况下,步骤S202的具体实施方式可以是:若目标游戏的游戏镜像中包括目标着色代码的第二编译结果,则直接从目标游戏的游戏镜像中获取该目标着色代码的第二编译结果作为目标编译结果;否则,则编译目标着色代码得到目标编译结果。
当单独使用动态共享GPU shader cache机制时,游戏资源便可只包括目标容器和关联容器之间的目标共享目录。在此情况下,步骤S202的具体实施方式可以是:若目标共享目录中包括目标着色代码的第一编译结果,则直接从目标共享目录中获取该目标着色代码的第一编译结果作为目标编译结果;否则,则编译目标着色代码得到目标编译结果。其中,该目标着色代码的第一编译结果可以是由关联容器在运行关联游戏的过程中,对目标着色代码进行编译得到的;也可以是由目标容器在运行目标游戏的历史过程中,对目标着色代码进行编译得到的,本申请实施例对此不作限制。
当组合使用静态共享GPU shader cache机制和动态共享GPU shader cache机制时,游戏资源中便可包括目标游戏的游戏镜像以及目标共享目录。在此情况下,步骤S202的具体实施方式可以是:在目标游戏的游戏镜像中,先检测是否存在目标着色代码的第二编译结果;若存在,则从游戏镜像中获取目标着色代码的第二编译结果作为目标编译结果。若不存在,则从目标容器和目标容器的关联容器之间的目标共享目录中,获取第一编译结果作为目标着色代码的目标编译结果。需要说明的是,若从目标共享目录中获取目标编译结果失败,则表明目标共享目录中不存在目标编译结果,即该目标着色代码未被目标容器和关联容器编译过;那么在此情况下,目标容器可编译目标着色代码得到目标编译结果。
S203,根据目标编译结果进行图形处理,得到操作事件对应的反馈图像。
在执行完步骤S203之后,该图像处理方法可以进一步包括:在目标游戏客户端中显示所述反馈图像。
在获取到目标编译结果后,目标容器可调用GPU根据该目标编译结果进行一系列的图形处理,从而得到操作事件对应的反馈图像。其中,图形处理可包括但不限于:阿尔法通道合并处理、像素值坐标的调整处理,等等。在得到反馈图像后,目标容器便可采用视频流的方式将该反馈图像发送至目标游戏客户端,以使得目标游戏客户端显示该反馈图像。
本申请实施例在响应针对目标容器内运行的目标游戏的操作事件,获取到与操作事件对应的目标着色代码后,可跳过目标着色代码的编译过程,直接从游戏镜像或者目标容器和目标容器的关联容器之间的目标共享目录中获取目标着色代码的目标编译结果。然后,可根据目标编 译结果进行图形处理,得到操作事件对应的反馈图像;并在目标游戏客户端中显示反馈图像。可见,本申请实施例通过直接利用游戏镜像或目标共享目录中关联容器已编译得到的目标编译结果进行图形处理,可有效节省目标着色代码的编译时间,从而提升目标游戏的运行速度。
基于上述图2所示的图像处理方法实施例的相关描述,下面将分别对图2所示的方法实施例中所涉及的目标游戏的游戏镜像的具体制作过程,以及目标共享目录的具体挂载过程进行分别阐述:
(一)基于静态共享GPU shader cache机制生成目标游戏的游戏镜像
参见图3a所示:在制作目标游戏的游戏镜像时,可先加载设备操作系统的基础镜像(如Android基础镜像)。接着可安装目标游戏,以触发编译与目标游戏相关的第一部分的GPU shader代码,得到第一部分的编译结果;并将该第一部分的编译结果添加至目标游戏的游戏镜像中。在一种实施方式中,可直接将该第一部分的编译结果和第一部分的GPU shader代码对应地添加至目标游戏的游戏镜像中;再一种实施方式中,可将第一部分的编译结果和第一部分的GPU shader代码的索引值对应地添加至目标游戏的游戏镜像中;此处的索引值可通过对GPU shader代码进行哈希运算得到。然后,可运行目标游戏并输入针对该目标游戏的模拟操作事件,以触发编译与该模拟操作事件对应的第二部分的GPU shader代码,得到第二部分的编译结果;并将该第二部分的编译结果添加至目标游戏的游戏镜像中。在一种实施方式中,可直接将该第二部分的编译结果和第二部分的GPU shader代码对应地添加至目标游戏的游戏镜像中;再一种实施方式中,可将第二部分的编译结果和第二部分的GPU shader代码的索引值对应地添加至目标游戏的游戏镜像中。
(二)基于动态共享GPU shader cache机制挂载目标共享目录
首先,目标边缘服务器可选择目标共享目录。其次,可将目标共享目录挂载至目标容器和关联容器中,使得目标容器和关联容器内的各自游戏的运行过程中,可将所编译的各个GPU shader代码的第一编译结果均同步缓存至该目标共享目录中。具体的,目标边缘服务器可生成携带目标共享目录的目录挂载指令;并向目标容器和关联容器分别发送该目录挂载指令,使得目标容器可将该目标共享目录挂载至目标容器内的动态缓存目录下,以及使得关联容器将该目标共享目录挂载至关联容器内的预设目录下。在成功将目标共享目录挂载至目标容器和关联容器后,若关联容器在运行关联容器的过程中,编译了至少一个GPU shader代码并得到对应的第一编译结果,则可将该关联容器编译得到的第一编译结果添加至目标共享目录中。同理,若目标容器在运行目标容器的过程中,编译了至少一个GPU shader代码得到第一编译结果,则可将该目标容器编译得到的第一编译结果添加至目标共享目录中。
其中,目标共享目录可支持两种选择方式:
选择方式一:在目标边缘服务器的服务器操作系统所在的服务器主机(即Host主机)上选择目标共享目录(例如:/home/shadercache),以供目标边缘服务器上所运行的所有系统容器进行使用;即此选择方式下,目标共享目录位于服务器操作系统所在的服务器主机中。在实际应用中,由于系统容器在运行不同种类的云游戏的过程中均会产生相应的GPU shader代码的第一编译结果,因此多个系统容器所累计的GPU shader代码的第一编译结果的数据量通常是比较大的。若将这些系统容器均挂载至同一个共享目录中,则会导致这一个共享目录中所缓存的编译结果的数据量较大,从而导致后续从这一个共享目录中查找相关GPU shader代码的编译结果时会花费较长的时间。基于此,服务器主机可根据目标边缘服务器中的各系统容器所运行的云游戏的种类数量来确定需提供的共享目录的数量。
在目标边缘服务器中的各系统容器所运行的云游戏的种类比较少(即云游戏的种类数量小于数量阈值时)的情况下,服务器主机可只提供一个共享目录,使得目标边缘服务器中的各个系统容器均和这一个共享目录进行挂载。那么在此情况下,目标边缘服务器可将服务器主机所提供的这一个共享目录中作为目标容器和关联容器之间的目标共享目录;即在此实施方式下,目标容器挂载目标共享目录的示意图可参见图3b所示。且由图3b可知,由于服务器主机只包括目标共享目录,因此该目标共享目录不仅可用于与目标容器以及目标容器的关联容器进行挂载,还可用于和目标边缘服务器中与目标容器无关的系统容器进行挂载。
在目标边缘服务器中的各系统容器所运行的云游戏的种类比较多(即云游戏的种类数量大于或等于数量阈值时)的情况下,服务器主机可提供多个共享目录。使得对于运行相同的云游 戏或者运行共用相同的游戏引擎的云游戏的相关系统容器而言,由于这些相关系统容器会有较大的可能性使用到相同的GPU shader代码,因此这些相关系统容器可与同一个共享目录进行挂载。对于非相关的系统容器而言,可使得这些非相关的系统容器与服务器主机上其他的共享目录进行挂载。那么在此情况下,目标边缘服务器可从服务器主机所提供的多个共享目录中随机选取一个共享目录作为目标容器和关联容器之间的目标共享目录;即在此实施方式下,目标容器挂载目标共享目录的示意图可参见图3c所示。且由图3c可知,由于服务器主机中不仅包括目标共享目录,还包括除目标共享目录以外的其他共享目录;因此该目标共享目录可只用于与目标容器以及目标容器的关联容器进行挂载,服务器主机中的其他共享目录可用于和目标边缘服务器中与目标容器无关的系统容器进行挂载。应理解的是,在云游戏数量比较多的情况下,若忽略在目标共享目录中查找相关GPU shader代码的编译结果时所消耗的时长这一指标,则服务器主机也可只提供一个共享目录。
选择方式二:在互联网网络上的网络文件系统中选择目标共享目录(例如:192.168.10.10:/mnt/share),以供网络上的所有边缘服务器中的各个系统容器进行使用;该网络文件系统与云游戏系统中的各个边缘服务器相互独立,且允许各个边缘服务器中的系统容器进行访问。即此选择方式下,目标共享目录位于网络文件系统中。在具体实现中,与服务器主机根据目标边缘服务器中的各系统容器所运行的云游戏种类数量来确定需提供的共享目录的数量的理由类似,网络文件系统也可根据目标边缘服务器中的各系统容器所运行的云游戏种类数量来确定需提供的共享目录的数量。
在云游戏系统中的各边缘服务器中的各系统容器所运行的云游戏的种类比较少(即云游戏的种类数量小于数量阈值时)的情况下,网络文件系统可只提供一个共享目录,使得云游戏系统中的各个系统容器均和这一个共享目录进行挂载。那么在此情况下,目标边缘服务器可将网络文件系统所提供的这一个共享目录中作为目标容器和关联容器之间的目标共享目录;即在此实施方式下,目标容器挂载目标共享目录的示意图可参见图3d所示。且由图3d可知,由于网络文件系统只包括目标共享目录,因此该目标共享目录不仅可用于与目标容器以及目标容器的关联容器进行挂载,还可用于和云游戏系统中与目标容器无关的系统容器进行挂载。
在云游戏系统中的各边缘服务器中的各系统容器所运行的云游戏的种类比较多(即云游戏的种类数量大于或等于数量阈值时)的情况下,网络文件系统可提供多个共享目录。使得对于运行相同的云游戏或者运行共用相同的游戏引擎的云游戏的相关系统容器而言,由于这些相关系统容器会有较大的可能性使用到相同的GPU shader代码,因此这些相关系统容器可与同一个共享目录进行挂载。对于非相关的系统容器而言,可使得这些非相关的系统容器与网络文件系统上其他的共享目录进行挂载。那么在此情况下,目标边缘服务器可从网络文件系统所提供的多个共享目录中随机选取一个共享目录作为目标容器和关联容器之间的目标共享目录;即在此实施方式下,目标容器挂载目标共享目录的示意图可参见图3e所示。且由图3e可知,由于网络文件系统中不仅包括目标共享目录,还包括除目标共享目录以外的其他共享目录;因此该目标共享目录可只用于与目标容器以及目标容器的关联容器进行挂载,网络文件系统中的其他共享目录可用于和云游戏系统中与目标容器无关的系统容器进行挂载。应理解的是,在云游戏数量比较多的情况下,若忽略在目标共享目录中查找相关GPU shader代码的编译结果时所消耗的时长这一指标,则网络文件系统也可只提供一个共享目录。
在实际应用中,目标边缘服务器可从上述两种选择方式任意选取一种选择方式来确定目标共享目录。进一步的,由于选择方式一是从服务器主机上选择目标共享目录的,目标共享目录和目标容器都存在于目标边缘服务器上,因此可保证目标容器对目标共享目录中的各第一编译结果的访问速度。而由于选择方式二是从网络文件系统中选择目标共享目录,网络文件系统与目标边缘服务器相互独立,因此可能会由于网络阻塞等因素而导致目标容器对目标共享目录中的各第一编译结果的访问速度较慢。基于此,目标边缘服务器可根据针对网络文件系统的访问速度的实际情况从上述两种选择方式选取一种选择方式来确定目标共享目录。具体的,在针对网络文件系统的访问速度没有保障的情况下,可选择实施方式一来确定目标共享目录;在针对网络文件系统的访问速度有保障的情况下,可选择实施方式二来确定目标共享目录。
应理解的是,本申请实施例只是示例性地说明可根据针对网络文件系统的访问速度这一参数来实现选择方式的选取,并非穷举;即在其他实施例中,还可根据其他参数来实现选择方式 的选取。例如,由于选择方式一是从服务器主机上选择目标共享目录的,因此目标共享目录中的各第一编译结果无法被其他边缘服务器中的系统容器进行访问。而由于选择方式二是从网络文件系统中选择目标共享目录,因此目标共享目录中的各第一编译结果可被其他边缘服务器中的系统容器进行访问。基于此,目标边缘服务器可根据实际的游戏部署要求从上述两种选择方式选取一种选择方式来确定目标共享目录。具体的,若游戏部署要求指示无需实现不同边缘服务器之间相互共享编译结果,则可选择实施方式一来确定目标共享目录;若游戏部署要求指示需实现不同边缘服务器之间相互共享编译结果,则选择实施方式二来确定目标共享目录。
进一步的,基于上述图2所示的图像处理方法实施例的相关描述,以及上述基于静态共享GPU shader cache机制生成目标游戏的游戏镜像的具体过程和基于动态共享GPU shader cache机制挂载目标共享目录的具体过程的相关描述,本申请实施例还提出一种更为具体的图像处理方法的流程示意图。本申请实施例主要以组合使用静态共享GPU shader cache机制和动态共享GPU shader cache机制为例进行说明,该图像处理方法可以由上述所提及的云游戏系统中的目标边缘服务器内所运行的目标容器执行;该目标容器是通过加载目标游戏的游戏镜像而启动的,目标游戏的游戏镜像中可至少包括预先运行目标游戏所编译的至少一个着色代码的第二编译结果。请参见图4,该图像处理方法可包括以下步骤S401-S407:
S401,接收目标边缘服务器发送的目录挂载指令,该目录挂载指令携带目标共享目录。
S402,在目标容器中指定动态缓存目录,并将目标共享目录挂载至动态缓存目录下。
在一种实施方式中,可在目标容器中任意指定一个目录作为动态缓存目录;即在此实施方式下,动态缓存目录可以和第二编译结果在游戏镜像中的存储目录相同,也可不同。再一种实施方式中,由于受容器目录挂载实现方法所限,当挂载目标共享目录至目标容器内部时,目标容器内部与该目标共享目录进行挂载的相应目录下的文件会被清空。因此为避免游戏镜像中的第二编译结果被清空,则可在目标容器内部采用两个不同的环境变量来分别指定挂载目标共享目录的动态缓存目录和第二编译结果在游戏镜像中的存储目录,从而实现将动态缓存目录和第二编译结果的存储目录进行分隔。使得在将目标共享目录挂载至动态缓存目录时,只清除动态缓存目录下的文件,不会影响存储目录下的第二编译结果。
在此实施方式下,动态缓存目录可采用第一环境变量进行指定;该第一环境变量可包括但不限于:Mesa代码中的“MESA_GLSL_CACHE_DIR”环境变量。而第二编译结果在游戏镜像中的存储目录可采用第二环境变量进行指定;具体的,该第二环境变量可以包括但不限于:Mesa代码中的“MESA_GLSL_CACHE_DIR_STATIC”环境变量。其中,此处的Mesa是一个开放源代码的计算机图形库;Mesa可用于实现opengl/opengles的应用程序接口。此处的opengl主要是用于渲染3D图形的跨平台应用程序编程接口API,而opengles则是opengl API的一个子集,其主要运用在嵌入式设备(例如:智能手机等)中。
在目标容器中指定动态缓存目录后,便可将目标共享目录挂载至动态缓存目录下,使目标共享目录和动态缓存目录之间保持数据同步。其中,该目标共享目录还被挂载至关联容器的预设目录中,以缓存关联容器在运行关联游戏的过程中,对至少一个着色代码进行编译所得到的第一编译结果。例如,当目标共享目录位于服务器主机上时,若该服务器主机只包括目标共享目录,则该目标共享目录的挂载示意图可参见图5a所示;若该服务器主机包括目标共享目录以及其他共享目录,则该目标共享目录的挂载示意图可参见图5b所示。又如,当目标共享目录位于网络文件系统上时,若该网络文件系统只包括目标共享目录,则该目标共享目录的挂载示意图可参见图5c所示;若该网络文件系统包括目标共享目录以及其他共享目录,则该目标共享目录的挂载示意图可参见图5d所示。
S403,响应针对目标容器内运行的目标游戏的操作事件,获取与操作事件对应的目标着色代码。
S404,在目标游戏的游戏镜像中,检测是否存在目标着色代码的第二编译结果。
由前述可知,游戏镜像中可至少包括预先运行目标游戏所编译的至少一个着色代码的第二编译结果。在一种实施方式中,该游戏镜像还可包括与各第二编译结果对应的着色代码;在此实施方式下,可直接检测目标游戏的游戏镜像中是否包括目标着色代码。若包括该目标着色代码,则可确定游戏镜像中存在目标着色代码的第二编译结果;若不包括该目标着色代码,则可确定游戏镜像中不存在目标着色代码的第二编译结果。
再一种实施方式中,该游戏镜像中还可包括至少一个着色代码的索引值,且一个索引值对应一个第二编译结果。那么在此实施方式下,可对目标着色代码进行哈希运算,得到目标着色代码的目标索引值;然后检测游戏镜像中是否包括该目标索引值。若游戏镜像中包括目标索引值,则可确定游戏镜像中存在目标着色代码的第二编译结果;若游戏镜像中不包括目标索引值,则可确定游戏镜像中不存在目标着色代码的第二编译结果。
若确定游戏镜像中存在目标着色代码的第二编译结果,则可执行步骤S405;若确定游戏镜像中不存在目标着色代码的第二编译结果,则可执行步骤S406。
S405,若存在,则从游戏镜像中获取目标着色代码的第二编译结果作为目标编译结果。
S406,若不存在,则从目标容器和目标容器的关联容器之间的目标共享目录中,获取第一编译结果作为目标着色代码的目标编译结果。
在具体实施过程中,目标共享目录中可包括至少一个着色代码的第一编译结果,且每个第一编译结果可对应一个索引值。那么步骤S406的具体实施方式可以一并参见图5e所示,具体的:目标容器可在目标共享目录中查找是否存在目标索引值。若存在,则跳过代码编译流程,直接获取目标索引值对应的第一编译结果作为目标编译结果。若不存在,则表明游戏资源中不包括目标着色代码的目标编译结果;那么可编译目标着色代码,得到目标编译结果;并将该目标编译结果缓存至动态缓存目录,以将目标编译结果同步至目标共享目录中,使得关联容器需编译目标着色代码时,直接从目标共享目录中获取目标编译结果。除此之外,还可将目标着色代码的目标索引值一并缓存至动态缓存目录中,以将该目标索引值同步至目标共享目录中。
S407,根据目标编译结果进行图形处理,得到操作事件对应的反馈图像。在执行完步骤S407之后,该图像处理方法可以进一步包括:在目标游戏客户端中显示反馈图像。
本申请实施例在响应针对目标容器内运行的目标游戏的操作事件,获取到与操作事件对应的目标着色代码后,可跳过目标着色代码的编译过程,直接从游戏镜像或者目标容器和目标容器的关联容器之间的目标共享目录中获取目标着色代码的目标编译结果。然后,可根据目标编译结果进行图形处理,得到操作事件对应的反馈图像;并在目标游戏客户端中显示反馈图像。可见,本申请实施例通过直接利用游戏镜像或目标共享目录中关联容器已编译得到的目标编译结果进行图形处理,可有效节省目标着色代码的编译时间,从而提升目标游戏的运行速度。
基于上述图像处理方法实施例的描述,本申请实施例还公开了一种图像处理装置,所述图像处理装置可以是运行于上述所提及的目标边缘服务器中的一个计算机程序(包括程序代码)。该图像处理装置可以执行图2或图4所示的方法。请参见图6,所述图像处理装置可以运行如下单元:
获取单元601,用于响应针对目标容器内运行的目标游戏的操作事件,获取与所述操作事件对应的目标着色代码;所述操作事件是在与所述目标容器相连接的目标游戏客户端显示的所述目标游戏的游戏画面中检测到的;
所述获取单元601,还用于从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:所述目标游戏的游戏镜像,及所述目标容器和所述目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果;
处理单元602,用于根据所述目标编译结果进行图形处理,得到所述操作事件对应的反馈图像;并在所述目标游戏客户端中显示所述反馈图像。
在一种实施方式中,所述游戏资源包括所述游戏镜像和所述目标共享目录;所述游戏镜像中包括预先运行所述目标游戏所编译的至少一个着色代码的第二编译结果,且各第二编译结果均是在制作所述游戏镜像时被添加至所述游戏镜像中的;相应的,获取单元601在用于从游戏资源中获取所述目标着色代码的目标编译结果时,可具体用于:
在所述目标游戏的游戏镜像中,检测是否存在所述目标着色代码的第二编译结果;
若存在,则从所述游戏镜像中获取所述目标着色代码的第二编译结果作为目标编译结果;
若不存在,则从所述目标容器和所述目标容器的关联容器之间的目标共享目录中,获取所述第一编译结果作为所述目标着色代码的目标编译结果。
再一种实施方式中,所述游戏镜像中还包括所述至少一个着色代码的索引值,且一个索引值对应一个第二编译结果;相应的,获取单元601在用于在所述目标游戏的游戏镜像中,检测 是否存在所述目标着色代码的第二编译结果时,可具体用于:
对所述目标着色代码进行哈希运算,得到所述目标着色代码的目标索引值;
若所述游戏镜像中包括所述目标索引值,则确定所述游戏镜像中存在所述目标着色代码的第二编译结果;
若所述游戏镜像中不包括所述目标索引值,则确定所述游戏镜像中不存在所述目标着色代码的第二编译结果。
再一种实施方式中,所述目标游戏是云游戏系统中的云游戏,所述云游戏系统包括至少一个边缘服务器以及多个游戏客户端;每个边缘服务器内部署有至少一个系统容器,每个系统容器与至少一个游戏客户端相连接;
所述每个系统容器用于运行一个或多个游戏,且所述每个系统容器在运行任一游戏的过程中,传输所述任一游戏的游戏画面至相连接的游戏客户端中进行显示;
其中,所述目标容器是基于目标边缘服务器的服务器操作系统所运行的任一系统容器,所述目标边缘服务器为所述云游戏系统中的任一边缘服务器;所述关联容器是指运行与所述目标游戏相关联的关联游戏的系统容器,所述关联游戏包括:所述目标游戏或者与所述目标游戏使用同一个游戏引擎的游戏。
再一种实施方式中,处理单元602还可用于:
接收所述目标边缘服务器发送的目录挂载指令,所述目录挂载指令携带所述目标共享目录;
在所述目标容器中指定动态缓存目录,并将所述目标共享目录挂载至所述动态缓存目录下,使所述目标共享目录和所述动态缓存目录之间保持数据同步;
其中,所述目标共享目录还被挂载至所述关联容器的预设目录中,以缓存所述关联容器在运行所述关联游戏的过程中,对至少一个着色代码进行编译所得到的第一编译结果。
再一种实施方式中,所述动态缓存目录采用第一环境变量进行指定,所述第二编译结果在所述游戏镜像中的存储目录采用第二环境变量进行指定。
再一种实施方式中,所述目标共享目录位于所述服务器操作系统所在的服务器主机中;或者,
所述共享目录位于网络文件系统中,所述网络文件系统与所述云游戏系统中的各个边缘服务器相互独立,且允许所述各个边缘服务器中的系统容器进行访问。
再一种实施方式中,若所述目标共享目录位于所述服务器主机中,则所述服务器主机中还包括除所述目标共享目录以外的其他共享目录,所述服务器主机中的其他共享目录用于和所述目标边缘服务器中与所述目标容器无关的系统容器进行挂载;
若所述目标共享目录位于所述网络文件系统中,则所述网络文件系统中还包括除所述目标共享目录以外的其他共享目录,所述网络文件系统中的其他共享目录用于和所述云游戏系统中与所述目标容器无关的系统容器进行挂载。
再一种实施方式中,所述游戏资源中不包括所述目标着色代码的目标编译结果;相应的,处理单元602还可用于:
若从所述游戏资源中获取所述目标编译结果失败,则编译所述目标着色代码,得到所述目标编译结果;
将所述目标编译结果缓存至所述动态缓存目录,以将所述目标编译结果同步至所述目标共享目录中,使得所述关联容器需编译所述目标着色代码时,从所述目标共享目录中获取所述目标编译结果。
根据本申请的一个实施例,图2或图4所示的方法所涉及的各个步骤均可以是由图6所示的图像处理装置中的各个单元来执行的。例如,图2中所示的步骤S201-S202均可由图6中所示的获取单元601来执行,步骤S203可由图6中所示的处理单元602来执行。又如,图4中所示的步骤S401-S402以及步骤S407均可由图6中所示的处理单元602来执行,步骤S403-S406均可由图6中所示的获取单元601来执行。
根据本申请的另一个实施例,图6所示的图像处理装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者 多个单元的功能由一个单元实现。在本申请的其它实施例中,基于图像处理装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算设备上运行能够执行如图2或图4中所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图6中所示的图像处理装置,以及来实现本申请实施例的图像处理方法。所述计算机程序可以记载于例如计算机可读存储介质上,并通过计算机可读存储介质装载于上述计算设备中,并在其中运行。
本申请实施例在响应针对目标容器内运行的目标游戏的操作事件,获取到与操作事件对应的目标着色代码后,可跳过目标着色代码的编译过程,直接从游戏镜像或者目标容器和目标容器的关联容器之间的目标共享目录中获取目标着色代码的目标编译结果。然后,可根据目标编译结果进行图形处理,得到操作事件对应的反馈图像;并在目标游戏客户端中显示反馈图像。可见,本申请实施例通过直接利用游戏镜像或目标共享目录中关联容器已编译得到的目标编译结果进行图形处理,可有效节省目标着色代码的编译时间,从而提升目标游戏的运行速度。
基于上述方法实施例以及装置实施例的描述,本申请实施例还提供一种服务器;该服务器可以是上述所提及的目标边缘服务器。请参见图7,该服务器至少包括处理器701、输入接口702、输出接口703以及计算机存储介质704。其中,服务器内的处理器701、输入接口702、输出接口703以及计算机存储介质704可通过总线或其他方式连接。
所述计算机存储介质704是服务器中的记忆设备,用于存放程序和数据。可以理解的是,此处的计算机存储介质704既可以包括服务器中的内置存储介质,当然也可以包括服务器所支持的扩展存储介质。计算机存储介质704提供存储空间,该存储空间存储了服务器的操作系统。并且,在该存储空间中还存放了适于被处理器701加载并执行的一条或多条的指令,这些指令可以是一个或一个以上的计算机程序(包括程序代码)。需要说明的是,此处的计算机存储介质可以是高速RAM存储器,也可以是非易失性的存储器(non-transitory memory),例如至少一个磁盘存储器;还可以是至少一个位于远离前述处理器的计算机存储介质。所述处理器701(或称中央处理器(Central Processing Unit,CPU))是服务器的计算核心以及控制核心,其适于实现一条或多条指令,具体适于加载并执行一条或多条指令从而实现相应方法流程或相应功能。
在一个实施例中,可由处理器701加载并执行计算机存储介质704中存放的一条或多条指令,以实现上述有关图2或图4所示的图像处理方法实施例中的相应方法步骤;具体实现中,计算机存储介质704中的一条或多条指令由处理器701加载并执行如下步骤:
响应针对目标容器内运行的目标游戏的操作事件,获取与所述操作事件对应的目标着色代码;所述操作事件是在与所述目标容器相连接的目标游戏客户端显示的所述目标游戏的游戏画面中检测到的;
从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:所述目标游戏的游戏镜像,及所述目标容器和所述目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果;
根据所述目标编译结果进行图形处理,得到所述操作事件对应的反馈图像;并在所述目标游戏客户端中显示所述反馈图像。
在一种实施方式中,所述游戏资源包括所述游戏镜像和所述目标共享目录;所述游戏镜像中包括预先运行所述目标游戏所编译的至少一个着色代码的第二编译结果,且各第二编译结果均是在制作所述游戏镜像时被添加至所述游戏镜像中的;相应的,在从游戏资源中获取所述目标着色代码的目标编译结果时,所述一条或多条指令可由处理器701加载并具体执行:
在所述目标游戏的游戏镜像中,检测是否存在所述目标着色代码的第二编译结果;
若存在,则从所述游戏镜像中获取所述目标着色代码的第二编译结果作为目标编译结果;
若不存在,则从所述目标容器和所述目标容器的关联容器之间的目标共享目录中,获取所述第一编译结果作为所述目标着色代码的目标编译结果。
再一种实施方式中,所述游戏镜像中还包括所述至少一个着色代码的索引值,且一个索引值对应一个第二编译结果;相应的,在所述目标游戏的游戏镜像中,检测是否存在所述目标着 色代码的第二编译结果时,所述一条或多条指令可由处理器701加载并具体执行:
对所述目标着色代码进行哈希运算,得到所述目标着色代码的目标索引值;
若所述游戏镜像中包括所述目标索引值,则确定所述游戏镜像中存在所述目标着色代码的第二编译结果;
若所述游戏镜像中不包括所述目标索引值,则确定所述游戏镜像中不存在所述目标着色代码的第二编译结果。
再一种实施方式中,所述目标游戏是云游戏系统中的云游戏,所述云游戏系统包括至少一个边缘服务器以及多个游戏客户端;每个边缘服务器内部署有至少一个系统容器,每个系统容器与至少一个游戏客户端相连接;
所述每个系统容器用于运行一个或多个游戏,且所述每个系统容器在运行任一游戏的过程中,传输所述任一游戏的游戏画面至相连接的游戏客户端中进行显示;
其中,所述目标容器是基于目标边缘服务器的服务器操作系统所运行的任一系统容器,所述目标边缘服务器为所述云游戏系统中的任一边缘服务器;所述关联容器是指运行与所述目标游戏相关联的关联游戏的系统容器,所述关联游戏包括:所述目标游戏或者与所述目标游戏使用同一个游戏引擎的游戏。
再一种实施方式中,所述一条或多条指令还可由处理器701加载并执行:
接收所述目标边缘服务器发送的目录挂载指令,所述目录挂载指令携带所述目标共享目录;
在所述目标容器中指定动态缓存目录,并将所述目标共享目录挂载至所述动态缓存目录下,使所述目标共享目录和所述动态缓存目录之间保持数据同步;
其中,所述目标共享目录还被挂载至所述关联容器的预设目录中,以缓存所述关联容器在运行所述关联游戏的过程中,对至少一个着色代码进行编译所得到的第一编译结果。
再一种实施方式中,所述动态缓存目录采用第一环境变量进行指定,所述第二编译结果在所述游戏镜像中的存储目录采用第二环境变量进行指定。
再一种实施方式中,所述目标共享目录位于所述服务器操作系统所在的服务器主机中;或者,
所述共享目录位于网络文件系统中,所述网络文件系统与所述云游戏系统中的各个边缘服务器相互独立,且允许所述各个边缘服务器中的系统容器进行访问。
再一种实施方式中,若所述目标共享目录位于所述服务器主机中,则所述服务器主机中还包括除所述目标共享目录以外的其他共享目录,所述服务器主机中的其他共享目录用于和所述目标边缘服务器中与所述目标容器无关的系统容器进行挂载;
若所述目标共享目录位于所述网络文件系统中,则所述网络文件系统中还包括除所述目标共享目录以外的其他共享目录,所述网络文件系统中的其他共享目录用于和所述云游戏系统中与所述目标容器无关的系统容器进行挂载。
再一种实施方式中,所述游戏资源中不包括所述目标着色代码的目标编译结果;相应的,所述一条或多条指令还可由处理器701加载并执行:
若从所述游戏资源中获取所述目标编译结果失败,则编译所述目标着色代码,得到所述目标编译结果;
将所述目标编译结果缓存至所述动态缓存目录,以将所述目标编译结果同步至所述目标共享目录中,使得所述关联容器需编译所述目标着色代码时,从所述目标共享目录中获取所述目标编译结果。
本申请实施例在响应针对目标容器内运行的目标游戏的操作事件,获取到与操作事件对应的目标着色代码后,可跳过目标着色代码的编译过程,直接从游戏镜像或者目标容器和目标容器的关联容器之间的目标共享目录中获取目标着色代码的目标编译结果。然后,可根据目标编译结果进行图形处理,得到操作事件对应的反馈图像;并在目标游戏客户端中显示反馈图像。可见,本申请实施例通过直接利用游戏镜像或目标共享目录中关联容器已编译得到的目标编译结果进行图形处理,可有效节省目标着色代码的编译时间,从而提升目标游戏的运行速度。
需要说明的是,根据本申请的一个方面,还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使 得该计算机设备执行上述图2或图4所示的图像处理方法实施例方面的各种方式中提供的方法。
并且,应理解的是,以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

Claims (20)

  1. 一种图像处理方法,其特征在于,包括:
    响应针对目标容器内运行的目标游戏的操作事件,获取与所述操作事件对应的目标着色代码;
    从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:所述目标游戏的游戏镜像,及所述目标容器和所述目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果;
    根据所述目标编译结果进行图形处理,得到所述操作事件对应的反馈图像。
  2. 如权利要求1所述的方法,其特征在于,所述游戏资源包括所述游戏镜像和所述目标共享目录;所述游戏镜像中包括预先运行所述目标游戏所编译的至少一个着色代码的第二编译结果,且各第二编译结果均是在制作所述游戏镜像时被添加至所述游戏镜像中的;
    所述从游戏资源中获取所述目标着色代码的目标编译结果,包括:
    在所述目标游戏的游戏镜像中,检测是否存在所述目标着色代码的第二编译结果;
    若存在,则从所述游戏镜像中获取所述目标着色代码的第二编译结果作为目标编译结果;
    若不存在,则从所述目标容器和所述目标容器的关联容器之间的目标共享目录中,获取所述第一编译结果作为所述目标着色代码的目标编译结果。
  3. 如权利要求2所述的方法,其特征在于,所述游戏镜像中还包括所述至少一个着色代码的索引值,且一个索引值对应一个第二编译结果;所述在所述目标游戏的游戏镜像中,检测是否存在所述目标着色代码的第二编译结果,包括:
    对所述目标着色代码进行哈希运算,得到所述目标着色代码的目标索引值;
    若所述游戏镜像中包括所述目标索引值,则确定所述游戏镜像中存在所述目标着色代码的第二编译结果;
    若所述游戏镜像中不包括所述目标索引值,则确定所述游戏镜像中不存在所述目标着色代码的第二编译结果。
  4. 如权利要求1所述的方法,其特征在于,所述目标游戏是云游戏系统中的云游戏,所述云游戏系统包括至少一个边缘服务器以及多个游戏客户端;每个边缘服务器内部署有至少一个系统容器,每个系统容器与至少一个游戏客户端相连接;
    所述每个系统容器用于运行一个或多个游戏,且所述每个系统容器在运行任一游戏的过程中,传输所述任一游戏的游戏画面至相连接的游戏客户端中进行显示;
    其中,所述目标容器是基于目标边缘服务器的服务器操作系统所运行的任一系统容器,所述目标边缘服务器为所述云游戏系统中的任一边缘服务器;所述关联容器是指运行与所述目标游戏相关联的关联游戏的系统容器,所述关联游戏包括:所述目标游戏或者与所述目标游戏使用同一个游戏引擎的游戏。
  5. 如权利要求4所述的方法,其特征在于,所述方法还包括:
    接收所述目标边缘服务器发送的目录挂载指令,所述目录挂载指令携带所述目标共享目录;
    在所述目标容器中指定动态缓存目录,并将所述目标共享目录挂载至所述动态缓存目录下,使所述目标共享目录和所述动态缓存目录之间保持数据同步;
    其中,所述目标共享目录还被挂载至所述关联容器的预设目录中,以缓存所述关联容器在运行所述关联游戏的过程中,对至少一个着色代码进行编译所得到的第一编译结果。
  6. 如权利要求5所述的方法,其特征在于,所述动态缓存目录采用第一环境变量进行指定,所述第二编译结果在所述游戏镜像中的存储目录采用第二环境变量进行指定。
  7. 如权利要求4-6任一项所述的方法,其特征在于,所述目标共享目录位于所述服务器操作系统所在的服务器主机中。
  8. 如权利要求4-6任一项所述的方法,其特征在于,所述共享目录位于网络文件系统中,所述网络文件系统与所述云游戏系统中的各个边缘服务器相互独立,且允许所述各个边缘服务器中的系统容器进行访问。
  9. 如权利要求7所述的方法,其特征在于,所述服务器主机中还包括除所述目标共享目录以外的其他共享目录,所述服务器主机中的其他共享目录用于和所述目标边缘服务器中与所述目标容器无关的系统容器进行挂载。
  10. 如权利要求8所述的方法,其特征在于,所述网络文件系统中还包括除所述目标共享目录以外的其他共享目录,所述网络文件系统中的其他共享目录用于和所述云游戏系统中与所述目标容器无关的系统容器进行挂载。
  11. 如权利要求5所述的方法,其特征在于,所述游戏资源中不包括所述目标着色代码的目标编译结果,所述方法还包括:
    若从所述游戏资源中获取所述目标编译结果失败,则编译所述目标着色代码,得到所述目标编译结果;
    将所述目标编译结果缓存至所述动态缓存目录,以将所述目标编译结果同步至所述目标共享目录中,使得所述关联容器需编译所述目标着色代码时,从所述目标共享目录中获取所述目标编译结果。
  12. 如权利要求1所述的方法,其特征在于,所述操作事件是在与所述目标容器相连接的目标游戏客户端显示的所述目标游戏的游戏画面中检测到的,在得到所述操作事件对应的反馈图像之后,所述方法进一步包括:
    在所述目标游戏客户端中显示所述反馈图像。
  13. 一种图像处理装置,其特征在于,包括:
    获取单元,用于响应针对目标容器内运行的目标游戏的操作事件,获取与所述操作事件对应的目标着色代码;
    所述获取单元,还用于从游戏资源中获取所述目标着色代码的目标编译结果,所述游戏资源包括以下至少一项:所述目标游戏的游戏镜像,及所述目标容器和所述目标容器的关联容器之间的目标共享目录,所述目标共享目录中包括所述关联容器在游戏运行过程中,编译至少一个着色代码所得到的第一编译结果;
    处理单元,用于根据所述目标编译结果进行图形处理,得到所述操作事件对应的反馈图像。
  14. 如权利要求13所述的装置,其特征在于,所述游戏资源包括所述游戏镜像和所述目标共享目录;所述游戏镜像中包括预先运行所述目标游戏所编译的至少一个着色代码的第二编译结果,且各第二编译结果均是在制作所述游戏镜像时被添加至所述游戏镜像中的;
    所述获取单元进一步用于:
    在所述目标游戏的游戏镜像中,检测是否存在所述目标着色代码的第二编译结果;
    若存在,则从所述游戏镜像中获取所述目标着色代码的第二编译结果作为目标编译结果;
    若不存在,则从所述目标容器和所述目标容器的关联容器之间的目标共享目录中,获取所述第一编译结果作为所述目标着色代码的目标编译结果。
  15. 如权利要求14所述的装置,其特征在于,所述游戏镜像中还包括所述至少一个着色代码的索引值,且一个索引值对应一个第二编译结果;
    所述获取单元进一步用于:
    对所述目标着色代码进行哈希运算,得到所述目标着色代码的目标索引值;
    若所述游戏镜像中包括所述目标索引值,则确定所述游戏镜像中存在所述目标着色代码的第二编译结果;
    若所述游戏镜像中不包括所述目标索引值,则确定所述游戏镜像中不存在所述目标着色代码的第二编译结果。
  16. 如权利要求13所述的装置,其特征在于,所述目标游戏是云游戏系统中的云游戏,所述云游戏系统包括至少一个边缘服务器以及多个游戏客户端;每个边缘服务器内部署有至少一个系统容器,每个系统容器与至少一个游戏客户端相连接;
    所述每个系统容器用于运行一个或多个游戏,且所述每个系统容器在运行任一游戏的过程中,传输所述任一游戏的游戏画面至相连接的游戏客户端中进行显示;
    其中,所述目标容器是基于目标边缘服务器的服务器操作系统所运行的任一系统容器,所述目标边缘服务器为所述云游戏系统中的任一边缘服务器;所述关联容器是指运行与所述目标游戏相关联的关联游戏的系统容器,所述关联游戏包括:所述目标游戏或者与所述目标游戏使 用同一个游戏引擎的游戏。
  17. 如权利要求16所述的装置,其特征在于,所述处理单元进一步用于:
    接收所述目标边缘服务器发送的目录挂载指令,所述目录挂载指令携带所述目标共享目录;
    在所述目标容器中指定动态缓存目录,并将所述目标共享目录挂载至所述动态缓存目录下,使所述目标共享目录和所述动态缓存目录之间保持数据同步;
    其中,所述目标共享目录还被挂载至所述关联容器的预设目录中,以缓存所述关联容器在运行所述关联游戏的过程中,对至少一个着色代码进行编译所得到的第一编译结果。
  18. 如权利要求13所述的装置,其特征在于,所述操作事件是在与所述目标容器相连接的目标游戏客户端显示的所述目标游戏的游戏画面中检测到的,所述处理单元进一步用于:
    在所述目标游戏客户端中显示所述反馈图像。
  19. 一种服务器,包括输入接口和输出接口,其特征在于,还包括:
    计算机存储介质,用于存储有一条或多条指令;
    处理器,用于加载所述计算机存储介质存储的一条或多条指令,以执行如权利要求1-12任一项所述的图像处理方法。
  20. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有一条或多条指令,所述一条或多条指令适于由处理器加载并执行如权利要求1-12任一项所述的图像处理方法。
PCT/CN2021/100026 2020-07-21 2021-06-15 图像处理方法、装置、服务器及介质 Ceased WO2022017070A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2022548779A JP7464732B2 (ja) 2020-07-21 2021-06-15 画像処理方法及びその装置、サーバ並びにコンピュータプログラム
KR1020227017638A KR102737061B1 (ko) 2020-07-21 2021-06-15 이미지 처리 방법 및 장치, 서버 및 매체
EP21845550.9A EP4120065A4 (en) 2020-07-21 2021-06-15 IMAGE PROCESSING METHOD AND DEVICE, AND SERVER AND MEDIUM
US17/731,170 US12121807B2 (en) 2020-07-21 2022-04-27 Image processing method using a shared GPU shader cache mechanism and apparatus, server, and medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010704005.8A CN111736850B (zh) 2020-07-21 2020-07-21 图像处理方法、装置、服务器及介质
CN202010704005.8 2020-07-21

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/731,170 Continuation US12121807B2 (en) 2020-07-21 2022-04-27 Image processing method using a shared GPU shader cache mechanism and apparatus, server, and medium

Publications (1)

Publication Number Publication Date
WO2022017070A1 true WO2022017070A1 (zh) 2022-01-27

Family

ID=72655217

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/100026 Ceased WO2022017070A1 (zh) 2020-07-21 2021-06-15 图像处理方法、装置、服务器及介质

Country Status (6)

Country Link
US (1) US12121807B2 (zh)
EP (1) EP4120065A4 (zh)
JP (1) JP7464732B2 (zh)
KR (1) KR102737061B1 (zh)
CN (1) CN111736850B (zh)
WO (1) WO2022017070A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114217908A (zh) * 2022-02-23 2022-03-22 广州趣丸网络科技有限公司 容器启动方法、系统、装置及设备
WO2023180809A3 (en) * 2022-03-21 2023-12-07 Oorbit, Inc. Software application streaming system

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111736850B (zh) 2020-07-21 2020-12-22 腾讯科技(深圳)有限公司 图像处理方法、装置、服务器及介质
CN112156475B (zh) * 2020-10-29 2022-04-12 腾讯科技(深圳)有限公司 一种业务数据处理方法、装置、电子设备及存储介质
CN112587917A (zh) * 2021-01-23 2021-04-02 上海达龙信息科技有限公司 一种云游戏服务器模板及游戏磁盘变更方法、系统、存储介质及服务器
US11321907B1 (en) 2021-03-02 2022-05-03 Samsung Electronics Co., Ltd. Method and apparatus for graphics driver optimization using daemon-based resources
CN113656143B (zh) * 2021-08-16 2024-05-31 深圳市瑞驰信息技术有限公司 一种实现安卓容器直通显卡的方法及系统
CN117971224A (zh) * 2022-10-25 2024-05-03 腾讯科技(深圳)有限公司 着色器文件的处理方法和装置、存储介质及电子设备
CN115695857B (zh) * 2022-12-29 2023-03-21 北京海誉动想科技股份有限公司 云应用的视频编码方法及装置
CN117008924A (zh) * 2023-10-07 2023-11-07 海马云(天津)信息技术有限公司 编译处理方法及装置、通信设备
CN120669985A (zh) * 2024-06-14 2025-09-19 华为技术有限公司 编译方法、电子设备和计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160162272A1 (en) * 2013-08-15 2016-06-09 Tencent Technology (Shenzhen) Company Limited Method and apparatus for loading a rendering engine
WO2019147974A2 (en) * 2018-01-26 2019-08-01 Valve Corporation Distributing shaders between client machines for precaching
CN110933036A (zh) * 2019-10-29 2020-03-27 咪咕互动娱乐有限公司 一种云游戏服务系统和服务器
CN111736850A (zh) * 2020-07-21 2020-10-02 腾讯科技(深圳)有限公司 图像处理方法、装置、服务器及介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7064766B2 (en) 2001-10-18 2006-06-20 Microsoft Corporation Intelligent caching data structure for immediate mode graphics
US7887420B2 (en) * 2005-09-12 2011-02-15 Igt Method and system for instant-on game download
US9495830B2 (en) 2013-08-12 2016-11-15 Namco Usa Inc. Cashless play system based on proprietary monetary systems
CN104780164B (zh) * 2015-03-25 2016-12-21 腾讯科技(深圳)有限公司 一种运行游戏客户端的方法和装置
US11794108B2 (en) * 2016-06-13 2023-10-24 Sony Interactive Entertainment LLC Method and system for saving a snapshot of game play and used to begin later execution of the game play by any user as executed on a game cloud system
CN106933635B (zh) * 2017-03-15 2020-06-30 北京搜狐新媒体信息技术有限公司 Docker镜像生成方法及Docker容器
WO2019074952A2 (en) * 2017-10-10 2019-04-18 Google Llc GAMING PROFILING BASED ON DISTRIBUTED SAMPLE WITH GAME AND MEASUREMENT METADATA, AND GAME API PLATFORM SUPPORTING THIRD CONTENT
WO2019199848A1 (en) * 2018-04-10 2019-10-17 Google Llc Memory management in gaming rendering
US10672362B2 (en) * 2018-08-17 2020-06-02 Ffipco, Llc Systems and methods for digital content creation and rendering
CN111352692B (zh) * 2018-12-21 2023-10-31 中国科学院声学研究所 一种采用web语言实现的容器镜像的方法和系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160162272A1 (en) * 2013-08-15 2016-06-09 Tencent Technology (Shenzhen) Company Limited Method and apparatus for loading a rendering engine
WO2019147974A2 (en) * 2018-01-26 2019-08-01 Valve Corporation Distributing shaders between client machines for precaching
CN110933036A (zh) * 2019-10-29 2020-03-27 咪咕互动娱乐有限公司 一种云游戏服务系统和服务器
CN111736850A (zh) * 2020-07-21 2020-10-02 腾讯科技(深圳)有限公司 图像处理方法、装置、服务器及介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4120065A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114217908A (zh) * 2022-02-23 2022-03-22 广州趣丸网络科技有限公司 容器启动方法、系统、装置及设备
WO2023180809A3 (en) * 2022-03-21 2023-12-07 Oorbit, Inc. Software application streaming system

Also Published As

Publication number Publication date
KR102737061B1 (ko) 2024-11-29
EP4120065A1 (en) 2023-01-18
CN111736850B (zh) 2020-12-22
CN111736850A (zh) 2020-10-02
US20220249948A1 (en) 2022-08-11
US12121807B2 (en) 2024-10-22
KR20220083832A (ko) 2022-06-20
JP2023513717A (ja) 2023-04-03
JP7464732B2 (ja) 2024-04-09
EP4120065A4 (en) 2023-08-16

Similar Documents

Publication Publication Date Title
US12121807B2 (en) Image processing method using a shared GPU shader cache mechanism and apparatus, server, and medium
US20230032554A1 (en) Data processing method and apparatus, and storage medium
US10074206B1 (en) Network-optimized graphics library for virtualized graphics processing
CN103582509B (zh) 通用处理器和图形处理器之间的负载均衡
US12373227B2 (en) 3D API redirection for virtual desktop infrastructure using a client-side shadow window
US20150135200A1 (en) Method, system and an executable piece of code for the virtualization of a hardware resource associated with a computer system
US20160077850A1 (en) Methods, systems, and media for binary compatibility
US20140365861A1 (en) Prefetching binary data for use by a browser plugin
CN110399214B (zh) 一种优化显卡负载的方法、装置及计算机设备
US10754825B2 (en) Path resolver for client access to distributed file systems
CN108073350B (zh) 一种用于云渲染的对象存储系统和方法
CN110968395B (zh) 一种在模拟器中处理渲染指令的方法及移动终端
CN112799801A (zh) 一种模拟鼠标指针绘制方法、装置、设备和介质
CN108446146A (zh) 一种游戏数据采集方法及装置
CN106991057B (zh) 一种共享显卡虚拟化中内存的调用方法及虚拟化平台
CN114461157B (zh) 一种idv客户端多屏分治方法及系统
CN112612531B (zh) 应用程序启动方法、装置、电子设备及存储介质
US20240212255A1 (en) Scene Rendering Method, Apparatus, Device, and System
CN117707657B (zh) 应用界面的显示方法、电子设备及计算机可读存储介质
HK40030905A (zh) 图像处理方法、装置、服务器及介质
HK40030905B (zh) 图像处理方法、装置、服务器及介质
WO2021121188A1 (zh) 配置文件的处理方法、装置、系统及存储介质
EP4235562B1 (en) Image processing method and electronic device
KR102287057B1 (ko) 복수의 사용자에게 효율적으로 동일한 컨텐츠를 제공하는 방법 및 장치
US20240193016A1 (en) Multiple processes sharing gpu memory objects

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21845550

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20227017638

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2022548779

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2021845550

Country of ref document: EP

Effective date: 20221012

NENP Non-entry into the national phase

Ref country code: DE