CN113836335A - Thumbnail display method and device, electronic equipment and readable storage medium - Google Patents

Thumbnail display method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113836335A
CN113836335A CN202110909988.3A CN202110909988A CN113836335A CN 113836335 A CN113836335 A CN 113836335A CN 202110909988 A CN202110909988 A CN 202110909988A CN 113836335 A CN113836335 A CN 113836335A
Authority
CN
China
Prior art keywords
thumbnail
interval
data
numbering
subinterval
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.)
Pending
Application number
CN202110909988.3A
Other languages
Chinese (zh)
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.)
Shenzhen Ape Man Innovation Technology Co ltd
Original Assignee
Shenzhen Ape Man Innovation 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 Shenzhen Ape Man Innovation Technology Co ltd filed Critical Shenzhen Ape Man Innovation Technology Co ltd
Priority to CN202110909988.3A priority Critical patent/CN113836335A/en
Publication of CN113836335A publication Critical patent/CN113836335A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/54Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of image processing, and discloses a thumbnail display method, a thumbnail display device, thumbnail display equipment and a readable storage medium, wherein the method comprises the following steps: sequencing and numbering image files stored in the electronic equipment, and constructing a numbering interval according to the numbers; screening out subintervals with preset lengths from the numbering interval to obtain numbering subintervals; screening numbers which are not contained in a preset thumbnail cache from the number subintervals to obtain a number set; extracting thumbnail data of the image file corresponding to each number in the number set; decoding the thumbnail data to obtain decoded data, establishing a mapping relation between the decoded data and the extracted number, and storing the decoded data and the extracted number in a thumbnail cache; acquiring a number corresponding to decoding data displayed at the upper left corner of a display interface of the electronic equipment to obtain a target number; and determining the target number as the center of the numbered subinterval, and updating the numbered subinterval. The invention can improve the speed of thumbnail display.

Description

