Image obtaining method and apparatus, server, and storage medium
11606436 · 2023-03-14
Assignee
Inventors
- Gengxing Huang (Shenzhen, CN)
- WEI YANG (Shenzhen, CN)
- Xue Wei (Shenzhen, CN)
- Cilang Wang (Shenzhen, CN)
- Borui Yu (Shenzhen, CN)
- Zhiwei Liu (Shenzhen, CN)
- Guangdong Yang (Shenzhen, CN)
- Cheng Zeng (Shenzhen, CN)
Cpc classification
G06F9/452
PHYSICS
H04N21/2343
ELECTRICITY
G06F9/455
PHYSICS
G09G2370/027
PHYSICS
A63F2300/209
HUMAN NECESSITIES
G09G2340/12
PHYSICS
G09G2360/06
PHYSICS
G09G2370/022
PHYSICS
H04L67/10
ELECTRICITY
H04L67/131
ELECTRICITY
A63F13/355
HUMAN NECESSITIES
H04N21/4312
ELECTRICITY
International classification
H04N21/478
ELECTRICITY
A63F13/355
HUMAN NECESSITIES
Abstract
Embodiments of this disclosure include an image obtaining method and apparatus, a server, and a storage medium. In the method, a target application process corresponding to a user identifier is obtained, by processing circuitry, from an application process set. A plurality of window image data that is currently generated is obtained, via a data obtaining module, when an image rendering function in the target application process is called. Image synthesis processing is performed on the plurality of window image data, to obtain a user interface image to be displayed. Further, a notification message that includes the user interface image is transmitted to a user terminal corresponding to the user identifier for display on a user interface.
Claims
1. An image obtaining method, comprising: obtaining, by processing circuitry from an application process set, a target application process corresponding to a user identifier; obtaining, via a data obtaining module, a plurality of window image data that is currently generated when an image rendering function in the target application process is called; generating an image binary tree by converting an image multi-way tree constructed according to window hierarchy identifiers corresponding to each of the plurality of window image data; performing image synthesis processing on the plurality of window image data, to obtain a user interface image to be displayed, by traversing the image binary tree; and transmitting a notification message that includes the user interface image to a user terminal corresponding to the user identifier for display on a user interface.
2. The method according to claim 1, wherein the plurality of window image data is of a plurality of windows displayed at different layers, and the image synthesis processing is performed on the plurality of window image data based on the different layers associated with the plurality of window image data.
3. The method according to claim 1, further comprising: obtaining a picture display parameter configured for the target application process; and determining a window hierarchy identifier of each window image data of the plurality of window image data according to the picture display parameter, wherein the performing the image synthesis processing includes performing the image synthesis processing on the plurality of window image data according to the window hierarchy identifiers.
4. The method according to claim 3, wherein the generating the image binary tree is performed according to the window hierarchy identifiers of the plurality of window image data, and the performing the image synthesis processing comprises: traversing the image binary tree according to a preset first traversing order, to obtain a synthesis order of the plurality of window image data; and performing the image synthesis processing on the plurality of window image data according to the synthesis order.
5. The method according to claim 4, wherein the generating comprises: constructing the image multi-way tree according to the window hierarchy identifiers of the plurality of window image data; and converting the image multi-way tree into the image binary tree.
6. The method according to claim 3, wherein the generating the image binary tree is performed according to the window hierarchy identifiers of the plurality of window image data, and the obtaining the plurality of window image data comprises: traversing the image binary tree according to a preset second traversing order, to obtain an image capturing order of the plurality of window image data; and calling the data obtaining module to obtain the plurality of window image data according to the image capturing order.
7. The method according to claim 1, wherein the obtaining the plurality of window image data comprises: determining a rendering manner of the image rendering function; determining a data capture submodule corresponding to the rendering manner; and calling the data capture submodule to acquire the plurality of window image data obtained when the image rendering function is executed.
8. The method according to claim 4, further comprising: generating a message response binary tree according to the window hierarchy identifiers of the plurality of window image data, wherein the performing the image synthesis processing comprises: determining display location information of each window image data of the plurality of window image data based on the message response binary tree; and performing the image synthesis processing on the plurality of window image data according to the display location information and the synthesis order.
9. The method according to claim 8, wherein the message response binary tree comprises a plurality of message nodes, and the method further comprises: receiving a user operation message transmitted by the user terminal; obtaining operation location information from the user operation message; traversing the message response binary tree according to a preset third traversing order; determine a message node of the plurality of message nodes at which the operation location information meets a preset location condition as a target message node; and processing, by using window image data corresponding to the target message node as target window image data, a window corresponding to the target window image data in response to the user operation message.
10. The method according to claim 9, wherein each of the plurality of message nodes records window location information and window size information of a corresponding window image data of the plurality of window image data; and the operation location information meets the preset location condition when the operation location information is within a range defined by the window location information and the window size information recorded by the target message node.
11. An image obtaining apparatus, comprising: processing circuitry configured to: obtain, from an application process set, a target application process corresponding to a user identifier; obtain, via a data obtaining module, a plurality of window image data that is currently generated when an image rendering function in the target application process is called; generate an image binary tree by converting an image multi-way tree constructed according to window hierarchy identifiers corresponding to each of the plurality of window image data; perform image synthesis processing on the plurality of window image data, to obtain a user interface image to be displayed, by traversing the image binary tree; and transmit a notification message that includes the user interface image to a user terminal corresponding to the user identifier for display on a user interface.
12. The apparatus according to claim 11, wherein the processing circuitry is configured to: obtain a picture display parameter configured for the target application process; determine a window hierarchy identifier of each window image data of the plurality of window image data according to the picture display parameter; and perform the image synthesis processing on the plurality of window image data according to the window hierarchy identifiers.
13. The apparatus according to claim 12, wherein the processing circuitry is configured to: generate the image binary tree according to the window hierarchy identifiers of the plurality of window image data; traverse the image binary tree according to a preset first traversing order, to obtain a synthesis order of the plurality of window image data; and perform the image synthesis processing on the plurality of window image data according to the synthesis order.
14. The apparatus according to claim 13, wherein the processing circuitry is configured to: construct the image multi-way tree according to the window hierarchy identifiers of the plurality of window image data; and convert the image multi-way tree into the image binary tree.
15. The apparatus according to claim 12, the processing circuitry is configured to: generate the image binary tree according to the window hierarchy identifiers of the plurality of window image data; traverse the image binary tree according to a preset second traversing order, to obtain an image capturing order of the plurality of window image data; and call the data obtaining module to obtain the plurality of window image data according to the image capturing order.
16. The apparatus according to claim 11, wherein the processing circuitry is configured to: determine a rendering manner of the image rendering function; determine a data capture submodule corresponding to the rendering manner; and call the data capture submodule to acquire the plurality of window image data obtained when the image rendering function is executed.
17. The apparatus according to claim 13, the processing circuitry is configured to: generate a message response binary tree according to the window hierarchy identifiers of the plurality of window image data; determine display location information of each window image data of the plurality of window image data based on the message response binary tree; and perform the image synthesis processing on the plurality of window image data according to the display location information and the synthesis order.
18. The apparatus according to claim 17, wherein the message response binary tree comprises a plurality of message nodes, and the processing circuitry is configured to: receive a user operation message transmitted by the user terminal; obtain operation location information from the user operation message; traverse the message response binary tree according to a preset third traversing order; determine a message node of the plurality of message nodes at which the operation location information meets a preset location condition as a target message node; and process, by using window image data corresponding to the target message node as target window image data, a window corresponding to the target window image data in response to the user operation message.
19. The apparatus according to claim 18, wherein each of the plurality of message nodes records window location information and window size information of a corresponding window image data of the plurality of window image data; and the operation location information meets the preset location condition when the operation location information is within a range defined by the window location information and the window size information recorded by the target message node.
20. A non-transitory computer-readable storage medium, storing instructions, which when executed by a processor cause the processor to perform: obtaining, from an application process set, a target application process corresponding to a user identifier; obtaining, via a data obtaining module, a plurality of window image data that is currently generated when an image rendering function in the target application process is called; generating an image binary tree by converting an image multi-way tree constructed according to window hierarchy identifiers corresponding to each of the plurality of window image data; performing image synthesis processing on the plurality of window image data, to obtain a user interface image to be displayed, by traversing the image binary tree; and transmitting a notification message that includes the user interface image to a user terminal corresponding to the user identifier for display on a user interface.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) To describe the technical solutions of the embodiments of this disclosure or the related technology more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments or the related technology. The accompanying drawings in the following description show some embodiments of this disclosure, and a person skilled in the art may still derive other drawings from these accompanying drawings.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
DESCRIPTION OF EMBODIMENTS
(22) The following describes technical solutions in embodiments of this disclosure with reference to the accompanying drawings in the embodiments of this disclosure.
(23) In an implementation in which a user terminal obtains an image from a server, an architecture diagram of image obtaining may be shown in
(24) The application server provides service support for the target application based on a service program related to the target application. For example, the application server may support the target application to implement the application function by executing the service program. In the field of computers, an activity of the application server running the service program can be referred to as an application process. If the target application runs on a plurality of user terminals simultaneously, to ensure that running of the target application in the user terminals does not interfere with each other, the application server creates an application process for each user to support running of the target application for the respective users. That is, the application server may execute an application process set that provides service support for implementing the application function of the target application. The application process set includes a plurality of application processes, and each application process corresponds to a user identifier. The target application process described in this embodiment of the disclosure may refer to an application process corresponding to any user identifier.
(25) For example, in a cloud gaming application scenario, assuming that the target application is a game application, if a user A and a user B start the game application at the same time by using different user terminals, the application server creates, upon detection of operation instructions of the user A and the user B on the game application, an application process A and an application process B respectively for the user A and the user B, to support the players of the two user terminals to experience the game application.
(26) In the architecture diagram of image obtaining shown in
(27) In an embodiment, the architecture diagram of image obtaining may be alternatively as shown in
(28) In an embodiment, during running of the target application process 202, the application server 201 may call the data interception module 2021 in the target application process 202 to intercept window image data. The window image data are obtained when an image rendering function in the target application process 202 is executed to perform rendering. Then image synthesis processing is performed on the window image data to obtain a user interface image to be displayed. In some embodiments, a picture synthesizer 204 may be configured in the application server 201, and the application server 201 may transmit the window image data intercepted by calling the data interception module to the picture synthesizer 204, to call the picture synthesizer 204 to perform image synthesis processing on the window image data to obtain the user interface image to be displayed. After obtaining the user interface image, the application server 201 transmits a notification message carrying the user interface image to the user terminal 203, so that the user terminal 203 displays the user interface image on a user interface.
(29) By comparing the architecture diagrams of image obtaining shown in
(30) In addition, to implement communication among the application server 101, the virtual machine 104, and the target application process 102 in
(31) In addition, in the architecture diagram shown in
(32) Compared with
(33) Based on the architecture diagram of image obtaining described in
(34) In an embodiment, the image obtaining method described in this embodiment of the disclosure is applicable to an application scenario of cloud gaming. The cloud gaming can refer to: games corresponding to a plurality of user identifiers run on a cloud server, and the cloud server renders a game scene in each game into a game picture or screen, and transmits the game picture to a user terminal corresponding to each user identifier in real time, so that a user identified by each user identifier inputs a corresponding operation for a game picture.
(35) When this embodiment of the disclosure is applied to the application scenario of the cloud gaming, the application server is equivalent to the cloud server, and the user interface image is equivalent to the game picture. For example,
(36) By using the image obtaining method described in this embodiment of the disclosure, a game picture corresponding to each user identifier can be respectively transmitted to a corresponding user terminal for display. For a user identified by a user identifier, a game picture seen in the user interface of the user terminal is a game picture corresponding to the user identifier in the cloud server, and a game picture corresponding to another user identifier is not displayed. That is, games corresponding to users do not interfere with each other. For example,
(37) Based on the foregoing descriptions, an embodiment of the disclosure provides a schematic flowchart of an image obtaining method, as shown in
(38) In step S401, a target application process corresponding to a user identifier is obtained from an application process set.
(39) The user identifier is used for indicating an identity of a user, and the user identifier may include any one or more of an ID card of the user, a mobile phone number of the user, and a login account of the user.
(40) In an embodiment, the obtaining a target application process corresponding to a user identifier may be performed after the application server receives a user operation request transmitted by a user terminal. The user terminal refers to a terminal device that is logged in based on the user identifier. The terminal device may include any device capable of decompressing a video, such as a mobile phone, a tablet, and a desktop computer. The user operation request may include any one or more of a login operation, a window switching operation, and a logout operation for a target application.
(41) For example, if the user indicated by the user identifier logs in to the target application in the user terminal for the first time, in this case, the user operation request transmitted by the user and received by the user terminal may refer to a login operation. If the target application is logged in to the user terminal based on the user identifier, in this case, a user operation message may refer to a logout operation, or a window switching operation on each window included in the target application, or a request to run an application function of the target application, or the like.
(42) In step S402, when detecting that an image rendering function in the target application process is called, a data interception module is called to intercept a plurality of window image data currently generated. In an example, a data obtaining module obtains the plurality of window image data currently generated.
(43) In this step, the window image data are obtained when the image rendering function in the target application process is executed during running the target application process. For example, an implementation of calling the data interception module to intercept the window image data currently generated is as shown in
(44) In step S4021, the image rendering function is executed in the target application process.
(45) In step S4022, the image rendering function is intercepted when detecting that the image rendering function in the target application process is called.
(46) In step S4023, the data interception module is called to obtain a window image data generated for each window by using the image rendering function.
(47) In step S4024, the execution of the image rendering function ends.
(48) Image rendering can refer to a process of transferring, processing and converting three-dimensional light energy transfer process into a two-dimensional image, and the image rendering function can refer to a function that can implement a function of image rendering.
(49) Commonly used image rendering manners in the image rendering function may include: Open Graphics Library (OpenGL), Graphics Device Interface (GDI), and programming interface DirectX. OpenGL is a bottom 3D graphics library that only provides a rendering function and may be ported between different platforms; DirectX mainly provides hardware support for GPU designs and is more suitable for image rendering of game applications; and GDI is designed for broad spectrum and may be also applied to image rendering of game applications, but an effect thereof is not as good as that of DirectX.
(50) In an embodiment, when rendering is performed for different windows, a rendering manner for each window in the image rendering function of the target application process may be different. For example, when a first window of the target application is rendered, the rendering manner included in the image rendering function may be GDI; and when a second window of the target application is rendered, the rendering manner included in the image rendering function may be OpenGL.
(51) In an embodiment,
(52) In step S403, image synthesis processing is performed on the plurality of window image data, to obtain a user interface image to be displayed.
(53) In an embodiment, the image synthesis processing may refer to sequentially superimposing the plurality of window image data according to a synthesis order of the plurality of window image data. The synthesis order may refer to an order in which the plurality of window image data are processed during the image synthesis processing, and a window image data with an earlier synthesis order is processed sooner during the image synthesis processing. The synthesis order may be determined according to window hierarchy identifiers corresponding to the plurality of window image data. The window hierarchy identifiers are each used for indicating a hierarchy of a window. A higher hierarchy indicated by the window hierarchy identifier indicates a later synthesis order of the window image data.
(54) For example, assume that in
(55) In step S404, a notification message carrying the user interface image is transmitted to a user terminal corresponding to the user identifier, so that the user terminal displays the user interface image on a user interface.
(56) The notification message is used for instructing the user terminal to display the user interface image on the user interface. A schematic diagram of the user terminal displaying the user interface image on the user interface may be shown in
(57) Compared with the manner of obtaining a user interface image by deploying a virtual machine in the related art, in this embodiment of the disclosure, the application server calls a rendering function to obtain window image data and performs image synthesis processing on the window image data to obtain a user interface image in a process of intercepting and executing the target application, which can reduce resource overheads of the application server.
(58)
(59) In step S601. a target application process corresponding to a user identifier is obtained from an application process set.
(60) This step can be the same as step 401, and details are not described herein again.
(61) In step S602, a rendering manner included in the image rendering function is determined when detecting that an image rendering function in the target application process is called.
(62) There can be a plurality of window image data. The plurality of window image data can be obtained by executing one or more image rendering functions of the target application. The rendering manner included in each image rendering function may be any of OpenGL, GDI and DirectX.
(63) In step S603, a data interception submodule corresponding to the rendering manner in a data interception module is determined according to the rendering manner.
(64) The data interception module may include three interception submodules, and the three interception submodules respectively correspond to the foregoing three rendering manners. For example, the three interception submodules included in the data interception module may be an OpenGL interception submodule, a GDI interception submodule, and a DirectX interception submodule. In some embodiments, correspondences between the interception submodules and the rendering manners may be: the rendering manner corresponding to the OpenGL interception submodule is OpenGL, the rendering manner corresponding to the GDI interception submodule is GDI, and the rendering manner corresponding to the DirectX interception submodule is DirectX. It is to be understood that calling an interception submodule corresponding to a rendering manner to obtain window image data can ensure the accuracy of the intercepted window image data.
(65) In an embodiment, a schematic diagram of the data interception module provided in this embodiment of the disclosure may be shown in
(66) In step S604, the data interception submodule is called to intercept a plurality of window image data obtained when the image rendering function is executed.
(67) While performing steps S602 to S604, step S605 in the following may be further performed:
(68) In step S605, a picture display parameter configured for the target application process is obtained, and a window hierarchy identifier of each window image data is determined according to the picture display parameter.
(69) The picture display parameter may include any one or more of whether a window corresponding to each window image data is minimized or maximized, and an arrangement relationship between the windows. For example, the arrangement relationship between the windows may be that a window A is placed before a window B, a window C is placed behind the window B, and the like.
(70) In an embodiment, the picture display parameter may be stored in a sandbox. The sandbox described in this embodiment of the disclosure is a mechanism that can isolate a plurality of application processes running on the application server from each other.
(71) In an embodiment, the picture display parameter configured for the target application process and stored in the sandbox may be a parameter set by default for the target application process by the application server. For example, assuming that the target application is a game application, a parameter set by the application server for the target application process configured to provide support for implementing a game function of the game application may include: a window corresponding to “homepage” window image data is placed at the front-most position for display, a window corresponding to “store” window image data is placed behind the window corresponding to the “homepage” window image data, and a window corresponding to “video” window image data is placed behind the window corresponding to the “store” window image data. In this case, the picture display parameter may be: the “homepage” window image data is placed at the front-most position for display, the “store” window image data is placed behind the “homepage” window image data, and the “video” window image data is placed behind the “store” window image data.
(72) In another embodiment, the picture display parameter configured for the target application process and stored in the sandbox may be determined according to a user operation request transmitted by a user terminal and parameters set by default for the target application process by the application server. For example, assuming that the target application is a game application, the parameter configured for the target application process configured to provide service support for implementing a game function of the game application may include: the window corresponding to the “homepage” window image data is placed at the front-most position for display, the window corresponding to the “store” window image data is placed behind the window corresponding to the “homepage” window image data, and the window corresponding to the “video” window image data is placed behind the window corresponding to the “store” window image data. It is detected that the user operation request includes switching from the window corresponding to the “homepage” window image data to the window corresponding to the “video” window image data. In this case, the picture display parameter determined according to the user operation request and the parameters set by default for the application by the application server may include: the window corresponding to the “video” window image data is placed at the front-most position for display, the window corresponding to the “store” window image data is placed behind the window corresponding to the “homepage” window image data, and the window corresponding to the “homepage” window image data is placed behind the window corresponding to the “video” window image data.
(73) After the picture display parameter configured for the target application process is obtained, the window hierarchy identifiers of the plurality of window image data may be determined according to the picture display parameter. The window hierarchy identifiers are each used for uniquely representing corresponding window image data, and the window hierarchy identifiers indicate a hierarchical relationship between window image data.
(74) The window hierarchy identifiers may be each represented by one or more numbers, such as 1, 2, 3, or (1, 2), (2, 1), (3, 1); or the window hierarchy identifiers may be alternatively represented in other forms. In this embodiment of the disclosure, when the window hierarchy identifiers are represented by using numbers: If quantities of numbers used to represent the window hierarchy identifiers are different, a greater quantity of numbers indicates a higher window hierarchy identifier. For example, a window hierarchy identifier represented by (1, 2) is higher than a window hierarchy identifier represented by 1. If quantities of numbers used to represent the window hierarchy identifier are all N, N is any positive integer greater than 1, the first (N−1) numbers are identical, and the N.sup.th number is different, a smaller sum of numbers indicates a higher window hierarchy identifier. For example, the window hierarchy identifier represented by (1, 2) is higher than a window hierarchy identifier represented by (1, 5). A window corresponding to a window hierarchy identifier (1, n) (n being any positive integer greater than or equal to 1) is a child window of a window corresponding to a window hierarchy identifier (1); and a window corresponding to a window hierarchy identifier (1, n, m) is a child window of the window corresponding to the window hierarchy identifier (1, n). It can be learned based on the foregoing description that a window hierarchy identifier corresponding to a child window is higher than a window hierarchy identifier corresponding to a parent window of the child window.
(75) In step S606, image synthesis processing is performed on the plurality of window image data according to the window hierarchy identifiers, to obtain user interface image to be displayed.
(76) Because the window hierarchy identifiers represent the hierarchical relationship between the windows, image synthesis processing is performed on the plurality of window image data according to an order of the hierarchical relationship from high to low.
(77) In step S607, a notification message carrying the user interface image is transmitted to a user terminal corresponding to the user identifier, so that the user terminal displays the user interface image on a user interface.
(78) This step can be the same as step S404, and details are not described herein again.
(79)
(80) In step S701, a target application process corresponding to a user identifier is obtained from an application process set.
(81) This step can be the same as step 401, and details are not described herein again.
(82) In step S702, a picture display parameter configured for the target application process is obtained, and a window hierarchy identifier of each window image data is determined according to the picture display parameter.
(83) This step can be the same as step 605, and details are not described herein again.
(84) In step S703, an image binary tree is generated according to the window hierarchy identifiers of the plurality of window image data.
(85) To improve convenience, in this embodiment of the disclosure, an image binary tree is generated according to the window hierarchy identifiers of the plurality of window image data. The image binary tree may include a plurality of binary tree nodes, and each binary tree node stores a window hierarchy identifier.
(86) In an embodiment, the generating an image binary tree according to the window hierarchy identifiers of the plurality of window image data may include:
(87) In step S7031, an image multi-way tree is constructed according to the window hierarchy identifiers of the plurality of window image data.
(88) The image multi-way tree includes N hierarchies, and each hierarchy includes M nodes, where N and M are both positive integers greater than or equal to 1. Two adjacent hierarchies in the image multi-way tree include a parent node and a child node sharing a parent-child relationship. Nodes having the same parent node in the same hierarchy of the image multi-way tree are sibling nodes.
(89) In step S7032, the image multi-way tree is converted into the image binary tree.
(90) A first node in each hierarchy of the image multi-way tree is converted into a left node of the image binary tree, and another node that is a sibling node of the first node is converted into a right node of the image binary tree.
(91) For example, it is assumed that the image multi-way tree constructed according to the window hierarchy identifiers of the plurality of window image data is shown in
(92) Windows corresponding to window hierarchy identifiers (1, 1) and (1, 2) in the hierarchy 702 are child windows of a window corresponding to a window hierarchy identifier 1. Therefore, a parent node of child nodes represented by the window hierarchy identifiers (1, 1) and (1, 2) is a node represented by the window hierarchy identifier 1, and the nodes represented by the window hierarchy identifiers (1, 1) and (1, 2) are sibling nodes. Similarly, nodes represented by window hierarchy identifiers 1, 2, and 3 are sibling nodes.
(93) Converting the image multi-way tree shown in
(94) It is to be understood that successively using the node represented by the window hierarchy identifier 2 and the node represented by the window hierarchy identifier 3 as the right nodes of the image binary tree may be understood as: the node represented by the window hierarchy identifier 2 is used as the right node of the node represented by the window hierarchy identifier 1, and the node represented by the window hierarchy identifier 3 is used as the right node of the node represented by the window hierarchy identifier 2.
(95) In step S704, the image binary tree is traversed according to a preset first traversing order, to obtain a synthesis order of the plurality of window image data.
(96) The preset first traversing order (e.g., binary tree image synthesis) may refer to pre-order traversing, and the pre-order traversing refers to: root node-left node-right node. For example, a result of the pre-order traversing in the image binary tree shown in
(97) In step S705, the image binary tree is traversed according to a preset second traversing order, to obtain an image capturing order of the plurality of window image data, and the data interception module is called to obtain, through interception, the plurality of window image data according to the image capturing order.
(98) In an embodiment, the preset second traversing order (e.g., binary image obtaining) may refer to post-order traversing, and a traversing order of the post-order traversing is: left node-right node-root node. For example, a result of the post-order traversing in the image binary tree shown in
(99) In an embodiment, after window image data are obtained, image synthesis processing may be performed on the window image data, to obtain a user interface image to be displayed.
(100) In step S706, image synthesis processing is performed on the plurality of window image data according to the synthesis order, to obtain a user interface image to be displayed.
(101) In an embodiment, an implementation of step 706 may be: allocating a sub-canvas for each window image data, placing the corresponding window image data on a corresponding sub-canvas, and combining the sub-canvas according to the foregoing synthesis order, to obtain the user interface image to be displayed.
(102) It is to be understood that the combination is performed according to the foregoing synthesis order, so that a window image data with a higher window hierarchy identifier is combined later. In this way, in the obtained user interface image, a window image data with a higher window hierarchy identifier covers a window image data with a lower window hierarchy identifier.
(103) In step S707, a notification message carrying the user interface image is transmitted to a user terminal corresponding to the user identifier.
(104) This step can be the same as step 404, and details are not described herein again.
(105) In another embodiment of the disclosure,
(106) In step S708, a message response binary tree is generated according to the window hierarchy identifiers of the plurality of window image data.
(107) The message response binary tree includes a plurality of message nodes, and each message node records window location information and window size information of corresponding window image data. For brevity of operation, when the message response binary tree is generated according to the window hierarchy identifiers of the plurality of window image data, the same method as step S703 may be used. In this way, the message response binary tree and the image binary tree have the same structure. For example, the message response binary tree generated according to the window hierarchy identifiers of the plurality of window image data may likewise be as shown in
(108) Each node of the image binary tree stores a window hierarchy identifier of a window image data. Unlike the image binary tree, each node in the message response binary tree not only stores a window hierarchy identifier of each window image data, but also stores window location information and window size information corresponding to the window image data. The window location information may include coordinates of a window, and the coordinates of the window may be represented in the form of pixel coordinates such as (3 pixels, 6 pixels), or may be represented in the form of world coordinates such as (10, 15). The window size information may include information such as a width and a height of the window.
(109) In step S709, display location information of each window image data is determined based on the message response binary tree.
(110) The display location information may include any one or both of the window location information and window size information of the window image data.
(111) In step S710, synthesis processing is performed on the plurality of window image data according to the display location information and the synthesis order, to obtain a user interface image to be displayed.
(112) When the plurality of window image data is synthesized, after the plurality of window image data are determined, where the plurality of window image data is located further needs to be determined. For example, as shown in
(113) Based on the foregoing description, an embodiment of the disclosure provides a schematic diagram of image synthesis processing as shown in
(114) In an embodiment, in step S709, an implementation of determining display location information of each window image data based on the message response binary tree may include the following.
(115) For first window image data in the plurality of window image data (e.g., the first window image data being any window image data in the plurality of window image data), when it is detected that image synthesis processing is currently performed on the first window image data, the application server may obtain a window hierarchy identifier of the first window image data according to the image binary tree; window location information and window size information corresponding to the window hierarchy identifier of the first window image data are searched from the message response binary tree; and the found window location information and window size information are determined as display location information of the first window image data.
(116) In another embodiment, in addition to being applied to image synthesis processing, the message response binary tree may be further used to search a target window image data corresponding to a user operation message, so that the application server can process the target window image data in response to the user operation message. The user operation message is an operation related to the user interface image and entered by the user by using the user terminal. For example,
(117) In step S711, a user operation message transmitted by the user terminal is received, and operation location information is obtained from the user operation message.
(118) The operation location information included in the user operation message refers to location information of a location at which the user inputs the operation. For example, the user taps, double-taps, or presses and holds a location in the user interface image, and location information of the location is determined as the operation location information.
(119) In step S712, the message response binary tree is traversed according to a preset third traversing order, and a message node at which the operation location information meets a preset location condition is determined as a target message node.
(120) For example, the target message node is the first message node found in the message response binary tree that meets the preset location condition. In an embodiment, the operation location information meets a preset location condition when the operation location information is within a range defined by window location information and window size information recorded by the target message node.
(121) In step S713, a window corresponding to the target window image data is processed, by using a window image data corresponding to the target message node as a target window image data, in response to the user operation message.
(122) Because application processes corresponding to a plurality of user identifiers run in the application server, user interface images corresponding to the plurality of user identifiers are displayed in the application server, and the user interface images corresponding to different user identifiers may overlap, as shown in
(123) Different user identifiers correspond to different application processes, and different application processes correspond to different picture display parameters. Because an image binary tree and a message response binary tree are generated according to a window hierarchy identifier determined by a picture display parameter, image binary trees and message response binary trees of different application processes are also different. Therefore, it may be understood that message response binary trees corresponding to different user identifiers are different.
(124) For the case of
(125) For the case of
(126) The preset third traversing order may refer to middle-order traversing, and the middle-order traversing refers to traversing a binary tree in an order of: left node-root node-right node. For example, assuming that the message response binary tree is shown in
(127) Based on the description of the foregoing image obtaining method, an embodiment of the disclosure further discloses an image obtaining apparatus. The image obtaining apparatus is applicable to a server, for example, the application server 101 shown in
(128) The obtaining unit 1101 is configured to obtain, from an application process set, a target application process corresponding to a user identifier.
(129) The interception unit 1102 is configured to call, when detecting that an image rendering function in the target application process obtained by using the obtaining unit 1101 is called, a data interception module to intercept a plurality of window image data currently generated.
(130) The first processing unit 1103 is configured to perform image synthesis processing on the plurality of window image data intercepted by using the interception unit 1102, to obtain a user interface image to be displayed.
(131) The transmission unit 1104 is configured to transmit a notification message carrying the user interface image obtained by using the first processing unit 1103 to a user terminal corresponding to the user identifier, so that the user terminal displays the user interface image on a user interface.
(132) In an embodiment, the obtaining unit 1101 is further configured to obtain a picture display parameter configured for the target application process.
(133) The apparatus 1100 further includes a determining unit 1105. The determining unit 1105 is configured to determine a window hierarchy identifier of each window image data according to the picture display parameter obtained by using the obtaining unit 1102. The first processing unit 1103 is further configured to perform image synthesis processing on the plurality of window image data according to the window hierarchy identifiers determined by using the determining unit 1105.
(134) In an embodiment, the apparatus 1100 further includes a first generation unit 1106. The first generation unit 1106 is configured to generate an image binary tree according to the window hierarchy identifiers of the plurality of window image data determined by using the determining unit 1105. The first processing unit 1103 is further configured to traverse the image binary tree generated by using the first generation unit 1106 according to a preset first traversing order, to obtain a synthesis order of the plurality of window image data; and perform image synthesis processing on the plurality of window image data according to the synthesis order.
(135) In an embodiment, the first generation unit 1106 is further configured to construct an image multi-way tree according to the window hierarchy identifiers of the plurality of window image data determined by using the determining unit 1105; and convert the image multi-way tree into the image binary tree.
(136) In an embodiment, the apparatus 1100 further includes a first generation unit 1106. The first generation unit 1106 is configured to generate an image binary tree according to the window hierarchy identifiers of the plurality of window image data determined by using the determining unit 1105. The interception unit 1102 is configured to traverse the image binary tree generated by using the first generation unit 1106 according to a preset second traversing order, to obtain an image capturing order of the plurality of window image data; and call the data interception module to obtain, through interception, the plurality of window image data according to the image capturing order.
(137) In an embodiment, the interception unit 1102 is configured to determine a rendering manner included in the image rendering function; determine a data interception submodule corresponding to the rendering manner in the data interception module according to the rendering manner; and call the data interception submodule to intercept the plurality of window image data obtained when the image rendering function is executed.
(138) In an embodiment, the apparatus 1100 further includes a second generation unit 1107. The second generation unit 1107 is configured to generate a message response binary tree according to the window hierarchy identifiers of the plurality of window image data determined by using the determining unit 1105. The first processing unit 1103 is configured to determine display location information of each window image data based on the message response binary tree generated by using the second generation unit 1107; and perform synthesis processing on the plurality of window image data according to the display location information and the synthesis order.
(139) In an embodiment, the message response binary tree includes a plurality of message nodes, and the obtaining unit 1101 is further configured to receive a user operation message transmitted by the user terminal, and obtain operation location information from the user operation message.
(140) The apparatus 1100 further includes a second processing unit 1108. The second processing unit 1108 is configured to traverse the message response binary tree generated by using the second generation unit 1107 according to a preset third traversing order, and determine a message node at which the operation location information obtained by using the obtaining unit 1101 meets a preset location condition as a target message node; and process, by using a window image data corresponding to the target message node as a target window image data, a window corresponding to the target window image data in response to the user operation message.
(141) According to another embodiment of the disclosure, the units of the image obtaining apparatus shown in
(142) According to another embodiment of the disclosure, a computer program (including program code) that can perform the steps in the corresponding method shown in
(143) Based on the descriptions of the foregoing method embodiments and apparatus embodiments, an embodiment of the disclosure further provides a server. The server may be the application server 101 shown in
(144) The computer storage medium 1203 may be stored in a memory of the server. The computer storage medium 1203 is configured to store a computer program. The computer program includes program instructions. The processor 1201 is configured to execute the program instructions stored in the computer storage medium 1203. The processor 1201, or referred to as a central processing unit (CPU), is a computing core and a control core of a terminal, is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement a corresponding method procedure or a corresponding function. In an embodiment, the processor 1201 described in this embodiment of the disclosure or other processing circuitry may be configured to perform the foregoing image obtaining method described in
(145) An embodiment of the disclosure further provides a computer storage medium such as a non-transitory computer-readable storage medium. The computer storage medium is a memory device in a terminal and is configured to store programs and data. As can be understood, the computer storage medium herein may include an internal storage medium of the terminal and may further include an extended storage medium supported by the terminal. The computer storage medium provides storage space, and the storage space stores an operating system of the terminal. In addition, the storage space further stores one or more instructions suitable to be loaded and executed by the processor 1201. The instructions may be one or more computer programs (including program code). The computer storage medium herein may be a high-speed RAM or a non-volatile memory, for example, at least one magnetic disk memory. Optionally, the computer storage medium may further be at least one computer storage medium located away from the foregoing processor.
(146) The term unit (and other similar terms such as module, submodule, etc.) in this disclosure may refer to a software unit, a hardware unit, or a combination thereof. A software unit (e.g., computer program) may be developed using a computer programming language. A hardware unit may be implemented using processing circuitry and/or memory. Each unit can be implemented using one or more processors (or processors and memory). Likewise, a processor (or processors and memory) can be used to implement one or more unit. Moreover, each unit can be part of an overall unit that includes the functionalities of the unit.
(147) In an embodiment, the one or more instructions stored in the computer storage medium may be loaded and executed by the processor 1201, to implement corresponding steps of the method in the foregoing embodiments related to the image obtaining method. In a specific implementation, the one or more instructions in the computer storage medium are loaded by the processor 1201 to perform the foregoing image obtaining method in
(148) What is disclosed above is merely exemplary embodiments of the disclosure, and is not intended to limit the scope of the claims of the disclosure. Therefore, equivalent variations made in accordance with the disclosure shall fall within the scope of the disclosure.