Movatterモバイル変換


[0]ホーム

URL:


CN111324586A - A cache-based picture display method, device, electronic device and medium - Google Patents

A cache-based picture display method, device, electronic device and medium
Download PDF

Info

Publication number
CN111324586A
CN111324586ACN201811536775.5ACN201811536775ACN111324586ACN 111324586 ACN111324586 ACN 111324586ACN 201811536775 ACN201811536775 ACN 201811536775ACN 111324586 ACN111324586 ACN 111324586A
Authority
CN
China
Prior art keywords
picture
data stream
cache
key
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811536775.5A
Other languages
Chinese (zh)
Other versions
CN111324586B (en
Inventor
周高锋
邓冬
史俊峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co LtdfiledCriticalChina Mobile Communications Group Co Ltd
Priority to CN201811536775.5ApriorityCriticalpatent/CN111324586B/en
Publication of CN111324586ApublicationCriticalpatent/CN111324586A/en
Application grantedgrantedCritical
Publication of CN111324586BpublicationCriticalpatent/CN111324586B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种基于缓存的图片显示方法、装置、电子设备及介质,所述方法包括:电子设备根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息,其中所述图片数据流头部的特征信息是根据所述图片上传服务器的时间戳生成的;根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成key;如果缓存中未保存有所述key对应的目标图片,向所述服务器获取所述图片的图片数据流,将所述图片数据流转换为图片,根据所述key在缓存中保存所述图片,并显示所述图片。提供了一种避免网络流量浪费,保证图片显示准确性的基于缓存的图片显示方案。

Figure 201811536775

The invention discloses a cache-based picture display method, device, electronic device and medium. The method includes: the electronic device obtains, according to the network address of the picture to be displayed, the feature information of the picture data stream header of the picture from the server , wherein the feature information of the picture data stream header is generated according to the time stamp of the picture uploading server; according to the time stamp corresponding to the feature information and the network address spliced into a string and a preset hash Algorithm, generate a key; if the target image corresponding to the key is not stored in the cache, obtain the image data stream of the image from the server, convert the image data stream into an image, and save it in the cache according to the key the picture, and display the picture. Provides a cache-based image display scheme that avoids wasting network traffic and ensures the accuracy of image display.

Figure 201811536775

Description

Translated fromChinese
一种基于缓存的图片显示方法、装置、电子设备及介质A cache-based picture display method, device, electronic device and medium

技术领域technical field

本发明涉及图片缓存技术领域,尤其涉及一种基于缓存的图片显示方法、装置、电子设备及介质。The present invention relates to the technical field of picture caching, and in particular, to a caching-based picture display method, device, electronic device and medium.

背景技术Background technique

应用程序(Application,APP)在电子设备中运行时,为了提高用户界面(UserInterface,UI)响应速度、用户体验、减少网络流量使用,通常使用图片缓存技术缓存图片。具体的,当电子设备首次加载图片时,电子设备中没有缓存该图片,电子设备需要从网络中加载该图片,加载完成后,将该图片保存到缓存中,以便再次使用该图片时,无需再次从网络中加载,达到减少网络流量使用、提高UI响应速度等目的。When an application (Application, APP) runs in an electronic device, in order to improve the response speed of a user interface (User Interface, UI), user experience, and reduce network traffic usage, a picture caching technology is usually used to cache pictures. Specifically, when the electronic device loads the image for the first time, the image is not cached in the electronic device, and the electronic device needs to load the image from the network. Load from the network to reduce network traffic usage and improve UI response speed.

目前,图片在缓存中通常以(key,value)的形式保存,其中哈希(key)为对图片的名称、网络地址等标识进行哈希运算后的哈希值,值(value)为图片的真实数据。然而,在实际使用过程中,会出现图片的网络地址不变,但图片内容发生变化的情况,这种情况下根据图片的标识生成的key不发生变化,显示缓存中与该网络地址存在映射关系的key对应的图片,会出现一直为旧图的情况,影响了用户体验。At present, pictures are usually stored in the cache in the form of (key, value), where the hash (key) is the hash value after hashing the name, network address and other identifiers of the picture, and the value (value) is the real data. However, in the actual use process, the network address of the picture will remain unchanged, but the content of the picture will change. In this case, the key generated according to the identification of the picture will not change, indicating that there is a mapping relationship between the cache and the network address. The image corresponding to the key of , will always be the old image, which affects the user experience.

现有技术中,通常采用设置缓存过期时间来自动更新缓存的方式,来防止缓存的图片一直为旧图的情况,但是这种方式缓存过期时间无法准确设置,并且自动更新时图片时,未发生变化的图片也会重新更新,造成了巨大的流量浪费,也降低了缓存存在的意义,因此需要解决现有技术中存在的网络流量资源浪费、图片显示为旧图不准确的问题。In the prior art, the cache expiration time is usually set to automatically update the cache to prevent the cached image from being the old image, but the cache expiration time cannot be set accurately in this way, and when the image is automatically updated, it does not occur. The changed pictures will also be updated again, causing huge traffic waste and reducing the meaning of cache existence. Therefore, it is necessary to solve the problems in the prior art that the network traffic resources are wasted and the pictures are displayed as old pictures inaccurately.

发明内容SUMMARY OF THE INVENTION

本发明提供一种基于缓存的图片显示方法、装置、电子设备及介质,用以解决现有技术中存在网络流量浪费、图片显示不准确的问题。The present invention provides a cache-based picture display method, device, electronic device and medium, which are used to solve the problems of wasted network traffic and inaccurate picture display in the prior art.

第一方面,本发明公开了一种基于缓存的图片显示方法,所述方法包括:In a first aspect, the present invention discloses a cache-based image display method, the method comprising:

根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息,其中所述图片数据流头部的特征信息是根据所述图片上传服务器的时间戳生成的;Obtain the feature information of the picture data stream header of the picture from the server according to the network address of the picture to be displayed, wherein the feature information of the picture data stream header is generated according to the timestamp of the picture uploading server;

根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成哈希值key;Generate a hash value key according to a string formed by splicing the timestamp corresponding to the feature information and the network address and a preset hash algorithm;

如果缓存中未保存有所述key对应的目标图片,向所述服务器获取所述图片的图片数据流,将所述图片数据流转换为图片,根据所述key在缓存中保存所述图片,并显示所述图片。If the target image corresponding to the key is not stored in the cache, obtain the image data stream of the image from the server, convert the image data stream into an image, save the image in the cache according to the key, and The picture is displayed.

在一个可选的设计中,根据所述图片上传服务器的时间戳生成所述图片数据流头部的特征信息包括:In an optional design, generating the feature information of the picture data stream header according to the timestamp of the picture uploading server includes:

将所述图片转换为图片数据流,将当前时间戳转换为设定字节的特征信息添加至所述图片数据流的头部,并将添加特征信息的图片数据流上传至所述服务器。Converting the picture into a picture data stream, converting the current timestamp into a set byte of feature information, and adding it to the header of the picture data stream, and uploading the picture data stream with the feature information added to the server.

在一个可选的设计中,所述方法还包括:In an optional design, the method further includes:

如果缓存中保存有所述key对应的目标图片,获取缓存中保存的所述目标图片并显示。If the target image corresponding to the key is stored in the cache, the target image stored in the cache is acquired and displayed.

在一个可选的设计中,所述根据所述key在缓存中保存所述图片之前,所述方法还包括:In an optional design, before saving the picture in the cache according to the key, the method further includes:

建立所述网络地址与所述key的映射关系。A mapping relationship between the network address and the key is established.

在一个可选的设计中,所述根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息之前,所述方法还包括:In an optional design, before obtaining the feature information of the picture data stream header of the picture from the server according to the network address of the picture to be displayed, the method further includes:

判断是否能够连接网络;Determine whether the network can be connected;

如果是,进行根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息的步骤;If yes, carry out the step of obtaining the feature information of the picture data stream header of the picture from the server according to the network address of the picture to be displayed;

如果否,判断缓存中是否存在与所述网络地址存在映射关系的目标key,如果判断结果为是,获取缓存中所述目标key对应的图片并显示,如果判断结果为否,显示错误图片的提示信息。If no, judge whether there is a target key that has a mapping relationship with the network address in the cache, if the judgement result is yes, obtain the picture corresponding to the target key in the cache and display it, if the judgement result is no, display the prompt of the wrong picture information.

在一个可选的设计中,所述根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成key之前,所述方法还包括:In an optional design, before generating the key, the method further includes:

校验所述特征信息的完整性,如果校验通过,进行根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成key的步骤。The integrity of the feature information is verified, and if the verification is passed, the step of generating a key is performed according to a string formed by splicing the timestamp corresponding to the feature information and the network address and a preset hash algorithm.

第二方面,本发明公开了一种基于缓存的图片显示装置,所述装置包括:In a second aspect, the present invention discloses a cache-based picture display device, the device comprising:

获取模块,用于根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息,其中所述图片数据流头部的特征信息是根据所述图片上传服务器的时间戳生成的;The obtaining module is used to obtain the feature information of the picture data stream header of the picture from the server according to the network address of the picture to be displayed, wherein the feature information of the picture data stream header is according to the timestamp of the picture uploading server Generated;

生成模块,用于根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成哈希值key;a generating module, configured to generate a hash value key according to a string formed by splicing a timestamp corresponding to the feature information and the network address and a preset hash algorithm;

缓存显示模块,用于如果缓存中未保存有所述key对应的目标图片,向所述服务器获取所述图片的图片数据流,将所述图片数据流转换为图片,根据所述key在缓存中保存所述图片,并显示所述图片。The cache display module is used to obtain the image data stream of the image from the server if the target image corresponding to the key is not stored in the cache, convert the image data stream into an image, and store the image in the cache according to the key. The picture is saved, and the picture is displayed.

在一个可选的设计中,根据所述图片上传服务器的时间戳生成所述图片数据流头部的特征信息包括:In an optional design, generating the feature information of the picture data stream header according to the timestamp of the picture uploading server includes:

将所述图片转换为图片数据流,将当前时间戳转换为设定字节的特征信息添加至所述图片数据流的头部,并将添加特征信息的图片数据流上传至所述服务器。Converting the picture into a picture data stream, converting the current timestamp into a set byte of feature information, and adding it to the header of the picture data stream, and uploading the picture data stream with the feature information added to the server.

在一个可选的设计中,所述缓存显示模块,还用于如果缓存中保存有所述key对应的目标图片,获取缓存中保存的所述目标图片并显示。In an optional design, the cache display module is further configured to acquire and display the target image stored in the cache if the target image corresponding to the key is stored in the cache.

在一个可选的设计中,所述缓存显示模块,还用于建立所述网络地址与所述key的映射关系。In an optional design, the cache display module is further configured to establish a mapping relationship between the network address and the key.

在一个可选的设计中,所述装置还包括:In an optional design, the device further includes:

判断模块,用于判断是否能够连接网络;如果是,触发获取模块,如果否,判断缓存中是否存在与所述网络地址存在映射关系的目标key,如果判断结果为是,获取缓存中所述目标key对应的图片并显示,如果判断结果为否,显示错误图片的提示信息。The judgment module is used to judge whether the network can be connected; if so, trigger the acquisition module, if not, judge whether there is a target key that has a mapping relationship with the network address in the cache, and if the judgment result is yes, obtain the target key in the cache The picture corresponding to the key is displayed, and if the judgment result is no, the prompt information of the wrong picture is displayed.

在一个可选的设计中,所述装置还包括:In an optional design, the device further includes:

校验模块,用于校验所述特征信息的完整性,如果校验通过,触发生成模块。The verification module is used to verify the integrity of the feature information, and if the verification is passed, the generation module is triggered.

第三方面,本发明公开了一种电子设备,包括:存储器、处理器和收发机;In a third aspect, the present invention discloses an electronic device, comprising: a memory, a processor and a transceiver;

所述处理器,用于读取存储器中的程序,执行下列过程:根据待显示图片的网络地址,通过收发机向服务器获取所述图片的图片数据流头部的特征信息,其中所述图片数据流头部的特征信息是根据所述图片上传服务器的时间戳生成的;根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成哈希值key;如果缓存中未保存有所述key对应的目标图片,向所述服务器获取所述图片的图片数据流,将所述图片数据流转换为图片,根据所述key在缓存中保存所述图片,并显示所述图片。The processor is used to read the program in the memory, and execute the following process: according to the network address of the picture to be displayed, obtain the feature information of the picture data stream header of the picture from the server through the transceiver, wherein the picture data The feature information of the stream header is generated according to the timestamp of the image uploading server; the hash value is generated according to the string formed by splicing the timestamp corresponding to the feature information and the network address and the preset hash algorithm key; if the target image corresponding to the key is not stored in the cache, obtain the image data stream of the image from the server, convert the image data stream into an image, and save the image in the cache according to the key , and display the picture.

在一个可选的设计中,根据所述图片上传服务器的时间戳生成所述图片数据流头部的特征信息包括:In an optional design, generating the feature information of the picture data stream header according to the timestamp of the picture uploading server includes:

将所述图片转换为图片数据流,将当前时间戳转换为设定字节的特征信息添加至所述图片数据流的头部,并将添加特征信息的图片数据流上传至所述服务器。Converting the picture into a picture data stream, converting the current timestamp into a set byte of feature information, and adding it to the header of the picture data stream, and uploading the picture data stream with the feature information added to the server.

在一个可选的设计中,所述处理器,还用于如果缓存中保存有所述key对应的目标图片,获取缓存中保存的所述目标图片并显示。In an optional design, the processor is further configured to acquire and display the target image stored in the cache if the target image corresponding to the key is stored in the cache.

在一个可选的设计中,所述处理器,还用于建立所述网络地址与所述key的映射关系。In an optional design, the processor is further configured to establish a mapping relationship between the network address and the key.

在一个可选的设计中,所述处理器,还用于判断是否能够连接网络;如果是,进行根据待显示图片的网络地址,通过收发机向服务器获取所述图片的图片数据流头部的特征信息的步骤,如果否,判断缓存中是否存在与所述网络地址存在映射关系的目标key,如果判断结果为是,获取缓存中所述目标key对应的图片并显示,如果判断结果为否,显示错误图片的提示信息。In an optional design, the processor is also used to determine whether the network can be connected; if so, perform the process of obtaining the picture data stream header of the picture from the server through the transceiver according to the network address of the picture to be displayed. The step of feature information, if no, judge whether there is a target key that has a mapping relationship with the network address in the cache, if the judgment result is yes, obtain the picture corresponding to the target key in the cache and display, if the judgment result is no, Displays a message for the wrong picture.

在一个可选的设计中,所述处理器,还用于校验所述特征信息的完整性,如果校验通过进行后续步骤。In an optional design, the processor is further configured to verify the integrity of the feature information, and if the verification is passed, the subsequent steps are performed.

第四方面,本发明公开了一种电子设备,包括:处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;In a fourth aspect, the present invention discloses an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

所述存储器中存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行上述第一方面或第一方面的任一种可选的设计中所述的方法。A computer program is stored in the memory, and when the program is executed by the processor, the processor causes the processor to execute the method described in the first aspect or any optional design of the first aspect.

第五方面,本发明公开了一种计算机可读存储介质,其存储有可由电子设备执行的计算机程序,当所述程序在所述电子设备上运行时,使得所述电子设备执行上述第一方面或第一方面的任一种可选的设计中所述的方法。In a fifth aspect, the present invention discloses a computer-readable storage medium, which stores a computer program executable by an electronic device, and when the program runs on the electronic device, causes the electronic device to execute the above-mentioned first aspect or the method described in any optional design of the first aspect.

第六方面,本发明公开了一种计算机程序产品,当电子设备读取并执行所述计算机程序产品时,使得所述电子设备执行上述第一方面或第一方面的任一种可选的设计中所述的方法。In a sixth aspect, the present invention discloses a computer program product that, when an electronic device reads and executes the computer program product, enables the electronic device to execute the first aspect or any optional design of the first aspect method described in.

本发明有益效果如下:The beneficial effects of the present invention are as follows:

由于在本发明实施例中,将根据上传时间戳生成的特征信息添加至图片数据流的头部,图片显示时根据特征信息和图片的网络地址生成的哈希值来判断缓存中是否存在该图片,进而判断是否需要对缓存进行更新,避免了现有技术在图片的网络地址不变图片内容发生变化时,无法识别图片内容发生变化导致显示图片为旧图的问题,提高了图片显示的准确性。同时仅需获取图片数据流头部的特征信息,即可确定图片的内容是否发生变化,避免了在图片未发生变化时,更新缓存中的图片,节省了网络流量。Because in the embodiment of the present invention, the feature information generated according to the upload time stamp is added to the header of the picture data stream, and when the picture is displayed, it is determined whether the picture exists in the cache according to the feature information and the hash value generated by the network address of the picture. , and then determine whether the cache needs to be updated, which avoids the problem that the existing technology cannot recognize the change of the picture content when the network address of the picture does not change and the picture content changes, and the displayed picture is an old picture, and the accuracy of the picture display is improved. . At the same time, only the feature information of the header of the picture data stream can be obtained to determine whether the content of the picture has changed, which avoids updating the picture in the cache when the picture does not change, and saves network traffic.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明实施例提供的一种基于缓存的图片显示过程示意图;FIG. 1 is a schematic diagram of a cache-based picture display process according to an embodiment of the present invention;

图2为本发明实施例提供的一种图片上传流程示意图;2 is a schematic diagram of a picture uploading process according to an embodiment of the present invention;

图3为本发明实施例提供的一种特征信息数据协议示意图;3 is a schematic diagram of a characteristic information data protocol provided by an embodiment of the present invention;

图4为本发明实施例提供的一种基于缓存的图片显示装置结构示意图;FIG. 4 is a schematic structural diagram of a cache-based picture display device according to an embodiment of the present invention;

图5为本发明实施例提供的一种电子设备的结构示意图之一;FIG. 5 is one of the schematic structural diagrams of an electronic device provided by an embodiment of the present invention;

图6为本发明实施例提供的一种电子设备的结构示意图之一。FIG. 6 is one of schematic structural diagrams of an electronic device according to an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

实施例1:Example 1:

图1为本发明实施例提供的一种基于缓存的图片显示过程示意图,该过程包括:FIG. 1 is a schematic diagram of a cache-based image display process provided by an embodiment of the present invention, and the process includes:

S101:根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息。S101: Obtain feature information of a picture data stream header of the picture from a server according to the network address of the picture to be displayed.

本发明实施例提供的基于缓存的图片显示方法应用于电子设备,该电子设备可以是手机、平板电脑、笔记本电脑、个人电脑等设备。The cache-based image display method provided by the embodiment of the present invention is applied to an electronic device, and the electronic device may be a mobile phone, a tablet computer, a notebook computer, a personal computer, or other devices.

具体的,在本发明实施例中,服务器中保存的图片的图片数据流头部包含图片的特征信息,其中图片的特征信息是根据图片上传服务器的时间戳生成的。Specifically, in the embodiment of the present invention, the image data stream header of the image stored in the server includes feature information of the image, wherein the feature information of the image is generated according to the timestamp of the image uploading server.

根据所述图片上传服务器的时间戳生成所述图片数据流头部的特征信息包括:The feature information of the image data stream header generated according to the timestamp of the image upload server includes:

将所述图片转换为图片数据流,将当前时间戳转换为设定字节的特征信息添加至所述图片数据流的头部,并将添加特征信息的图片数据流上传至所述服务器。Converting the picture into a picture data stream, converting the current timestamp into a set byte of feature information, and adding it to the header of the picture data stream, and uploading the picture data stream with the feature information added to the server.

具体的,图片上传设备将图片转换为图片数据流,并获取当前时间戳,生成包含当前时间戳的设定字节的特征信息,并将生成的特征信息添加至图片数据流的头部,生成包含特征信息的图片数据流,并将包含特征信息的图片数据流上传至服务器。Specifically, the picture uploading device converts the picture into a picture data stream, obtains the current timestamp, generates feature information containing the set bytes of the current timestamp, and adds the generated feature information to the header of the picture data stream to generate Image data stream containing feature information, and uploading the image data stream containing feature information to the server.

示例性的,参照图2所示的图片上传流程:(1)图片上传设备将待上传的图片转换为图片数据流(Br);(2)图片上传设备获取当前时间戳(ts),并根据设定的特征信息数据协议构建包含当前时间戳(ts)的设定字节的特征信息(Bh),本发明实施例以设定字节为32字节为例,设定的特征信息(Bh)数据协议如图3所示,特征信息依次由4字节(位)的时戳长度、t字节的时间戳及32-4-t字节的补位部分组成;(3)图片上传设备将生成的特征信息(Bh)添加至图片数据流(Br)的头部输出新的图片数据流(Bp),Bp=Bh+Br;(4)图片上传设备按照设备的编码方式,如Base64编码等,对图片数据流(Bp)进行编码,得到编码后的图片数据流(Bb),并将包含特征信息的图片数据流(Bb)上传至服务器。Exemplarily, referring to the picture uploading process shown in FIG. 2: (1) the picture uploading device converts the picture to be uploaded into a picture data stream (Br); (2) the picture uploading device obtains the current time stamp (ts), and according to The set feature information data protocol constructs feature information (Bh) that includes the set bytes of the current timestamp (ts). ) The data protocol is shown in Figure 3, and the feature information is sequentially composed of the timestamp length of 4 bytes (bits), the timestamp of t bytes and the complement part of 32-4-t bytes; (3) Picture uploading device Add the generated feature information (Bh) to the header of the picture data stream (Br) to output a new picture data stream (Bp), Bp=Bh+Br; (4) The picture uploading device follows the encoding method of the device, such as Base64 encoding etc., encode the picture data stream (Bp) to obtain the encoded picture data stream (Bb), and upload the picture data stream (Bb) including the feature information to the server.

具体的,在对上传至服务器的图片内容更新时,参照图3所示,图片上传设备将新图片转换为图片数据流后,会根据当前时间戳重新生成特征信息,将重新生成的特征信息添加至新图片转换的图片数据流中,并将包含重新生成的特征信息的图片数据流,上传至服务器中待更新图片的网络地址下,对待更新的图片进行更新,更新后的图片中特征信息发生了变化。Specifically, when updating the image content uploaded to the server, referring to FIG. 3 , after the image uploading device converts the new image into an image data stream, it will regenerate feature information according to the current timestamp, and add the regenerated feature information to the image data stream. To the image data stream converted from the new image, upload the image data stream containing the regenerated feature information to the network address of the image to be updated in the server, update the image to be updated, and the feature information in the updated image occurs. changed.

较佳的,在本发明实施例中图片的网络地址为统一资源定位符(UniformResourceLocator,URL),图片上传设备可以为手机、平板电脑、笔记本电脑等设备,可以与上述电子设备是同一设备,也可以不同,不再进行赘述。Preferably, in the embodiment of the present invention, the network address of the picture is a uniform resource locator (Uniform Resource Locator, URL), and the picture uploading device may be a mobile phone, a tablet computer, a notebook computer, etc., and may be the same device as the above-mentioned electronic device, or may be different, and details are not described again.

具体的,电子设备根据待显示的图片的网络地址,获取服务器在所述网络地址下保存的图片数据流头部的特征信息。如图3所示,以特征信息为32字节为例,电子设备仅获取服务器在网络地址下保存的图片数据流头部的32字节的特征信息,避免获取整个图片数据流,相对于图片动辄1M、3M等的数据量,可以忽略不计。Specifically, the electronic device acquires, according to the network address of the picture to be displayed, the feature information of the header of the picture data stream saved by the server under the network address. As shown in Figure 3, taking the feature information as 32 bytes as an example, the electronic device only obtains the 32-byte feature information in the header of the picture data stream saved by the server under the network address, so as to avoid obtaining the entire picture data stream. The amount of data, such as 1M, 3M, etc., can be ignored.

S102:根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成key。S102: Generate a key according to a string formed by splicing the timestamp corresponding to the feature information and the network address and a preset hash algorithm.

具体的,电子设备根据图片数据流头部的特征信息,获取特征信息对应的时间戳。以图3所示的特征信息为例,示例性的,获取特征信息对应的时间戳的过程为:电子设备首先获取特征信息前4个字节的内容,对前4个字节的内容进行解析,如进行Base64解码,获取整数类型的时间戳的长度(size),即图3所示的时间戳长度t。并从特征信息中获取第5个字节至第4+size个字节的内容,对第5个字节至第4+size个字节的内容进行解析,获取长整型的时间戳(ts)。Specifically, the electronic device obtains the timestamp corresponding to the feature information according to the feature information in the header of the picture data stream. Taking the feature information shown in FIG. 3 as an example, the exemplary process of obtaining the timestamp corresponding to the feature information is as follows: the electronic device first obtains the content of the first 4 bytes of the feature information, and parses the content of the first 4 bytes. , if Base64 decoding is performed, the length (size) of the timestamp of integer type is obtained, that is, the timestamp length t shown in FIG. 3 . And obtain the content from the 5th byte to the 4th+size byte from the feature information, parse the content from the 5th byte to the 4th+size byte, and obtain the long integer timestamp (ts ).

电子设备将获取的时间戳(ts)与待显示图片的网络地址拼接成字符串,并运行设定的哈希算法,如消息摘要算法(Message Digest Algorithm,MD5),生成拼接成的字符串的key。The electronic device splices the acquired time stamp (ts) and the network address of the picture to be displayed into a string, and runs a set hash algorithm, such as a message digest algorithm (MD5), to generate the spliced string. key.

可选的,所述根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成key之前,所述方法还包括:Optionally, before generating the key, the method further includes:

校验所述特征信息的完整性,如果校验通过,进行根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成key的步骤。The integrity of the feature information is verified, and if the verification is passed, the step of generating a key is performed according to a string formed by splicing the timestamp corresponding to the feature information and the network address and a preset hash algorithm.

较佳的,在本发明实施例中,电子设备获取图片数据流头部的特征信息后,校验特征信息的完整性,如校验特征信息是否为设定字节等,校验通过后,在进行后续生成key的步骤,以保证图片缓存和显示的准确性。Preferably, in this embodiment of the present invention, after the electronic device obtains the feature information in the header of the image data stream, it verifies the integrity of the feature information, such as checking whether the feature information is a set byte, etc. After the verification is passed, In the subsequent steps of key generation, to ensure the accuracy of image caching and display.

S103:判断缓存中是否保存有所述key对应的目标图片,如果是,进行S104,如果否,进行S105。S103: Determine whether the target image corresponding to the key is stored in the cache, and if so, go to S104, and if not, go to S105.