Thumbnail display method and device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of image processing, and in particular, to a thumbnail display method and apparatus, an electronic device, and a readable storage medium.
Background
With the continuous progress of storage technology, people can store more and more image files in multimedia devices (such as cameras and mobile phones) and preview the image files through thumbnails, so that a thumbnail display method is needed to ensure that people can smoothly preview the stored image files.
However, the conventional thumbnail display method cannot timely decode the thumbnail to be displayed, which results in a slow thumbnail display speed.
Disclosure of Invention
The invention provides a thumbnail display method, a thumbnail display device, electronic equipment and a computer-readable storage medium, and mainly aims to improve the speed of thumbnail display.
In order to achieve the above object, the present invention provides a thumbnail display method, including:
sequencing and numbering image files stored in electronic equipment, and constructing a numbering interval according to the numbers of all the image files;
screening out subintervals with preset lengths from the number intervals by taking a preset number as a starting point to obtain number subintervals;
screening the numbers which are not contained in a preset thumbnail cache from the number subintervals to obtain a number set;
extracting an image file corresponding to each number in the number set, and generating thumbnail data of the extracted image file;
decoding the thumbnail data to obtain corresponding decoded data, establishing a mapping relation between the decoded data and the extracted serial number, and storing the mapping relation in the thumbnail cache;
acquiring a number corresponding to the decoding data displayed at the upper left corner of the display interface of the electronic equipment to obtain a target number;
and determining the target number as the interval center of the number subinterval, updating the number subinterval, and returning to the step of screening the numbers which are not contained in a preset thumbnail cache from the number subinterval to obtain a number set.
Optionally, the filtering, from the number subintervals, numbers that are not included in a preset thumbnail cache to obtain a number set includes:
summarizing all numbers in the number subintervals to obtain an initial number set;
summarizing all numbers in the thumbnail cache to obtain the cache number set;
and calculating a complement set of the cache number set in the initial number set to obtain the number set.
Optionally, the generating thumbnail data of the image file includes:
acquiring the file type of the image file;
and extracting file header information of the image file according to the file type to generate the thumbnail data.
Optionally, the decoding the thumbnail data to obtain corresponding decoded data includes:
acquiring a file coding type corresponding to the thumbnail data;
calling a corresponding decoding algorithm according to the file coding type to decode the thumbnail data to obtain initial decoding data;
and converting the initial decoding data into RGB color decoding data to obtain the decoding data.
Optionally, the screening out a sub-interval of a preset length from the number interval with a preset number as a starting point to obtain a number sub-interval includes:
selecting the preset number as a left interval endpoint;
and taking the left end point of the interval as a starting point, and intercepting the interval with the preset interval length from the numbering interval to obtain the numbering subinterval.
Optionally, the determining the target number as the interval center of the numbering subinterval updates the numbering subinterval, including:
calculating to obtain an updated left interval endpoint of the numbering subinterval according to the interval center and the interval length;
and updating the numbering subinterval by using the updated left interval endpoint and the interval length.
Optionally, the sorting and numbering the image files stored in the electronic device includes:
extracting creation time of an image file stored in the electronic device;
sequencing the image files according to the creation time to obtain an image file sequence;
and numbering the image files according to the image file sequence.
In order to solve the above problems, the present invention also provides a thumbnail display apparatus, the apparatus including:
the file interval screening module is used for sequencing and numbering image files stored in the electronic equipment and constructing a numbering interval according to the numbers of all the image files; screening out subintervals with preset lengths from the number intervals by taking a preset number as a starting point to obtain number subintervals; screening the numbers which are not contained in a preset thumbnail cache from the number subintervals to obtain a number set;
the file decoding module is used for extracting the image file corresponding to each number in the number set and generating the thumbnail data of the extracted image file; decoding the thumbnail data to obtain corresponding decoded data, establishing a mapping relation between the decoded data and the extracted serial number, and storing the mapping relation in the thumbnail cache;
the interval updating module is used for acquiring a number corresponding to the decoding data displayed at the upper left corner of the display interface of the electronic equipment to obtain a target number; and determining the target number as the interval center of the number subinterval, updating the number subinterval, and returning to the step of screening the numbers which are not contained in a preset thumbnail cache from the number subinterval to obtain a number set.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and a processor that executes the computer program stored in the memory to implement the thumbnail display method described above.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having at least one computer program stored therein, the at least one computer program being executed by a processor in an electronic device to implement the thumbnail display method described above.
The embodiment of the invention extracts the image file corresponding to each number in the number set and generates the thumbnail data of the extracted image file, and the data existing in the memory does not need to be decoded repeatedly, thereby realizing memory multiplexing, improving the decoding speed and further improving the speed of displaying the subsequent thumbnail; and determining the target number as the interval center of the numbered subinterval, updating the numbered subinterval, and detecting the number of the decoded data displayed on the display interface in real time, so that the decoded data in the thumbnail cache is updated, the displayed decoded data can be guaranteed to be decoded in advance, and the thumbnail display speed is improved. Therefore, the thumbnail display method, the thumbnail display device, the electronic equipment and the readable storage medium provided by the embodiment of the invention improve the thumbnail display speed.
Drawings
Fig. 1 is a schematic flowchart of a thumbnail display method according to an embodiment of the present invention;
fig. 2 is a schematic detailed flowchart illustrating updating of a number subinterval in the thumbnail display method according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of a thumbnail display apparatus according to an embodiment of the present invention;
fig. 4 is a schematic internal structural diagram of an electronic device implementing a thumbnail display method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a thumbnail display method. The execution main body of the thumbnail display method includes, but is not limited to, at least one of electronic devices such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the present application. In other words, the thumbnail display method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Referring to a flowchart of a thumbnail display method shown in fig. 1 according to an embodiment of the present invention, in the embodiment of the present invention, the thumbnail display method includes:
s1, sequencing and numbering image files stored in the electronic equipment, and constructing a numbering interval according to the numbers of all the image files;
in detail, the image files in the embodiment of the present invention are a set of image files stored in an electronic device, and the image files include, but are not limited to: MP4 file, JPG file, the image file includes corresponding file creation time and file size information.
Further, in the embodiment of the present invention, in order to better display thumbnails corresponding to different image files, a sequence of the displayed thumbnails is determined, and therefore, the image files stored in the electronic device need to be ordered and numbered.
Optionally, the image files may be sorted and numbered according to the file creation time of the image files in the embodiment of the present invention.
In detail, the embodiment of the present invention performs ranking numbering on image files stored in an electronic device, and includes:
step A: extracting creation time of an image file stored in the electronic device;
and B: sequencing the image files according to the creation time to obtain an image file sequence;
optionally, in the embodiment of the present invention, all the image files in the electronic device are arranged in a descending order according to the corresponding file creation time, so as to obtain the image file sequence.
And C: and numbering the image files according to the image file sequence.
Optionally, in the embodiment of the present invention, the position where each image file in the sequence of image files is ordered is determined as the number corresponding to the image file.
For example: the sorting position corresponding to the first image file in the image file sequence is 1, and then the number corresponding to the file is also 1.
Further, in the embodiment of the present invention, in order to better determine that the image files of the thumbnail need to be displayed, a number interval is constructed according to the numbers of all the image files.
In detail, in the embodiment of the present invention, the smallest number and the largest number in the numbers of all the image files are used as two end points of a section, and the number section is obtained, for example: the smallest number of all the image files is 1 and the largest number is 10, then the number interval is [1,10 ].
S2, screening out subintervals with preset lengths from the number intervals by taking a preset number as a starting point to obtain number subintervals;
in detail, in the embodiment of the present invention, the preset length is a length value preset according to the decoding capability of the electronic device and the thumbnail display number of the display interface.
Further, in the embodiment of the present invention, in the number interval, with a preset number as a starting point, a sub-interval with a preset length is screened out to determine a range of numbers of image files that need to be decoded.
The preset number may be a left end point of the number interval.
Specifically, in the embodiment of the present invention, screening out a sub-interval of a preset length from the preset number as a starting point in the number interval to obtain a number sub-interval, where the method includes: selecting a number corresponding to the left endpoint of the number interval as a left interval endpoint; and taking the left end point of the interval as a starting point, and intercepting the interval with the preset interval length from the numbering interval to obtain the numbering subinterval. For example, if the number interval is [1,10] and the length is 5, then the number interval with the length of 5 is [1,6] with 1 as the starting point.
S3, screening the numbers which are not contained in the preset thumbnail cache from the number subintervals to obtain a number set;
in order to improve the display speed of the thumbnail, the embodiment of the invention stores a part of decoded data corresponding to the thumbnail in the thumbnail cache, wherein the thumbnail cache is a memory of cache data, when browsing the part of thumbnails, the data corresponding to the part of thumbnails do not need to be decoded again, so that memory multiplexing is realized, the speed of batch display of the thumbnails is improved, and when the data needs to be stored in the thumbnail cache, if the space in the thumbnail cache is insufficient, the thumbnail cache deletes the data with the earliest storage time in the memory so as to vacate the space to store new data.
In detail, in the embodiment of the present invention, the step of screening, from the number subintervals, numbers that are not included in a preset thumbnail cache to obtain a number set includes:
summarizing all numbers in the number subintervals to obtain an initial number set;
summarizing all numbers in the thumbnail cache to obtain the cache number set;
and calculating a complement set of the cache number set in the initial number set to obtain the number set.
S4, extracting image files corresponding to each number in the number set, and generating thumbnail data of the extracted image files;
in detail, the image files are compressed and encoded files stored in different encoding formats, and the embodiment of the present invention only needs to display the thumbnail corresponding to each image file, so that the embodiment of the present invention only needs to extract the image file corresponding to each number in the number set and generate the thumbnail data corresponding to the image file.
In detail, in the embodiment of the present invention, extracting an image file corresponding to each number in the number set, and generating thumbnail data of the extracted image file includes:
acquiring the file type of the image file; and extracting file header information of the image file according to the file type to generate the thumbnail data. For example: the file type is MP4, and the corresponding Header information is tkhd (Track Header Box) information in the image file
S5, decoding the thumbnail data to obtain corresponding decoded data, and storing the decoded data and the extracted number in the thumbnail cache after establishing a mapping relation;
in the embodiment of the present invention, since the thumbnail data is data in a compressed package format, in order to normally display the thumbnail data, the thumbnail data needs to be decoded to obtain corresponding decoded data.
Specifically, in the embodiment of the present invention, decoding the thumbnail data to obtain corresponding decoded data includes:
acquiring a file coding type corresponding to the thumbnail data; calling a corresponding decoding algorithm according to the file encoding type to decode the thumbnail data to obtain initial decoded data, optionally, the decoding algorithm in the embodiment of the present invention is an MP4 decoding algorithm, further, in the embodiment of the present invention, in order to better display the initial decoded data on a display interface, performing color encoding conversion on the initial decoded data to obtain the decoded data, and optionally, converting the initial decoded data into RGB color decoded data.
Further, in the embodiment of the present invention, in order to ensure that the decoded data does not need to be re-decoded when used next time, and meanwhile, in order to facilitate searching and comparing the decoded data in the thumbnail cache, after establishing a mapping relationship between the decoded data and the extracted number, the decoded data and the number are stored in the thumbnail cache, where the decoded data and the number correspond to each other one to one, for example: if the number of the image file corresponding to the decoded data is 1, the decoded data can be marked with a number 1 label, so as to construct a mapping relation between the decoded data and the number.
S6, acquiring a number corresponding to the decoded data displayed at the upper left corner of the display interface of the electronic equipment to obtain a target number;
because the display quantity of the thumbnails corresponding to different display interfaces is different, the screen display quantity value of the display interface is obtained in advance, and the screen display quantity value is the quantity of the thumbnails which can be displayed on the display interface.
Further, the embodiment of the invention divides the numbering subinterval by using the screen display quantity value to obtain the target numbering interval.
In detail, the embodiment of the present invention divides the number interval by using the screen display quantity value to obtain a target number interval, including: taking the left end point of the numbering interval as a starting point, segmenting the interval with the length of the screen display quantity value to obtain the target numbering interval, wherein the left end point of the target numbering interval is the number of the decoding data corresponding to the upper left corner of the display interface,
for example: the screen display quantity value is 6, the numbering interval is [1,11], the left end point 1 of the numbering interval is used as a starting point, the screen display quantity value is used as an interval length, interval segmentation is carried out, and the target numbering interval is [1,7 ].
In detail, in the embodiment of the present invention, the display control corresponding to the display interface displays the memory to point to the memory where each number in the target number interval in the memory corresponds to the decoded data, so that the corresponding decoded data is displayed on the display interface.
Further, when the sliding operation is performed on the display interface in the embodiment of the present invention, if the corresponding sliding operation is successfully responded by the electronic device to which the display interface belongs, the decoded data displayed on the display interface changes, so that in order to ensure that the thumbnails displayed after the sliding page turning are the decoded thumbnail data and can be updated in time, and ensure the display fluency, a number corresponding to the decoded data displayed on the current display interface needs to be obtained in time.
And S7, determining the target number as the interval center of the number subinterval, updating the number subinterval, and returning the number which is not included in a preset thumbnail cache from the number subinterval to obtain a number set.
In detail, in the embodiment of the present invention, referring to fig. 2, the updating the number interval by using the interval center includes:
s71, calculating to obtain an updated left interval endpoint of the numbering subinterval according to the interval center and the interval length;
for example: the interval center is 8, the interval length is 10, the new interval end points include a new left interval end point and a new right interval end point, the new left interval end point is 3, and the new left interval end point is 13.
And S72, updating the numbering subinterval by using the updated left interval endpoint and the interval length.
For example: the new left interval end points are 3 and the interval length is 10, respectively, then the updated number subinterval is [3,13 ].
As shown in fig. 2, is a functional block diagram of the thumbnail display apparatus of the present invention.
The thumbnail display apparatus 100 according to the present invention may be installed in an electronic device. According to the implemented functions, the thumbnail display apparatus may include a file section filtering module 101, a file decoding module 102, and a section updating module 103, which may also be referred to as a unit, and refers to a series of computer program segments that can be executed by a processor of an electronic device and can perform fixed functions, and are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the file interval screening module 101 is configured to sequence and number image files stored in the electronic device, and construct a number interval according to the numbers of all the image files; screening out subintervals with preset lengths from the number intervals by taking a preset number as a starting point to obtain number subintervals; screening the numbers which are not contained in a preset thumbnail cache from the number subintervals to obtain a number set;
in detail, the image files in the embodiment of the present invention are a set of image files stored in an electronic device, and the image files include, but are not limited to: MP4 file, JPG file, the image file includes corresponding file creation time and file size information.
Further, in the embodiment of the present invention, in order to better display thumbnails corresponding to different image files, a sequence of the displayed thumbnails is determined, and therefore, the image files stored in the electronic device need to be ordered and numbered.
Optionally, the file interval screening module 101 according to the embodiment of the present invention may sequence and number the image files according to the file creation time of the image files.
In detail, the file interval screening module 101 in the embodiment of the present invention performs ranking and numbering on image files stored in an electronic device, and includes:
step A: extracting creation time of an image file stored in the electronic device;
and B: sequencing the image files according to the creation time to obtain an image file sequence;
optionally, in the embodiment of the present invention, all the image files in the electronic device are arranged in a descending order according to the corresponding file creation time, so as to obtain the image file sequence.
And C: and numbering the image files according to the image file sequence.
Optionally, the file interval screening module 101 according to the embodiment of the present invention determines a position where each image file in the image file sequence is sorted as a number corresponding to the image file.
For example: the sorting position corresponding to the first image file in the image file sequence is 1, and then the number corresponding to the file is also 1.
Further, in the embodiment of the present invention, in order to better determine that the image files of the thumbnail need to be displayed, the file interval screening module 101 constructs a number interval according to the numbers of all the image files.
In detail, in the embodiment of the present invention, the file section screening module 101 uses the minimum number and the maximum number of the numbers of all the image files as two end points of a section to obtain the number section, for example: the smallest number of all the image files is 1 and the largest number is 10, then the number interval is [1,10 ].
In detail, in the embodiment of the present invention, the preset length is a length value preset according to the decoding capability of the electronic device and the thumbnail display number of the display interface.
Further, in the embodiment of the present invention, the file interval screening module 101 screens out a sub-interval with a preset length from the preset number as a starting point in the number interval, so as to determine a range of the number of the image file to be decoded.
Specifically, in the embodiment of the present invention, the screening module 101 screens out a sub-interval with a preset length from the preset number as a starting point in the number interval, so as to obtain a number sub-interval, where the method includes: selecting a number corresponding to the left endpoint of the number interval as a left interval endpoint; and taking the left end point of the interval as a starting point, and intercepting the interval with the preset interval length from the numbering interval to obtain the numbering subinterval. For example, if the number interval is [1,10] and the length is 5, then the number interval with the length of 5 is [1,6] with 1 as the starting point.
In order to improve the display speed of the thumbnail, the embodiment of the invention stores a part of decoded data corresponding to the thumbnail in the thumbnail cache, wherein the thumbnail cache is a memory of cache data, when browsing the part of thumbnails, the data corresponding to the part of thumbnails do not need to be decoded again, so that memory multiplexing is realized, the speed of batch display of the thumbnails is improved, and when the data needs to be stored in the thumbnail cache, if the space in the thumbnail cache is insufficient, the thumbnail cache deletes the data with the earliest storage time in the memory so as to vacate the space to store new data.
In detail, in the embodiment of the present invention, the file interval screening module 101 screens, from the number subintervals, numbers that are not included in a preset thumbnail cache to obtain a number set, where the number set includes:
summarizing all numbers in the number subintervals to obtain an initial number set;
summarizing all numbers in the thumbnail cache to obtain the cache number set;
and calculating a complement set of the cache number set in the initial number set to obtain the number set.
The file decoding module 102 is configured to extract an image file corresponding to each number in the number set, and generate thumbnail data of the extracted image file; decoding the thumbnail data to obtain corresponding decoded data, establishing a mapping relation between the decoded data and the extracted serial number, and storing the mapping relation in the thumbnail cache;
in detail, the image files are compressed and encoded files stored in different encoding formats, and the file decoding module 102 according to the embodiment of the present invention only needs to display the thumbnail corresponding to each image file, so that the embodiment of the present invention only needs to extract the image file corresponding to each number in the number set and generate the thumbnail data corresponding to the image file.
In detail, in the embodiment of the present invention, the file decoding module 102 extracts an image file corresponding to each number in the number set, and generates thumbnail data of the extracted image file, including:
acquiring the file type of the image file; and extracting file header information of the image file according to the file type to generate the thumbnail data. For example: the file type is MP4, and the corresponding Header information is tkhd (Track Header Box) information in the image file
In the embodiment of the present invention, since the thumbnail data is data in a compressed package format, in order to normally display the thumbnail data, the thumbnail data needs to be decoded to obtain corresponding decoded data.
Specifically, in the embodiment of the present invention, the decoding module 102 decodes the thumbnail data to obtain corresponding decoded data, including:
acquiring a file coding type corresponding to the thumbnail data; calling a corresponding decoding algorithm according to the file encoding type to decode the thumbnail data to obtain initial decoded data, optionally, the decoding algorithm in the embodiment of the present invention is an MP4 decoding algorithm, further, in the embodiment of the present invention, in order to better display the initial decoded data on a display interface, performing color encoding conversion on the initial decoded data to obtain the decoded data, and optionally, converting the initial decoded data into RGB color decoded data.
Further, in the embodiment of the present invention, in order to ensure that the decoded data does not need to be re-decoded when used next time, and meanwhile, in order to facilitate searching and comparing the decoded data in the thumbnail cache, after the file decoding module 102 establishes a mapping relationship between the decoded data and the extracted number, the decoded data and the number are stored in the thumbnail cache, where the decoded data and the number correspond to each other one to one, for example: if the number of the image file corresponding to the decoded data is 1, the decoded data can be marked with a number 1 label, so as to construct a mapping relation between the decoded data and the number.
The interval updating module 103 is configured to obtain a number corresponding to decoded data displayed in an upper left corner of a display interface of the electronic device, so as to obtain a target number; and determining the target number as the interval center of the number subinterval, updating the number subinterval, and returning to the step of screening the numbers which are not contained in a preset thumbnail cache from the number subinterval to obtain a number set.
Because the display numbers of the thumbnails corresponding to different display interfaces are different, the interval update module 103 obtains a screen display number value of the display interface in advance, where the screen display number value is the number of thumbnails that can be displayed by the display interface.
Further, the embodiment of the invention divides the numbering subinterval by using the screen display quantity value to obtain the target numbering interval.
In detail, the section updating module 103 according to the embodiment of the present invention segments the number section by using the screen display quantity value to obtain a target number section, including: taking the left end point of the numbering interval as a starting point, segmenting the interval with the length of the screen display quantity value to obtain the target numbering interval, wherein the left end point of the target numbering interval is the number of the decoding data corresponding to the upper left corner of the display interface,
for example: the screen display quantity value is 6, the numbering interval is [1,11], the left end point 1 of the numbering interval is used as a starting point, the screen display quantity value is used as an interval length, interval segmentation is carried out, and the target numbering interval is [1,7 ].
In detail, in the embodiment of the present invention, the interval update module 103 directs the display control display memory corresponding to the display interface to the decoded data corresponding to each number in the target number interval in the memory, so as to display the corresponding decoded data on the display interface.
Further, when the sliding operation is performed on the display interface in the embodiment of the present invention, if the corresponding sliding operation is successfully responded by the electronic device to which the display interface belongs, the decoded data displayed on the display interface changes, so that in order to ensure that the thumbnails displayed after the sliding page turning are the decoded thumbnail data and can be updated in time, and ensure the display fluency, a number corresponding to the decoded data displayed on the current display interface needs to be obtained in time.
In detail, in the embodiment of the present invention, the updating module 103 updates the number interval by using the interval center, including:
calculating to obtain an updated left interval endpoint of the numbering subinterval according to the interval center and the interval length;
for example: the interval center is 8, the interval length is 9, the new interval end points include a new left interval end point and a new right interval end point, the new left interval end point is 3, and the new left interval end point is 13.
And updating the numbering subinterval by using the updated left interval endpoint and the interval length.
For example: the new left interval end points are 3 and the interval length is 10, respectively, then the updated number subinterval is [3,13 ].
Fig. 3 is a schematic structural diagram of an electronic device implementing the thumbnail display method according to the present invention.
The electronic device may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may further include a computer program, such as a thumbnail display program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of thumbnail display programs, etc., but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., thumbnail display programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The communication bus 12 may be a PerIPheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
Fig. 3 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Optionally, the communication interface 13 may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the communication interface 13 may further include a user interface, which may be a Display (Display), an input unit (such as a Keyboard (Keyboard)), and optionally, a standard wired interface, or a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The thumbnail display program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs, and when running in the processor 10, can realize:
sequencing and numbering image files stored in electronic equipment, and constructing a numbering interval according to the numbers of all the image files;
screening out subintervals with preset lengths from the number intervals by taking a preset number as a starting point to obtain number subintervals;
screening the numbers which are not contained in a preset thumbnail cache from the number subintervals to obtain a number set;
extracting an image file corresponding to each number in the number set, and generating thumbnail data of the extracted image file;
decoding the thumbnail data to obtain corresponding decoded data, establishing a mapping relation between the decoded data and the extracted serial number, and storing the mapping relation in the thumbnail cache;
acquiring a number corresponding to the decoding data displayed at the upper left corner of the display interface of the electronic equipment to obtain a target number;
and determining the target number as the interval center of the number subinterval, updating the number subinterval, and returning to the step of screening the numbers which are not contained in a preset thumbnail cache from the number subinterval to obtain a number set.
Specifically, the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer program, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable medium may be non-volatile or volatile. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Embodiments of the present invention may also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:
sequencing and numbering image files stored in electronic equipment, and constructing a numbering interval according to the numbers of all the image files;
screening out subintervals with preset lengths from the number intervals by taking a preset number as a starting point to obtain number subintervals;
screening the numbers which are not contained in a preset thumbnail cache from the number subintervals to obtain a number set;
extracting an image file corresponding to each number in the number set, and generating thumbnail data of the extracted image file;
decoding the thumbnail data to obtain corresponding decoded data, establishing a mapping relation between the decoded data and the extracted serial number, and storing the mapping relation in the thumbnail cache;
acquiring a number corresponding to the decoding data displayed at the upper left corner of the display interface of the electronic equipment to obtain a target number;
and determining the target number as the interval center of the number subinterval, updating the number subinterval, and returning to the step of screening the numbers which are not contained in a preset thumbnail cache from the number subinterval to obtain a number set.
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A thumbnail display method, characterized in that the method comprises:
sequencing and numbering image files stored in electronic equipment, and constructing a numbering interval according to the numbers of all the image files;
screening out subintervals with preset lengths from the number intervals by taking a preset number as a starting point to obtain number subintervals;
screening the numbers which are not contained in a preset thumbnail cache from the number subintervals to obtain a number set;
extracting an image file corresponding to each number in the number set, and generating thumbnail data of the extracted image file;
decoding the thumbnail data to obtain corresponding decoded data, establishing a mapping relation between the decoded data and the extracted serial number, and storing the mapping relation in the thumbnail cache;
acquiring a number corresponding to the decoding data displayed at the upper left corner of the display interface of the electronic equipment to obtain a target number;
and determining the target number as the interval center of the number subinterval, updating the number subinterval, and returning to the step of screening the numbers which are not contained in a preset thumbnail cache from the number subinterval to obtain a number set.
2. The thumbnail display method according to claim 1, wherein said filtering out numbers not contained in a preset thumbnail buffer from said number subintervals to obtain a number set comprises:
summarizing all numbers in the number subintervals to obtain an initial number set;
summarizing all numbers in the thumbnail cache to obtain the cache number set;
and calculating a complement set of the cache number set in the initial number set to obtain the number set.
3. The thumbnail display method according to claim 1, wherein said generating thumbnail data of said image file comprises:
acquiring the file type of the image file;
and extracting file header information of the image file according to the file type to generate the thumbnail data.
4. The thumbnail display method according to claim 1, wherein said decoding said thumbnail data to obtain corresponding decoded data comprises:
acquiring a file coding type corresponding to the thumbnail data;
calling a corresponding decoding algorithm according to the file coding type to decode the thumbnail data to obtain initial decoding data;
and converting the initial decoding data into RGB color decoding data to obtain the decoding data.
5. The thumbnail display method according to claim 1, wherein the screening out a sub-section of a predetermined length from a predetermined number as a starting point in the number section to obtain a number sub-section comprises:
selecting the preset number as a left interval endpoint;
and taking the left end point of the interval as a starting point, and intercepting the interval with the preset interval length from the numbering interval to obtain the numbering subinterval.
6. The thumbnail display method of claim 5 wherein said determining said target number as the section center of said numbered subinterval updates said numbered subinterval comprising:
calculating to obtain an updated left interval endpoint of the numbering subinterval according to the interval center and the interval length;
and updating the numbering subinterval by using the updated left interval endpoint and the interval length.
7. The thumbnail display method according to any one of claims 1 to 6, wherein the sorting numbering of the image files stored in the electronic device includes:
extracting creation time of an image file stored in the electronic device;
sequencing the image files according to the creation time to obtain an image file sequence;
and numbering the image files according to the image file sequence.
8. A thumbnail display apparatus characterized by comprising:
the file interval screening module is used for sequencing and numbering image files stored in the electronic equipment and constructing a numbering interval according to the numbers of all the image files; screening out subintervals with preset lengths from the number intervals by taking a preset number as a starting point to obtain number subintervals; screening the numbers which are not contained in a preset thumbnail cache from the number subintervals to obtain a number set;
the file decoding module is used for extracting the image file corresponding to each number in the number set and generating the thumbnail data of the extracted image file; decoding the thumbnail data to obtain corresponding decoded data, establishing a mapping relation between the decoded data and the extracted serial number, and storing the mapping relation in the thumbnail cache;
the interval updating module is used for acquiring a number corresponding to the decoding data displayed at the upper left corner of the display interface of the electronic equipment to obtain a target number; and determining the target number as the interval center of the number subinterval, updating the number subinterval, and returning to the step of screening the numbers which are not contained in a preset thumbnail cache from the number subinterval to obtain a number set.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the thumbnail display method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the thumbnail display method according to any one of claims 1 to 7.
CN202110909988.3A 2021-08-09 2021-08-09 Thumbnail display method and device, electronic equipment and readable storage medium Pending CN113836335A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110909988.3A CN113836335A (en) 2021-08-09 2021-08-09 Thumbnail display method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110909988.3A CN113836335A (en) 2021-08-09 2021-08-09 Thumbnail display method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN113836335A true CN113836335A (en) 2021-12-24

