Page display method and device, equipment and storage medium
By converting and caching image data in formats not supported by Web pages obtained by the server on the client side, the problem of slow image data display speed and high network traffic is solved, and more efficient image data display and transmission are achieved.
Patent Information
- Application Number
- CN202410620870.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing technology, the display speed of image data is low and the network traffic consumption is high.
After receiving the Web display request, the client directly obtains the target image image in a format not supported by the Web page from the server, converts it to a format supported by the Web page on the client, and displays the converted image data to avoid service It pre-processes images on the client side, reduces data processing pressure on the server, and improves network transmission efficiency by transmitting non-Web page supported formats with low data volume.
It reduces the data processing pressure and network transmission resource consumption on the server side, and improves the display speed and transmission efficiency of image data.
Smart Images

Figure CN118568371A
Abstract
Description
Technical Field
[0001] The present application relates to communication technology, and in particular to a page display method, device, equipment and storage medium. Background Art
[0002] With the development of science and technology, information management systems are applied in all walks of life to provide convenient services for users. At present, when the front-end terminal device displays the image data of the information management system, the back-end server usually pre-processes the image data of the information management system first, converts the image data into a file format supported by the front-end display, and stores it. When the front-end terminal device receives a query request for image data from the information management system, the front-end terminal device obtains the image data that can be directly displayed from the back-end server and displays the image data. However, the current method has the problems of low display speed of image data and high network traffic consumption.
[0003] Therefore, how to increase the display speed of image data and reduce network traffic consumption is an urgent problem to be solved. Summary of the invention
[0004] The present application provides a page display method, device, equipment and storage medium to solve the problems of low display speed of image data and high network traffic consumption.
[0005] In a first aspect, the present application provides a page display method, comprising:
[0006] Receiving a Web display request for a target image;
[0007] In response to the Web display request, obtaining the target image from the server, wherein the original format of the target image is not a format supported by the Web page;
[0008] Converting the target image into a format supported by the Web page;
[0009] Displays the target image after the format conversion.
[0010] Optionally, converting the format of the target image so that the converted target image is in a format supported by the Web page includes:
[0011] According to the target image, a binary large object Blob corresponding to the target image is generated.
[0012] Optionally, generating a binary large object Blob corresponding to the target image according to the target image includes:
[0013] Acquire binary data of the target image;
[0014] According to the binary data, image information of the target image is obtained, wherein the image information includes a color mode and a compression method;
[0015] According to the compression method and the color mode, a Blob corresponding to the target image is decoded and generated.
[0016] Optionally, obtaining the target image from the server includes:
[0017] Obtaining the identification of the target image from the server;
[0018] If it is determined according to the identifier that the target image is not cached in the user end, the target image is obtained from the server end.
[0019] Optionally, the method further includes:
[0020] According to the target image after the format conversion, generating a thumbnail corresponding to the target image after the format conversion;
[0021] Cache the thumbnail, the target image after the conversion, and the identifier of the target image in the user terminal;
[0022] The display of the target image after the format conversion includes:
[0023] displaying the thumbnail;
[0024] In response to an operation request for the thumbnail, extracting the target image after the format conversion according to the identifier;
[0025] The target image after the format conversion is displayed.
[0026] Optionally, the method further includes:
[0027] When caching the data to be cached in the user terminal, checking whether the resource occupation of the data to be cached is greater than or equal to the remaining resource space of the user terminal, the data to be cached includes the thumbnail, the target image after the format conversion, and the identifier of the target image;
[0028] If so, the cached data with a usage frequency lower than the target frequency threshold is deleted according to the usage frequency of the cached data in the user terminal until the remaining resource space of the user terminal is larger than the resource occupation of the data to be cached.
[0029] Optionally, the target image is an image of an insurance policy, and the original format is a TIFF format.
[0030] In a second aspect, the present application provides a page display device, comprising:
[0031] A receiving module, used for receiving a Web display request for a target image;
[0032] An acquisition module, configured to acquire the target image from a server in response to the Web display request, wherein the original format of the target image is not a format supported by the Web page;
[0033] A processing module, used for converting the format of the target image so that the converted target image is in a format supported by the Web page;
[0034] The control module is used to display the target image after the format conversion.
[0035] In a third aspect, the present application provides an electronic device, comprising: a processor, a communication interface, and a memory, wherein the processor is communicatively connected to the communication interface and the memory respectively;
[0036] The memory stores computer-executable instructions;
[0037] The display displays an image;
[0038] The communication interface communicates and interacts with external devices;
[0039] The processor executes the computer-executable instructions stored in the memory to implement the method as described in any one of the first aspects.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0041] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method as described in any one of the first aspects.
[0042] The page display method, device, equipment and storage medium provided by the present application enable the client to directly obtain the target image in a format not supported by the Web page from the server after receiving a Web display request for the target image, and to display the converted target image after converting the target image into a format supported by the Web page on the client, thereby avoiding the need for the server to pre-process the image and reducing the data processing pressure on the server. Since the server directly transmits the target image in a format not supported by the Web page to the client, and the data volume of the target image in a format not supported by the Web page is lower than that of the common image format, the method can also reduce the consumption of network transmission resources and improve transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0044] Figure 1 A schematic diagram of a page display scenario provided for this application;
[0045] Figure 2 A flow chart of a page display method provided in an embodiment of the present application;
[0046] Figure 3 A flowchart of another page display method provided in an embodiment of the present application;
[0047] Figure 4 A flowchart of another page display method provided in an embodiment of the present application;
[0048] Figure 5 A flowchart of another page display method provided in an embodiment of the present application;
[0049] Figure 6 A flowchart of another page display method provided in an embodiment of the present application;
[0050] Figure 7 A flowchart of another page display method provided in an embodiment of the present application;
[0051] Figure 8 A schematic diagram of the structure of a page display device provided in an embodiment of the present application;
[0052] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0053] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0054] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0055] First, the terms involved in this application are explained:
[0056] HyperText Markup Language (HTML): It is a language description method for constructing the content of the World Wide Web (Web). It is also the new generation standard of the Internet, used to construct and present Internet content.
[0057] Blob (Binary Large Object): A type of web storage used to store and process large amounts of data in a small container. It is mainly used to store and process binary data, such as images, audio, and video.
[0058] Uniform Resource Locator (URL): is a string that represents the address of a resource on the Web (such as a web page, image, video, file, etc.). The browser locates and obtains these resources by parsing the URL.
[0059] Tagged Image File Format (TIFF): is a flexible bitmap format. Its main advantages are its high-quality image support, lossless compression, wide color space support, and stability. It supports images of various resolutions and color depths, making the image fidelity and quality high. At the same time, as a lossless compression file format, TIFF does not reduce image quality when compressing images.
[0060] To facilitate understanding, we first introduce in detail the scenes of image data display in the current information management system.
[0061] Figure 1 A schematic diagram of a page display scenario provided by this application. Figure 1As shown, the scenario includes: a user end and a server end.
[0062] Among them, the user end is used to provide services to users of the information management system (for example, providing services for displaying image data of the information management system), that is, the front end of the information management system. The user end can be a software program that implements the above functions, or it can be an electronic device that deploys the software program. The electronic device can be, for example, a mobile phone, a computer, a tablet computer, a company's counter machine and other devices. The server end is responsible for data storage, data management, business logic processing and other functions. The server end can be, for example, a back-end server, a cloud platform, etc. of the information management system.
[0063] At present, the server will pre-process the images of the information management system, convert these images into a format that the client can recognize and display (for example, it can be a common image format such as jpg, png, etc.) and store them. When the client receives a request for Web display of an image, the client sends a request to the server to obtain the image. In response to the request, the server returns the image to the client so that the client can display the image on the Web.
[0064] However, in the current page display method, the server needs to pre-process each image and convert it into an image format that the client can recognize and display, which requires high data processing capabilities on the server. In addition, the image format that the client can recognize and display occupies a large storage space, which puts a lot of storage pressure on the server. It also causes the server to transmit images to the user end, resulting in high network transmission resource consumption and low transmission efficiency.
[0065] In view of this, the present application provides a page display method, after receiving a Web display request for a target image, the client directly obtains the target image in a format not supported by the Web page from the server, and after the client converts the target image into a format supported by the Web page, displays the converted target image, so as to avoid the need for the server to pre-process the image and reduce the data processing pressure on the server. Since the server directly transmits the target image in a format not supported by the Web page to the client, and the data volume of the target image in a format not supported by the Web page is lower than the data volume of the common image format, the method can also reduce the consumption of network transmission resources and improve transmission efficiency.
[0066] The following takes the execution subject as the user end, the user end as the electronic device on which the user end software program is deployed, and the server end as the back-end server as an example, and combines specific embodiments to explain in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0067] Figure 2 A flow chart of a page display method provided in an embodiment of the present application. Figure 2 As shown, the method may include:
[0068] S201: Receive a Web display request for a target image.
[0069] Among them, the target image is related to the information management system involved. For example, when the information management system is an insurance policy management system, the image may include, for example, an insurance policy image, an insurance application document, a claim document, etc.; when the information management system is a medical image information management system, the image may include, for example, an X-ray, an ultrasound image, an endoscopic image, a pathological section image, etc. When the information management system is an archive management system, the image may include, for example, a contract scan, a document scan, an invoice scan, a historical document, etc. The above are only some examples provided by this application. It should be understood that the information management system involved in this application, as well as the target image, are not limited to the above content.
[0070] In a possible implementation, the Web display request is sent by an external device to a terminal device where the user terminal is located. For example, a user may send a Web display request for a target image to a terminal device where the user terminal is deployed through an external device such as a mobile phone or a computer. The terminal device where the user terminal is located receives the Web display request for the target image through the Internet, near field communication, or the like. Optionally, the Web display request may be, for example, a display request for displaying the target image through HTML5.
[0071] In another possible implementation, the Web display request is received by the user terminal in response to a user operation. For example, the user can operate the terminal device where the user terminal is located (for example, through peripheral operations such as a mouse and keyboard, or touch screen operations, or voice control, etc.), so that the terminal device where the user terminal is located can respond to the user's operation and receive the Web display request for the target image.
[0072] S202: In response to the Web display request, obtain the target image from the server.
[0073] The original format of the target image is not a format supported by the Web page. For example, the original format may be TIFF format, or an image format that the Web page does not support for direct display or display through the img tag, such as High Efficiency Image File Format (HEIC).
[0074] The user terminal sends a request to the server terminal to request to obtain the target image from the server terminal. The server terminal returns the target image to the user terminal according to the request. The communication between the user terminal and the server terminal can be carried out through the network or near field communication, and this application does not limit this.
[0075] In a possible implementation, the server may directly send the target image to the user.
[0076] In another possible implementation, the server may send the URL of the target image to the user. In this implementation, the server may also send the format type of the target image to the user when sending the URL of the target image to the user, so that the user can perform format conversion on the target image according to the format type.
[0077] S203: Convert the target image into a format that is supported by the Web page.
[0078] The user end obtains information of the target image by parsing the target image, and converts the format of the target image according to the information to generate the target image in a format supported by the Web page.
[0079] In a possible implementation, the user end may parse the target image to obtain information of the target image to generate a Blob file corresponding to the target image, and convert the Blob file into a URL that can be directly used in the img tag of a Web page to generate a converted target image.
[0080] Another possible implementation method is that the user end can convert the target image format through an image processing library, for example, the target image format can be converted through Python's PIL library, Node.js's sharp library, etc.
[0081] S204: Display the target image after the format conversion.
[0082] By converting the target image after format conversion into a URL that can be directly used in the img tag of the Web page, an img tag for displaying the target image after format conversion is created to display the target image after format conversion in the Web page, wherein the src attribute of the img tag for displaying the target image is the URL generated by the conversion of the target image after format conversion.
[0083] An img tag for displaying the target image is added to a web page to display the target image after the format conversion.
[0084] The method provided by the embodiment of the present application is that after receiving a Web display request for a target image, the client directly obtains the target image in a format not supported by the Web page from the server, and after the client converts the target image into a format supported by the Web page, the converted target image is displayed, so as to avoid the need for the server to pre-process the image and reduce the data processing pressure on the server. Since the server directly transmits the target image in a format not supported by the Web page to the client, and the data volume of the target image in a format not supported by the Web page is lower than the data volume of the common image format, the method can also reduce the consumption of network transmission resources and improve transmission efficiency.
[0085] Next, taking the generation of a Blob file corresponding to a target image as an example, how to convert the format of the target image in the aforementioned step S203 so that the converted target image is in a format supported by a Web page is described in detail.
[0086] Figure 3 A flow chart of another page display method provided in an embodiment of the present application. Figure 3 As shown, the aforementioned step S203 may include:
[0087] S301. Generate a binary large object Blob corresponding to the target image according to the target image.
[0088] According to the target image, the binary data of the target image is obtained. For example, taking the target image as an image in TIFF format as an example, the binary data of the target image can be extracted from the target image using XMLHttpRequest or fetch interface.
[0089] According to the binary data of the target image, the image information of the target image is extracted therefrom. The image information may include the color mode of the target image, the compression mode of the target image, the width and height of the target image, and other information. According to the compression mode and color mode of the target image, a decoding algorithm corresponding to the compression mode and color mode is selected to decode the binary data to obtain a decoded pixel array. A Blob corresponding to the target image is generated according to the pixel array. For example, the decoded pixel array can be input into a Canvas API to generate a Blob corresponding to the target image.
[0090] Based on the above step S301, the method for displaying the target image after the format conversion can be implemented by the following steps S302-S303:
[0091] S302: Generate a uniform resource locator URL of the Blob.
[0092] By calling URL.createObjectURL(), the Blob corresponding to the target image is converted into the uniform resource locator URL of the Blob, so as to display the target image in a web page by calling the URL later.
[0093] S303. Display the target video image after format conversion according to the URL.
[0094] Create an img tag for displaying the converted target image, and set the src attribute in the img tag to the URL of the Blob. Add the img tag for displaying the converted target image to a web page, and the converted target image can be displayed in the web page.
[0095] The method provided in the embodiment of the present application generates a binary large object Blob corresponding to the target image by extracting the binary data of the target image in a format not supported by the web page. The format conversion of the target image is achieved by converting the Blob into a URL to generate the target image in a format supported by the web page. This avoids the need for the server to pre-process the image, reduces the data processing pressure on the server, and can reduce the consumption of network transmission resources and improve transmission efficiency.
[0096] Figure 4 A flow chart of another page display method provided in an embodiment of the present application. Figure 4 As shown, the method may also include:
[0097] S401: Obtain the identification of the target image from the server.
[0098] The identification of the target image may be the name, ID, access address, etc. of the target image. The access address may be, for example, the URL of the target image, or may be another type of access address of the target image. The following description will be made by taking the identification of the target image as the URL of the target image as an example.
[0099] After receiving the Web display request for the target image, the client responds to the request and interacts with the server. For example, the client may request the server to obtain the identifier. The server returns the identifier of the target image to the client according to the request of the client.
[0100] S402: If it is determined according to the identifier that the target image is not cached in the user end, the target image is obtained from the server end.
[0101] The user terminal queries whether the target image is cached in the terminal device where the user terminal is located according to the URL of the target image. The target image may be cached in a database corresponding to the user terminal, which may be deployed in the terminal device where the user terminal is located, or may be an external database connected to the user terminal. The database may be an IndexedDB database.
[0102] The user terminal queries whether the target image is cached in the terminal device where the user terminal is located according to the URL of the target image and the mapping relationship between the URL of the target image and the target image. The mapping relationship is the mapping relationship between the URL and the target image pre-established when caching the target image.
[0103] If the user terminal determines that the target image is not cached in the user terminal according to the URL of the target image, it means that the user terminal needs to obtain the target image from the server to perform subsequent format conversion so as to display the target image on the user terminal.
[0104] The method of obtaining the target image from the server can refer to the aforementioned step S202, which will not be repeated here.
[0105] S403: If it is determined according to the access address that the target image is cached in the user terminal, the target image is obtained from the user terminal.
[0106] If the user terminal determines that the target image is cached in the user terminal according to the URL of the target image, it means that the user terminal can directly obtain the target image from the local computer or from an external database connected to the user terminal to perform subsequent format conversion, thereby displaying the target image on the user terminal.
[0107] The method provided by the embodiment of the present application can cache the target image in the user terminal, and when the target image is cached, the target image is obtained locally without re-downloading the target image from the remote server, thereby reducing loading time, saving network bandwidth, and increasing the speed of page display. When the target image is not cached in the user terminal, the target image is obtained from the server, reducing the number or frequency of obtaining the image from the server, thereby reducing the load on the server.
[0108] A thumbnail is a snapshot, usually a picture generated by a specific algorithm. A thumbnail represents a reduced version of the original image, and the size of the thumbnail is generally several times smaller than the original image. Optionally, the page display method provided by the present application can further include a thumbnail corresponding to the target image to facilitate the user end to display the above image.
[0109] In the case of adding thumbnails, the aforementioned step S203 may also include generating content of the thumbnail. Figure 5 A flow chart of another page display method provided in an embodiment of the present application. Figure 5 As shown, after the aforementioned step S303, the aforementioned step S203 may further include:
[0110] S501 . Generate a thumbnail Blob corresponding to the target image according to the Blob corresponding to the target image.
[0111] The client uses the Canvas API to convert the Blob corresponding to the target image into a thumbnail Blob corresponding to the target image.
[0112] Specifically, the user end converts the Blob corresponding to the target image into a URL, and then uses the URL to create an Image object of the Blob corresponding to the target image. After the Image object is loaded, the user end uses the Canvas API to draw a thumbnail of the Blob of the target image. Finally, the user end calls the Canvas.toBlob method to convert the content of the Canvas into a new Blob (i.e., the thumbnail Blob corresponding to the target image).
[0113] S502: Generate a thumbnail URL of the thumbnail Blob.
[0114] By calling URL.createObjectURL(), the thumbnail Blob is converted into the uniform resource locator URL of the Blob, so as to be used for subsequently generating the thumbnail corresponding to the target image after the format conversion and which can be directly displayed in the Web page through the URL.
[0115] S503: Generate a thumbnail of the target video image after format conversion according to the thumbnail URL.
[0116] Create an img tag for displaying thumbnails, and set the src attribute in the img tag to the thumbnail URL. Add the img tag for displaying thumbnails to a web page, and the thumbnail of the target image can be displayed in the web page.
[0117] On this basis, combined with the above Figure 4 The method described herein can also cache the thumbnail and the target image after the format conversion together in the user terminal or in the database of the user terminal. Figure 6 A flow chart of another page display method provided in an embodiment of the present application. Figure 6 As shown, the method may also include:
[0118] S601. Generate a thumbnail corresponding to the target image after the format conversion according to the target image after the format conversion.
[0119] The specific implementation method of step S601 is as described above. Figure 5 The description of the provided method will not be repeated here.
[0120] S602: Cache the thumbnail, the target image after the format conversion, and the identifier of the target image in the user terminal.
[0121] A possible implementation method is to directly cache the thumbnail, the target image after the format conversion, and the identifier of the target image in the user terminal, and establish an association relationship between the thumbnail, the target image after the format conversion, and the identifier of the target image. For example, the mapping relationship between the thumbnail and the identifier of the target image, and the mapping relationship between the target image after the format conversion and the identifier of the target image can be established respectively with the identifier of the target image as an index.
[0122] Another possible implementation method is to store the thumbnail and the target image after conversion in the file system of the terminal device where the user is located, and store the access address of the thumbnail (such as URL), the access address of the target image after conversion (such as URL), and the identification of the target image in a database, and establish an association between the thumbnail, the target image after conversion, and the identification of the target image.
[0123] In the aforementioned Figure 5 and Figure 6On the basis of, when the user terminal displays the target image after the format conversion, the user terminal can first display the thumbnail of the target image, and then display the target image after the format conversion according to the user's operation on the thumbnail. Figure 7 A flow chart of another page display method provided in an embodiment of the present application. Figure 7 As shown, the method may include:
[0124] S701. Display thumbnails.
[0125] The user end may obtain the target image from the server end, and generate the target image in a converted format and a thumbnail of the target image according to the target image. The user end may also obtain the cached thumbnail of the target image from the local cache.
[0126] The user end creates an img tag for displaying the thumbnail, sets the src attribute in the img tag to the thumbnail URL, and then adds the img tag to the Web interface to display the thumbnail.
[0127] S702: In response to an operation request for a thumbnail, extract a target image after format conversion according to the identifier.
[0128] The operation request for the thumbnail can be, for example, an operation request sent by the user to the user terminal through an external device, or an operation request generated by the user directly operating the terminal device where the user terminal is located. For example, the user can click on the thumbnail displayed by the terminal device where the user terminal is located to trigger the user terminal to perform an operation of displaying the target image after the format conversion. Alternatively, the user can send a request to display the target image after the format conversion to the user terminal through a personal electronic device (such as a mobile phone, a computer, etc.) to trigger the user terminal to perform an operation of displaying the target image after the format conversion.
[0129] In response to an operation request for a thumbnail, the user terminal determines the identifier of a target image image that is mapped to the thumbnail (e.g., the URL of a target image image that is mapped to the thumbnail), and extracts the target image image in the converted format from the user terminal or a database through the URL and the mapping relationship between the URL and the target image image in the converted format.
[0130] S703: Display the target image after the format conversion.
[0131] This step is the same as the aforementioned step S204 and will not be described again here.
[0132] The method provided in the embodiment of the present application is that the user end automatically generates a corresponding thumbnail according to the target image, and parses the target image in the original format into a format supported by the Web page, thereby reducing the data processing load on the server end. By displaying thumbnails, the number of target images displayed on the Web page of the user end is increased, and the amount of data in the Web page is reduced by using thumbnails with smaller data volumes.
[0133] In addition, the present application also provides a method for optimizing the cache behavior of the user terminal involved in the aforementioned method embodiment.
[0134] When the thumbnail, the converted target image, and the target image identifier are cached in the user terminal, the user terminal may check whether the resource usage of the cached data is greater than or equal to the remaining resource space of the user terminal.
[0135] If the resource usage of the data to be cached is greater than or equal to the remaining resource space of the user terminal, it indicates that the user terminal does not have enough resource space to cache the data to be cached, and some cached data needs to be deleted to obtain enough resource space to cache the data to be cached.
[0136] If the resource occupation amount of the data to be cached is less than the remaining resource space of the user terminal, it indicates that the user terminal has sufficient resource space to cache the data to be cached, and the data to be cached can be directly cached.
[0137] Optionally, the user terminal may also set a resource threshold of the cache space, which is less than or equal to the resource space size of the user terminal. If the sum of the resource occupation of the data to be cached and the resource occupation of the data already cached by the user terminal is greater than or equal to the resource threshold, part of the cached data needs to be deleted to obtain sufficient resource space to cache the data to be cached.
[0138] In the above-mentioned multiple implementations, if the resource occupation of the data to be cached is greater than or equal to the remaining resource space of the user terminal, the user terminal deletes the cached data whose usage frequency is lower than the target frequency threshold according to the usage frequency of the cached data in the user terminal, until the remaining resource space of the user terminal is greater than the resource occupation of the data to be cached. For example, the user terminal may delete the least frequently used cached data in the cached data according to the Least Recently Used (LRU) principle, until the remaining resource space of the user terminal is greater than the resource occupation of the data to be cached.
[0139] The method provided in the embodiment of the present application adjusts the cached data in the user terminal if the remaining resource space in the user terminal is insufficient to cache the thumbnails, the target image after format conversion, and the identifier of the target image when caching these data, so as to ensure the resource utilization efficiency of the cache control of the user terminal, thereby improving the stability of the user terminal when displaying the page.
[0140] Figure 8 This is a schematic diagram of the structure of a page display device provided in an embodiment of the present application. Figure 8 As shown, the device may include: a receiving module 11, an acquiring module 12, a processing module 13, and a control module 14.
[0141] The receiving module 11 is used to receive a Web display request for a target image.
[0142] The acquisition module 12 is used to obtain the target image from the server in response to the Web display request, where the original format of the target image is not a format supported by the Web page.
[0143] The processing module 13 is used to convert the format of the target image so that the converted target image is in a format supported by the Web page.
[0144] The control module 14 is used to display the target image after the format conversion.
[0145] Optionally, the processing module 13 is used to generate a binary large object Blob corresponding to the target image according to the target image.
[0146] Optionally, the acquisition module 12 is specifically used to acquire binary data of the target image. The processing module 13 is used to acquire image information of the target image specifically based on the binary data. According to the compression method and the color mode, the Blob corresponding to the target image is decoded and generated, and the image information includes the color mode and the compression method.
[0147] Optionally, the acquisition module 12 is specifically configured to acquire the identifier of the target image from the server, and if it is determined according to the identifier that the target image is not cached in the user terminal, the target image is acquired from the server.
[0148] Optionally, the processing module 13 is further used to generate a thumbnail corresponding to the target image after the conversion according to the target image after the conversion. The thumbnail, the target image after the conversion, and the identifier of the target image are cached in the user terminal. The control module 14 is specifically used to display the thumbnail. In response to an operation request for the thumbnail, the target image after the conversion is extracted according to the identifier. The target image after the conversion is displayed.
[0149] Optionally, the processing module 13 is further used to check whether the resource occupation of the data to be cached is greater than or equal to the remaining resource space of the user terminal when caching the data to be cached in the user terminal. If so, the cached data with a usage frequency lower than the target frequency threshold is deleted according to the usage frequency of the cached data in the user terminal until the remaining resource space of the user terminal is greater than the resource occupation of the data to be cached, and the data to be cached includes the thumbnail, the target image after the converted format, and the identifier of the target image.
[0150] Optionally, the target image is an image of an insurance policy, and the original format is TIFF format.
[0151] The page display device provided in the embodiment of the present application can execute the page display method in the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0152] Fig. 9 The structure diagram of an electronic device provided in an embodiment of the present application. The electronic device is used to execute the page display method mentioned above, for example, it can be the terminal device where the user terminal is located. Fig. 9 As shown, the electronic device 900 may include: at least one processor 901 , a memory 902 , a communication interface 903 , and a display 904 .
[0153] The memory 902 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions.
[0154] The memory 902 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0155] The processor 901 is used to execute the computer-executable instructions stored in the memory 902 to implement the method described in the above method embodiment. The processor 901 may be a CPU, or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0156] The display 904 is used to display the target image and / or thumbnail in the aforementioned method embodiment.
[0157] The processor 901 can communicate and interact with external devices through the communication interface 903. The external device can be, for example, the server where the aforementioned service end is located, or the user's personal terminal device. In a specific implementation, if the communication interface 903, the display 904, the memory 902 and the processor 901 are implemented independently, the communication interface 903, the display 904, the memory 902 and the processor 901 can be interconnected through a bus and complete mutual communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0158] Optionally, in a specific implementation, if the communication interface 903, the display 904, the memory 902 and the processor 901 are integrated on a chip, the communication interface 903, the display 904, the memory 902 and the processor 901 can communicate through an internal interface.
[0159] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores program instructions, and the program instructions are used for the methods in the above embodiments.
[0160] The present application also provides a program product, which includes an execution instruction, which is stored in a readable storage medium. At least one processor of a computing device can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the computing device implements the action of the above-mentioned page display device.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A page display method, characterized in that: The method comprises: Receiving a Web display request for a target image; In response to the Web display request, obtaining the target image from the server, wherein the original format of the target image is not a format supported by the Web page; Converting the target image into a format supported by the Web page; Displays the target image after the format conversion.
2. The method according to claim 1, characterized in that The step of converting the target image format so that the converted target image format is in a format supported by the Web page includes: According to the target image, a binary large object Blob corresponding to the target image is generated.
3. The method according to claim 2, characterized in that The step of generating a binary large object Blob corresponding to the target image according to the target image includes: Acquire binary data of the target image; According to the binary data, image information of the target image is obtained, wherein the image information includes a color mode and a compression method; According to the compression method and the color mode, a Blob corresponding to the target image is decoded and generated.
4. The method according to any one of claims 1 to 3, characterized in that: The step of obtaining the target image from the server includes: Obtaining the identification of the target image from the server; If it is determined according to the identifier that the target image is not cached in the user end, the target image is obtained from the server end.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: According to the target image after the format conversion, generating a thumbnail corresponding to the target image after the format conversion; Cache the thumbnail, the target image after the conversion, and the identifier of the target image in the user terminal; The display of the target image after the format conversion includes: displaying the thumbnail; In response to an operation request for the thumbnail, extracting the target image after the format conversion according to the identifier; The target image after the format conversion is displayed.
6. The method according to claim 5, characterized in that The method further comprises: When caching the data to be cached in the user terminal, checking whether the resource occupation of the data to be cached is greater than or equal to the remaining resource space of the user terminal, the data to be cached includes the thumbnail, the target image after the format conversion, and the identifier of the target image; If so, the cached data with a usage frequency lower than the target frequency threshold is deleted according to the usage frequency of the cached data in the user terminal until the remaining resource space of the user terminal is larger than the resource occupation of the data to be cached.
7. The method according to any one of claims 1 to 3, characterized in that: The target image is the image of the insurance policy, and the original format is TIFF format.
8. A page display device, characterized in that: The device comprises: A receiving module, used for receiving a Web display request for a target image; An acquisition module, configured to acquire the target image from a server in response to the Web display request, wherein the original format of the target image is not a format supported by the Web page; A processing module, used for converting the format of the target image so that the converted target image is in a format supported by the Web page; The control module is used to display the target image after the format conversion.
9. An electronic device, characterized in that: include: A processor, a display, a communication interface and a memory, wherein the processor is communicatively connected to the communication interface and the memory respectively; The memory stores computer-executable instructions; The display displays an image; The communication interface communicates and interacts with external devices; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Cited By
High-resolution image thumbnail caching and loading method and system of iOS terminal, terminal equipment and medium
CN121188301A
