WO2019024332A1 - 图片显示方法、服务器和计算机可读存储介质 - Google Patents

图片显示方法、服务器和计算机可读存储介质 Download PDF

Info

Publication number
WO2019024332A1
WO2019024332A1 PCT/CN2017/111935 CN2017111935W WO2019024332A1 WO 2019024332 A1 WO2019024332 A1 WO 2019024332A1 CN 2017111935 W CN2017111935 W CN 2017111935W WO 2019024332 A1 WO2019024332 A1 WO 2019024332A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
displayed
original image
picture display
stored
Prior art date
Application number
PCT/CN2017/111935
Other languages
English (en)
French (fr)
Inventor
易周成
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019024332A1 publication Critical patent/WO2019024332A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting

Definitions

  • the present application relates to the field of picture display, and in particular, to a picture display method, a server, and a computer readable storage medium.
  • the original image with high resolution is generally uploaded to the server system, and the original image is stored in the server system.
  • the main purpose of the present application is to provide a picture display method, a server, and a computer readable storage medium, which are intended to solve the existing image display mode and require technical problems of consuming a large amount of server resources.
  • the present application provides a picture display method, which is applied to a server, where the picture display method includes:
  • the pre-stored picture is called from the disk
  • the called pre-stored picture is transmitted to the terminal interface for display.
  • the step of calling the pre-stored picture from the disk includes:
  • the size of the placeholder to be displayed is smaller than the preset threshold, determine whether the picture type corresponding to the picture to be displayed is a preset type
  • the compressed picture associated with the picture to be displayed is called from the disk.
  • the step of calling the pre-stored picture from the disk further includes:
  • the pre-stored universal picture is called from the disk.
  • the step of determining a picture type corresponding to the picture to be displayed includes:
  • the picture type corresponding to the picture to be displayed is considered to be a preset type.
  • the step of determining that the picture type corresponding to the picture to be displayed is a preset type includes:
  • the picture type corresponding to the picture to be displayed is considered to be a preset type.
  • the step of determining whether the content of the graphic information in the picture to be displayed matches the content of the graphic information in the pre-stored picture of the system comprises:
  • the text matching rate at the same position reaches the first preset value, and when the pattern similarity at the same position reaches the second preset value, the content of the graphic information is considered to match.
  • the method before the step of determining, according to the picture display instruction, the size of the placeholder to be displayed, the method further includes:
  • the original image is stored on the disk
  • the original image is copied, and the copied original image is compressed to obtain a compressed image, and the original image and the compressed image are associated and saved.
  • the method further includes:
  • the original picture of the picture is called from the disk, and the called original picture is transmitted to the terminal interface for display.
  • the present application further provides a server including a memory, a processor, and a picture display program stored on the memory and operable on the processor, the picture display program being The processor performs the steps of the picture display method as described above when executed.
  • the present application further provides a computer readable storage medium having a picture display program stored thereon, the picture display program being executed by a processor to implement a picture as described above The steps to display the method.
  • the technical solution proposed by the present application when receiving the picture display instruction sent by the terminal, first determines the size of the placeholder to be displayed for the picture to be displayed based on the picture display instruction, and if the size of the placeholder to be displayed is smaller than a preset threshold , the pre-stored picture is called from the disk, and the called pre-stored picture is transmitted to the terminal interface for display.
  • the terminal interface displays a picture
  • the size of the placeholder of the picture to be displayed is small, it is only necessary to obtain the previously stored picture from the disk for display, and it is not necessary to perform a compression operation on the picture, thereby reducing the consumption of the server resource.
  • FIG. 1 is a schematic structural diagram of a server in a hardware operating environment according to an embodiment of the present application
  • FIG. 2 is a schematic flow chart of a first embodiment of a picture display method according to the present application.
  • step S20 in FIG. 2 is a schematic diagram of a first refinement process of step S20 in FIG. 2;
  • FIG. 4 is a schematic diagram of a refinement process of step S21 in FIG. 3;
  • FIG. 5 is a schematic diagram of a second refinement process of step S20 in FIG. 2.
  • the solution of the embodiment of the present application is: when receiving the picture display instruction sent by the terminal, first determining, according to the picture display instruction, a placeholder size to be displayed on the picture to be displayed, if the size of the placeholder to be displayed is smaller than
  • the preset threshold is used to call the pre-stored picture from the disk, and the called pre-stored picture is transmitted to the terminal interface for display.
  • it requires a lot of server resources.
  • FIG. 1 is a schematic structural diagram of a server in a hardware operating environment involved in an embodiment of the present application.
  • the server of the embodiment of the present application includes but is not limited to a one-way server, a multi-way server, and a distributed server.
  • the server may include a processor 1001, such as a CPU, a communication bus 1002, a network interface 1003, and a memory 1004.
  • the communication bus 1002 is used to implement connection communication between these components.
  • the network interface 1003 may optionally include a standard wired interface (for connecting to a wired network), a wireless interface (such as a WI-FI interface, a Bluetooth interface, an infrared interface, etc. for connecting to a wireless network).
  • the memory 1004 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage.
  • the memory 1004 can also optionally be a storage device independent of the aforementioned processor 1001.
  • the server may also include RF (Radio) Frequency, RF) circuits, sensors, WiFi modules, and more.
  • RF Radio
  • RF Radio
  • server structure illustrated in FIG. 1 does not constitute a limitation to the device, and may include more or less components than those illustrated, or some components may be combined, or different component arrangements.
  • an operating system As shown in FIG. 1, an operating system, a network communication module, and a picture display program may be included in the memory 1004 as a computer readable storage medium.
  • the operating system is a program for managing and controlling server and software resources, and supports operation of a network communication module, a picture display program, and other programs or software; the network communication module is used to manage and control the network interface 1003.
  • the network interface 1003 is mainly used to connect the terminal and perform data communication with the terminal;
  • the server invokes the picture display program stored in the memory 1004 by the processor 1001 to implement the following steps:
  • the pre-stored picture is called from the disk
  • the called pre-stored picture is transmitted to the terminal interface for display.
  • the server invokes the picture display program stored in the memory 1004 by the processor 1001 to implement the step of calling the pre-stored picture from the disk:
  • the size of the placeholder to be displayed is smaller than the preset threshold, determine whether the picture type corresponding to the picture to be displayed is a preset type
  • the compressed picture associated with the picture to be displayed is called from the disk.
  • the server invokes the picture display program stored in the memory 1004 by the processor 1001 to implement the step of calling the pre-stored picture from the disk. :
  • the pre-stored universal picture is called from the disk.
  • the server invokes the picture display program stored in the memory 1004 by the processor 1001 to implement the step of determining the picture type corresponding to the picture to be displayed:
  • the picture type corresponding to the picture to be displayed is considered to be a preset type.
  • the server invokes the picture display program stored in the memory 1004 by the processor 1001 to implement the steps of determining that the picture type corresponding to the picture to be displayed is the preset type.
  • the picture type corresponding to the picture to be displayed is considered to be a preset type.
  • the server invokes the picture display program stored in the memory 1004 by the processor 1001 to implement a step of determining whether the content of the graphic information in the picture to be displayed matches the content of the graphic information in the system pre-stored picture:
  • the text matching rate at the same position reaches the first preset value, and when the pattern similarity at the same position reaches the second preset value, the content of the graphic information is considered to match.
  • the server determines to store in the memory 1004 by the processor 1001 before the step of determining the size of the placeholder to be displayed for the picture to be displayed based on the picture display instruction.
  • the picture shows the program to implement the following steps:
  • the original image is stored on the disk
  • the original image is copied, and the copied original image is compressed to obtain a compressed image, and the original image and the compressed image are associated and saved.
  • the server determines to store the size of the placeholder to be displayed according to the picture display instruction, and the server calls the memory 1004 to be stored by the processor 1001.
  • the picture shows the program to implement the following steps:
  • the original picture of the picture is called from the disk, and the called original picture is transmitted to the terminal interface for display.
  • the technical solution proposed by the present application when receiving the picture display instruction sent by the terminal, first determines the size of the placeholder to be displayed for the picture to be displayed based on the picture display instruction, and if the size of the placeholder to be displayed is smaller than a preset threshold , the pre-stored picture is called from the disk, and the called pre-stored picture is transmitted to the terminal interface for display.
  • the terminal interface displays a picture
  • the size of the placeholder of the picture to be displayed is small, it is only necessary to obtain the previously stored picture from the disk for display, and it is not necessary to perform a compression operation on the picture, thereby reducing the consumption of the server resource.
  • FIG. 2 is a schematic flowchart of a first embodiment of a picture display method according to the present application.
  • the picture display method is applied to a server, and the picture display method includes:
  • Step S10 when receiving the picture display instruction sent by the terminal, determining, according to the picture display instruction, a placeholder size that needs to be displayed on the picture to be displayed; in step S20, if the size of the placeholder to be displayed is smaller than a preset threshold, The pre-stored picture is called from the disk; in step S30, the called pre-stored picture is transmitted to the terminal interface for display.
  • the picture display method is applied to a server, and the server is a server as shown in FIG. 1.
  • the server is provided with a disk for storing pictures.
  • Step S10 when receiving the picture display instruction sent by the terminal, determining, according to the picture display instruction, a placeholder size that needs to be displayed for the picture to be displayed;
  • the triggering manner of the picture display instruction includes:
  • the terminal front-end device
  • the terminal needs to trigger a picture display instruction when the picture is loaded on the display interface, and send the picture display instruction to the server.
  • the terminal When receiving the touch operation in the picture display control, the terminal triggers the picture display instruction, and sends the picture display instruction to the server, where the touch operation includes but is not limited to a click touch operation, a long press touch operation, or a sliding touch operation. .
  • the server When the server receives the picture display instruction sent by the terminal, the server first determines the picture to be displayed corresponding to the picture display instruction. Specifically, the server extracts the picture identifier from the picture display instruction, and determines the picture to be displayed based on the extracted picture identifier.
  • the picture identifier is 0021.jpg, which is set according to the actual situation, and is not limited herein.
  • the server After determining the picture to be displayed, the server further determines the placeholder size that the picture needs to be displayed.
  • the server determines the size of the placeholder that the picture needs to be displayed, and is also determined according to the picture display instruction. Specifically, the server checks whether the picture display instruction carries preset flag bit information, and the flag bit information It can be set according to the actual situation. If the preset flag is carried, the size of the placeholder that the picture needs to be displayed is large, and the preset threshold is reached. If the picture display instruction does not carry the preset flag, then The placeholder size that the picture needs to be displayed is small and smaller than the preset threshold. In this embodiment, the preset threshold is also not limited, and is set according to actual conditions.
  • the size of the picture to be requested is determined first.
  • the terminal requests the picture with the placeholder size larger than the preset size.
  • the terminal sets the preset flag bit information. For example, when the location size requested by the terminal is less than or equal to the picture of the preset size, the terminal does not set the flag information.
  • the terminal determines the size of the placeholder of the picture, which is determined according to the operation of the user in the display interface.
  • the picture to be displayed by the terminal is preferably a small picture, if the user does not perform a touch operation (including clicking, Long press or slide operation) means that the terminal only needs to load a small picture for display; when the user double-clicks the area where the picture is located in the display interface, it means that the terminal wants to load a large picture. Therefore, when the terminal does not receive the touch operation, it indicates that the mini-picture is currently loaded, and the terminal does not need to add the preset flag bit information in the picture display instruction, and directly adds the picture identifier to be sent to the server.
  • a touch operation including clicking, Long press or slide operation
  • Step S20 if the size of the placeholder to be displayed is smaller than a preset threshold, the pre-stored picture is called from the disk;
  • the server determines the size of the placeholder to be displayed for the picture to be displayed, if it is detected that the size of the placeholder to be displayed is smaller than a preset threshold, the server calls the pre-stored picture from the disk.
  • the implementation manner of the step S20 includes:
  • Step S20 includes:
  • step S21 if the size of the placeholder to be displayed is smaller than the preset threshold, it is determined whether the picture type corresponding to the picture to be displayed is a preset type;
  • step S22 when the picture type is not the preset type, the compressed picture associated with the picture to be displayed is called from the disk.
  • the step S21 includes:
  • Step S211 identifying the graphic information in the picture to be displayed to determine the location of the graphic information in the picture to be displayed;
  • Step S212 acquiring a pre-stored picture of the system
  • Step S213 comparing the picture to be displayed with the pre-stored picture of the system, to determine whether the location of the graphic information in the picture to be displayed is the same as the position of the graphic information in the pre-stored picture of the system;
  • step S214 if the same, the picture type corresponding to the picture to be displayed is considered to be a preset type.
  • the server after determining the picture to be displayed, the server first identifies the graphic information in the displayed picture to determine the location of the graphic information, and obtains the pre-stored picture after determining the location of the graphic information.
  • the pre-stored picture is a picture stored in the server system in advance. After the pre-stored picture is obtained, the server compares the picture to be displayed with the pre-stored picture of the system to determine the picture to be displayed.
  • the location of the text information is the same as the location of the graphic information in the pre-stored picture of the system.
  • the pre-stored graphic information of the system has a specific graphic combination, and therefore, the preset type of image includes a picture of a specific graphic combination.
  • the image type corresponding to the image to be displayed is considered to be a preset type, and then, when the image to be displayed is displayed
  • the preset type is preferably: Card type.
  • the server can call the compressed picture associated with the picture to be displayed from the disk. That is, in the embodiment, when it is determined that the picture type of the picture to be displayed is not the ID card picture type, at this time, the compressed picture is extracted from the system disk, and the compressed picture can be subsequently sent to the terminal for display.
  • the server when the terminal views a small picture, the server extracts the pre-compressed picture from the disk for subsequent display. Since the image has been compressed beforehand, the subsequent extraction is directly extracted, which reduces the server resources required for the image display.
  • Step S20 further includes:
  • step S23 when the picture type is a preset type, the pre-stored general picture is called from the disk.
  • the server may extract the pre-stored universal picture on the disk, so as to send the pre-stored general picture to the terminal for display, the pre-stored general picture and the preset type of picture. Consistent, that is, the pre-stored universal picture is also set as an ID picture.
  • the server when the terminal views a small picture and the picture is an ID picture, the server loads the disk to pre-store the general picture for display, and does not need to perform compression beforehand, thereby saving the traffic consumed when the picture is stored.
  • the compressed picture of the picture to be displayed is extracted, or the common picture is pre-stored, and the extracted compressed picture and the common picture are used as pre-stored pictures to facilitate subsequent display.
  • step S30 the called pre-stored picture is transmitted to the terminal interface for display.
  • the server After the server extracts the pre-stored picture, the extracted pre-stored picture can be transmitted to the terminal for display.
  • the server receives the picture display instruction sent by the terminal, and transmits the extracted pre-stored picture to the terminal, preferably both.
  • the message queue is used to receive the picture display instruction sent by the front end through the message queue, and then the extracted pre-stored picture is transmitted to the terminal through the message queue. Because the message queue has the characteristics of first-in-first-out, the display process of the picture is executed in order, ensuring that the picture display process is more orderly.
  • the communication process between the server and the terminal is implemented through the message queue, and when multiple terminals are simultaneously sent to the picture display instruction, the server has to respond to multiple instructions, causing system resource overload.
  • the technical solution provided by the embodiment when receiving the picture display instruction sent by the terminal, first determines, according to the picture display instruction, a placeholder size to be displayed for the picture to be displayed, if the size of the placeholder to be displayed is smaller than the preset Threshold, the pre-stored picture is called from the disk, and the called pre-stored picture is transmitted to the terminal interface for display.
  • the terminal interface displays a picture
  • the size of the placeholder of the picture to be displayed is small, it is only necessary to obtain the previously stored picture from the disk for display, and it is not necessary to perform a compression operation on the picture, thereby reducing the consumption of the server resource.
  • the second embodiment of the picture display method differs from the first embodiment of the picture display method in that, in the embodiment, the step S214 includes:
  • Step A If they are the same, determine whether the content of the graphic information in the picture to be displayed matches the content of the graphic information in the pre-stored picture of the system;
  • step B if it matches, it is considered that the picture type corresponding to the picture to be displayed is a preset type.
  • the server in the case that the location where the graphic information is located in the picture to be displayed is the same as the position of the graphic information in the pre-stored picture of the system, the server is used to improve the accuracy of the graphic information determination. Further determining whether the content of the graphic information in the picture to be displayed matches the content of the graphic information in the pre-stored picture of the system.
  • the step A includes:
  • Step A1 comparing the image to be displayed with the text at the same position in the pre-stored picture of the system, and comparing the patterns at the same position;
  • step A2 the text matching rate at the same position reaches the first preset value, and when the pattern similarity at the same position reaches the second preset value, the content of the graphic information is considered to match.
  • the image to be displayed is first compared with the text at the same position in the pre-stored picture of the system, and the picture to be displayed is compared with the pattern at the same position in the pre-stored picture of the system, and the matching rate of the text at the same position reaches the first preset.
  • the value and the pattern similarity of the same position reach the second preset value, the content of the graphic information is considered to match.
  • the first preset value and the second preset value may be different values, and may be the same value. The specific value is set according to actual conditions, and is not limited herein.
  • the picture type corresponding to the picture to be displayed may be considered as a preset type.
  • the content of the graphic information in the two pictures is further compared, and If the content of the graphic information is also matched, it is considered that the image type corresponding to the image to be displayed is a preset type, which improves the accuracy of the image type recognition in the image to be displayed.
  • a third embodiment of the picture display method of the present application is proposed based on the first or second embodiment.
  • the third embodiment of the picture display method differs from the first or second embodiment of the picture display method in that, before the step S10, the method further includes:
  • Step C when receiving the original image uploaded by the terminal, storing the original image on the disk;
  • Step D determining whether the type of the original image is the preset type
  • Step E uploading a general picture to the disk when the original picture is the preset type, and storing the universal picture;
  • step F when the original image is not the preset type, the original image is copied, and the copied original image is compressed to obtain a compressed image, and the original image and the compressed image are associated and saved.
  • the original picture uploaded by the terminal is obtained first, and then the obtained original picture is stored in the disk. Then, the picture type of the original picture is analyzed. In this embodiment, the picture type of the original picture is analyzed in the first and second embodiments above, and details are not described herein again.
  • the preset type is the ID picture picture type mentioned above.
  • the server acquires a general picture, and stores the obtained general picture to a disk for storage. .
  • the original image is copied at this time, and then the copied original image is compressed to obtain a compressed image, and finally the original image and the compressed image are associated and saved, so that the subsequent view is small.
  • the compressed image associated with the original image is called for display.
  • the server directly on the disk
  • the corresponding picture is obtained for display, that is, when the subsequent terminal wants to view the picture, the server does not need to perform the compression operation, which saves the server resources and reduces the processing pressure of the server, thereby improving the processing speed of the server.
  • a fourth embodiment of the picture display method of the present application is proposed based on the first to third embodiments.
  • the fourth embodiment of the picture display method is different from the first to third embodiments of the picture display method in that after the step S10, the method further includes:
  • Step G If the size of the placeholder to be displayed reaches the preset threshold, the original picture of the picture is called from the disk, and the called original picture is transmitted to the terminal interface for display.
  • the server calls the original image corresponding to the picture to be displayed from the disk, and transmits the called original image to the terminal interface for display.
  • the server when the terminal requests the original image, the server directly feeds back the original image, and stores various pictures through the disk to feed back the corresponding picture according to the actual request of the terminal, so that the picture viewing is more flexible.
  • the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a picture display program, and when the picture display program is executed by the processor, the following operations are implemented:
  • the pre-stored picture is called from the disk
  • the called pre-stored picture is transmitted to the terminal interface for display.
  • the operation of calling the pre-stored picture from the disk is also implemented:
  • the size of the placeholder to be displayed is smaller than the preset threshold, determine whether the picture type corresponding to the picture to be displayed is a preset type
  • the compressed picture associated with the picture to be displayed is called from the disk.
  • the operation of calling the pre-stored picture from the disk is also implemented:
  • the pre-stored universal picture is called from the disk.
  • the picture type corresponding to the picture to be displayed is considered to be a preset type.
  • the picture display program when executed by the processor, the same operation is performed, and the picture type corresponding to the picture to be displayed is considered to be a preset type operation:
  • the picture type corresponding to the picture to be displayed is considered to be a preset type.
  • the picture display program when executed by the processor, it is further implemented to determine whether the content of the graphic information in the picture to be displayed matches the content of the graphic information in the pre-stored picture of the system:
  • the text matching rate at the same position reaches the first preset value, and when the pattern similarity at the same position reaches the second preset value, the content of the graphic information is considered to match.
  • the original image is stored on the disk
  • the original image is copied, and the copied original image is compressed to obtain a compressed image, and the original image and the compressed image are associated and saved.
  • the original picture of the picture is called from the disk, and the called original picture is transmitted to the terminal interface for display.
  • the technical solution proposed by the present application when receiving the picture display instruction sent by the terminal, first determines the size of the placeholder to be displayed for the picture to be displayed based on the picture display instruction, and if the size of the placeholder to be displayed is smaller than a preset threshold , the pre-stored picture is called from the disk, and the called pre-stored picture is transmitted to the terminal interface for display.
  • the terminal interface displays a picture
  • the size of the placeholder of the picture to be displayed is small, it is only necessary to obtain the previously stored picture from the disk for display, and it is not necessary to perform a compression operation on the picture, thereby reducing the consumption of the server resource.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本申请公开了一种图片显示方法,应用于服务器中,所述方法包括:在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸;若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片;将调用的预存图片传输至终端界面进行显示。本申请还公开了一种服务器和计算机可读存储介质。本申请实现了终端界面显示图片时,若要显示的图片的占位符尺寸较小,只要从磁盘中获取事先存储的图片进行显示即可,无需对图片执行压缩操作,降低了服务器资源的消耗。

Description

图片显示方法、服务器和计算机可读存储介质
本申请要求于2017年07月31日提交中国专利局、申请号为201710645023.1、发明名称为“图片显示方法、服务器和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图片显示领域,尤其涉及一种图片显示方法、服务器和计算机可读存储介质。
背景技术
现有的图片显示方法,一般是先将分辨率高的原图上传至服务器***,并在服务器***存储该原图。
当***需要显示图片时,由于很多场景只需要显示小图片,这个时候,需要先读取高分辨率原图,然后将高分辨率的原图进行压缩以传到前端显示,实际过程中,***需要大量显示小图片,若是每次显示图片都要压缩图片,需要消耗大量的流量,显然,现有的小图片显示方式,需要耗费大量服务器资源。
发明内容
本申请的主要目的在于提供一种图片显示方法、服务器和计算机可读存储介质,旨在解决现有的图片显示方式,需要耗费大量服务器资源的技术问题。
为实现上述目的,本申请提供一种图片显示方法,应用于服务器中,所述图片显示方法包括:
在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸;
若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片;
将调用的预存图片传输至终端界面进行显示。
可选地,所述若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片的步骤包括:
若需要显示的占位符尺寸小于预设阈值,则确定待显示的图片对应的图片类型是否为预设类型;
在图片类型不为预设类型时,从磁盘中调用待显示图片关联的压缩图片。
可选地,所述确定待显示的图片对应的图片类型是否为预设类型的步骤之后,所述从磁盘中调用预存图片的步骤还包括:
在图片类型为预设类型时,从磁盘中调用预存通用图片。
可选地,所述确定待显示的图片对应的图片类型的步骤包括:
对待显示的图片中的图文信息进行识别,以确定待显示的图片中图文信息所在的位置;
获取***预存图片;
将待显示的图片与***预存图片进行比较,以判断待显示的图片中图文信息所在的位置与***预存图片中的图文信息所在位置是否相同;
若相同,认为待显示的图片对应的图片类型为预设类型。
可选地,所述若相同,认为待显示的图片对应的图片类型为预设类型的步骤包括:
若相同,判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配;
若匹配,认为待显示的图片对应的图片类型为预设类型。
可选地,所述判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配的步骤包括:
将待显示的图片与***预存图片中相同位置的文字进行比较,以及将相同位置的图案进行比较;
在相同位置的文字匹配率达到第一预设值,在相同位置的图案相似度达到第二预设值时,认为图文信息的内容匹配。
可选地,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之前,所述方法还包括:
在接收到终端上传的原图时,将原图存储到磁盘中;
确定原图的类型是否为所述预设类型;
在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
可选地,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之后,所述方法还包括:
若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
此外,为实现上述目的,本申请还提供一种服务器,所述服务器包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的图片显示程序,所述图片显示程序被所述处理器执行时实现如上文所述的图片显示方法的步骤。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有图片显示程序,所述图片显示程序被处理器执行时实现如上文所述的图片显示方法的步骤。
本申请提出的技术方案,在接收到终端发送的图片显示指令时,先基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸,若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片,并将调用的预存图片传输至终端界面进行显示。实现了终端界面显示图片时,若要显示的图片的占位符尺寸较小,只要从磁盘中获取事先存储的图片进行显示即可,无需对图片执行压缩操作,降低了服务器资源的消耗。
附图说明
图1是本申请实施例方案涉及的硬件运行环境的服务器结构示意图;
图2为本申请图片显示方法第一实施例的流程示意图;
图3为图2中步骤S20的第一细化流程示意图;
图4为图3中步骤S21的细化流程示意图;
图5为图2中步骤S20的第二细化流程示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例的解决方案主要是:在接收到终端发送的图片显示指令时,先基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸,若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片,并将调用的预存图片传输至终端界面进行显示。以解决现有的图片显示方式,需要耗费大量服务器资源的问题。
如图1所示,图1是本申请实施例方案涉及的硬件运行环境的服务器结构示意图。
本申请实施例服务器包括但不限于单路服务器、多路服务器和分布式服务器。
如图1所示,该服务器可以包括:处理器1001,例如CPU,通信总线1002、网络接口1003,存储器1004。其中,通信总线1002用于实现这些组件之间的连接通信。网络接口1003可选的可以包括标准的有线接口(用于连接有线网络)、无线接口(如WI-FI接口、蓝牙接口、红外线接口等,用于连接无线网络)。存储器1004可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1004可选的还可以是独立于前述处理器1001的存储装置。
可选地,服务器还可以包括RF(Radio Frequency,射频)电路,传感器、WiFi模块等等。
本领域技术人员可以理解,图1中示出的服务器结构并不构成对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图1所示,作为一种计算机可读存储介质的存储器1004中可以包括操作***、网络通信模块以及图片显示程序。其中,操作***是管理和控制服务器与软件资源的程序,支持网络通信模块、图片显示程序以及其他程序或软件的运行;网络通信模块用于管理和控制网络接口1003。
在图1所示的终端中,网络接口1003主要用于连接终端,与终端进行数据通信;所述服务器通过处理器1001调用存储器1004中存储的图片显示程序,以实现以下步骤:
在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸;
若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片;
将调用的预存图片传输至终端界面进行显示。
进一步地,若需要显示的占位符尺寸小于预设阈值,所述服务器通过处理器1001调用存储器1004中存储的图片显示程序,以实现从磁盘中调用预存图片的步骤:
若需要显示的占位符尺寸小于预设阈值,则确定待显示的图片对应的图片类型是否为预设类型;
在图片类型不为预设类型时,从磁盘中调用待显示图片关联的压缩图片。
进一步地,所述确定待显示的图片对应的图片类型是否为预设类型的步骤之后,所述服务器通过处理器1001调用存储器1004中存储的图片显示程序,以实现从磁盘中调用预存图片的步骤:
在图片类型为预设类型时,从磁盘中调用预存通用图片。
进一步地,所述服务器通过处理器1001调用存储器1004中存储的图片显示程序,以实现确定待显示的图片对应的图片类型的步骤:
对待显示的图片中的图文信息进行识别,以确定待显示的图片中图文信息所在的位置;
获取***预存图片;
将待显示的图片与***预存图片进行比较,以判断待显示的图片中图文信息所在的位置与***预存图片中的图文信息所在位置是否相同;
若相同,认为待显示的图片对应的图片类型为预设类型。
进一步地,所述服务器通过处理器1001调用存储器1004中存储的图片显示程序,以实现若相同,认为待显示的图片对应的图片类型为预设类型的步骤:
若相同,判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配;
若匹配,认为待显示的图片对应的图片类型为预设类型。
进一步地,所述服务器通过处理器1001调用存储器1004中存储的图片显示程序,以实现判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配的步骤:
将待显示的图片与***预存图片中相同位置的文字进行比较,以及将相同位置的图案进行比较;
在相同位置的文字匹配率达到第一预设值,在相同位置的图案相似度达到第二预设值时,认为图文信息的内容匹配。
进一步地,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之前,所述服务器通过处理器1001调用存储器1004中存储的图片显示程序,以实现以下步骤:
在接收到终端上传的原图时,将原图存储到磁盘中;
确定原图的类型是否为所述预设类型;
在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
进一步地,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之后,所述服务器通过处理器1001调用存储器1004中存储的图片显示程序,以实现以下步骤:
若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
本申请提出的技术方案,在接收到终端发送的图片显示指令时,先基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸,若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片,并将调用的预存图片传输至终端界面进行显示。实现了终端界面显示图片时,若要显示的图片的占位符尺寸较小,只要从磁盘中获取事先存储的图片进行显示即可,无需对图片执行压缩操作,降低了服务器资源的消耗。
基于上述终端硬件结构,提出本申请图片显示方法的各个实施例。
参照图2,图2为本申请图片显示方法第一实施例的流程示意图。
在本实施例中,图片显示方法应用于服务器中,所述图片显示方法包括:
步骤S10,在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸;步骤S20,若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片;步骤S30,将调用的预存图片传输至终端界面进行显示。
在本实施例中,所述图片显示方法应用于服务器中,所述服务器如图1所示的服务器。所述服务器内设有磁盘,该磁盘用于存储图片。
以下是本实施例中实现图片显示的具体步骤:
步骤S10,在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸;
在本实施例中,所述图片显示指令的触发方式包括:
a、终端(前端设备)需要在显示界面加载图片时,触发图片显示指令,并将图片显示指令发送给服务器。
b、终端在图片显示控件中接收到触摸操作时,触发图片显示指令,并将图片显示指令发送给服务器,其中,所述触摸操作包括但不限于点击触摸操作、长按触摸操作或滑动触摸操作。
当服务器接收到终端发送的图片显示指令,服务器先确定所述图片显示指令对应的待显示图片,具体地,服务器从所述图片显示指令中提取出图片标识,基于提取的图片标识确定待显示图片,所述图片标识如0021.jpg,具体根据实际情况设定,此处不做限定。
在确定待显示的图片之后,服务器进一步确定该图片需要显示的占位符尺寸。在本实施例中,所述服务器确定该图片需要显示的占位符尺寸,同样是根据图片显示指令确定,具体地,服务器查看该图片显示指令是否携带预设标志位信息,所述标志位信息可根据实际情况设定,若携带有预设标志位息,则认为该图片需要显示的占位符尺寸较大,已经达到预设阈值,若该图片显示指令未携带预设标志位息,则认为该图片需要显示的占位符尺寸较小,小于预设阈值。本实施例中,所述预设阈值同样不做限定,根据实际情况进行设置。
需要说明的是,终端发送图片显示指令至所述服务器之前,先确定要请求的图片大小,当该终端请求的是占位符尺寸大于预设尺寸的图片时,终端设置预设标志位信息,如1,当该终端请求的占位符尺寸小于或等于所述预设尺寸的图片时,终端不设置标志位信息。而终端确定图片的占位符尺寸,是根据用户在显示界面中的操作确定的,本实施例中,可优选终端原本待显示的图片都是小图片,若用户没有执行触摸操作(包括点击、长按或滑动操作),则表示终端只要加载小图片进行显示即可;当用户双击显示界面中的该图片所在的区域时,表示要终端加载大图片。因此,当终端未接收到触摸操作时,说明当前只要加载小图片,那么终端无须在图片显示指令中添加预设标志位信息,直接添加图片标识即可发送给服务器。
步骤S20,若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片;
当服务器确定待显示的图片需要显示的占位符尺寸之后,若检测到需要显示的占位符尺寸小于预设阈值,则所述服务器从磁盘中调用预存图片。具体地,具体地,所述步骤S20的实施方式包括:
1)方式一、参照图3,所述步骤S20包括:
步骤S21,若需要显示的占位符尺寸小于预设阈值,则确定待显示的图片对应的图片类型是否为预设类型;
步骤S22,在图片类型不为预设类型时,从磁盘中调用待显示图片关联的压缩图片。
在本实施方式中,在需要显示的占位符尺寸小于预设阈值时,先确定待显示的图片对应的图片类型是否为预设类型,具体地,参照图4,所述步骤S21包括:
步骤S211,对待显示的图片中的图文信息进行识别,以确定待显示的图片中图文信息所在的位置;
步骤S212,获取***预存图片;
步骤S213,将待显示的图片与***预存图片进行比较,以判断待显示的图片中图文信息所在的位置与***预存图片中的图文信息所在位置是否相同;
步骤S214,若相同,认为待显示的图片对应的图片类型为预设类型。
也就是说,服务器在确定待显示的图片之后,先对待显示的图片中的图文信息进行识别,以确定图文信息所在的位置,在确定图文信息所在的位置之后,获取***预存图片,本实施例中,***预存图片是事先存储到服务器***中的图片,在获取到该***预存图片之后,服务器再将待显示的图片与该***预存图片进行比较,以判断待显示的图片中图文信息所在的位置与该***预存图片中图文信息所在位置是否相同。本实施例中,所述***预存图文信息具有特定图文组合,因此,预设类型的图片即包含特定图文组合的图片。
当该待显示图片中图文信息所在的位置与该***预存图片中图文信息所在位置相同的情况下,才认为待显示的图片对应的图片类型为预设类型,那么,当该待显示图片中图文信息所在的位置与该***预存图片中图文信息所在位置不同时,认为该待显示的图片的类型不为预设类型,本申请实施例中,所述预设类型优选为:身份证图片类型。
在确定待显示图片的图片类型不为预设类型时,此时,服务器从可从磁盘中调用待显示图片关联的压缩图片。即,本实施方式中,在确定待显示的图片的图片类型不为身份证图片类型时,此时,***磁盘中提取出压缩图片,后续可将该压缩图片发送至终端进行显示。
本实施方式中,实现了终端查看小图片时,由服务器从磁盘中提取出该事先压缩的图片,以便后续进行显示。由于事先已经对图片进行压缩,后续查看时,直接提取,减少了图片显示时所需要花费的服务器资源。
2)方式二、参照图5,所述步骤S21之后,所述步骤S20还包括:
步骤S23,在图片类型为预设类型时,从磁盘中调用预存通用图片。
在本实施方式中,在确定该待显示图片的图片类型之后,若检测到该图片类型为预设类型,如身份证图片类型时,由于所有的身份证图片类型基本上都是一致的,此时,若是仅仅在终端中显示小图,那么所述服务器可在磁盘中提取出预存通用图片,以便后续将该预存通用图片发送至终端进行显示,所述预存通用图片跟该预设类型的图片保持一致,即该预存通用图片也设置为身份证图片。
在本实施方式中,实现了终端查看小图片,且该图片是身份证图片时,由服务器加载磁盘预存通用图片进行显示即可,事先也无须进行压缩,节省了图片存储时所花费的流量。
通过上述两种实施方式,提取出待显示图片的压缩图片,或者是预存通用图片,将提取的压缩图片和通用图片都作为预存图片,便于后续显示。
步骤S30,将调用的预存图片传输至终端界面进行显示。
当服务器提取出预存图片之后,即可将提取的预存图片传输至终端进行显示,本实施例中,所述服务器接收终端发送的图片显示指令,以及将提取的预存图片传输至终端,优选都是通过消息队列实现,即通过消息队列接收前端发送的图片显示指令,再通过该消息队列将提取的预存图片传输至终端。由于消息队列具有先进先出的特点,使得图片的显示过程,是按照顺序依次执行,保证图片显示过程更加有序。此外,通过消息队列实现服务器和终端的通信过程,防止多个终端同时发送图片显示指令时,服务器要响应多个指令导致***资源超负荷。
本实施例提出的技术方案,在接收到终端发送的图片显示指令时,先基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸,若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片,并将调用的预存图片传输至终端界面进行显示。实现了终端界面显示图片时,若要显示的图片的占位符尺寸较小,只要从磁盘中获取事先存储的图片进行显示即可,无需对图片执行压缩操作,降低了服务器资源的消耗。
进一步地,基于第一实施例提出本申请图片显示方法的第二实施例。
图片显示方法的第二实施例与图片显示方法的第一实施例的区别在于,在本实施例中,所述步骤S214包括:
步骤A,若相同,判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配;
步骤B,若匹配,认为待显示的图片对应的图片类型为预设类型。
即,在本实施例中,在检测到待显示图片中图文信息所在的位置与该***预存图片中图文信息所在位置相同的情况下,为了提高图文信息判断的准确性,所述服务器进一步判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配,具体地,所述步骤A包括:
步骤A1,将待显示的图片与***预存图片中相同位置的文字进行比较,以及将相同位置的图案进行比较;
步骤A2,在相同位置的文字匹配率达到第一预设值,在相同位置的图案相似度达到第二预设值时,认为图文信息的内容匹配。
即,先将待显示的图片与***预存图片中相同位置的文字进行比较,并将待显示的图片与***预存图片中相同位置的图案进行比较,当相同位置的文字匹配率达到第一预设值,并且相同位置的图案相似度达到第二预设值时,认为该图文信息的内容匹配。本实施例中,所述第一预设值和第二预设值可以为不同的值,也可以为相同的值,具体的数值根据实际情况设定,此处不做限定。
当确定待显示的图片中图文信息的内容与***预存图片中的图文信息的内容匹配之后,此时可认为待显示的图片对应的图片类型为预设类型。
在本实施例中,在待显示图片中图文信息所在的位置与该***预存图片中图文信息所在位置相同的情况下,进一步地对两个图片中图文信息的内容进行比较,并在图文信息的内容也匹配的情况下,才认为待显示的图片对应的图片类型为预设类型,提高了待显示图片中图片类型识别的准确性。
进一步地,基于第一或第二实施例提出本申请图片显示方法的第三实施例。
图片显示方法的第三实施例与图片显示方法的第一或第二实施例的区别在于,所述步骤S10之前,所述方法还包括:
步骤C,在接收到终端上传的原图时,将原图存储到磁盘中;
步骤D,确定原图的类型是否为所述预设类型;
步骤E,在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
步骤F,在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
在本实施例中,在进行图片显示之前,若检测到终端上传原图,先获取终端上传的原图,然后将获取的原图存储到磁盘中。接着,分析该原图的图片类型,本实施例中,分析该原图的图片类型已经在上文的第一和第二实施例中详述,此处不再赘述。
若该原图的图片类型为预设类型,所述预设类型即上文提及的身份证图片类型,此时,所述服务器获取通用图片,并将获取的通用图片存储至磁盘中进行存储。
在该原图的类型不为预设类型时,此时对原图进行复制,然后对复制的原图进行压缩,得到压缩图片,最终将该原图和压缩图片进行关联保存,以便后续查看小图片时,调用该原图关联的压缩图片进行显示。
在本实施例中,相当于是在显示图片之前,先在服务器的磁盘中上传原图并存储原图,并根据原图的类型执行相应的操作,后续终端要查看图片时,直接由服务器在磁盘中获取对应的图片进行显示即可,也就是说,后续终端要查看图片时,无须服务器再执行压缩操作,节省了服务器资源,减小了服务器的处理压力,从而提高服务器处理的速度。
进一步地,基于第一至第三实施例提出本申请图片显示方法的第四实施例。
图片显示方法的第四实施例与图片显示方法的第一至第三实施例的区别在于,所述步骤S10之后,所述方法还包括:
步骤G,若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
在本实施例中,在确定待显示的图片需要显示的占位符尺寸之后,若检测到需要显示的占位符尺寸达到了所述预设阈值,说明终端当前要查看的图片不是小图片,而是原图,此时,所述服务器从磁盘中调用待显示的图片对应的原图,并将调用的原图传输至终端界面进行显示即可。
在本实施例中,相当于是终端请求原图时,服务器直接反馈原图,通过磁盘存储各种图片,以根据终端的实际请求反馈相应的图片,使得图片查看更加灵活。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有图片显示程序,所述图片显示程序被处理器执行时实现如下操作:
在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸;
若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片;
将调用的预存图片传输至终端界面进行显示。
进一步地,所述若需要显示的占位符尺寸小于预设阈值,所述图片显示程序被处理器执行时,还实现从磁盘中调用预存图片的操作:
若需要显示的占位符尺寸小于预设阈值,则确定待显示的图片对应的图片类型是否为预设类型;
在图片类型不为预设类型时,从磁盘中调用待显示图片关联的压缩图片。
进一步地,所述确定待显示的图片对应的图片类型是否为预设类型的步骤之后,所述图片显示程序被处理器执行时,还实现从磁盘中调用预存图片的操作:
在图片类型为预设类型时,从磁盘中调用预存通用图片。
进一步地,所述图片显示程序被处理器执行时,还实现确定待显示的图片对应的图片类型的操作:
对待显示的图片中的图文信息进行识别,以确定待显示的图片中图文信息所在的位置;
获取***预存图片;
将待显示的图片与***预存图片进行比较,以判断待显示的图片中图文信息所在的位置与***预存图片中的图文信息所在位置是否相同;
若相同,认为待显示的图片对应的图片类型为预设类型。
进一步地,所述图片显示程序被处理器执行时,还实现若相同,认为待显示的图片对应的图片类型为预设类型的操作:
若相同,判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配;
若匹配,认为待显示的图片对应的图片类型为预设类型。
进一步地,所述图片显示程序被处理器执行时,还实现判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配的操作:
将待显示的图片与***预存图片中相同位置的文字进行比较,以及将相同位置的图案进行比较;
在相同位置的文字匹配率达到第一预设值,在相同位置的图案相似度达到第二预设值时,认为图文信息的内容匹配。
进一步地,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之前,所述图片显示程序被处理器执行时,还实现以下操作:
在接收到终端上传的原图时,将原图存储到磁盘中;
确定原图的类型是否为所述预设类型;
在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
进一步地,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之后,所述图片显示程序被处理器执行时,还实现以下操作:
若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
本申请提出的技术方案,在接收到终端发送的图片显示指令时,先基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸,若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片,并将调用的预存图片传输至终端界面进行显示。实现了终端界面显示图片时,若要显示的图片的占位符尺寸较小,只要从磁盘中获取事先存储的图片进行显示即可,无需对图片执行压缩操作,降低了服务器资源的消耗。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其它要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种图片显示方法,其特征在于,应用于服务器中,所述图片显示方法包括:
    在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸;
    若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片;
    将调用的预存图片传输至终端界面进行显示。
  2. 如权利要求1所述的图片显示方法,其特征在于,所述若需要显示的占位符尺寸小于预设阈值,则从磁盘中调用预存图片的步骤包括:
    若需要显示的占位符尺寸小于预设阈值,则确定待显示的图片对应的图片类型是否为预设类型;
    在图片类型不为预设类型时,从磁盘中调用待显示图片关联的压缩图片。
  3. 如权利要求2所述的图片显示方法,其特征在于,所述确定待显示的图片对应的图片类型是否为预设类型的步骤之后,所述从磁盘中调用预存图片的步骤还包括:
    在图片类型为预设类型时,从磁盘中调用预存通用图片。
  4. 如权利要求2所述的图片显示方法,其特征在于,所述确定待显示的图片对应的图片类型的步骤包括:
    对待显示的图片中的图文信息进行识别,以确定待显示的图片中图文信息所在的位置;
    获取***预存图片;
    将待显示的图片与***预存图片进行比较,以判断待显示的图片中图文信息所在的位置与***预存图片中的图文信息所在位置是否相同;
    若相同,认为待显示的图片对应的图片类型为预设类型。
  5. 如权利要求4所述的图片显示方法,其特征在于,所述若相同,认为待显示的图片对应的图片类型为预设类型的步骤包括:
    若相同,判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配;
    若匹配,认为待显示的图片对应的图片类型为预设类型。
  6. 如权利要求5所述的图片显示方法,其特征在于,所述判断待显示的图片中图文信息的内容与***预存图片中的图文信息的内容是否匹配的步骤包括:
    将待显示的图片与***预存图片中相同位置的文字进行比较,以及将相同位置的图案进行比较;
    在相同位置的文字匹配率达到第一预设值,在相同位置的图案相似度达到第二预设值时,认为图文信息的内容匹配。
  7. 如权利要求2所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之前,所述方法还包括:
    在接收到终端上传的原图时,将原图存储到磁盘中;
    确定原图的类型是否为所述预设类型;
    在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
    在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
  8. 如权利要求3所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之前,所述方法还包括:
    在接收到终端上传的原图时,将原图存储到磁盘中;
    确定原图的类型是否为所述预设类型;
    在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
    在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
  9. 如权利要求4所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之前,所述方法还包括:
    在接收到终端上传的原图时,将原图存储到磁盘中;
    确定原图的类型是否为所述预设类型;
    在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
    在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
  10. 如权利要求5所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之前,所述方法还包括:
    在接收到终端上传的原图时,将原图存储到磁盘中;
    确定原图的类型是否为所述预设类型;
    在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
    在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
  11. 如权利要求6所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之前,所述方法还包括:
    在接收到终端上传的原图时,将原图存储到磁盘中;
    确定原图的类型是否为所述预设类型;
    在原图为所述预设类型时,上传通用图片至磁盘中,并存储所述通用图片;
    在原图不为所述预设类型时,复制原图,并对复制的原图进行压缩,以得到压缩图片,将所述原图和压缩图片进行关联保存。
  12. 如权利要求7所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之后,所述方法还包括:
    若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
  13. 如权利要求8所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之后,所述方法还包括:
    若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
  14. 如权利要求9所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之后,所述方法还包括:
    若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
  15. 如权利要求10所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之后,所述方法还包括:
    若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
  16. 如权利要求11所述的图片显示方法,其特征在于,所述在接收到终端发送的图片显示指令时,基于所述图片显示指令确定待显示的图片需要显示的占位符尺寸的步骤之后,所述方法还包括:
    若需要显示的占位符尺寸达到所述预设阈值,则从磁盘中调用所述图片的原图,并将调用的原图传输至终端界面进行显示。
  17. 一种服务器,其特征在于,所述服务器包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的图片显示程序,所述图片显示程序被所述处理器执行时实现如权利要求1所述的图片显示方法的步骤。
  18. 如权利要求17所述的服务器,其特征在于,所述图片显示程序被所述处理器执行时,还实现如权利要求16所述的图片显示方法的步骤。
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有图片显示程序,所述图片显示程序被处理器执行时实现如权利要求1所述的图片显示方法的步骤。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述图片显示程序被处理器执行时,还实现如权利要求16所述的图片显示方法的步骤。
PCT/CN2017/111935 2017-07-31 2017-11-20 图片显示方法、服务器和计算机可读存储介质 WO2019024332A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710645023.1 2017-07-31
CN201710645023.1A CN107679063B (zh) 2017-07-31 2017-07-31 图片显示方法、服务器和计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019024332A1 true WO2019024332A1 (zh) 2019-02-07

Family

ID=61134363

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/111935 WO2019024332A1 (zh) 2017-07-31 2017-11-20 图片显示方法、服务器和计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN107679063B (zh)
WO (1) WO2019024332A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108549708B (zh) * 2018-04-19 2021-08-31 聊城市中芯智能科技有限公司 一种图文匹配方法及***
CN111767492B (zh) * 2020-06-30 2023-04-11 中国平安财产保险股份有限公司 图片加载方法、装置、计算机设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100185987A1 (en) * 2009-01-21 2010-07-22 Samsung Electronics Co., Ltd. Image management method and system using thumbnail in dlna system
CN102043799A (zh) * 2009-10-14 2011-05-04 上海通路快建网络服务外包有限公司 图片放大方法
CN102387125A (zh) * 2010-09-02 2012-03-21 腾讯科技(深圳)有限公司 访问微博的方法和***及微博网站图片发送方法和***
CN102841896A (zh) * 2011-06-22 2012-12-26 腾讯科技(深圳)有限公司 一种移动终端图文信息显示的方法、***及移动终端
CN103699566A (zh) * 2013-11-01 2014-04-02 北京奇虎科技有限公司 一种图片实时切图装置及方法
CN104243923A (zh) * 2014-09-09 2014-12-24 苏州科达科技股份有限公司 一种图片处理及图片预览的方法及***

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103399802B (zh) * 2013-07-30 2018-02-16 Tcl集团股份有限公司 一种图片预加载方法以及装置
JP6507577B2 (ja) * 2014-11-06 2019-05-08 コニカミノルタ株式会社 画像形成装置及び画像データの転送方法
CN104462491A (zh) * 2014-12-22 2015-03-25 上海斐讯数据通信技术有限公司 上传图片的方法、***及相应的服务器
CN106713689A (zh) * 2015-11-13 2017-05-24 北京奇虎科技有限公司 一种图片上传方法和装置
CN106599023A (zh) * 2016-11-01 2017-04-26 乐视控股(北京)有限公司 一种图片显示的优化方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100185987A1 (en) * 2009-01-21 2010-07-22 Samsung Electronics Co., Ltd. Image management method and system using thumbnail in dlna system
CN102043799A (zh) * 2009-10-14 2011-05-04 上海通路快建网络服务外包有限公司 图片放大方法
CN102387125A (zh) * 2010-09-02 2012-03-21 腾讯科技(深圳)有限公司 访问微博的方法和***及微博网站图片发送方法和***
CN102841896A (zh) * 2011-06-22 2012-12-26 腾讯科技(深圳)有限公司 一种移动终端图文信息显示的方法、***及移动终端
CN103699566A (zh) * 2013-11-01 2014-04-02 北京奇虎科技有限公司 一种图片实时切图装置及方法
CN104243923A (zh) * 2014-09-09 2014-12-24 苏州科达科技股份有限公司 一种图片处理及图片预览的方法及***

Also Published As

Publication number Publication date
CN107679063A (zh) 2018-02-09
CN107679063B (zh) 2020-05-22

Similar Documents

Publication Publication Date Title
WO2019019374A1 (zh) 智能语音设备控制家电的方法、装置及***
WO2017201899A1 (zh) 连接蓝牙设备的方法及装置
WO2019019378A1 (zh) 业务处理方法、装置、适配器及计算机可读存储介质
WO2019051890A1 (zh) 终端控制方法、装置及计算机可读存储介质
WO2018227887A1 (zh) 视频广告投放、生成方法、装置、服务器及可读存储介质
WO2019114269A1 (zh) 一种节目续播方法、电视设备及计算机可读存储介质
WO2015139639A1 (en) Method and apparatus for displaying application icons on terminal
WO2018233367A1 (zh) 立案方法、装置、终端和计算机可读存储介质
WO2018166236A1 (zh) 理赔账单识别方法、装置、设备及计算机可读存储介质
WO2017063369A1 (zh) 无线直连连接方法及装置
WO2019062194A1 (zh) 家电设备及其控制方法、***及计算机可读存储介质
WO2018000856A1 (zh) 一种实现SDN Overlay网络报文转发的方法、终端、设备及计算机可读存储介质
WO2018032688A1 (zh) 一种终端设备播放开机视频的控制方法及装置
WO2019024336A1 (zh) 数据查询方法、装置及计算机可读存储介质
WO2019051895A1 (zh) 终端控制方法、装置及存储介质
WO2019019351A1 (zh) 用户行为数据处理方法、装置及计算机可读存储介质
WO2018149191A1 (zh) 保单核保的方法、装置、设备及计算机可读存储介质
WO2019071762A1 (zh) 楼层位置定位方法、***、服务器和计算机可读存储介质
WO2019085323A1 (zh) Epg信息扩充方法、装置及计算机可读存储介质
WO2017088437A1 (zh) 智能电视控制终端摄像头切换方法及装置
WO2019051934A1 (zh) 业务人员考核方法、考核平台和计算机可读存储介质
WO2017148028A1 (zh) 基于智能电视的远端网络连接方法和***
WO2019024332A1 (zh) 图片显示方法、服务器和计算机可读存储介质
WO2019019329A1 (zh) 一种网络性能优化方法、***及计算机可读存储介质
WO2017113596A1 (zh) 单独听控制方法及***、移动终端及智能电视

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21/10/2020)

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

Ref document number: 17919830

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17919830

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17919830

Country of ref document: EP

Kind code of ref document: A1