Family

ID=78963160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110909988.3A Pending CN113836335A (en) 2021-08-09 2021-08-09 Thumbnail display method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113836335A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050041035A1 (en) * 2003-08-21 2005-02-24 Casio Computer Co., Ltd. Electronic apparatus having a communication function and an image pickup function, and image display method and program
CN101527804A (en) * 2008-03-04 2009-09-09 奥林巴斯映像株式会社 Multi-image file editing device and multi-image file editing method
CN102129702A (en) * 2010-01-12 2011-07-20 北大方正集团有限公司 Image thumbnail making method and system thereof
CN102375680A (en) * 2010-08-19 2012-03-14 索尼公司 Information processing apparatus, information processing method, and program
CN103995706A (en) * 2014-06-06 2014-08-20 广州金山网络科技有限公司 Method and device for displaying picture thumbnail
CN106572381A (en) * 2016-11-07 2017-04-19 青岛海信电器股份有限公司 Processing method of photo thumbnail and intelligent television
CN106803911A (en) * 2017-03-03 2017-06-06 天津天地伟业信息***集成有限公司 A kind of thumbnail creation and read method of NVR video files
CN111866419A (en) * 2019-04-24 2020-10-30 杭州海康微影传感科技有限公司 Thermal imaging image display method and device and thermal imaging equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050041035A1 (en) * 2003-08-21 2005-02-24 Casio Computer Co., Ltd. Electronic apparatus having a communication function and an image pickup function, and image display method and program
CN101527804A (en) * 2008-03-04 2009-09-09 奥林巴斯映像株式会社 Multi-image file editing device and multi-image file editing method
CN102129702A (en) * 2010-01-12 2011-07-20 北大方正集团有限公司 Image thumbnail making method and system thereof
CN102375680A (en) * 2010-08-19 2012-03-14 索尼公司 Information processing apparatus, information processing method, and program
CN103995706A (en) * 2014-06-06 2014-08-20 广州金山网络科技有限公司 Method and device for displaying picture thumbnail
CN106572381A (en) * 2016-11-07 2017-04-19 青岛海信电器股份有限公司 Processing method of photo thumbnail and intelligent television
US20170109012A1 (en) * 2016-11-07 2017-04-20 Hisense Electric Co., Ltd. Smart tv set, and method for processing a thumbnail of a picture
CN106803911A (en) * 2017-03-03 2017-06-06 天津天地伟业信息***集成有限公司 A kind of thumbnail creation and read method of NVR video files
CN111866419A (en) * 2019-04-24 2020-10-30 杭州海康微影传感科技有限公司 Thermal imaging image display method and device and thermal imaging equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘浩阳;: "Windows缩略图缓存文件的分析和取证", 信息网络安全, vol. 2012, no. 01, 31 January 2012 (2012-01-31) *

Similar Documents

Publication Publication Date Title
CN112137591B (en) Target object position detection method, device, equipment and medium based on video stream
CN112671921A (en) Data transmission method and device, electronic equipment and readable storage medium
CN113239106B (en) Excel file export method and device, electronic equipment and storage medium
CN112050820A (en) Road matching method and device, electronic equipment and readable storage medium
CN113868528A (en) Information recommendation method and device, electronic equipment and readable storage medium
CN112949443A (en) Table structure identification method and device, electronic equipment and storage medium
CN112860905A (en) Text information extraction method, device and equipment and readable storage medium
CN112528616A (en) Business form generation method and device, electronic equipment and computer storage medium
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
CN114640707A (en) Message asynchronous processing method and device, electronic equipment and storage medium
CN113505273A (en) Data sorting method, device, equipment and medium based on repeated data screening
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN115409041B (en) Unstructured data extraction method, device, equipment and storage medium
CN114237829B (en) Data acquisition and processing method for power equipment
CN113836335A (en) Thumbnail display method and device, electronic equipment and readable storage medium
CN114911479A (en) Interface generation method, device, equipment and storage medium based on configuration
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN114186540A (en) Mail content intelligent filling method and device, electronic equipment and storage medium
CN113010129A (en) Virtual studio full-flow multi-terminal blackboard writing extraction method and device
CN112632422A (en) Intelligent image cutting method and device, electronic equipment and storage medium
CN112233194A (en) Medical picture optimization method, device and equipment and computer-readable storage medium
CN113672565B (en) File marking method and device, electronic equipment and storage medium
CN113240776B (en) Method, device and storage medium for changing picture color based on canvas
CN113452703B (en) Combined communication request response method and device, electronic equipment and readable storage medium
CN113657076B (en) Page operation record table generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination