A data processing method and device, computer equipment and a storage medium

CN116205259BActive Publication Date: 2026-08-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111443236.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2026-08-18
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

[0002]目前市面上的生成图片的普遍做法是调用应用程序APP原生代码生成图片,嵌入固定的二维码,所以图片上的地址是固定不变的,不能针对不同渠道生成不同的二维码,并且图片的生成依赖APP的版本发布,一旦产品上线,不能随时更改图片的逻辑

Benefits of technology

[0063]在本申请实施例中,通过基于目标应用场景获取图片生成指令,并根据所述图片生成指令创建图片生成窗口,所述图片生成窗口具有对应所述目标应用场景的属性信息,进一步获取所述目标应用场景对应的资源信息,所述资源信息携带有资源位置信息,最后根据所述图片生成窗口的属性信息和所述资源信息的资源位置信息,采用所述资源信息在所述图片生成窗口生成所述目标应用场景对应的目标图片。采用上述方法,通过目标应用场景对应的资源信息,生成对应的目标图片,避免了遍历加载页面的所有节点,收集所有元素的信息,导致生成目标图片耗时较长的问题,提高了图片生成的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116205259B_ABST
    Figure CN116205259B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method and device, computer equipment and a storage medium, wherein the method comprises the following steps: obtaining picture generation instructions based on a target application scenario; creating a picture generation window according to the picture generation instructions, the picture generation window having attribute information corresponding to the target application scenario; obtaining resource information corresponding to the target application scenario; the resource information carrying resource location information; and generating a target picture corresponding to the target application scenario in the picture generation window using the resource information according to the attribute information of the picture generation window and the resource location information of the resource information. Embodiments of the present application can be applied to the field of maps. The present application can improve the efficiency of picture generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a data processing method, apparatus, computer equipment, and storage medium. Background Technology

[0002] Currently, the common practice for generating images is to call the app's native code to generate images and embed fixed QR codes. Therefore, the URL on the image is fixed and cannot be changed for different channels. Furthermore, image generation depends on the app's version release; once the product is launched, the image logic cannot be changed at any time. The solution for drawing images generally uses the html2canvas library, which iterates through the DOM nodes of the loaded page, collects information from all elements, and draws the image based on the DOM elements and attributes. This process is time-consuming and affects image drawing efficiency. Summary of the Invention

[0003] This application provides a data processing method, apparatus, computer equipment, and storage medium that can improve the efficiency of image generation.

[0004] One embodiment of this application provides a data processing method, which may include:

[0005] Obtain image generation instructions based on the target application scenario;

[0006] An image generation window is created according to the image generation instructions, and the image generation window has attribute information corresponding to the target application scenario;

[0007] Obtain resource information corresponding to the target application scenario; the resource information carries resource location information;

[0008] Based on the attribute information of the image generation window and the resource location information of the resource information, the target image corresponding to the target application scenario is generated in the image generation window using the resource information.

[0009] In one feasible implementation, it further includes:

[0010] Based on the target image size in the attribute information, the resource image corresponding to the target application scenario is preprocessed to generate a resource image with the target image size; the resource image carries image location information;

[0011] Detect the number of resource images in the target application scenario;

[0012] If the number of images is greater than one, at least two preprocessed resource images are stitched together to generate a stitched resource image for the target application scenario; the stitched resource image carries the image location information of each resource image; the stitched resource image carries stitched image location information, and the stitched image location information includes the image location information of each resource image;

[0013] If the number of images is equal to one, then the preprocessed resource image will be used as the stitched resource image for the target application scenario.

[0014] In one feasible implementation, obtaining the resource information corresponding to the target application scenario includes:

[0015] Obtain the text information corresponding to the target application scenario;

[0016] Obtain a stitched resource image of the target application scenario; the stitched resource image is generated from the resource image of the target application scenario;

[0017] Obtain the Uniform Resource Locator (URL) for the target application scenario and the channel information corresponding to the target application scenario;

[0018] Based on the Uniform Resource Locator and the channel information, path information corresponding to the target application scenario is generated;

[0019] The text information, the stitched resource image, and the path information are used as resource information corresponding to the target application scenario; the text information carries text location information, the stitched resource image carries stitched image location information, and the path information carries path location information, and the resource location information of the resource information includes the text location information, the stitched image location information, and the path location information.

[0020] In one feasible implementation, generating path information corresponding to the target application scenario based on the Uniform Resource Locator (URL) and the channel information includes:

[0021] The unified resource locator is concatenated with the channel information to generate fused information;

[0022] Based on the QR code generator, the fused information is used to generate a corresponding QR code, and the QR code is used as the path information corresponding to the target application scenario.

[0023] In one feasible implementation, the step of generating a target image corresponding to the target application scenario in the image generation window using the resource information based on the attribute information of the image generation window and the resource location information of the resource information includes:

[0024] Based on the attribute information of the image generation window and the resource location information of the resource information, the absolute position information of the resource information in the image generation window is determined; the resource information includes stitched resource images, text information, and path information.

[0025] Based on the resource information and the absolute position information of the resource information, a target image corresponding to the target application scenario is generated in the image generation window.

[0026] In one feasible implementation, generating a target image corresponding to the target application scenario in the image generation window based on the resource information and the absolute position information of the resource information includes:

[0027] Based on the planar coordinate information in the absolute position information, the text information, the path information, and the resource images in the stitched resource image are placed in the image generation window; the stitched resource image includes at least one resource image;

[0028] Based on the height information in the absolute position information, the text information, the path information, and the resource images in the stitched resource images are layered to generate a target image corresponding to the target application scenario.

[0029] In one feasible implementation, it further includes:

[0030] Obtain a format conversion instruction for the target image, the format conversion instruction carrying target format information;

[0031] The target image is converted into an image with the target format information.

[0032] One embodiment of this application provides a data processing apparatus, which may include:

[0033] The instruction acquisition unit is used to acquire image generation instructions based on the target application scenario.

[0034] A window creation unit is used to create an image generation window according to the image generation instruction, wherein the image generation window has attribute information corresponding to the target application scenario;

[0035] The resource acquisition unit is used to acquire resource information corresponding to the target application scenario; the resource information carries resource location information.

[0036] The image generation unit is used to generate a target image corresponding to the target application scenario in the image generation window based on the attribute information of the image generation window and the resource location information of the resource information, using the resource information.

[0037] In one feasible implementation, it further includes:

[0038] The image stitching unit is used to preprocess the resource image corresponding to the target application scenario according to the target image size in the attribute information, and generate a resource image with the target image size; the resource image carries image location information;

[0039] Detect the number of resource images in the target application scenario;

[0040] If the number of images is greater than one, at least two preprocessed resource images are stitched together to generate a stitched resource image for the target application scenario; the stitched resource image carries the image location information of each resource image; the stitched resource image carries stitched image location information, and the stitched image location information includes the image location information of each resource image;

[0041] If the number of images is equal to one, then the preprocessed resource image will be used as the stitched resource image for the target application scenario.

[0042] In one feasible implementation, the resource acquisition unit is used to:

[0043] Obtain the text information corresponding to the target application scenario;

[0044] Obtain a stitched resource image of the target application scenario; the stitched resource image is generated from the resource image of the target application scenario;

[0045] Obtain the Uniform Resource Locator (URL) for the target application scenario and the channel information corresponding to the target application scenario;

[0046] Based on the Uniform Resource Locator and the channel information, path information corresponding to the target application scenario is generated;

[0047] The text information, the stitched resource image, and the path information are used as resource information corresponding to the target application scenario; the text information carries text location information, the stitched resource image carries stitched image location information, and the path information carries path location information, and the resource location information of the resource information includes the text location information, the stitched image location information, and the path location information.

[0048] In one feasible implementation, the resource acquisition unit is used to:

[0049] The unified resource locator is concatenated with the channel information to generate fused information;

[0050] Based on the QR code generator, the fused information is used to generate a corresponding QR code, and the QR code is used as the path information corresponding to the target application scenario.

[0051] In one feasible implementation, the image generation unit is used for:

[0052] Based on the attribute information of the image generation window and the resource location information of the resource information, the absolute position information of the resource information in the image generation window is determined; the resource information includes stitched resource images, text information, and path information.

[0053] Based on the resource information and the absolute position information of the resource information, a target image corresponding to the target application scenario is generated in the image generation window.

[0054] In one feasible implementation, the image generation unit is used for:

[0055] Based on the planar coordinate information in the absolute position information, the text information, the path information, and the resource images in the stitched resource image are placed in the image generation window; the stitched resource image includes at least one resource image;

[0056] Based on the height information in the absolute position information, the text information, the path information, and the resource images in the stitched resource images are layered to generate a target image corresponding to the target application scenario.

[0057] In one feasible implementation, it further includes:

[0058] A format conversion unit is used to obtain a format conversion instruction for the target image, wherein the format conversion instruction carries target format information;

[0059] The target image is converted into an image with the target format information.

[0060] One embodiment of this application provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed by the above-described method steps.

[0061] One embodiment of this application provides a computer device, including: a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the above-described method steps.

[0062] One embodiment of this application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method steps described above.

[0063] In this embodiment, an image generation instruction is obtained based on a target application scenario, and an image generation window is created according to the instruction. This window contains attribute information corresponding to the target application scenario. Further, resource information corresponding to the target application scenario is obtained, including resource location information. Finally, based on the attribute information of the image generation window and the resource location information, the target image corresponding to the target application scenario is generated in the image generation window using the resource information. This method generates the corresponding target image using the resource information of the target application scenario, avoiding the time-consuming process of traversing all nodes of the loaded page and collecting information from all elements, thus improving image generation efficiency. Attached Figure Description

[0064] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0065] Figure 1 This is a network architecture diagram for data processing provided in an embodiment of this application;

[0066] Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0067] Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0068] Figure 4a This is an example diagram illustrating image generation provided in an embodiment of this application;

[0069] Figure 4b This is an example illustration of generating a target image based on resource information provided in an embodiment of this application;

[0070] Figure 4c This is an example diagram illustrating client-side rendering and server-side rendering provided in an embodiment of this application;

[0071] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0072] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0073] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0074] Please see Figure 1 , Figure 1 This is a network architecture diagram for data processing provided in an embodiment of this application. The network architecture diagram may include a service server 100 and a user terminal cluster. The user terminal cluster may include user terminal 10a, user terminal 10b, ..., user terminal 10c. Communication connections may exist between user terminals in the cluster; for example, there is a communication connection between user terminal 10a and user terminal 10b, and a communication connection between user terminal 10b and user terminal 10c. Furthermore, any user terminal in the user terminal cluster may have a communication connection with the service server 100; for example, there is a communication connection between user terminal 10a and service server 100, and a communication connection between user terminal 10b and service server 100.

[0075] The aforementioned user terminal cluster (including user terminal 10a, user terminal 10b, and user terminal 10c) can all integrate and install the target application. Optionally, the target application may include an application with the function of displaying data information such as text, images, and videos. Database 10d stores resource information corresponding to the target application scenario. In one feasible implementation, the user terminal obtains an image generation instruction based on the target application scenario and creates an image generation window according to the image generation instruction. The image generation window has attribute information corresponding to the target application scenario. The user terminal further obtains resource information corresponding to the target application scenario. The resource information carries resource location information. Finally, the user terminal uses the resource information to generate the target image corresponding to the target application scenario in the image generation window based on the attribute information of the image generation window and the resource location information of the resource information. Optionally, the aforementioned user terminal can be... Figure 1 Any user terminal selected in the user terminal cluster of the corresponding embodiment, for example, the user terminal can be the aforementioned user terminal 10b.

[0076] It is understood that the methods provided in this application embodiment can be executed by computer devices, including but not limited to terminals or servers. The business server 100 in this application embodiment can be a computer device, and the user terminals in the user terminal cluster can also be computer devices; this is not limited here. The aforementioned business server can be an independent physical server, a server cluster composed of multiple physical servers, or a distributed system. It can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The aforementioned terminals can include: smartphones, tablets, laptops, desktop computers, smart TVs, smart speakers, desktop computers, smartwatches, smart voice interaction devices, smart home appliances, vehicle terminals, and other intelligent terminals with image recognition functions, but are not limited thereto. The user terminals and business servers can be directly or indirectly connected via wired or wireless communication; this application does not impose any limitations on this. The embodiments of this invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0077] Furthermore, for ease of understanding, please refer to Figure 2 , Figure 2 This is a flowchart illustrating the data processing method provided in an embodiment of this application. The method can be implemented by a user terminal (e.g., the one described above). Figure 1 The operation can be performed by the user terminal shown, or by the user terminal and the service server (as described above). Figure 1 The service server 100 in the corresponding embodiment performs the operation together. For ease of understanding, this embodiment uses the method executed by the aforementioned user terminal as an example for explanation. The data processing method may include at least the following steps S101-S104:

[0078] S101, Obtain image generation instructions based on the target application scenario;

[0079] Specifically, the user terminal obtains image generation instructions based on a target application scenario. This target application scenario can be a scenario within an application's image generation function, or a scenario where an image is generated within an image generation program. More specifically, the target application scenario could be an image generation scenario within a fun game. For example, after a fun game ends, an image displaying the game result is generated based on the image generation instructions. The image generation instructions are trigger instructions for generating images within the target application scenario. Specifically, these can be click instructions or touchscreen instructions. For instance, after a fun game ends, clicking a virtual button to generate an image triggers the image generation instructions, further generating an image displaying the game result.

[0080] S102, Create an image generation window according to the image generation instruction;

[0081] Specifically, the user terminal creates an image generation window according to the image generation instruction. The image generation window has attribute information corresponding to the target application scenario. It can be understood that the image generation window is used to generate the target image and display the image. The image generation window can be an H5 page. The image generation window has attribute information corresponding to the target application scenario. The attribute information includes the window size, background information, etc. For example, different image backgrounds can be used for different application scenarios.

[0082] S103, Obtain resource information corresponding to the target application scenario; the resource information carries resource location information;

[0083] Specifically, the user terminal obtains text information corresponding to the target application scenario. Further, the user terminal obtains a stitched resource image of the target application scenario, which is generated from resource images of the target application scenario. The stitched resource image can be understood as a collection of images composed of at least one resource image. Further, the user terminal obtains the Uniform Resource Locator (URL) of the target application scenario and the channel information corresponding to the target application scenario. The URL is a unique identifier indicating the target application scenario; for example, in a game scenario, the URL could be a game link address. The channel information indicates the user's source, such as how the user downloaded the application. Further, the user terminal generates path information corresponding to the target application scenario based on the URL and the channel information. The path information can be QR code information or link information. The generation of path information is explained below using QR code information. Specifically, user terminals can obtain channel information through a Uniform Resource Locator (URL) or navigator. The URL is then concatenated with the channel information to generate fused information. Based on a QR code generator, a corresponding QR code is generated from this fused information, and this QR code serves as the path information for the target application scenario. Therefore, different QR codes can be generated for different channel information, allowing for customized QR code generation and ensuring diversity and flexibility in image generation. Simultaneously, users attracted through QR code scanning can have their user and channel origins accurately tracked, facilitating user funnel screening and profile analysis. The QR code generator can specifically be `setQrcode`. The `setQrcode` process involves obtaining the tags of DOM nodes and then drawing them using the HTML5Canvas tool. It should be noted that the QR code generation process allows for customization of the QR code's size, margins, color, and image type.

[0084] Finally, the user terminal uses the text information, the stitched resource image, and the path information as resource information corresponding to the target application scenario. The resource information carries resource location information. The text information carries text location information, the stitched resource image carries stitched image location information, and the path information carries path location information. The resource location information of the resource information includes the text location information, the stitched image location information, and the path location information. The resource location information indicates the position of the resource information in the image generation window.

[0085] S104, based on the attribute information of the image generation window and the resource location information of the resource information, the target image corresponding to the target application scenario is generated in the image generation window using the resource information.

[0086] Specifically, the user terminal determines the absolute position of the resource information within the image generation window based on the attribute information of the image generation window and the resource location information of the resource information. It should be noted that the resource location information can be understood as relative position information. The attribute information of the image generation window includes its position information. Based on the position information of the image generation window and the resource location information, the absolute position of the resource information within the image generation window can be determined. The resource information includes a stitched resource image, text information, and path information. Further, the user terminal generates a target image corresponding to the target application scenario within the image generation window based on the resource information and its absolute position information. This target image can achieve customized sharing content. For example, to improve operational efficiency, market data and token information can be sent out. Specifically, the upper part of the target image contains the App name and description, and the lower part contains a page QR code.

[0087] Based on the resource information and its absolute location information, the specific steps for generating the target image are as follows:

[0088] The absolute position information includes planar coordinate information and height information. The user terminal places the text information, the path information, and the resource images from the stitched resource image into an image generation window based on the planar coordinate information in the absolute position information. The stitched resource image includes at least one resource image. Further, the user terminal stacks the text information, the path information, and the resource images from the stitched resource image based on the height information in the absolute position information to generate a target image corresponding to the target application scenario. The height information is used to indicate the stacking order of the resource information in the image generation window. For example, if the height information of image A is greater than the height information of image B, then image A is located above image B.

[0089] In this embodiment, an image generation instruction is obtained based on a target application scenario, and an image generation window is created according to the instruction. This window contains attribute information corresponding to the target application scenario. Further, resource information corresponding to the target application scenario is obtained, including resource location information. Finally, based on the attribute information of the image generation window and the resource location information, the target image corresponding to the target application scenario is generated in the image generation window using the resource information. This method generates the corresponding target image using the resource information of the target application scenario, avoiding the time-consuming process of traversing all nodes of the loaded page and collecting information from all elements, thus improving image generation efficiency.

[0090] Please see Figure 3 , Figure 3 This is a flowchart illustrating the data processing method provided in an embodiment of this application. The method can be implemented by a user terminal (e.g., the one described above). Figure 1 The operation can be performed by the user terminal shown, or by the user terminal and the service server (as described above). Figure 1 The service server 100 in the corresponding embodiment performs the operation together. For ease of understanding, this embodiment uses the method executed by the aforementioned user terminal as an example for explanation. The data processing method may include at least the following steps S201-S206:

[0091] S201, Obtain image generation instructions based on the target application scenario;

[0092] Wherein, step S201 of the embodiment of the present invention is referred to Figure 2 The specific description of step S101 in the illustrated embodiment will not be repeated here.

[0093] S202, Create an image generation window according to the image generation instruction, the image generation window having attribute information corresponding to the target application scenario;

[0094] Wherein, step S202 of the embodiment of the present invention is referred to Figure 2 The specific description of step S102 in the illustrated embodiment will not be repeated here.

[0095] S203, preprocess the resource image and generate a stitched resource image of the target application scenario.

[0096] Specifically, the user terminal preprocesses the resource images corresponding to the target application scenario based on the target image size in the attribute information to generate resource images with the target image size. These resource images carry image location information. The number of resource images in the target application scenario is further detected. If the number of images is greater than one, at least two preprocessed resource images are stitched together to generate a stitched resource image for the target application scenario. This stitched resource image carries image location information for each resource image. The stitched resource image includes the image location information of each resource image. If the number of images is equal to one, the preprocessed resource image is used as the stitched resource image for the target application scenario. It should be noted that before generating the target image from the resource images, since the resource images are highly unstable and their sizes are not fixed, the resource images are preloaded to obtain their aspect ratio. The resource images are then pre-cropped according to this aspect ratio to generate a fixed size, preventing image stretching due to inconsistent resource image sizes and thus avoiding visual distortion.

[0097] S204, Obtain resource information corresponding to the target application scenario;

[0098] In this embodiment of the invention, step S204 is described below. Figure 2 The specific description of step S103 in the illustrated embodiment will not be repeated here.

[0099] S205, based on the attribute information of the image generation window and the resource location information of the resource information, the target image corresponding to the target application scenario is generated in the image generation window using the resource information.

[0100] In this embodiment of the invention, step S205 is described below. Figure 2 The specific description of step S104 in the illustrated embodiment will not be repeated here.

[0101] S206, obtain a format conversion instruction for the target image, the format conversion instruction carrying target format information; convert the target image into an image with the target format information.

[0102] Specifically, traditional image saving methods involve either manual screenshotting by the user or the application creating a view and stacking necessary elements on top. The image size and dimensions are not flexible, and modifications require a new application version, a cumbersome process. In this solution, the user terminal can obtain format conversion instructions for the target image, converting it into an image with the specified target format information. This is independent of the application version and allows for flexible image saving. The format conversion instructions are operations that convert the target image to its specified format information. For example, if the target image is in PNG format, it can be converted to base64 format for easier saving.

[0103] Please see Figure 4a , Figure 4a This is an example illustration of image generation provided in an embodiment of this application. For example... Figure 4a As shown, this method uses a canvas drawing tool to draw the target image. It should be noted that 3D graphics can also be created on a canvas using the WebGL specification. First, image generation instructions are obtained based on the target application scenario. An image generation window is created according to these instructions. The image generation window is initially a blank canvas. A reference to the canvas element's two-dimensional drawing context is obtained. Based on this reference, the canvas element's `getContext()` method is executed to obtain the resource information corresponding to the target application scenario. This resource information includes text information, resource images, path information, etc. When obtaining resource images from the resource information, multiple resource images can be preprocessed to stitch them into a single stitched resource image. This stitched resource image contains all the independent resource images. For a single stitched resource image, the user terminal only needs to send one HTTP request to the server. By reducing the number of HTTP requests, the efficiency of image generation can be improved. On a standard webpage, each independent resource image can be extracted from a single stitched resource image for display. The specific display method utilizes the `drawImage()` method in the canvas. By changing various parameters, smaller resource images are extracted from a larger stitched resource image for display. Furthermore, the resource images are layered by controlling the x and y coordinates on the canvas. Finally, based on the attribute information of the image generation window and the resource location information, the target image corresponding to the target application scenario is generated in the image generation window using the resource information. Please refer to [link to relevant documentation]. Figure 4b , Figure 4b This is an example illustration of generating a target image based on resource information, provided in an embodiment of this application. For example... Figure 4b As shown, in a blank canvas created according to the image generation instructions, the size (width and height), background, border, and pixel ratio of the canvas are customized. The user terminal obtains splicing resource information, text information, and path information according to an HTTP request. The text information carries text position information, the spliced ​​resource image carries spliced ​​image position information, and the path information carries path position information. The resource position information of the resource information includes the text position information, the spliced ​​image position information, and the path position information. The resource position information of the resource information can be understood as relative position information. The attribute information of the image generation window includes the position information of the image generation window. Based on the position information of the image generation window and the resource position information of the resource information, the user terminal can determine the absolute position information of the resource information in the image generation window. The absolute position information indicates the x and y axis positioning information of the resource information in the image generation window, thus determining the position of each resource image in the text information, path information, and spliced ​​resource image in the image generation window. Furthermore, the user terminal uses absolute position information to draw resource information sequentially onto the canvas according to the page layout and the positioning information of the x and y axes, thereby generating the target image corresponding to the target application scenario.

[0104] Furthermore, the pixel ratio can be adjusted by setting the ratio to control the clarity of the target image displayed on different types of user terminals. In the above method for generating target images, the layout of the target image can be adjusted at any time and is flexibly reusable. Both platforms (e.g., iOS and Android) require only one set of code, eliminating the need for rewriting, thus reducing code volume and manpower. Compared to other traditional image generation libraries, this method can be written in native language, directly calling APIs and using point-based calculations to reduce the time by approximately 30% while generating the same image.

[0105] It should be noted that the process of generating the target image based on resource information in this solution can employ either server-side rendering (SSR) or client-side rendering (CSR). To improve the loading time of the target image, server-side rendering (SSR) can be used. Compared to client-side rendering (CSR), server-side rendering can save time spent loading JavaScript, reduce the time users spend on blank screens, and improve the user experience. Please refer to [link / reference]. Figure 4c , Figure 4c This is an example diagram illustrating client-side rendering and server-side rendering provided in an embodiment of this application. Figure 4cAs shown, client-side rendering requires downloading HTML text and JS scripts, and then executing the JS scripts to prepare the page. In contrast, server-side rendering can request resource information from the interface in advance, which can complete the page preparation work more quickly.

[0106] In this embodiment, an image generation instruction is obtained based on a target application scenario, and an image generation window is created according to the instruction. This window contains attribute information corresponding to the target application scenario. Further, resource information corresponding to the target application scenario is obtained, including resource location information. Finally, based on the attribute information of the image generation window and the resource location information, the target image corresponding to the target application scenario is generated in the image generation window using the resource information. This method generates the corresponding target image using the resource information of the target application scenario, avoiding the time-consuming process of traversing all nodes of the loaded page and collecting information from all elements, thus improving image generation efficiency.

[0107] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application. The data processing apparatus may be a computer program (including program code) running on a computer device; for example, the data processing apparatus may be an application software. The apparatus may be used to execute corresponding steps in the methods provided in the embodiments of this application. Figure 5 As shown, the data processing device 1 in this embodiment may include: an instruction acquisition unit 11, a window creation unit 12, a resource acquisition unit 13, and an image generation unit 14.

[0108] Instruction acquisition unit 11 is used to acquire image generation instructions based on the target application scenario;

[0109] The window creation unit 12 is used to create an image generation window according to the image generation instruction, and the image generation window has attribute information corresponding to the target application scenario;

[0110] Resource acquisition unit 13 is used to acquire resource information corresponding to the target application scenario; the resource information carries resource location information;

[0111] Image generation unit 14 is used to generate a target image corresponding to the target application scenario in the image generation window based on the attribute information of the image generation window and the resource location information of the resource information, using the resource information.

[0112] Please see Figure 5 The data processing device 1 described in this application embodiment may further include: an image stitching unit 15.

[0113] Image stitching unit 15 is used to preprocess the resource image corresponding to the target application scenario according to the target image size in the attribute information, and generate a resource image with the target image size; the resource image carries image location information;

[0114] Detect the number of resource images in the target application scenario;

[0115] If the number of images is greater than one, at least two preprocessed resource images are stitched together to generate a stitched resource image for the target application scenario; the stitched resource image carries the image location information of each resource image; the stitched resource image carries stitched image location information, and the stitched image location information includes the image location information of each resource image;

[0116] If the number of images is equal to one, then the preprocessed resource image will be used as the stitched resource image for the target application scenario.

[0117] In one feasible implementation, the resource acquisition unit 13 is used for:

[0118] Obtain the text information corresponding to the target application scenario;

[0119] Obtain a stitched resource image of the target application scenario; the stitched resource image is generated from the resource image of the target application scenario;

[0120] Obtain the Uniform Resource Locator (URL) for the target application scenario and the channel information corresponding to the target application scenario;

[0121] Based on the Uniform Resource Locator and the channel information, path information corresponding to the target application scenario is generated;

[0122] The text information, the stitched resource image, and the path information are used as resource information corresponding to the target application scenario; the text information carries text location information, the stitched resource image carries stitched image location information, and the path information carries path location information, and the resource location information of the resource information includes the text location information, the stitched image location information, and the path location information.

[0123] In one feasible implementation, the resource acquisition unit 13 is used for:

[0124] The unified resource locator is concatenated with the channel information to generate fused information;

[0125] Based on the QR code generator, the fused information is used to generate a corresponding QR code, and the QR code is used as the path information corresponding to the target application scenario.

[0126] In one feasible implementation, the image generation unit 14 is used for:

[0127] Based on the attribute information of the image generation window and the resource location information of the resource information, the absolute position information of the resource information in the image generation window is determined; the resource information includes stitched resource images, text information, and path information.

[0128] Based on the resource information and the absolute position information of the resource information, a target image corresponding to the target application scenario is generated in the image generation window.

[0129] In one feasible implementation, the image generation unit 14 is used for:

[0130] Based on the planar coordinate information in the absolute position information, the text information, the path information, and the resource images in the stitched resource image are placed in the image generation window; the stitched resource image includes at least one resource image;

[0131] Based on the height information in the absolute position information, the text information, the path information, and the resource images in the stitched resource images are layered to generate a target image corresponding to the target application scenario.

[0132] Please see Figure 5 The data processing device 1 described in this application embodiment may further include a format conversion unit 16.

[0133] The format conversion unit 16 is used to obtain a format conversion instruction for the target image, wherein the format conversion instruction carries target format information;

[0134] The target image is converted into an image with the target format information.

[0135] In this embodiment, an image generation instruction is obtained based on a target application scenario, and an image generation window is created according to the instruction. This window contains attribute information corresponding to the target application scenario. Further, resource information corresponding to the target application scenario is obtained, including resource location information. Finally, based on the attribute information of the image generation window and the resource location information, the target image corresponding to the target application scenario is generated in the image generation window using the resource information. This method generates the corresponding target image using the resource information of the target application scenario, avoiding the time-consuming process of traversing all nodes of the loaded page and collecting information from all elements, thus improving image generation efficiency.

[0136] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 6 As shown, the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen, and optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 6 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a data processing application program.

[0137] exist Figure 6 In the computer device 1000 shown, the network interface 1004 provides network communication functions, the user interface 1003 is mainly used to provide an input interface for the user, and the processor 1001 can be used to call the data processing application stored in the memory 1005 to achieve the above. Figures 2-4c The description of the data processing method in any corresponding embodiment will not be repeated here.

[0138] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figures 2-4c The description of the data processing method in any corresponding embodiment can also be performed as described above. Figure 5 The description of the data processing device in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0139] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned data processing device, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the aforementioned... Figures 2-4cThe description of the data processing method in any corresponding embodiment is already provided, and therefore will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application. As an example, program instructions may be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network. These multiple computing devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.

[0140] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The computer-readable storage medium can be an internal storage unit of a data processing apparatus or device provided in any of the foregoing embodiments, such as a hard disk or memory of an electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device. The computer-readable storage medium can also include magnetic disks, optical disks, read-only memory (ROM), or random access memory, etc. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the electronic device. The computer-readable storage medium is used to store the computer program and other programs and quantities required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0141] The terms "first," "second," etc., used in the claims, description, and drawings of this invention are used to distinguish different objects, not to describe a particular order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses. References to "embodiment" herein mean that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The presentation of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0142] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Those skilled in the art can implement the described functions using different methods for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0143] In the various embodiments of this application, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0144] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A data processing method, characterized in that, include: Obtain image generation instructions based on the target application scenario; An image generation window is created according to the image generation instructions, and the image generation window has attribute information corresponding to the target application scenario; The resource information corresponding to the target application scenario is obtained according to the HTTP request; the resource information carries resource location information; the resource information includes spliced ​​resource images, text information and path information, and the resource location information includes text location information carried by the text information, spliced ​​image location information carried by the spliced ​​resource images, and path location information carried by the path information; Based on the position information of the image generation window contained in the attribute information of the image generation window and the resource position information of the resource information, the absolute position information of the stitched resource image, the text information and the path information in the image generation window is determined; Based on the resource information and the absolute position information of the resource information, a target image corresponding to the target application scenario is generated in the image generation window.

2. The method according to claim 1, characterized in that, Before obtaining the resource information corresponding to the target application scenario, the method further includes: Based on the target image size in the attribute information, the resource image corresponding to the target application scenario is preprocessed to generate a resource image with the target image size; the resource image carries image location information; Detect the number of resource images in the target application scenario; If the number of images is greater than one, at least two preprocessed resource images are stitched together to generate a stitched resource image for the target application scenario; the stitched resource image carries the image location information of each resource image; the stitched resource image carries stitched image location information, and the stitched image location information includes the image location information of each resource image; If the number of images is equal to one, then the preprocessed resource image will be used as the stitched resource image for the target application scenario.

3. The method according to claim 2, characterized in that, The step of obtaining the resource information corresponding to the target application scenario based on the HTTP request includes: Obtain the text information corresponding to the target application scenario based on the HTTP request; Obtain a stitched resource image of the target application scenario; the stitched resource image is generated from the resource image of the target application scenario; Obtain the Uniform Resource Locator (URL) for the target application scenario and the channel information corresponding to the target application scenario; Based on the Uniform Resource Locator and the channel information, path information corresponding to the target application scenario is generated; The text information, the stitched resource image, and the path information are used as resource information corresponding to the target application scenario; the text information carries text location information, the stitched resource image carries stitched image location information, and the path information carries path location information, and the resource location information of the resource information includes the text location information, the stitched image location information, and the path location information.

4. The method according to claim 3, characterized in that, The step of generating path information corresponding to the target application scenario based on the Uniform Resource Locator (URL) and the channel information includes: The unified resource locator is concatenated with the channel information to generate fused information; Based on the QR code generator, the fused information is used to generate a corresponding QR code, and the QR code is used as the path information corresponding to the target application scenario.

5. The method according to claim 1, characterized in that, The step of generating a target image corresponding to the target application scenario in the image generation window based on the resource information and the absolute position information of the resource information includes: Based on the planar coordinate information in the absolute position information, the text information, the path information, and the resource images in the stitched resource image are placed in the image generation window; the stitched resource image includes at least one resource image; Based on the height information in the absolute position information, the text information, the path information, and the resource images in the stitched resource images are layered to generate a target image corresponding to the target application scenario.

6. The method according to claim 1, characterized in that, Also includes: Obtain a format conversion instruction for the target image, the format conversion instruction carrying target format information; The target image is converted into an image with the target format information.

7. A data processing apparatus, characterized in that, include: The instruction acquisition unit is used to acquire image generation instructions based on the target application scenario. A window creation unit is used to create an image generation window according to the image generation instruction, wherein the image generation window has attribute information corresponding to the target application scenario; The resource acquisition unit is used to acquire resource information corresponding to the target application scenario according to an HTTP request; the resource information carries resource location information; the resource information includes a spliced ​​resource image, text information and path information, and the resource location information includes text location information carried by the text information, spliced ​​image location information carried by the spliced ​​resource image, and path location information carried by the path information; The image generation unit is used to determine the absolute position information of the stitched resource image, the text information, and the path information in the image generation window based on the position information of the image generation window contained in the attribute information of the image generation window and the resource position information of the resource information. The image generation unit is further configured to generate a target image corresponding to the target application scenario in the image generation window based on the resource information and the absolute position information of the resource information.

8. A computer device, characterized in that, include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and to execute the method of any one of claims 1-6.

10. A computer program product or computer program comprising computer instructions stored in a computer-readable storage medium, wherein a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to perform the method of any one of claims 1-6.