S104:获取缓存中保存的所述目标图片并显示。S104: Acquire and display the target picture saved in the cache.

S105:向所述服务器获取所述图片的图片数据流,将所述图片数据流转换为图片,根据所述key在缓存中保存所述图片,并显示所述图片。S105: Obtain the picture data stream of the picture from the server, convert the picture data stream into a picture, save the picture in the cache according to the key, and display the picture.

在本发明实施例中,电子设备的缓存可以为电子设备的网络缓存、内存缓存、磁盘缓存等。在电子设备的缓存中以(key,value)的形式保存有电子设备已缓存的图片。生成拼接成的字符串的key后,电子设备在自身的缓存中查找是否存在与生成的key相同的目标key,进而判断缓存中是否有与生成的key对应的目标图片,如果缓存中存在与生成的key相同的目标key,确定缓存中存在与生成的key对应的目标图片,获取缓存中与目标key对应的目标图片并显示。In this embodiment of the present invention, the cache of the electronic device may be a network cache, a memory cache, a disk cache, and the like of the electronic device. A cached image of the electronic device is stored in the cache of the electronic device in the form of (key, value). After generating the key of the spliced string, the electronic device searches its own cache for the same target key as the generated key, and then judges whether there is a target image corresponding to the generated key in the cache. If the target key is the same as the target key, determine that there is a target image corresponding to the generated key in the cache, obtain and display the target image corresponding to the target key in the cache.

如果缓存中不存在与生成的key对应的目标图片,电子设备根据待显示图片的网络地址,向服务器获取所述图片完整的图片数据流,去掉图片数据流头部的特征信息,得到真正的图片内容的图片数据流,并将其转换为图片。同时电子设备以生成的key为键值在缓存中保存该图片,即在缓存中以(key,value)的形式保存该图片。示例性的,以生成的key为key(x),该图片为value(y)为例,在电子设备的缓存中以(key(x),value(y))的形式保存该图片。电子设备在缓存中保存该图片后,显示该图片。If the target image corresponding to the generated key does not exist in the cache, the electronic device obtains the complete image data stream of the image from the server according to the network address of the image to be displayed, removes the feature information in the header of the image data stream, and obtains the real image A stream of image data for content and converts it to an image. At the same time, the electronic device saves the picture in the cache with the generated key as the key value, that is, the picture is saved in the cache in the form of (key, value). Exemplarily, taking the generated key as key(x) and the image as value(y) as an example, the image is saved in the form of (key(x), value(y)) in the cache of the electronic device. After the electronic device saves the picture in the cache, it displays the picture.

由于在本发明实施例中,将根据上传时间戳生成的特征信息添加至图片数据流的头部,图片显示时根据特征信息和图片的网络地址生成的哈希值来判断缓存中是否存在该图片,进而判断是否需要对缓存进行更新,避免了现有技术在图片的网络地址不变图片内容发生变化时,无法识别图片内容发生变化导致显示图片为旧图的问题,提高了图片显示的准确性。同时仅需获取图片数据流头部的特征信息,即可确定图片的内容是否发生变化,避免了在图片未发生变化时,更新缓存中的图片,节省了网络流量。Because in the embodiment of the present invention, the feature information generated according to the upload time stamp is added to the header of the picture data stream, and when the picture is displayed, it is determined whether the picture exists in the cache according to the feature information and the hash value generated by the network address of the picture. , and then determine whether the cache needs to be updated, which avoids the problem that the existing technology cannot recognize the change of the picture content when the network address of the picture does not change and the picture content changes, and the displayed picture is an old picture, and the accuracy of the picture display is improved. . At the same time, only the feature information of the header of the picture data stream can be obtained to determine whether the content of the picture has changed, which avoids updating the picture in the cache when the picture does not change, and saves network traffic.

实施例2:Example 2:

为了提高用户体验,在上述实施例的基础上,在本发明实施例中,所述根据所述key在缓存中保存所述图片之前,所述方法还包括:In order to improve user experience, on the basis of the above embodiments, in this embodiment of the present invention, before saving the picture in the cache according to the key, the method further includes:

建立所述网络地址与所述key的映射关系。A mapping relationship between the network address and the key is established.

具体的,在本发明实施例中,还建立有图片对应的网络地址与图片对应key的映射关系,以便在电子设备不能够连接网络时,对图片的显示。Specifically, in the embodiment of the present invention, a mapping relationship between the network address corresponding to the picture and the key corresponding to the picture is also established, so as to display the picture when the electronic device cannot connect to the network.

可选的,所述根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息之前,所述方法还包括:Optionally, before obtaining the feature information of the picture data stream header of the picture from the server according to the network address of the picture to be displayed, the method further includes:

判断是否能够连接网络;Determine whether the network can be connected;

如果是,进行根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息的步骤;If yes, carry out the step of obtaining the feature information of the picture data stream header of the picture from the server according to the network address of the picture to be displayed;

如果否,判断缓存中是否存在与所述网络地址存在映射关系的目标key,如果判断结果为是,获取缓存中所述目标key对应的图片并显示,如果判断结果为否,显示错误图片的提示信息。If no, judge whether there is a target key that has a mapping relationship with the network address in the cache, if the judgement result is yes, obtain the picture corresponding to the target key in the cache and display it, if the judgement result is no, display the prompt of the wrong picture information.

具体的,电子设备向服务器获取图片数据流头部的特征信息之前,判断是否能够连接网络,如果能够连接网络,进行后续根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息的步骤;如果不能连接网络,根据待显示图片的网络地址,在网络地址与key的映射关系中,查找是否存在与待显示图片的网络地址存在映射关系的目标key,如果存在,获取缓存中所述目标key对应的图片并显示,如果不存在,显示错误图片的提示信息,如显示“默认错误图片”等。Specifically, before the electronic device obtains the feature information of the image data stream header from the server, it determines whether it can connect to the network, and if it can connect to the network, the electronic device subsequently obtains the image data stream header of the image from the server according to the network address of the image to be displayed. The step of the feature information of the part; if the network cannot be connected, according to the network address of the picture to be displayed, in the mapping relationship between the network address and the key, find out whether there is a target key that has a mapping relationship with the network address of the picture to be displayed, if there is, Obtain the image corresponding to the target key in the cache and display it. If it does not exist, display the prompt information of the wrong image, such as displaying "default wrong image".

实施例3:Example 3:

图4为本发明实施例提供的一种基于缓存的图片显示装置结构示意图,所述装置包括:FIG. 4 is a schematic structural diagram of a cache-based picture display device according to an embodiment of the present invention, where the device includes:

获取模块41,用于根据待显示图片的网络地址,向服务器获取所述图片的图片数据流头部的特征信息,其中所述图片数据流头部的特征信息是根据所述图片上传服务器的时间戳生成的;The obtainingmodule 41 is configured to obtain the feature information of the picture data stream header of the picture from the server according to the network address of the picture to be displayed, wherein the feature information of the picture data stream header is according to the time of the picture uploading server generated by stamp;

生成模块42,用于根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成哈希值key;The generatingmodule 42 is configured to generate a hash value key according to a string formed by splicing a timestamp corresponding to the feature information and the network address and a preset hash algorithm;

缓存显示模块43,用于如果缓存中未保存有所述key对应的目标图片,向所述服务器获取所述图片的图片数据流,将所述图片数据流转换为图片,根据所述key在缓存中保存所述图片,并显示所述图片。Thecache display module 43 is configured to obtain the image data stream of the image from the server if the target image corresponding to the key is not stored in the cache, convert the image data stream into an image, and store the image in the cache according to the key. Save the picture in and display the picture.

优选地,根据所述图片上传服务器的时间戳生成所述图片数据流头部的特征信息包括:Preferably, generating the feature information of the picture data stream header according to the timestamp of the picture uploading server includes:

将所述图片转换为图片数据流,将当前时间戳转换为设定字节的特征信息添加至所述图片数据流的头部,并将添加特征信息的图片数据流上传至所述服务器。Converting the picture into a picture data stream, converting the current timestamp into a set byte of feature information, and adding it to the header of the picture data stream, and uploading the picture data stream with the feature information added to the server.

优选地,所述缓存显示模块43,还用于如果缓存中保存有所述key对应的目标图片,获取缓存中保存的所述目标图片并显示。Preferably, thecache display module 43 is further configured to acquire and display the target image stored in the cache if the target image corresponding to the key is stored in the cache.

优选地,所述缓存显示模块43,还用于建立所述网络地址与所述key的映射关系。Preferably, thecache display module 43 is further configured to establish a mapping relationship between the network address and the key.

优选地,所述装置还包括:Preferably, the device further comprises:

判断模块44,用于判断是否能够连接网络;如果是,触发获取模块,如果否,判断缓存中是否存在与所述网络地址存在映射关系的目标key,如果判断结果为是,获取缓存中所述目标key对应的图片并显示,如果判断结果为否,显示错误图片的提示信息。Thejudgment module 44 is used to judge whether the network can be connected; if so, trigger the acquisition module, if not, judge whether there is a target key that has a mapping relationship with the network address in the cache, and if the judgment result is yes, obtain the information in the cache The picture corresponding to the target key is displayed. If the judgment result is no, the prompt message of the wrong picture is displayed.

优选地,所述装置还包括:Preferably, the device further comprises:

校验模块45,用于校验所述特征信息的完整性,如果校验通过,触发生成模块。Theverification module 45 is used to verify the integrity of the feature information, and if the verification is passed, the generation module is triggered.

实施例4:Example 4:

基于同一发明构思,本发明实施例中还提供了一种电子设备,由于上述电子设备解决问题的原理与基于缓存的图片显示方法相似,因此上述电子设备的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present invention also provides an electronic device. Since the principle of solving the problem of the electronic device is similar to that of the cache-based image display method, the implementation of the electronic device can refer to the implementation of the method. No longer.

如图5所示,其为本发明实施例提供的电子设备的结构示意图,其中在图5中,总线架构可以包括任意数量的互联的总线和桥,具体有处理器51代表的一个或多个处理器51和存储器53代表的存储器53的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发机52可以是多个元件,即包括发送机和收发机,提供用于在传输介质上与各种其他装置通信的单元。处理器51负责管理总线架构和通常的处理,存储器53可以存储处理器51在执行操作时所使用的数据。As shown in FIG. 5 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present invention, in which, in FIG. 5 , the bus architecture may include any number of interconnected buses and bridges, and specifically one or more interconnected buses and bridges represented by theprocessor 51Processor 51 and various circuits of memory 53 represented by memory 53 are linked together. The bus architecture may also link together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be described further herein. The bus interface provides the interface. Transceiver 52 may be a number of elements, including a transmitter and a transceiver, providing a means for communicating with various other devices over a transmission medium. Theprocessor 51 is responsible for managing the bus architecture and general processing, and the memory 53 may store data used by theprocessor 51 in performing operations.

在本发明实施例提供的电子设备中:In the electronic device provided by the embodiment of the present invention:

所述处理器51,用于读取存储器53中的程序,执行下列过程:根据待显示图片的网络地址,通过收发机52向服务器获取所述图片的图片数据流头部的特征信息,其中所述图片数据流头部的特征信息是根据所述图片上传服务器的时间戳生成的;根据所述特征信息对应的时间戳与所述网络地址拼接成的字符串及预设的哈希算法,生成哈希值key;如果缓存中未保存有所述key对应的目标图片,向所述服务器获取所述图片的图片数据流,将所述图片数据流转换为图片,根据所述key在缓存中保存所述图片,并显示所述图片。Theprocessor 51 is used to read the program in the memory 53, and performs the following process: according to the network address of the picture to be displayed, obtain the feature information of the picture data stream header of the picture from the server through the transceiver 52, wherein the The feature information of the picture data stream header is generated according to the timestamp of the picture uploading server; according to the string and the preset hash algorithm spliced into the timestamp corresponding to the feature information and the network address, the generated Hash value key; if the target image corresponding to the key is not stored in the cache, obtain the image data stream of the image from the server, convert the image data stream into an image, and save it in the cache according to the key the picture, and display the picture.

优选地,根据所述图片上传服务器的时间戳生成所述图片数据流头部的特征信息包括:Preferably, generating the feature information of the picture data stream header according to the timestamp of the picture uploading server includes:

将所述图片转换为图片数据流,将当前时间戳转换为设定字节的特征信息添加至所述图片数据流的头部,并将添加特征信息的图片数据流上传至所述服务器。Converting the picture into a picture data stream, converting the current timestamp into a set byte of feature information, and adding it to the header of the picture data stream, and uploading the picture data stream with the feature information added to the server.

优选地,所述处理器51,还用于如果缓存中保存有所述key对应的目标图片,获取缓存中保存的所述目标图片并显示。Preferably, theprocessor 51 is further configured to acquire and display the target image stored in the cache if the target image corresponding to the key is stored in the cache.

优选地,所述处理器51,还用于建立所述网络地址与所述key的映射关系。Preferably, theprocessor 51 is further configured to establish a mapping relationship between the network address and the key.

优选地,所述处理器51,还用于判断是否能够连接网络;如果是,进行根据待显示图片的网络地址,通过收发机52向服务器获取所述图片的图片数据流头部的特征信息的步骤,如果否,判断缓存中是否存在与所述网络地址存在映射关系的目标key,如果判断结果为是,获取缓存中所述目标key对应的图片并显示,如果判断结果为否,显示错误图片的提示信息。Preferably, theprocessor 51 is also used to determine whether the network can be connected; if so, to obtain the feature information of the picture data stream header of the picture from the server through the transceiver 52 according to the network address of the picture to be displayed Step, if no, judge whether there is a target key with a mapping relationship with the network address in the cache, if the judgment result is yes, obtain the picture corresponding to the target key in the cache and display, if the judgment result is no, display the wrong picture prompt information.

优选地,所述处理器51,还用于校验所述特征信息的完整性,如果校验通过进行后续步骤。Preferably, theprocessor 51 is further configured to verify the integrity of the feature information, and if the verification is passed, the subsequent steps are performed.

实施例5:Example 5:

在上述各实施例的基础上,本发明实施例还提供了一种电子设备,如图6所示,包括:处理器61、通信接口62、存储器63和通信总线64,其中,处理器61、通信接口62、存储器63通过通信总线64完成相互间的通信;On the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device, as shown in FIG. 6 , including: aprocessor 61 , acommunication interface 62 , amemory 63 and acommunication bus 64 , wherein theprocessor 61 , Thecommunication interface 62 and thememory 63 complete the mutual communication through thecommunication bus 64;

所述存储器63中存储有计算机程序,当所述程序被所述处理器61执行时,使得所述处理器61执行上述实施例描述的基于缓存的图片显示方法。A computer program is stored in thememory 63, and when the program is executed by theprocessor 61, theprocessor 61 is made to execute the cache-based picture display method described in the above embodiments.

在上述各实施例的基础上,本发明实施例还提供了一种计算机存储可读存储介质,所述计算机可读存储介质内存储有可由电子设备执行的计算机程序,当所述程序在所述电子设备上运行时,使得所述电子设备执行上述实施例描述的基于缓存的图片显示方法。On the basis of the foregoing embodiments, embodiments of the present invention further provide a computer storage-readable storage medium, where a computer program executable by an electronic device is stored in the computer-readable storage medium. When running on an electronic device, the electronic device is caused to execute the cache-based picture display method described in the above embodiments.

对于系统/装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。For the system/apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the partial description of the method embodiment.

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiments of the present application have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of this application.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims (10)

the processor is used for reading the program in the memory and executing the following processes: acquiring characteristic information of a picture data stream header of a picture from a server through a transceiver according to a network address of the picture to be displayed, wherein the characteristic information of the picture data stream header is generated according to a timestamp of a picture uploading server; generating a hash value key according to a character string formed by splicing the timestamp corresponding to the characteristic information and the network address and a preset hash algorithm; and if the target picture corresponding to the key is not stored in the cache, obtaining the picture data stream of the picture from the server, converting the picture data stream into the picture, storing the picture in the cache according to the key, and displaying the picture.
CN201811536775.5A2018-12-142018-12-14Picture display method and device based on cache, electronic equipment and mediumActiveCN111324586B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201811536775.5ACN111324586B (en)2018-12-142018-12-14Picture display method and device based on cache, electronic equipment and medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201811536775.5ACN111324586B (en)2018-12-142018-12-14Picture display method and device based on cache, electronic equipment and medium

Publications (2)

Publication NumberPublication Date
CN111324586Atrue CN111324586A (en)2020-06-23
CN111324586B CN111324586B (en)2024-04-09

Family

ID=71166955

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201811536775.5AActiveCN111324586B (en)2018-12-142018-12-14Picture display method and device based on cache, electronic equipment and medium

Country Status (1)

CountryLink
CN (1)CN111324586B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112256993A (en)*2020-09-222021-01-22恒鸿达科技有限公司Picture accelerated display method, system, equipment and medium
CN113434546A (en)*2021-06-242021-09-24江苏通付盾科技有限公司Method for caching data flow calculation based on dynamic time slice

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20030097564A1 (en)*2000-08-182003-05-22Tewari Anoop KailasnathSecure content delivery system
CN101409706A (en)*2007-10-092009-04-15华为技术有限公司Method, system and relevant equipment for distributing data of edge network
CN102096712A (en)*2011-01-282011-06-15深圳市五巨科技有限公司Method and device for cache-control of mobile terminal
CN103503486A (en)*2011-12-272014-01-08华为技术有限公司 A video publishing method and system, and a video playing method and system
CN104933054A (en)*2014-03-182015-09-23上海帝联信息科技股份有限公司Uniform resource locator (URL) storage method and device of cache resource file, and cache server
CN107766469A (en)*2017-09-292018-03-06北京金山安全管理系统技术有限公司A kind of method for caching and processing and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20030097564A1 (en)*2000-08-182003-05-22Tewari Anoop KailasnathSecure content delivery system
CN101409706A (en)*2007-10-092009-04-15华为技术有限公司Method, system and relevant equipment for distributing data of edge network
CN102096712A (en)*2011-01-282011-06-15深圳市五巨科技有限公司Method and device for cache-control of mobile terminal
CN103503486A (en)*2011-12-272014-01-08华为技术有限公司 A video publishing method and system, and a video playing method and system
CN104933054A (en)*2014-03-182015-09-23上海帝联信息科技股份有限公司Uniform resource locator (URL) storage method and device of cache resource file, and cache server
CN107766469A (en)*2017-09-292018-03-06北京金山安全管理系统技术有限公司A kind of method for caching and processing and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
马郓;刘?哲;梅宏;: "面向移动Web应用的浏览器缓存性能度量与优化"*

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112256993A (en)*2020-09-222021-01-22恒鸿达科技有限公司Picture accelerated display method, system, equipment and medium
CN112256993B (en)*2020-09-222023-06-27恒鸿达科技有限公司Picture acceleration display method, system, equipment and medium
CN113434546A (en)*2021-06-242021-09-24江苏通付盾科技有限公司Method for caching data flow calculation based on dynamic time slice

Also Published As

Publication numberPublication date
CN111324586B (en)2024-04-09

Similar Documents

PublicationPublication DateTitle
CN105022750A (en)resource file loading method and device
CN104363271B (en)Document breakpoint transmission method and device
CN107168999A (en)A kind of method for updating pages and device
CN106648712A (en)Incremental updating packet generating method and device, and server
EP3819802A1 (en)Data consistency checking method and data uploading/downloading apparatus
WO2022142153A1 (en)Electricity meter upgrading method and system, smart meter, and storage medium
CN113972990B (en)Data verification method and device, storage medium and electronic equipment
CN108512898A (en)File push method, apparatus, computer equipment and storage medium
CN111897846A (en)Cache data verification method, device, equipment and storage medium
CN114780519A (en)DBC file generation method, device, equipment and medium based on CAN communication
CN116708563B (en) Archival data processing method, device, server and readable storage medium
CN111324586A (en) A cache-based picture display method, device, electronic device and medium
CN112506878B (en) File processing method, device, storage medium and electronic device
CN114564227A (en) Application program updating method, apparatus, electronic device and storage medium
CN114385570A (en) Method, apparatus, electronic device and readable medium for data synchronization
CN114374517A (en) API calling method, system, device and storage medium based on dynamic timestamp
US20210099432A1 (en)Data consistency verification method, and data uploading and downloading device
CN111107133A (en)Generation method of difference packet, data updating method, device and storage medium
CN108205588A (en)Based on hypotactic method of data synchronization and device
CN110990360A (en)File synchronization method based on network storage device and related components
CN106156235B (en)Picture downloading method and system based on Android platform
CN109361767B (en) Optimize the processing method, server, and client of client data display errors
CN113918237A (en)Gray scale publishing method, device, equipment and computer readable medium
CN112256714A (en) Data synchronization method, apparatus, electronic device and computer readable medium
CN108197157B (en)Method, apparatus and computer-readable storage medium for managing data to be stored

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp