Picture display method and related device
By splicing multiple thumbnails into large images in electronic devices and displaying them with a small number of view controls, the lag problem when displaying a large number of thumbnails is solved, improving performance and user experience.
Patent Information
- Application Number
- CN202510084670.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2044-06-20
AI Technical Summary
In electronic devices, it is easy to cause lag when displaying a large number of thumbnails, because the creation of a large number of view controls and image decoding leads to the preemption of the central processor resources, which in turn affects the loading and display performance.
By splicing multiple thumbnails into large images and sending the spliced large images through a small number of view controls, the number of calls to the IO interface is reduced and rendering and displaying performance is improved.
Effectively reduce or avoid the lag problem when users browse a large number of thumbnails, improve the performance and frame rate of electronic devices when displaying a large number of thumbnails, and improve the user experience.
Smart Images

Figure CN120111229A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202410808432.9, and the original application date is June 20, 2024. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of electronic equipment and electronic technology, and in particular to a picture display method and related devices. Background Art
[0003] The electronic device can display thumbnails corresponding to photos (also referred to as pictures) taken or saved by the electronic device in the thumbnail display interface. In some view scenarios, the electronic device can display a large number of thumbnails at the same time. For example, the electronic device can display a large number of thumbnails at the same time in the month view scenario and the year view scenario of the gallery.
[0004] At present, for multiple thumbnails displayed in the thumbnail display interface of the electronic device, the electronic device will create multiple view controls to carry and display multiple thumbnails respectively. Each thumbnail displayed in the thumbnail display interface will occupy a view control exclusively. When the electronic device loads and displays thumbnails, the electronic device will create a view control, and obtain image resources through the input / output (IO) interface, and decode the image resources and render and display the view control. When the electronic device needs to load and display a large number of thumbnails, the electronic device needs to create a large number of view controls, and needs to call the IO interface multiple times to obtain image resources, and perform multiple image decoding, and render and display the view control multiple times. When the electronic device needs to display a large number of thumbnails in a short time, the electronic device's rendering, display, calling the IO interface to obtain image resources, decoding images, and other operations of the electronic device mutually occupy the resources of the central processing unit (CPU) of the electronic device. As a result, the time for the electronic device to obtain image resources, decode images, and create view controls becomes longer. When a user quickly slides or drags a scroll bar in a thumbnail display interface for displaying a large number of thumbnails in a gallery, the image may not be decoded after the view control is created, or the view control may not be created in time, causing a freeze when the electronic device displays the thumbnails, for example, a large number of white blocks appear in the thumbnail display interface. This results in a poor user experience.
[0005] Therefore, how to reduce or avoid display freezes in electronic devices when the electronic devices display a large number of thumbnails is an urgent problem to be solved. Summary of the invention
[0006] The present application provides a picture display method and related devices, through which the picture display method can reduce or avoid the problem of lag in the electronic device when displaying a large number of thumbnails.
[0007] In a first aspect, the present application provides a method for displaying an image, which may include: an electronic device receives and responds to a first operation of a user on a gallery application, obtains a first group of thumbnails, and the first group of thumbnails includes at least two thumbnails; the electronic device splices the first group of thumbnails into a first large image in a display order; the electronic device renders the first large image and displays a thumbnail display interface of the gallery application, wherein the first large image is displayed in the thumbnail display interface.
[0008] The first operation includes any one of an operation of a user opening a gallery application, an operation of a user switching a view scene on a thumbnail display interface, and a user sliding on a thumbnail display interface.
[0009] Through the image display method provided in the first aspect, the electronic device can splice the multiple thumbnails obtained to obtain the spliced thumbnails, and then the electronic device can display the spliced thumbnails through the view control. The thumbnails displayed in the thumbnail display interface are spliced into one or more large images. A view control can carry a large image. In this way, the electronic device only needs a small number of view controls to display a large number of thumbnails. In addition, the electronic device can query and obtain thumbnails in batches, which can reduce the number of times the IO interface is called. In this way, the performance and frame rate of the electronic device loading and displaying a large number of thumbnails can be improved, thereby avoiding or reducing the white blocks and jamming problems that occur when users browse a large number of thumbnails.
[0010] In combination with the first aspect, in a possible implementation, before displaying the thumbnail display interface of the gallery application, the method may include: the electronic device creates a first view control, and carries the first large image through the first view control.
[0011] In this way, one view control can carry a large image, and the electronic device only needs a small number of view controls to display a large number of thumbnails, thereby improving the display performance of the electronic device.
[0012] In combination with the first aspect, in a possible implementation, the method may also include: the electronic device obtains a second group of thumbnails in response to the first operation, the second group of thumbnails including at least two thumbnails; the electronic device splices the second group of thumbnails into a second large image in display order; the electronic device renders the second large image and displays the second large image on the thumbnail display interface.
[0013] In this way, all the spliced large images are displayed in the thumbnail display interface, and a thumbnail display interface only needs a small number of view controls to display a large number of thumbnails, thereby improving the display performance of the electronic device.
[0014] In combination with the first aspect, in a possible implementation, after the second large image is displayed on the thumbnail display interface, the method may also include: the electronic device receives and responds to a second operation, displays a portion of the content of the first large image and the entire content of the second large image on the thumbnail display interface, and the second operation is an operation of sliding upwards in the thumbnail display interface.
[0015] In this way, the electronic device can determine which controls to display in the thumbnail display interface and what part of the large image in the control to display, part or all, based on the second operation. Since the large image carried in the view control is complete, only a part of it is displayed in the display area of the thumbnail display interface due to user operation. Since the undisplayed part has also been loaded and spliced in advance, when the user slides, the electronic device can display the undisplayed part of the large image in the view control more quickly. Thereby, the display performance of the electronic device can be improved and the user experience can be enhanced.
[0016] In combination with the first aspect, in a possible implementation, before the second large image is displayed on the thumbnail display interface, the method may further include: the electronic device creates a second view control, and carries the second large image through the second view control.
[0017] In this way, one view control can carry a large image, and the electronic device only needs a small number of view controls to display a large number of thumbnails, thereby improving the display performance of the electronic device.
[0018] In combination with the first aspect, in a possible implementation, after displaying the thumbnail display interface of the gallery application, the method may also include: the electronic device receives and responds to a third operation, obtains a third group of thumbnails, the third group of thumbnails includes at least two thumbnails; the electronic device splices the third group of thumbnails into a third large image in the display order; the electronic device creates a third view control, and carries the third large image through the third view control; the electronic device renders the third large image, and displays the third large image on the thumbnail display interface.
[0019] In this way, the electronic device only needs a small number of view controls to display a large number of thumbnails.
[0020] In combination with the first aspect, in a possible implementation, obtaining the first group of thumbnails may include: the electronic device obtains the first group of thumbnails from a database, and the storage order of the first group of thumbnails in the database is consistent with the display order of the first group of thumbnails.
[0021] In this way, since the storage order of the first group of thumbnails in the database is consistent with the display order of the first group of thumbnails, the electronic device can read the first group of thumbnails in batches at one time, thereby reducing the number of times the electronic device calls the input / output interface, improving the performance and frame rate of the electronic device loading and displaying a large number of thumbnails, and saving the power consumption of the electronic device.
[0022] In combination with the first aspect, in a possible implementation method, the electronic device stitches the first group of thumbnails into a large picture in the order of display, which may include: the electronic device applies for a first memory; the database of the electronic device fills the first group of thumbnails into the first memory in sequence in the order of display, and stitches them into a large picture in the first memory.
[0023] Among them, the first memory is a shared memory.
[0024] In this way, other processes of the electronic device, such as the rendering process, can read the large image across processes, which can improve the rendering performance and save the power consumption of the electronic device.
[0025] In conjunction with the first aspect, in a possible implementation, the electronic device rendering the first large image may include: a rendering process of the electronic device reading the first large image from a first memory and rendering the first large image. In this way, the rendering process can read the large image across processes, which can improve rendering performance and save power consumption of the electronic device.
[0026] In conjunction with the first aspect, in a possible implementation, metadata of the first group of thumbnails is stored in the database, and the metadata includes the date and time corresponding to the first group of thumbnails and an ID. In this way, the electronic device can distinguish different thumbnails by the date and time corresponding to the thumbnails and the ID.
[0027] In conjunction with the first aspect, in a possible implementation, the first group of thumbnails includes a first thumbnail, the date and time corresponding to the first thumbnail is a first date and time, the ID corresponding to the first thumbnail is a first ID, the first date and time is the date and time when the electronic device saves the first thumbnail, and the first ID is a number generated by the electronic device when saving the first thumbnail for identifying the first thumbnail. In this way, the electronic device can distinguish different thumbnails by the date and time corresponding to the thumbnail and the ID.
[0028] In combination with the first aspect, in a possible implementation, obtaining a first group of thumbnails may include: the electronic device obtains metadata of the first group of thumbnails; the electronic device obtains a first query range based on the date, time and ID in the metadata of the first group of thumbnails; the electronic device obtains the first group of thumbnails within the first query range from the database at one time based on the first query range.
[0029] In this way, the electronic device can read multiple thumbnails at a time, which can reduce the number of times the input / output interface is called, improve the performance and frame rate of the electronic device in loading and displaying a large number of thumbnails, and save the power consumption of the electronic device.
[0030] In conjunction with the first aspect, in a possible implementation, the electronic device obtains the query range based on the date, time and ID in the metadata of the first group of thumbnails, which may include: the electronic device assembles the date, time and ID of the first group of thumbnails to obtain multiple character strings, the number of the multiple character strings is equal to the number of the first group of thumbnails; the electronic device determines the maximum value and the minimum value of the multiple character strings, and sets the first query range based on the maximum value and the minimum value. In this way, the electronic device can determine the query range of the thumbnails through the maximum value and the minimum value, and obtain all thumbnails within the query range.
[0031] In combination with the first aspect, in one possible implementation, the third operation is a sliding operation, and obtaining the third group of thumbnails may include: the electronic device determines the date, time, and ID of the third group of thumbnails based on the third operation; the electronic device determines the second query range of the third group of thumbnails based on the date, time, and ID of the third group of thumbnails; the electronic device obtains the third group of thumbnails within the second query range from the database at one time based on the second query range.
[0032] In this way, the electronic device can determine which thumbnails are currently displayed based on the operation, and set the query range according to the metadata of the thumbnails to be displayed as needed. Thus, the electronic device can batch-acquire thumbnails within the query range at one time.
[0033] In conjunction with the first aspect, in a possible implementation, the electronic device obtaining the first group of thumbnails may include: the electronic device assigning a first view control to carry the first group of thumbnails; the electronic device sending a thumbnail loading request to a database through the first view control, the thumbnail loading request being used to obtain the first group of thumbnails from the database. In this way, the electronic device may request to load the thumbnails required to be carried by the view control through the view control.
[0034] In conjunction with the first aspect, in a possible implementation, the number of view controls required in the thumbnail display interface is determined by the total number of thumbnails stored in the electronic device and the number of thumbnails read in batches. In this way, the electronic device can determine the number of view controls required in the thumbnail display interface.
[0035] In combination with the first aspect, in a possible implementation, before the electronic device receives and responds to the user's first operation on the gallery application and obtains the first group of thumbnails, the method may also include: the electronic device obtains the first image; the electronic device downsamples the first image to obtain a thumbnail of the first image; the electronic device saves the date, time and ID corresponding to the thumbnail of the first image; the electronic device saves the thumbnails of the first image to the database in the order of the date, time and ID corresponding to the thumbnails of the first image.
[0036] In this way, since the storage order of the thumbnails is consistent with the display order, the electronic device has the ability to obtain thumbnails in batches.
[0037] In combination with the first aspect, in a possible implementation method, the electronic device saves the thumbnail of the first picture to a database in the order of the date, time and ID corresponding to the thumbnail of the first picture, which may include: the electronic device performs texture compression on the thumbnail of the first picture to obtain texture data; the electronic device saves the texture data to the database in the order of the date, time and ID corresponding to the thumbnail of the first picture.
[0038] In this way, since the texture data does not need to be decoded and can be directly sent to the GPU for display, the decoding time of the electronic device is saved and the power consumption of the electronic device is saved.
[0039] In a second aspect, an electronic device is provided, which may include a first application, a processing module, a graphics subsystem, and a database, wherein the database is used to: store thumbnails;
[0040] The first application may be used to: receive and, in response to a first operation of a user on a gallery application, obtain a first group of thumbnails, wherein the first group of thumbnails includes at least two thumbnails;
[0041] The processing module may be used to: splice the first group of thumbnails into a first large image according to the display order;
[0042] The graphics subsystem can be used to: render the first large image;
[0043] The first application can be used to: display a thumbnail display interface of a gallery application, wherein the thumbnail display interface displays a first large image.
[0044] The first operation includes any one of an operation of a user opening a first application, an operation of a user switching a view scene on a thumbnail display interface, and a sliding operation of a user on a thumbnail display interface.
[0045] The first application may include any one of a gallery application, a file management application, and a picture selection application.
[0046] In this way, the electronic device can splice the multiple thumbnails obtained to obtain the spliced thumbnails, and then the electronic device can display the spliced thumbnails through the view control. The thumbnails displayed in the thumbnail display interface are spliced into one or more large images. A view control can carry a large image. In this way, the electronic device only needs a small number of view controls to display a large number of thumbnails. In addition, the electronic device can query and obtain thumbnails in batches, which can reduce the number of times the IO interface is called. In this way, the performance and frame rate of the electronic device loading and displaying a large number of thumbnails can be improved, thereby avoiding or reducing the white blocks and freezes that occur when users browse a large number of thumbnails.
[0047] In combination with the second aspect, in a possible implementation, the first application may further include: creating a first view control, and carrying the first large image through the first view control.
[0048] In this way, one view control can carry a large image, and the electronic device only needs a small number of view controls to display a large number of thumbnails, thereby improving the display performance of the electronic device.
[0049] In conjunction with the second aspect, in a possible implementation, the processing module may also be used to: in response to the first operation, obtain a second group of thumbnails, the second group of thumbnails including at least two thumbnails; splice the second group of thumbnails into a second large image in a display order;
[0050] The graphics subsystem can also be used to: render the second largest image;
[0051] The first application may also be used to: display the second largest image on the thumbnail display interface.
[0052] In this way, all the spliced large images are displayed in the thumbnail display interface, and a thumbnail display interface only needs a small number of view controls to display a large number of thumbnails, thereby improving the display performance of the electronic device.
[0053] In combination with the second aspect, in one possible implementation, the first application can also be used to: receive and respond to a second operation, display a portion of the content of the first large image and the entire content of the second large image in the thumbnail display interface, and the second operation is an operation of sliding upward in the thumbnail display interface.
[0054] In this way, the electronic device can determine which controls to display in the thumbnail display interface, and what part of the large image in the control to display, part or all, based on the second operation. Since the large image carried in the view control is complete, only a part of it is displayed in the display area of the thumbnail display interface due to user operation. Since the undisplayed part has also been loaded and spliced in advance, when the user slides, the electronic device can display the undisplayed part of the large image in the view control more quickly. Thereby, the display performance of the electronic device can be improved and the user experience can be enhanced.
[0055] In combination with the second aspect, in a possible implementation, the first application may also be used for: the electronic device to create a second view control, and to carry the second large image through the second view control.
[0056] In this way, one view control can carry a large image, and the electronic device only needs a small number of view controls to display a large number of thumbnails, thereby improving the display performance of the electronic device.
[0057] In combination with the second aspect, in a possible implementation, the first application may also be used to: the electronic device receives and responds to a third operation to obtain a third group of thumbnails, where the third group of thumbnails includes at least two thumbnails;
[0058] The processing module may also be used to: splice the third group of thumbnails into a third large image according to the display order;
[0059] The first application can also be used to: create a third view control, and carry a third large image through the third view control;
[0060] The graphics subsystem can also be used to: render the third largest image;
[0061] The first application may also be used to: display the third largest image on the thumbnail display interface.
[0062] In this way, the electronic device only needs a small number of view controls to display a large number of thumbnails.
[0063] In conjunction with the second aspect, in a possible implementation, the first application may also be used to: obtain a first group of thumbnails from a database, wherein a storage order of the first group of thumbnails in the database is consistent with a display order of the first group of thumbnails.
[0064] In this way, since the storage order of the first group of thumbnails in the database is consistent with the display order of the first group of thumbnails, the electronic device can read the first group of thumbnails in batches at one time, thereby reducing the number of times the electronic device calls the input / output interface, improving the performance and frame rate of the electronic device loading and displaying a large number of thumbnails, and saving the power consumption of the electronic device.
[0065] In conjunction with the second aspect, in a possible implementation, the database may also be used to: apply for a first memory;
[0066] The database can also be used to: fill the first group of thumbnails into the first memory in sequence according to the display order, and splice them in the first memory to obtain a large picture.
[0067] Among them, the first memory is a shared memory.
[0068] In this way, other processes of the electronic device, such as the rendering process, can read the large image across processes, which can improve the rendering performance and save the power consumption of the electronic device.
[0069] In conjunction with the second aspect, in a possible implementation, the graphics subsystem may also be used to: read the first large image from the first memory, and render the first large image. In this way, the graphics subsystem can read the large image across processes, which can improve rendering performance and save power consumption of the electronic device.
[0070] In conjunction with the second aspect, in a possible implementation, metadata of the first group of thumbnails is stored in the database, and the metadata includes the date and time corresponding to the first group of thumbnails and an ID. In this way, the electronic device can distinguish different thumbnails by the date and time corresponding to the thumbnails and the ID.
[0071] In conjunction with the second aspect, in a possible implementation, the first group of thumbnails includes a first thumbnail, the date and time corresponding to the first thumbnail is a first date and time, the ID corresponding to the first thumbnail is a first ID, the first date and time is the date and time when the electronic device saves the first thumbnail, and the first ID is a number generated by the electronic device when saving the first thumbnail for identifying the first thumbnail. In this way, the electronic device can distinguish different thumbnails by the date and time corresponding to the thumbnail and the ID.
[0072] In conjunction with the second aspect, in a possible implementation, the electronic device may further include a media library and a distributed data management module, and the media library may be used to: obtain metadata of the first group of thumbnails; and send a thumbnail query instruction to the distributed data management module, wherein the query instruction carries the metadata of the first group of thumbnails;
[0073] The distributed data management module can be used to: receive a query instruction, and obtain a first query range based on the date, time and ID in the metadata of the first group of thumbnails carried in the query instruction; and obtain the first group of thumbnails within the first query range from the database at one time based on the first query range.
[0074] In this way, the electronic device can read multiple thumbnails at a time, which can reduce the number of times the input / output interface is called, improve the performance and frame rate of the electronic device in loading and displaying a large number of thumbnails, and save the power consumption of the electronic device.
[0075] In conjunction with the second aspect, in a possible implementation, the distributed data management module can also be used to: assemble the date and time and ID of the first group of thumbnails to obtain multiple character strings, the number of the multiple character strings is equal to the number of the first group of thumbnails; the electronic device determines the maximum value and the minimum value of the multiple character strings, and sets the first query range based on the maximum value and the minimum value. In this way, the electronic device can determine the query range of the thumbnails through the maximum value and the minimum value, and obtain all thumbnails within the query range.
[0076] In conjunction with the second aspect, in a possible implementation, the third operation is a sliding operation, and the media library may also be used to: determine the date, time and ID of the third group of thumbnails based on the third operation;
[0077] The distributed data management module can also be used to: determine a second query range of the third group of thumbnails based on the date, time and ID of the third group of thumbnails; and obtain the third group of thumbnails within the second query range from the database at one time based on the second query range.
[0078] In this way, the electronic device can determine which thumbnails are currently displayed based on the operation, and set the query range according to the metadata of the thumbnails to be displayed as needed. Thus, the electronic device can batch-acquire thumbnails within the query range at one time.
[0079] In conjunction with the second aspect, in a possible implementation, the first application may also be used to: allocate a first view control to carry a first group of thumbnails; and send a thumbnail loading request to a database through the first view control, where the thumbnail loading request is used to obtain the first group of thumbnails from the database. In this way, the electronic device may load thumbnails required to be carried by the view control through a view control request.
[0080] In conjunction with the second aspect, in a possible implementation, the number of view controls required in the thumbnail display interface is determined by the total number of thumbnails stored in the electronic device and the number of thumbnails read in batches. In this way, the electronic device can determine the number of view controls required in the thumbnail display interface.
[0081] In conjunction with the second aspect, in a possible implementation, the electronic device may further include a second application, and the second application may be used to: acquire the first picture;
[0082] The media library may also be used to: downsample the first image to obtain a thumbnail of the first image;
[0083] The media library may also be used to: instruct the distributed data management module to save the date, time and ID corresponding to the thumbnail of the first picture;
[0084] The distributed data management module may also be used to save the thumbnails of the first pictures to the database in the order of the date and time and ID corresponding to the thumbnails of the first pictures.
[0085] In this way, since the storage order of the thumbnails is consistent with the display order, the electronic device has the ability to obtain thumbnails in batches.
[0086] In conjunction with the second aspect, in a possible implementation, the media library may also be used for: the electronic device performs texture compression on the thumbnail of the first picture to obtain texture data;
[0087] The distributed data management module may also be used to save the texture data to the database in the order of the date and time and ID corresponding to the thumbnail of the first picture.
[0088] In this way, since the texture data does not need to be decoded and can be directly sent to the GPU for display, the decoding time of the electronic device is saved and the power consumption of the electronic device is saved.
[0089] In a third aspect, the present application provides an electronic device, which may include one or more processors, one or more display screens, and a memory, wherein the one or more display screens and the memory are coupled to the one or more processors, and the memory stores code, and when the code is processed by the processor, the electronic device executes a method in any possible implementation of the first aspect above.
[0090] In a fourth aspect, the present application provides a computer-readable storage medium, comprising computer instructions, which, when executed on a computer, enable the computer to execute a method in any possible implementation of the first aspect.
[0091] In a fifth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute a method in any possible implementation of the first aspect.
[0092] In a sixth aspect, the present application provides a chip or a chip system, which is applied to an electronic device, including a processing circuit and an interface circuit, the interface circuit being used to receive code instructions and transmit them to the processing circuit, and the processing circuit being used to run the code instructions to execute the method in any possible implementation of the first aspect above.
[0093] It can be understood that the electronic device provided in the third aspect, the computer-readable storage medium provided in the fourth aspect, the computer program product provided in the fifth aspect, and the chip or chip system provided in the sixth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] Figure 1 is a schematic diagram of a thumbnail display interface in a day view scenario provided in an embodiment of the present application;
[0095] Figure 2 is a schematic diagram of a thumbnail display interface in a month view scenario provided in an embodiment of the present application;
[0096] Figure 3 is a schematic diagram of a thumbnail display interface in a year view scenario provided in an embodiment of the present application;
[0097] Figure 4 is a schematic diagram of a white block appearing on the thumbnail display interface in the year view scenario provided in an embodiment of the present application;
[0098] Figure 5A is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0099] Figure 5B is a software structure block diagram of the electronic device provided in the embodiment of the present application;
[0100] Figure 5C is a software structure block diagram of the electronic device provided in the embodiment of the present application;
[0101] Figure 6 is a schematic diagram of a process of saving thumbnails by the electronic device 100 provided in an embodiment of the present application;
[0102] Figure 7 It is a schematic diagram of an electronic device storing thumbnails in an orderly manner provided by an embodiment of the present application;
[0103] Figure 8 It is a flowchart of a method for displaying an image provided by an embodiment of the present application;
[0104] Fig.9A is a schematic diagram of a view control included in a thumbnail display interface provided in an embodiment of the present application;
[0105] Fig. 9B is a schematic diagram of a display area display view control of a thumbnail display interface provided in an embodiment of the present application;
[0106] Fig. 9C is a schematic diagram of a display area display view control of a thumbnail display interface provided in an embodiment of the present application;
[0107] Fig.9D is a schematic diagram of a display area display view control of a thumbnail display interface provided in an embodiment of the present application;
[0108] Fig.10 is a schematic diagram of a spliced thumbnail provided in an embodiment of the present application;
[0109] Fig.11 It is a flowchart of a method for displaying an image provided in an embodiment of the present application. DETAILED DESCRIPTION
[0110] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0111] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear contrary indication in the context. The terms "first" and "second" are only used for descriptive purposes, and cannot be understood as implying or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. "First" and "second" etc. are used to distinguish different objects, rather than for describing a specific order of objects. For example, the first object and the second object are used to distinguish different objects, rather than for describing a specific order of objects.
[0112] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
[0113] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or related scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0114] The term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0115] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0116] In order to better understand the technical solution provided by the present application, before describing the technical solution of the present application, the electronic device 100 with gallery or album function to which the present application is applicable is briefly introduced in conjunction with the accompanying drawings. In the embodiment of the present application, the electronic device 100 may be referred to as a terminal, or may be referred to as a user equipment (UE), which is not limited in the embodiment of the present application. The electronic device 100 involved in the present application may include, but is not limited to: a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR), a vehicle-mounted device, etc. The embodiment of the present application does not limit the specific form or type of the electronic device 100.
[0117] Currently, the gallery application of the electronic device 100 displays thumbnail display interfaces in different view scenarios. For example, the electronic device 100 can display thumbnail display interfaces in scenarios such as day view, month view, and year view in the gallery application. In the electronic device 100, the user can preview thumbnails presented in chronological order. The user can also choose to preview thumbnails according to the year, month, and day dimensions. The preview views under the year, month, and day dimensions can be called year view, month view, and day view, respectively. The thumbnail display interfaces in different view scenarios display thumbnails of different sizes and different orders of magnitude, and different views can jump to each other, so that users can quickly find the corresponding pictures.
[0118] Figure 1The thumbnail display interface 101 of the electronic device 100 in the day view scene is exemplarily shown. Figure 1 As shown, the thumbnail display interface 101 can be used to display thumbnails of photos acquired on a specific date. The thumbnail display interface 101 can also include a text prompt 102. For example, the text prompt 102 can be "February 23, 2023", which is used to prompt that the shooting date or storage date of the thumbnails corresponding to the multiple photos displayed on the thumbnail display interface 101 is "February 20, 2023". The thumbnails corresponding to the multiple photos displayed on the thumbnail display interface 101 can include a thumbnail 104 corresponding to photo 1.
[0119] Optionally, the electronic device 100 may arrange the thumbnails corresponding to multiple photos whose shooting date or saving date is February 20, 2023 in a distribution relationship of 8 rows and 4 columns in the thumbnail display interface 101.
[0120] Optionally, the user may also slide up or down in the thumbnail display interface 101 to view thumbnails corresponding to photos (or pictures) taken or saved on other dates.
[0121] like Figure 1 As shown, the thumbnail display interface 101 may also include a view switching control 103. The view switching control 103 is used to switch different view scenes. Exemplarily, the view switching control 103 may include a day view control 103a, a month view control 103b, and a year view control 103c. The current day view control 103a is in a selected state, which is used to indicate that the current electronic device 100 displays the thumbnail display interface under the day view scene. The month view control 103b is used to instruct the electronic device 100 to switch to displaying the thumbnail display interface under the month view scene. The year view control 103c is used to instruct the electronic device 100 to switch to displaying the thumbnail display interface under the year view scene.
[0122] In some feasible examples, the user may click on the month view control 103b. In response to the user operation, the electronic device 100 may display a thumbnail display interface in the month view scene.
[0123] Figure 2 The thumbnail display interface 200 in the moon view scene of the electronic device 100 is exemplarily shown. Figure 2As shown, the thumbnail display interface 200 can be used to display thumbnails of photos acquired in a specific month. The thumbnail display interface 200 can also include a text prompt 201. For example, the text prompt 201 can be "February 2023", which is used to prompt that the shooting month or the saving month of the thumbnails corresponding to the multiple photos displayed in the thumbnail display interface 200 is "February 2023". The thumbnails corresponding to the multiple photos displayed in the thumbnail display interface 200 can include a thumbnail 202 corresponding to photo 1.
[0124] Optionally, the electronic device 100 may arrange the thumbnails corresponding to multiple photos whose shooting month or saving month is February 2023 in a distribution relationship of 16 rows and 8 columns in the thumbnail display interface 200.
[0125] Optionally, the user may also slide up or down in the thumbnail display interface 200 to view thumbnails corresponding to photos taken or saved in other months.
[0126] like Figure 2 As shown, the thumbnail display interface 200 may also include a view switching control 103. Currently, the month view control 103b in the view switching control 103 is in a selected state, indicating that the electronic device 100 currently displays the thumbnail display interface in the month view scene. Figure 1 The description is not repeated here.
[0127] In some feasible examples, the user may click on the year view control 103c. In response to the user operation, the electronic device 100 may display a thumbnail display interface in the year view scenario.
[0128] Figure 3 The thumbnail display interface 300 in the year view scenario of the electronic device 100 is exemplarily shown. Figure 3 As shown, the thumbnail display interface 300 can be used to display thumbnails of photos acquired in a specific year. The thumbnail display interface 300 can also include a text prompt 301. For example, the text prompt 301 can be "2023", which is used to prompt that the shooting year or the saving year of the thumbnails corresponding to the multiple photos displayed in the thumbnail display interface 300 is "2023". The thumbnails corresponding to the multiple photos displayed in the thumbnail display interface 300 can include a thumbnail 302 corresponding to photo 1.
[0129] Optionally, the electronic device 100 may arrange the thumbnails corresponding to multiple photos whose shooting year or saving year is 2023 in a distribution relationship of 32 rows and 16 columns in the thumbnail display interface 300.
[0130] Optionally, the user can also slide up or down in the thumbnail display interface 300 to view thumbnails corresponding to photos taken or saved in other years.
[0131] like Figure 3 As shown, the thumbnail display interface 300 may also include a view switching control 103. Currently, the year view control 103c in the view switching control 103 is in a selected state, indicating that the electronic device 100 currently displays the thumbnail display interface in the year view scene. Figure 1 The description is not repeated here.
[0132] In some feasible examples, since the number of thumbnails displayed in the thumbnail display interface gradually increases from the day view scene to the year view scene, and the size of the display screen of the electronic device 100 is unchanged, the size of the thumbnails displayed in the thumbnail display interface will gradually decrease from the day view scene to the year view scene. Exemplarily, for the same photo, the size of the thumbnail of the photo displayed in the thumbnail display interface under the month view scene is smaller than the size of the thumbnail of the photo displayed in the thumbnail display interface under the day view scene. The size of the thumbnail of the photo displayed in the thumbnail display interface under the year view scene is smaller than the size of the thumbnail of the photo displayed in the thumbnail display interface under the month view scene. For example, the size of the thumbnail 302 corresponding to the photo 1 in the year view scene is smaller than the size of the thumbnail 202 corresponding to the photo 1 in the month view scene. The size of the thumbnail 202 corresponding to the photo 1 in the month view scene is smaller than the size of the thumbnail 104 corresponding to the photo 1 in the day view scene.
[0133] In the embodiment of the present application, the number of thumbnails displayed by the electronic device 100 in the day view scene, the month view scene, and the year view scene is not limited. It can be understood that the number of thumbnails that can be displayed in the thumbnail display interface of the number of thumbnails displayed by the electronic device 100 in the day view scene, the month view scene, and the year view scene is related to the size of the display screen of the electronic device 100. The larger the size of the display screen of the electronic device 100, the more thumbnails can be displayed in the thumbnail display interface of the number of thumbnails displayed by the electronic device 100 in the day view scene, the month view scene, and the year view scene.
[0134] Taking the year view scenario as an example, when the user is in the thumbnail display interface of the year view scenario (for example, Figure 3When a finger touches and slides up and down in the thumbnail display interface 300 shown in the figure, after the view control for displaying pictures in the thumbnail display interface receives the touch event, the corresponding display area will request to refresh the thumbnails arranged in reverse chronological order one by one. The process of requesting to refresh includes reading the thumbnail resources, decoding the pictures, drawing and rendering, and finally displaying the thumbnails one by one in the corresponding display area.
[0135] At present, the number of thumbnails that can be displayed by the electronic device 100 in the month view scene and the year view scene is much greater than the number of thumbnails that can be displayed in the day view scene. When the electronic device 100 needs to load and display a large number of thumbnails, the electronic device 100 needs to create a large number of view controls, and needs to call the IO interface multiple times to obtain image resources, perform multiple image decoding, and render and display the view controls multiple times. When the electronic device 100 needs to display a large number of thumbnails in a short time, the rendering, display, calling the IO interface to obtain image resources, decoding images, and other operations of the electronic device 100 mutually occupy the resources of the CPU of the electronic device 100. As a result, the time for the electronic device 100 to obtain image resources, decode images, and create view controls becomes longer. When the user quickly slides in the thumbnail display interface of the gallery for displaying a large number of thumbnails, or drags the scroll bar and other operations, the view control will be created, but the picture has not been decoded, or the view control will not be created in time, so that the electronic device will freeze when displaying thumbnails, for example, a large number of white blocks appear in the thumbnail display interface. For the scene of displaying a large number of thumbnails in the month view scene and the year view scene, taking the year view scene as an example, when the user quickly slides or drags the scroll bar in the thumbnail display interface 300 in the year view scene, a large number of white blocks will appear in the thumbnail display interface. Figure 4 As shown, a white block appears in area 401 in the thumbnail display interface 300. This results in a poor user experience.
[0136] In order to solve the problem of white blocks and freezes when the user browses thumbnails in the scene where the electronic device 100 displays a large number of thumbnails, the embodiment of the present application provides a method for displaying pictures, which may include: first, when the electronic device 100 stores thumbnails corresponding to the captured or saved pictures, the thumbnails are stored in the order in which the thumbnails are arranged in the thumbnail display interface. In this way, the electronic device 100 has the ability to query and obtain thumbnails in batches. Then, when the electronic device displays the thumbnail display interface, the electronic device 100 can query and obtain thumbnails in batches. The electronic device 100 can splice the multiple thumbnails obtained to obtain the spliced thumbnails, and then the electronic device 100 can display the spliced thumbnails through the view control.
[0137] Through the image display method provided by the present application, the thumbnails displayed in the thumbnail display interface are spliced into one or more large images. One view control can carry one large image. In this way, the electronic device 100 only needs a small number of view controls (for example, 1 or 2, etc.) to display a large number of thumbnails. In addition, the electronic device 100 can query and obtain thumbnails in batches, which can reduce the number of times the IO interface is called. In this way, the performance and frame rate of electronic devices loading and displaying a large number of thumbnails can be improved, thereby avoiding or reducing the occurrence of white blocks and freezes in the process of users browsing a large number of thumbnails.
[0138] It should be noted that the thumbnails involved in the present application can be thumbnails corresponding to pictures, or thumbnails corresponding to video files, audio files, etc. The following takes pictures as an example to illustrate the storage and display process of thumbnails corresponding to pictures. It is understandable that the thumbnails of video files, audio files, etc. can refer to the storage and display process of thumbnails corresponding to pictures, and the embodiments of the present application will not be repeated here.
[0139] The following first introduces an exemplary electronic device 100 provided in an embodiment of the present application.
[0140] Figure 5A It is a schematic diagram of the structure of the electronic device 100 provided in an embodiment of the present application.
[0141] The embodiment is described in detail below by taking the electronic device 100 as an example. It should be understood that the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0142] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194 and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0143] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0144] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0145] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0146] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0147] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0148] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0149] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0150] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0151] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0152] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0153] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0154] The SIM interface can be used to communicate with the SIM card interface 195 to implement the function of transmitting data to the SIM card or reading data in the SIM card.
[0155] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0156] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0157] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0158] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
[0159] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0160] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0161] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0162] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0163] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0164] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0165] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0166] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0167] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0168] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0169] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0170] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0171] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0172] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0173] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0174] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, applications required for at least one function (such as face recognition function, fingerprint recognition function, mobile payment function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as face information template data, fingerprint information template, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0175] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0176] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0177] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0178] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0179] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0180] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0181] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0182] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0183] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0184] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0185] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0186] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0187] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0188] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0189] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0190] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0191] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0192] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0193] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0194] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0195] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications.
[0196] Figure 5B It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0197] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided from top to bottom into the application layer, the framework and system service layer, and the kernel layer.
[0198] The application layer may include a series of application packages. In some examples, the application layer may also be referred to as the application layer.
[0199] like Figure 5B As shown, the application package may include camera, gallery, file management, desktop, photo picker and other application programs (also referred to as applications).
[0200] The camera can capture images. The desktop can be used to display icons of applications installed in the electronic device 100. Applications such as gallery, file management, and picture selection can all be used to display thumbnails. The following is an example of loading and displaying thumbnails in a gallery application. In the embodiment of the present application, the gallery application can also be referred to as a gallery.
[0201] Optionally, in some examples, the gallery may be used to display a thumbnail display interface, wherein the thumbnail display interface is used to display thumbnails of multiple photos acquired by the electronic device 100 .
[0202] The gallery can also be used to determine the preview specifications of the thumbnail display interface (for example, the number of thumbnails that can be displayed, and the performance parameters that can support batch query of thumbnails) and the number of view controls required to layout the thumbnail display interface according to the UI interface display rules provided by the UI framework. Then, the gallery application can calculate the thumbnails that need to be displayed for each view control in the thumbnail display interface based on the thumbnails to be displayed, and obtain the metadata information set of the thumbnails. The gallery application can also assemble metadata information according to the order in which the thumbnails are displayed on the thumbnail display interface to obtain the primary key information. The display module can also request to load and display batch thumbnails based on the key information and layout distribution information of multiple thumbnails.
[0203] The framework layer provides an application programming interface (API) and a programming framework for the application programs in the application layer. The framework layer may include some predefined functions.
[0204] Optionally, in a possible implementation, the API and programming framework provided by the framework layer may support multiple languages, for example, programming languages such as C, C++, Java, and JS.
[0205] like Figure 5BAs shown, the framework layer may also include a UI framework, which may be applied in electronic devices, such as a gallery, to provide UI components and interface layout calculation capabilities, UI interaction capabilities, and the like.
[0206] like Figure 5B As shown, the framework layer may include a loading framework. The loading framework may include a reading module and a splicing module. The reading module may be used to batch read image data based on metadata information of thumbnails that can be displayed by each view control and layout distribution information.
[0207] The stitching module can be used to stitch multiple thumbnails read by the reading module into one large picture according to the layout distribution information of the thumbnail display interface.
[0208] The splicing module can also be used to decode the read ultra-compressed texture data of the thumbnail into texture data.
[0209] like Figure 5B As shown, the framework layer may further include a graphics subsystem. The graphics subsystem may have the ability to encapsulate texture objects, for example, the graphics subsystem may encapsulate texture data into a bitmap and store it in a shared memory.
[0210] The graphics subsystem may also have texture rendering and display capabilities. For example, the graphics subsystem may render a large image spliced by the splicing module, and send the rendered large image to a thumbnail display interface of the gallery.
[0211] The system service layer is a core capability set of the operating system of the electronic device 100. The system service layer can provide services to the application layer through the framework layer.
[0212] like Figure 5B As shown, the system service layer may include a media library, which may be used to provide access to the application layer and obtain services for media resources (e.g., pictures, videos, audio, files, etc.) in the electronic device. The media library may also include a data processing module and a data storage module. The data processing module may process the video or picture taken by the electronic device to obtain a thumbnail corresponding to the video or picture. The data storage module may be used to send a storage command, which may be used to instruct the distributed data management module to store the thumbnail.
[0213] like Figure 5B As shown, the system service layer may also include a texture algorithm, and the texture algorithm may include a texture compression algorithm, a texture super-compression algorithm, and a texture splicing algorithm.
[0214] The data processing module in the media library can call the texture compression algorithm to compress the thumbnail into texture data, and then call the texture super-compression algorithm to compress the texture data into super-compressed texture data (or texture super-compressed data, or super-compressed data, etc.).
[0215] After obtaining the ultra-compressed texture data corresponding to the thumbnail, the stitching module can call the texture ultra-compression algorithm to decode the ultra-compressed texture data into texture data, and then call the texture stitching algorithm to stitch the texture data of multiple thumbnails into a large texture image.
[0216] like Figure 5B As shown, the system service layer may further include a distributed data management module. The distributed data management module may include an owner / visitor database module, a key-value database (KVDB) management module, and a relational database management module.
[0217] The owner / visitor database module can be used to manage the access rights of the database. The owner of the database can directly read the data in the database and write data in the database; the visitor of the database can directly read the data in the database without crossing processes.
[0218] The KVDB management module can be used to store thumbnails based on the storage instructions of the media library. Specifically, the KVDB management module can store the texture data corresponding to the thumbnails in the year view scene or the month view scene generated by the media library in an orderly manner into a thumbnail database file, and the thumbnail database can be implemented as a KVDB. The KVDB management module can store the texture data corresponding to the thumbnail in the day view scene generated by the media library into the thumbnail file.
[0219] The kernel layer may include one or more kernel subsystems, which may provide basic kernel capabilities for the upper layer, including process / thread management, memory management, file system and other kernel capabilities.
[0220] like Figure 5B As shown, the kernel layer may include a file system module, and the file system module may be used to store media resources in the electronic device 100. The file system module may include multiple files, and the multiple files may include a thumbnail database file for storing thumbnails of year and month view scenes, a metadata database file for storing metadata, and a thumbnail file for storing thumbnails in a day view scene.
[0221] like Figure 5B As shown, the kernel layer may further include a sandbox management module, which may be used to provide sandbox isolation for the application.
[0222] Hereinafter, the thumbnail database file is simply referred to as a thumbnail database.
[0223] Combined with the above Figure 5B The software structure block diagram of the electronic device 100 provided in Figure 5C The embodiment of the present application shows the interaction of related modules and the specific data flow when the electronic device saves thumbnails and loads and displays thumbnails. Figure 5C In the embodiment, application 1 can obtain a picture and request to save the picture, as well as the thumbnail corresponding to the picture. Application 2 can request to load and display the thumbnail. Application 1 can be any application in the electronic device 100 that can obtain and save pictures, for example, a camera. Application 2 can be any application in the electronic device 100 that can display thumbnails, for example, a gallery, file management, picture selection, etc. The following is explained by taking application 1 as a camera and application 2 as a gallery as an example. It can be understood that the embodiments of the present application do not specifically limit application 1 and application 2.
[0224] like Figure 5C As shown, the electronic device 100 saves thumbnails and displays thumbnails in a gallery, which may include the following steps:
[0225] Step ①-Step ③: Save the thumbnail.
[0226] ①. The electronic device 100 receives and responds to the operation for the camera application, and the electronic device 100 takes photos and transmits the taken photos to the media library.
[0227] The user can click on the shooting control in the shooting interface of the camera application, and in response to the user operation, the camera of the electronic device 100 can take a photo. The electronic device 100 can transfer the photo taken by the camera to the media library.
[0228] In some feasible examples, the electronic device 100 may first transmit the photos taken by the camera head to the camera application, process the photos taken by the camera application through the relevant algorithm of the camera application, and then transmit the photos processed by the camera application to the media library. This embodiment of the application is not limited to this.
[0229] ②. The data processing module in the media library processes the taken photos and sends the processed photo data to the file system module.
[0230] The media library can generate a thumbnail A2 corresponding to the photo A1 based on the captured photo A1, and then process the thumbnail A2 through the data processing module to obtain texture data A3. Then, the media library can send a storage instruction to instruct the distributed data management module to transfer the texture data A3 to the thumbnail database in the file system module.
[0231] Exemplarily, the media library may compress the photographed photo A1 to obtain a thumbnail A2 corresponding to the photo. The embodiment of the present application does not limit the method of generating the thumbnail A2 corresponding to the photo A1.
[0232] Optionally, in a possible implementation, when the electronic device 100 displays a browser application or a communication application, in response to a user's operation of saving a picture B1 displayed in an application interface such as a browser application or a communication application, the electronic device 100 may download the picture B1. Then, the electronic device 100 may transfer the downloaded picture B1 to the media library. The media library may generate a thumbnail B2 corresponding to the picture B1, and process the thumbnail to obtain texture data B3. Then, the media library may transfer the texture data B3 to a thumbnail database in the file system module.
[0233] ③. The distributed data management module stores the photo data in the file system module in an orderly manner.
[0234] The distributed data management module can store the texture data obtained by thumbnail processing into the file system module based on the storage instruction sent by the media library.
[0235] In one possible implementation, the distributed data management module may store the texture data in a thumbnail database in the file system module. In some examples, the thumbnail database may be implemented as a key-value database (KVDB). The KVDB may store or index data based on the key value of the data.
[0236] Furthermore, in a possible implementation, the distributed data management module can also store the texture data corresponding to the thumbnails in the KVDB in an orderly manner according to the preview order of the thumbnails in the thumbnail display interface. In this way, the KVDB can provide the ability to query the texture data of the thumbnails by range.
[0237] In a possible implementation, the media library may further instruct the distributed data management module to send the captured photos to the file system module, which may store the captured photos.
[0238] For details about the storage of texture images obtained by thumbnail processing, please refer to the following Figure 6 The description of is not repeated here.
[0239] Step ④-Step ⑧: Display thumbnails.
[0240] ④. The gallery sends an image loading request to the loading framework.
[0241] When a user opens a gallery, or when a user slides in the thumbnail display interface of the gallery, the gallery may send a picture loading request to the loading framework in the framework layer.
[0242] ⑤. Load the reading module in the framework to read the image data.
[0243] The reading module in the loading framework can obtain the image data from the media library based on the image loading request sent by the application. Then, the media library can read the image data from the database of the file system module based on the image loading request.
[0244] In a possible implementation, the image data read by the reading module is the texture data corresponding to the thumbnail, and the texture data does not need to be decoded and can be directly sent for display.
[0245] Furthermore, the reading module can read the image data in batches, that is, the texture data corresponding to multiple thumbnails can be obtained at one time.
[0246] ⑥. The reading module transmits the read image data to the stitching module.
[0247] The reading module can transmit the read image data, that is, the texture data, to the stitching module.
[0248] ⑦. The stitching module stitches the read image data and sends the stitched large image to the graphics subsystem.
[0249] The splicing module can splice the read image data to obtain spliced image data. In some examples, the spliced image data is called large image data or large image.
[0250] The stitching module can transmit the stitched image data to the graphics subsystem.
[0251] ⑧. The graphics subsystem renders the large image and sends the rendered large image to the image library.
[0252] The graphics subsystem can render the spliced image data to obtain a rendered large image. After the gallery receives the rendered large image, the display module in the gallery can display the rendered large image.
[0253] For details on how the electronic device 100 loads and displays thumbnails, please refer to the following description. Figure 8 The description is not repeated here.
[0254] The specific process of saving thumbnails by the electronic device 100 in the embodiment of the present application is described in detail below.
[0255] Figure 6 The following is a schematic diagram of a process for electronic device 100 to save thumbnails in an embodiment of the present application. Figure 6 As shown, the electronic device 100 may store thumbnails in the following steps:
[0256] S601. The electronic device 100 saves the picture 1 to the media library.
[0257] The picture 1 may be taken by a camera of the electronic device 100, or may be downloaded by the electronic device 100 based on a saving operation of the user, which is not limited in the embodiment of the present application.
[0258] In some examples, the picture 1 may also be referred to as the original picture.
[0259] The electronic device 100 can save the picture 1 to the media library based on the user's shooting operation or the user's click-save operation.
[0260] In some examples, the format of the picture 1 acquired by the electronic device 100 may be RGBX. Then, the electronic device 100 may encode the picture 1 into binary data in the joint photographic experts group (JPEG) format, and store the binary data in the JPEG format in the media library. The binary data in the JPEG format may become the source data, or may be referred to as the source data of the picture 1.
[0261] S602. The electronic device 100 creates metadata of the picture 1. The metadata of the picture 1 includes uniform resource locator URL information, date and time information, and identity information of the picture 1.
[0262] When saving picture 1 to the media library, the electronic device 100 may create metadata for picture 1. The metadata for picture 1 may include, but is not limited to, one or more of: a uniform resource locator (URL), date and time information, and identity information of picture 1.
[0263] In the embodiment of the present application, the electronic device 100 can create metadata corresponding to the picture when saving the picture. Then, the electronic device 100 can store the created metadata in the metadata database. The metadata of the picture is used to describe the attribute information of the picture, for example, to indicate the storage location, file name, picture size, occupied space, creation time, identity, etc. of the picture. The electronic device 100 can find the corresponding picture and the thumbnail corresponding to the picture based on the metadata of the picture.
[0264] The electronic device 100 may have a metadata database and a thumbnail database. The metadata database may be used to store metadata, and the thumbnail database may be used to store texture data corresponding to thumbnails. In some examples, the thumbnail data may be implemented as a key-value database KVDB. The following description will be given by taking the thumbnail database as a key-value database KVDB as an example.
[0265] The metadata may include one or more of a uniform resource locator, date and time information, and identity information. The uniform resource locator may be used to indicate the storage location of the image corresponding to the metadata. The date and time information may be used to indicate the time when the electronic device 100 acquires the image (also referred to as the creation time). The identity information is a unique identifier of the image. When other attribute information of two images (e.g., storage location, creation time file name, image size, occupied space, creation time, etc.) is the same, the two images may be distinguished by the identity information.
[0266] In some examples, the URL may also be referred to as a link. The electronic device 100 may find the location where the source data of the picture 1 is stored based on the URL in the metadata of the picture 1, and obtain the source data of the picture 1 based on the URL.
[0267] The date and time information datetime of picture 1 may include the date and time when the electronic device 100 takes or downloads picture 1. For example, the date when the electronic device 100 takes picture 1 is February 20, 2023, and the time is 08:30:45. The date and time information of picture 1 created by the electronic device 100 may be "20230220_083045". That is to say, the format of the date and time information created by the electronic device 100 may be "year-month-day-hour-minute-second". It is understandable that the embodiment of the present application does not limit the format of the date and time information.
[0268] The metadata of the picture 1 may also include the identification information of the picture, for example, the identification information of the picture 1 may be the primary key ID corresponding to the picture 1. Optionally, the primary key ID of the picture 1 may be composed of numbers, for example, the primary key ID of the picture 1 may be 1. It is understood that the primary key ID of each picture stored in the electronic device 100 is different.
[0269] In one possible implementation, the electronic device 100 generates the primary key ID of the picture saved by the electronic device 100 in a sequentially increasing manner. That is, the newer the date and time of the picture saved by the electronic device 100, the larger the value of the primary key ID corresponding to the picture. For example, the date when the electronic device 100 took picture 1 is February 20, 2023, and the time is 08:30:45. The primary key ID corresponding to picture 1 can be 10. The primary key ID of the next picture 2 saved by the electronic device 100 after picture 1 can increase the first value based on the primary key ID of picture 1. Taking the first value of 1 as an example, that is, the primary key ID of picture 2 can be 11.
[0270] The embodiment of the present application does not specifically limit the primary key ID of the picture 1. The embodiment of the present application does not specifically limit the specific value of the first value.
[0271] S603. The electronic device 100 generates a thumbnail of the picture 1 Figure 1 .
[0272] The electronic device 100 can generate a thumbnail of the picture 1 Figure 1 For example, the electronic device 100 may downsample the image 1 to obtain a thumbnail image. Figure 1 . Abbreviation Figure 1 The size is smaller than that of picture 1.
[0273] In one possible implementation, see Figure 5B The media library of the electronic device 100 may include a data processing module. The electronic device 100 may also downsample the image 1 through the data processing module to obtain a thumbnail of the image 1. Figure 1 .
[0274] When the picture 1 is taken by the electronic device 100, the electronic device 100 can generate a thumbnail corresponding to the picture 1 at the same time when the picture is taken. When the picture 1 is downloaded by the electronic device 100, the thumbnail of the picture 1 will be generated only after the user opens the gallery after the electronic device 100 downloads the picture. Figure 1 .
[0275] It is understandable that the metadata database may include metadata corresponding to the original image (e.g., image 1) and may also include thumbnails (e.g., thumbnails 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, Figure 1 ) corresponding metadata.
[0276] S604. Electronic device 100 pairs of thumbnails Figure 1 Encoding is performed to obtain texture data 1.
[0277] The electronic device 100 can Figure 1Encoding is performed to obtain texture data 1. The texture data 1 can support direct display, that is, the electronic device 100 does not need to decode before acquiring the texture data 1 for display.
[0278] In a possible implementation, the electronic device 100 may use adaptive scalable texture compression (ASTC) to encode the thumbnail to obtain binary data in the ASTC format. The binary data in the ASTC format may also be referred to as texture data.
[0279] In one possible implementation, see Figure 5B The media library of the electronic device 100 may include a data processing module. The electronic device 100 may also use the data processing module to use ASTC to abbreviate Figure 1 Encode and get the abbreviation Figure 1 The corresponding binary data in ASTC format (can be called texture data 1).
[0280] Compared with binary data in JPEG format, binary data in ASTC format can be directly displayed without decoding. However, for binary data in JPEG format, the electronic device 100 needs to decode it before displaying it. In this way, when the electronic device 100 uses binary data in ASTC format to store thumbnails, when the electronic device 100 displays thumbnails, it does not need to decode the binary data in ASTC format corresponding to the thumbnail, and directly displays it, which can improve the display frame rate of the electronic device 100.
[0281] S605. The electronic device 100 saves the texture data 1 into the database. The key information of the texture data 1 in the database includes the date and time information and the identity information of the image 1.
[0282] The electronic device 100 stores the texture data corresponding to the plurality of thumbnails in a database according to the display order of the plurality of thumbnails. Figure 1 The texture data corresponding to the plurality of thumbnails include texture data 1. The electronic device 100 Figure 1 The display order of the thumbnails is saved Figure 1 The corresponding texture data 1 is stored in the database, and the key information of texture data 1 in the database includes the date and time information and identity information of image 1.
[0283] In some possible implementations, the electronic device 100 determines the display order of the thumbnails based on the date and time information of the multiple thumbnails. The electronic device 100 may display thumbnails with earlier dates and times before thumbnails with later dates and times.
[0284] Further, in a possible implementation, the electronic device 100 may display a thumbnail with an earlier date and time before a thumbnail with a later date and time, which may include: the electronic device 100 may display the thumbnail with an earlier date and time in the upper row of the thumbnail with a later date and time. Or, for example, the electronic device 100 may display the thumbnail with an earlier date and time in the same row of the thumbnail with a later date and time, but the position of the thumbnail with an earlier date and time is before the thumbnail with a later date and time. Taking the electronic device 100 arranging thumbnails from left to right as an example, then the thumbnail with an earlier date and time is displayed in the same row of the thumbnail with a later date and time, and the position of the thumbnail with an earlier date and time is before the thumbnail with a later date and time, that is, the thumbnail with an earlier date and time is displayed in the same row of the thumbnail with a later date and time, and the thumbnail with an earlier date and time is on the left side of the thumbnail with a later date and time.
[0285] For example, the abbreviation Figure 1 The date and time of the corresponding original image (i.e., Image 1) is "February 20, 2023 08:30:45", abbreviated Figure 2 The corresponding date and time of the original image is "2023-02-20 09:30:45". That is, the electronic device 100 obtains the thumbnail Figure 2 The original image is obtained later than the thumbnail Figure 1 Then, the electronic device 100 will Figure 2 Show in thumbnail Figure 1 The same line of Figure 2 Located in the abbreviation Figure 1 or the electronic device 100 will be abbreviated Figure 1 Show in thumbnail Figure 2 When the electronic device 100 obtains the thumbnail Figure 1 The date and time of the original image to get the thumbnail Figure 2 No other images were obtained within the date and time of the original image. Figure 2 and abbreviation Figure 1 When displayed on the same line, the Figure 2 In abbreviated Figure 1 Left and adjacent; if abbreviated Figure 2 and abbreviation Figure 1 If they are not on the same line, then abbreviate Figure 2 Can display the rightmost side of the previous line, abbreviated Figure 1 Can be displayed on the left side of the next line.
[0286] Optionally, in another possible implementation, the electronic device 100 determines the display order of the thumbnails based on the date and time order of the multiple thumbnails and the order of the primary key IDs corresponding to the multiple thumbnails. In the case where the electronic device 100 determines the display order of the thumbnails based on the date and time information and the primary key ID, the electronic device 100 can store the texture data corresponding to the thumbnails in reverse order of the date and time and the primary key ID.
[0287] For example, Figure 7 As shown, the electronic device 100 displays thumbnails according to the date and time datetime and the primary key ID, with the date and time arranged in reverse order and the primary key ID arranged in reverse order. The date and time of the first thumbnail in the first row of thumbnails in the thumbnail display interface displayed by the electronic device 100 and the primary key ID are assembled into a string of "20230201000102_768". The string "20230201000102_768" indicates that the date and time corresponding to the first thumbnail is "2023-02-01 00:01:02", and the primary key ID corresponding to the first thumbnail is "768". The date and time of the last thumbnail in the first row of thumbnails in the thumbnail display interface displayed by the electronic device 100 and the primary key ID are assembled into a string of "20230201000101_753". The string "20230201000101_753" indicates that the date and time corresponding to the last thumbnail is "2023-02-01 00:01:01", and the primary key ID corresponding to the last thumbnail is "753". The string assembled from the date and time of the first thumbnail in the second row of thumbnails in the thumbnail display interface displayed by the electronic device 100 and the primary key ID is "20230201120101_752". The string "20230201120101_752" indicates that the date and time corresponding to the first thumbnail is "2023-02-01 12:01:01", and the primary key ID corresponding to the first thumbnail is "752". The string assembled from the date and time of the last thumbnail in the second row of thumbnails in the thumbnail display interface displayed by the electronic device 100 and the primary key ID is "20230130120101_737". The string "20230130120101_737" indicates that the date and time corresponding to the last thumbnail is "2023-01-30 12:01:01", and the primary key ID corresponding to the last thumbnail is "737".
[0288] That is, the date and time of the 16 thumbnails in the first row are arranged in reverse order, and the primary key IDs are arranged in reverse order from "768" to "753". Then, when the electronic device 100 generates the thumbnails of the first row and stores them in the database, the 16 thumbnails in the first row are also stored in the thumbnail database in sequence according to the display order. The date and time of the 16 thumbnails in the second row are arranged in reverse order, and the primary key IDs are arranged in reverse order from "752" to "737". The 16 thumbnails in the second row are also stored in the thumbnail database in sequence according to the display order. The position of the first thumbnail in the second row in the thumbnail database is adjacent to the position of the last thumbnail of the 16 thumbnails in the first row in the thumbnail data.
[0289] Exemplarily, the database may be a KVDB. That is, the storage order of the plurality of thumbnails in the electronic device 100 in the database is consistent with the display order of the plurality of thumbnails in the thumbnail display interface, and corresponds one to one.
[0290] It is understandable that the above Figure 7 The date and time of the first thumbnail and the primary key of the first thumbnail in the first and second rows of thumbnails shown in FIG. 1 are only examples. Similarly, Figure 7 The date, time and primary key of the last thumbnail in the first and second rows of thumbnails shown in the figure are only examples. Figure 7 The display order of the thumbnails in the thumbnail display interface is reflected by the date time and primary key of the first thumbnail in the first and second rows of thumbnails, and the date time and primary key of the last thumbnail.
[0291] In one possible implementation, the key information corresponding to the thumbnail in the database can be a datetime_id string composed of the date and time corresponding to the thumbnail and the primary key ID. When storing thumbnails, the electronic device 100 stores them in order according to the datetime_id string corresponding to the thumbnail. In this way, the database KVDB for storing thumbnails in the electronic device 100 provides the ability to query batch thumbnails by range. For example, a gallery application can initiate a request to read thumbnails, which carries the maximum value max and minimum value min of the key information. KVDB can return the key information from all thumbnails within the min-max range. It can be understood that if the texture data of the thumbnail is stored in the KVDB, then the KVDB can return the key information corresponding to the texture data of all thumbnails within the min-max range. If the KVDB stores decoded thumbnails, then the KVDB can return the key information from all decoded thumbnails within the min-max range.
[0292] In the embodiment of the present application, the KVDB may store texture data of the thumbnail or decoded thumbnail, which is not limited in the embodiment of the present application.
[0293] In a possible implementation, the electronic device 100 may store the plurality of thumbnails in the KVDB in an orderly manner according to the display order through a data storage service in distributed data management.
[0294] Based on the storage method of thumbnails described above, the following will specifically introduce the process of reading thumbnails and displaying thumbnails when the electronic device displays thumbnails.
[0295] Figure 8 The following is a flow chart showing an exemplary method of displaying an image provided by an embodiment of the present application. Figure 8 As shown, a picture display method provided in an embodiment of the present application may include the following steps:
[0296] S801. In response to the user's operation on the gallery application, the gallery application of the electronic device 100 obtains all metadata, where the metadata includes one or more of a uniform resource locator, date and time information, and identity information.
[0297] The user's operation on the gallery application may include opening the gallery application, the user's view scene switching operation in the gallery application, and the view scene switching operation may include switching from a day view scene to a month view scene or a year view scene, switching from a month view scene to a day view scene or a year view scene, and switching from a year view scene to a day view scene or a month view scene. Figure 1 In the thumbnail display interface 101 shown in FIG. 101 , click the month view control 103b or the year view control 103c. For another example, the user can Figure 2 In the thumbnail display interface 200 shown in FIG. 200 , click the day view control 103a or the year view control 103c. For example, the user can Figure 3 In the thumbnail display interface 300 shown, the day view control 103 a or the month view control 103 b is clicked.
[0298] It is understandable that the present application does not specifically limit the user's operations on the gallery application.
[0299] The electronic device 100 may receive an operation of the user on the gallery application. In response to the operation, the gallery application of the electronic device 100 may obtain all metadata stored in the metadata library in the electronic device 100. Each picture obtained by the electronic device 100 has corresponding metadata. The metadata of the picture is used to describe the attribute information of the picture, for example, to indicate the storage location, file name, picture size, occupied space, creation time, identity, etc. of the picture. The electronic device 100 can find the corresponding picture and the thumbnail corresponding to the picture based on the metadata of the picture.
[0300] The electronic device 100 may have a metadata database and a thumbnail database. The metadata database may be used to store metadata, and the thumbnail database may be used to store texture data corresponding to thumbnails. In some examples, the thumbnail data may be implemented as a key-value database KVDB.
[0301] The metadata may include one or more of a uniform resource locator, date and time information, and identity information. The uniform resource locator may be used to indicate the storage location of the image corresponding to the metadata. The date and time information may be used to indicate the time when the electronic device 100 acquires the image (also referred to as the creation time). The identity information is a unique identifier of the image. When other attribute information of two images (e.g., storage location, creation time file name, image size, occupied space, creation time, etc.) is the same, the two images may be distinguished by the identity information.
[0302] S802. The electronic device 100 assembles all metadata to obtain a plurality of assembly information.
[0303] The electronic device 100 may assemble all metadata, for example, by combining the date and time information and the identity information in the metadata into a character string; then, the electronic device 100 may obtain the assembly information of each metadata.
[0304] In some possible implementations, since the key information in the KVDB of the stored thumbnails is a string consisting of the date and time information and the primary key ID corresponding to each thumbnail, when the electronic device 100 queries in the KVDB and reads the corresponding thumbnail, it is necessary to use the key information to query the thumbnail corresponding to the key information stored in the KVDB. Therefore, the electronic device 100 needs to assemble the metadata according to the format of the key information to obtain the assembled information. Exemplarily, the electronic device 100 can assemble the date and time and the primary key ID in the metadata corresponding to each thumbnail into a string in the form of datetime_id. In this way, the electronic device 100 can obtain the assembled information corresponding to all thumbnails, and the assembled information of each thumbnail is the date and time and the primary key ID in the data corresponding to the thumbnail assembled into a string in the form of datetime_id. For example, the thumbnail Figure 1 The corresponding date and time in the metadata is "February 20, 2023 08:30:45", and the primary key ID is 01. Figure 1 The corresponding assembly information may be "20230220083045_01".
[0305] It is understandable that the format of the assembled information is consistent with the format of the key information. When the key information of the KVDB is in other formats, the electronic device 100 can assemble the metadata to obtain assembled information consistent with the format of the key information. The embodiment of the present application does not limit the specific format of the key information.
[0306] In a possible implementation, when the user opens the gallery, the electronic device 100 has already executed step S801 and step S802, that is, it has already acquired all metadata and assembled the metadata. Then, when the user switches the view scene in the gallery application, the electronic device 100 does not need to acquire the metadata again and assemble the metadata. The assembly information obtained when opening the gallery can be directly used. That is, the electronic device 100 does not need to execute step S801 and step S802 again.
[0307] S803. The electronic device 100 determines that the optimal number of thumbnail images for batch reading performance is m.
[0308] The electronic device 100 may store a KVDB that supports batch reading of thumbnails with an optimal performance of m thumbnails.
[0309] In a possible implementation, the number of thumbnails that KVDB supports to read in batches with the best performance is determined by the performance of the storage chip (also referred to as memory) and / or the performance of the I / O interface in the electronic device 100. The better the performance of the storage chip and the better the performance of the I / O interface, the more thumbnails that the electronic device 100 can read in batches from the KVDB with the best performance, that is, the larger the value of m.
[0310] It is understandable that for electronic devices with different storage chip performance and / or different I / O interface performance, the maximum number of thumbnails supported by KVDB for batch reading may also be different. In other words, for different electronic devices, the value of m may be different. The specific value of m is not limited in the embodiment of the present application.
[0311] It is understandable that the electronic device 100 has the best performance when it reads m thumbnails at a time, but it does not mean that the electronic device 100 can only read m thumbnails at a time. The number of thumbnails read by the electronic device 100 at a time can be greater than m or less than m.
[0312] S804. The electronic device 100 determines that the total number of thumbnails stored is n, and the number of columns of thumbnails that can be displayed on the thumbnail display interface is y.
[0313] The electronic device 100 can determine that the total number of thumbnails stored in the KVDB is n. It is understandable that in any thumbnail display interface under any view scene displayed by the electronic device 100, the user can view all thumbnails stored in the electronic device 100 by sliding up and down.
[0314] It is understandable that the total number of thumbnails stored in the electronic devices of different users may be different. For the electronic device of the same user, the total number of thumbnails stored at different times may also be different. The embodiment of the present application does not limit the total number of thumbnails stored in the electronic device 100, that is, the value of n.
[0315] The system of the electronic device 100 may be configured with the number of columns y of thumbnails that can be displayed on the thumbnail display interface in different view scenarios. The electronic device 100 may determine the number of columns y of thumbnails that can be displayed on the thumbnail display interface from the system configuration. The specific value of the number of columns y is not limited in the embodiment of the present application.
[0316] Although the thumbnail display interface in each view scene can display all thumbnails stored in the electronic device 100 through the user's up and down sliding operation, the number of thumbnails that can be displayed in the current display area of the thumbnail display interface in different scenes is different, and the number of columns that can display thumbnails is also different. The size of the current display area is equal to the size of the display screen.
[0317] For example, the number of thumbnails that can be displayed in the current display area of the thumbnail display interface in the day view scenario is smaller than the number of thumbnails that can be displayed in the current display area of the thumbnail display interface in the month view scenario. The number of thumbnail columns that can be displayed in the current display area of the thumbnail display interface in the day view scenario is smaller than the number of thumbnail columns that can be displayed in the current display area of the thumbnail display interface in the month view scenario. The number of thumbnail columns that can be displayed in the current display area of the thumbnail display interface in the month view scenario is smaller than the number of thumbnail columns that can be displayed in the current display area of the thumbnail display interface in the year view scenario. See. Figure 1 , a thumbnail display interface 101 in a day view scenario is shown. The number of thumbnails displayed in the current display area of the thumbnail display interface 101 is 32, and the 32 thumbnails can be arranged in a distribution relationship of 8 rows and 4 columns. Figure 2 2 shows a thumbnail display interface 200 in a month view scenario. The current display area of the thumbnail display interface 200 can display 108 thumbnails, and the 108 thumbnails can be arranged in a distribution relationship of 16 rows and 8 columns. Figure 3 In the thumbnail display interface 300 in the year view scenario shown in FIG. 3 , the number of thumbnails that can be displayed in the current display area of the thumbnail display interface 300 is 512, and the 512 thumbnails can be arranged in a distribution relationship of 32 rows and 16 columns.
[0318] The number of thumbnails and the number of columns that can be displayed in the current display area of the thumbnail display interface of different types of electronic devices 100 are also different. The larger the display screen of the electronic device 100, the more thumbnails and the number of columns of thumbnails that can be displayed in the current display area of the thumbnail display interface of the electronic device 100. For example, when the size of the display screen of the tablet is larger than the size of the display screen of the mobile phone, the number of thumbnails and the number of columns that can be displayed in the current display area of the thumbnail display interface of the tablet under each view scene are more than the number of thumbnails and the number of columns that can be displayed in the current display area of the thumbnail display interface of the mobile phone under the corresponding view scene. That is, in the same year view scene, the number of thumbnails that can be displayed in the current display area of the thumbnail display interface of the tablet is more than the number of thumbnails that can be displayed in the current display area of the thumbnail display interface of the mobile phone; the number of columns of thumbnails that can be displayed in the current display area of the thumbnail display interface of the tablet is more than the number of columns of thumbnails that can be displayed in the current display area of the thumbnail display interface of the mobile phone.
[0319] In a possible implementation, when the user opens the gallery, the electronic device 100 has already executed step S803, that is, it has determined that the number of thumbnails with the best batch reading performance is m. Then, when the user switches the view scene in the gallery application, the electronic device 100 does not need to determine again that the number of thumbnails with the best batch reading performance is m, and can directly use the determination result when the gallery is opened. That is, the electronic device 100 does not need to execute step S803 again.
[0320] S805. Based on m and n, the electronic device 100 determines that the number of view controls required in the thumbnail display interface is v, the number of thumbnails supported by each of the v view controls, and the distribution relationship of each view control, wherein the v view controls include view control 1, the number of thumbnails supported by view control 1 is K, and the distribution relationship of view control 1 is x rows and y columns.
[0321] The electronic device 100 can determine the number of view controls required in the thumbnail display interface as v based on the total number of thumbnails n stored in the electronic device 100 and the number of thumbnails m with the best batch reading performance. The electronic device 100 also needs to determine the number of thumbnails supported by each view control in the v view controls and the distribution relationship of each view control. The v view controls can include a view control 1, the number of thumbnails supported by the view control 1 is k, and the distribution relationship of the k thumbnails is x rows and y columns.
[0322] In one possible implementation, m is greater than n, so the electronic device 100 can read all thumbnails in one batch. Then, the electronic device 100 only needs to create one view control and initiate a request to read thumbnails through the view control. That is, the value of v is 1. For example, if n=500 and m=800, then the electronic device 100 only needs to create one view control, initiate a request to read thumbnails, and read 500 thumbnails in batches at a time. Here, reading thumbnails refers to reading the texture data corresponding to the thumbnails stored in the KVDB.
[0323] In this way, only one view control is needed in the thumbnail display interface displayed by the electronic device 100. When the user slides the thumbnail display interface up and down, the view control has prepared the thumbnails to be displayed. In this way, when the user slides the thumbnail display interface up and down, the electronic device 100 can display the thumbnails in the thumbnail display interface more quickly, thereby improving the user experience.
[0324] Further, in a possible implementation, the electronic device 100 can determine the number of rows x required to be displayed by the view control based on the number of columns in which the view control can display thumbnails and n. The number of columns in which the view control can display thumbnails is equal to the number of columns y in which the thumbnail display interface can display thumbnails. In different view scenarios, the number of columns y in which thumbnails can be displayed in the thumbnail display interface is fixed, and the y value can be configured by the system. The number of rows required to be displayed by the view control will change with the number of thumbnails required to be displayed.
[0325] In some feasible examples, x is equal to the rounded-up value of (n / y), where " / " represents the division operator. For example, n=100, y=16, then 100 / 16=6.25, then 6.25 is rounded up to get 7, that is, x=7.
[0326] Optionally, in another possible implementation, m is less than n, and one view control can read m thumbnails in batches at a time. Then, the electronic device 100 needs to use multiple view controls to obtain n thumbnails. The number of view controls v is equal to the rounded-up value of (n / m). For example, n=512, m=200, then n / m=512 / 200=2.56, and 2.56 can be rounded up to get 3. That is, the number of view controls v is equal to 3. That is, the electronic device 100 needs to create 3 view controls to obtain 512 thumbnails.
[0327] Further, in a possible implementation, the electronic device 100 first determines the number of rows x required to be displayed for the view control 1 among the v view controls. x is equal to the rounded-up value of (m / y). Then the maximum number of thumbnails that can be displayed by the view control 1 is x*y. Among them, x*y is greater than or equal to m. The number of rows required to be displayed for other view controls among the v view controls is determined based on n, the maximum number of thumbnails x*y (i.e., k) that can be displayed by the view control 1, and the number of columns of thumbnails that can be displayed by the view control.
[0328] For example, take v=3, n=512, m=200, y=16 as an example. Then the number of rows x that view control 1 needs to display is equal to the value 13 rounded up to (200 / 16=12.5). Then, the number of thumbnails that view control 1 can display is 13*16=208. The number of rows p that view control 2 needs to display is equal to the value 13 rounded up to (200 / 16=12.5). Then, the number of thumbnails that view control 2 can display is 13*16=208. In this way, both view control 1 and view control 2 can display 208 thumbnails, and view control 3 only needs to display the remaining 96 (512-208-208=96) thumbnails. The number of rows q that view control 3 needs to display is equal to 6 (96 / 16=6).
[0329] It can be understood that, for the number of thumbnails supported by the view control 1 to be displayed is k, the number of thumbnails that the view control 1 needs to read in batches is k. When k is equal to m, the performance of the view control 1 in batch reading thumbnails is optimal. When k is less than m, or greater than m, but the difference between k and m is not large, although the performance of the view control 1 in batch reading thumbnails is not optimal, the impact on performance is also large.
[0330] For example, if the number n of thumbnails stored in the electronic device 100 is 768 and m is 256, then the electronic device 100 may determine that the required number of view controls is 3 (768 / 256=3). Fig.9A As shown, the electronic device 100 can determine that the number of view controls required for the thumbnail display interface 300 is 3, namely, view control 901, view control 902, and view control 903. View control 901 and view control 902 can be in the current display area of the thumbnail display interface 300, and view control 903 is not in the current display area of the thumbnail display interface 300. The electronic device 100 needs to determine the number of thumbnails supported by the view control 901, view control 902, and view control 903, and then, it is necessary to determine the distribution relationship of view control 901, view control 902, and view control 903 respectively. For example, the distribution relationship of view control 901 is x rows and y columns. That is, the view control 901 can display x rows and y columns of thumbnails.
[0331] See also Figure 5B In one possible implementation, the electronic device 100 may create v view controls through a display module in a gallery application.
[0332] S806. The electronic device 100 distributes the multiple assembly information according to the number of thumbnails supported by the v view controls, and determines the assembly information corresponding to each view control, wherein view control 1 corresponds to k assembly information.
[0333] The electronic device 100 can allocate the assembly information of the thumbnails of the electronic device 100 to determine which thumbnails each view control can be used to display. For example, the electronic device 100 can divide the assembly information of the thumbnails into v groups, taking the example that each view control can display x*y=k thumbnails. Then, the electronic device 100 can allocate the assembly information of the x*y thumbnails with the latest date and time, a total of k assembly information, to the view control 1. The electronic device 100 can allocate the v groups of assembly information to the v view controls in sequence according to the display order.
[0334] For example, Fig. 9BAs shown, the electronic device 100 can assign assembly information 20230201000102_768 to assembly information 20230120080102_513, a total of 256 assembly information, to the view control 901, and the view control 901 can display 256 thumbnails corresponding to the assembly information 20230201000102_768 to the assembly information 20230120080102_513.
[0335] like Fig. 9B As shown, the electronic device 100 can assign assembly information 20230118090102_512 to assembly information 20230101120102_257, a total of 256 assembly information, to the view control 902, and the view control 902 can display 256 thumbnails corresponding to the assembly information 20230118090102_512 to 20230101120102_257.
[0336] like Fig. 9B As shown, the current display area of the thumbnail display interface 300 may display a view control 901 and a view control 902. The user may swipe upward to view the thumbnail displayed in the view control 903. In response to the user swiping upward in the current display area of the thumbnail display interface 300, the electronic device 100 may display the view control 903 in the current display area of the thumbnail display interface 300.
[0337] like Fig. 9C As shown, the electronic device 100 can respond to the user's upward sliding operation, and the electronic device 100 can display a part of the spliced large image carried by the view control 901, the entire spliced large image carried by the view control 902, and a part of the spliced large image carried by the view control 903 in the current display of the thumbnail display interface 300.
[0338] As the user continues to swipe up, Fig.9D As shown, in response to the sliding operation, the electronic device 100 can display the view control 902 and the view control 903 in the current display area of the thumbnail display interface 300. The electronic device 100 can assign assembly information 20221218120102_256 to assembly information 20221010090102_001, a total of 256 assembly information, to the view control 903, and then the view control 903 can display 256 thumbnails corresponding to the assembly information 20221218120102_256 to 20221010090102_001.
[0339] S807. The view control 1 in the electronic device 100 initiates a loading request, wherein the loading request carries k pieces of assembly information.
[0340] The view control 1 in the electronic device 100 initiates a loading request, wherein the loading request may carry k pieces of assembly information.
[0341] See also Figure 5C In a possible implementation, the display module in the electronic device 100 can send the loading request initiated by the view control 1 to the reading module in the loading framework.
[0342] S808. The electronic device 100 sets a query range based on the k pieces of assembly information, and obtains all thumbnails within the query range.
[0343] The electronic device 100 can find the largest datetime_id string and the smallest datetime_id string in the assembly information of k thumbnails. The largest datetime_id string indicates the assembly information corresponding to the thumbnail with the latest date and the largest primary key ID value in the assembly information of k thumbnails. The smallest datetime_id string indicates the assembly information corresponding to the thumbnail with the earliest date and the smallest primary key ID value in the assembly information of k thumbnails.
[0344] For the convenience of description, the largest datetime_id string can be recorded as datetime_id(max), and the smallest datetime_id string can be recorded as datetime_id(min).
[0345] Then, the electronic device 100 may set the query range to datetime_id(min)-datetime_id(max). Based on the query range, the electronic device 100 may obtain texture data corresponding to all thumbnails in the thumbnail database whose key information is within the query range.
[0346] For example, if the largest datetime_id string in the assembly information corresponding to the k thumbnails is "20240220100000_208" and the smallest datetime_id string is "20230220100000_000". Then the query range set by the electronic device 100 is "20230220100000_000" - "20240220100000_208". The electronic device 100 can obtain the texture data corresponding to all thumbnails whose key information is within the query range according to the query range.
[0347] See also Figure 5CIn a possible implementation, the electronic device 100 can set query information by loading a reading module in the framework, and the reading module can obtain texture data corresponding to all thumbnails within the query range from the thumbnail database. Specifically, the reading module can set a query command for KVDB, and the query command can carry datetime_id(min) and datetime_id(max). After receiving the query command, KVDB only needs to query twice, once for the location of datetime_id(max), and then query again for the location of datetime_id(min). Finally, KVDB can return the entire storage buffer data within the query range to the reading module. The entire storage buffer data contains the texture data corresponding to all thumbnails within the query range.
[0348] Further, in a possible implementation, after the reading module obtains the entire block of storage buffer data, it traverses the buffer content to determine whether the key information of each thumbnail in the buffer falls within the query range of datetime_id(min)-datetime_id(max). If it is within the query range of datetime_id(min)-datetime_id(max), the texture data corresponding to the thumbnail stored in the buffer is retained. If it is not within the query range of datetime_id(min)-datetime_id(max), the texture data corresponding to the thumbnail stored in the buffer is deleted. Sequentially, the reading module can traverse the key information corresponding to the complete block of buffer data, that is, the key information of the texture data corresponding to all thumbnails within the query range returned by KVDB. In this way, it can be avoided that the entire block of buffer data returned by KVDB contains data corresponding to thumbnails that have been selected to be deleted by the user. That is, some thumbnails are selected to be deleted by the user in the thumbnail display interface, and the electronic device 100 only performs logical deletion on the thumbnail without physical deletion. That is to say, the electronic device 100 deletes the metadata corresponding to the thumbnail, but the texture data corresponding to the thumbnail stored in the KVDB is not deleted in time.
[0349] S809. The electronic device 100 splices the acquired thumbnails according to the distribution relationship of x rows and y columns to obtain a spliced texture image.
[0350] The electronic device 100 may splice the obtained k thumbnails according to the grouping result to obtain a spliced texture map. That is, the electronic device 100 splices the k thumbnails according to the distribution relationship of the k thumbnails in the x row and y column.
[0351] Specifically, in a possible implementation, the electronic device 100 can obtain the data size singlesize of the first thumbnail among the k thumbnails, the file header size headsize, and apply for a shared memory of size (x*y*singlesize+headsize) (* represents a multiplication sign). The electronic device 100 fills the texture data corresponding to the k thumbnails into the shared memory in sequence according to the grouping result of the k thumbnails, and finally obtains a buffer with the k thumbnails spliced together.
[0352] For example, Fig.10 As shown, take k as 192, that is, x=12, y=16 as an example. The electronic device 100 can obtain the texture data corresponding to the 192 thumbnails from the KVDB. Then, apply for a shared memory of size (12*16*singlesize+headsize). The electronic device 100 can fill the 192 thumbnails into each memory block of the shared memory in turn according to the grouping results, and finally obtain a buffer with a spliced texture map.
[0353] See also Figure 5B In a possible implementation, the reading module in the electronic device 100 transmits the acquired k thumbnails to the splicing module, and the splicing module splices the k thumbnails according to the grouping results to obtain a spliced texture map.
[0354] S810. The view control 1 of the electronic device 100 displays the texture map.
[0355] The view control 1 of the electronic device 100 can directly display the spliced texture image without decoding. In this way, the electronic device 100 can display k thumbnails in the view control 1 more quickly.
[0356] In a possible implementation, the view control 1 of the electronic device 100 may instruct the graphics subsystem to render the spliced texture image. After the graphics subsystem completes the rendering, the view control 1 may display the rendered texture image.
[0357] The electronic device 100 can determine which view controls can be displayed in the current display area of the thumbnail display interface based on the first operation. For example, the electronic device 100 can display view control 1 in the current display area of the thumbnail display interface based on the first operation. Then, the view control 1 can determine the query range and obtain the thumbnails within the query range according to the k assembly information corresponding to the k-length thumbnails assigned to the view control 1 by the electronic device 100. That is, the view control 1 can obtain thumbnails according to the above steps S807-S810 and display the spliced thumbnails.
[0358] It can be understood that when the electronic device 100 creates multiple view controls, the multiple view controls can obtain thumbnails and display thumbnails according to the process of obtaining and displaying k thumbnails in view control 1 in the above steps S807-S810. The present application does not repeat the specific steps for obtaining thumbnails and displaying thumbnails for other view controls in the multiple view controls.
[0359] It is understandable that, taking the year view scene as an example, when the electronic device 100 switches from other view scenes to the year view scene, the electronic device 100 can display the thumbnail display interface under the year view scene according to the above steps S801-S810. When the electronic device 100 determines that the thumbnail display interface under the year view scene contains v view controls, the electronic device 100 has allocated the number of thumbnails displayed for each view control and which thumbnails are specifically displayed. The electronic device 100 displays only one or more view controls in the current interface of the thumbnail display interface according to the above steps. When the user slides up and down in the thumbnail display interface, the electronic device 100 can determine which view control is displayed in the current interface based on the user's sliding operation, and then batch obtain multiple thumbnails to be displayed in the view control, and splice the multiple thumbnails. Then, the electronic device 100 can send the spliced thumbnails for display. After sending, the user can see the thumbnails after sending in the current interface of the thumbnail display interface. That is, when refreshing, each view control in the current interface can obtain and display thumbnails according to the process of obtaining and displaying k thumbnails in the view control 1 in the above steps S807-S810. Since the electronic device 100 has determined the thumbnails to be displayed by each view control, and when the electronic device 100 refreshes and displays the thumbnails based on the user's sliding operation, the corresponding view control can obtain thumbnails in batches. In this way, the electronic device 100 can display the refreshed thumbnails more quickly, which can improve the display performance of the electronic device 100. Thus, the user experience can be improved.
[0360] In addition, since the spliced texture map is stored in shared memory and shared memory can support cross-process transmission, the rendering process can obtain the shared memory with the spliced texture map across processes without copying between processes, which can reduce the number of memory copies of the electronic device 100, thereby improving the display performance of the electronic device 100.
[0361] By the picture display method provided by the embodiment of the present application, when the electronic device 100 stores the thumbnails corresponding to the photographed or saved pictures, the thumbnails are stored in the order in which the thumbnails are arranged in the thumbnail display interface. In this way, the electronic device 100 has the ability to query and obtain thumbnails in batches. Then, when the electronic device displays the thumbnail display interface, the electronic device 100 can query and obtain thumbnails in batches. The electronic device 100 can splice the multiple thumbnails obtained to obtain the spliced thumbnails, and then the electronic device 100 can send the spliced thumbnails through the view control. The thumbnails displayed in the thumbnail display interface are spliced into one or more large pictures. A view control can carry a large picture. In this way, the electronic device 100 only needs a small number of view controls (for example, 1 or 2, etc.) to display a large number of thumbnails. In addition, the electronic device 100 can query and obtain thumbnails in batches, which can reduce the number of times the IO interface is called. In this way, the performance and frame rate of electronic devices loading and displaying a large number of thumbnails can be improved, thereby avoiding or reducing the white blocks and freeze problems that occur when users browse a large number of thumbnails.
[0362] It is understandable that the picture display method provided in the embodiment of the present application is described by taking the display of thumbnails in the gallery as an example. In the present application, there is no restriction on the application that can display thumbnails. For example, the file management application can also display thumbnails. The process of displaying thumbnails by other applications that can display thumbnails can refer to the process of displaying thumbnails by the gallery application above, and the embodiment of the present application will not be repeated here.
[0363] Fig.11 The flowchart of a method for displaying an image provided by an embodiment of the present application is shown as an example. Fig.11 As shown, a picture display method provided in an embodiment of the present application may include the following steps:
[0364] S1101. The electronic device 100 receives and responds to a first operation of a user on a first application, and obtains a first group of thumbnails, where the first group of thumbnails includes at least two thumbnails.
[0365] The first operation may include any one of an operation of a user opening a gallery application, an operation of a user switching a view scene on a thumbnail display interface, and a user sliding on a thumbnail display interface.
[0366] In a possible implementation, obtaining the first group of thumbnails may include: the electronic device 100 obtains the first group of thumbnails from a database, and the storage order of the first group of thumbnails in the database is consistent with the display order of the first group of thumbnails.
[0367] In one possible implementation, obtaining a first group of thumbnails may include: the electronic device 100 obtains metadata of the first group of thumbnails; the electronic device 100 obtains a first query range based on the date, time and ID in the metadata of the first group of thumbnails; the electronic device 100 obtains the first group of thumbnails within the first query range from a database at one time based on the first query range.
[0368] In one possible implementation, the electronic device 100 obtains a query range based on the date, time and ID in the metadata of the first group of thumbnails, which may include: the electronic device 100 assembles the date, time and ID of the first group of thumbnails to obtain multiple strings, and the number of the multiple strings is equal to the number of the first group of thumbnails; the electronic device 100 determines the maximum and minimum values of the multiple strings, and sets the first query range based on the maximum and the minimum values.
[0369] In a possible implementation, the electronic device obtaining the first group of thumbnails may include: the electronic device 100 assigns a first view control to carry the first group of thumbnails; the electronic device 100 sends a thumbnail loading request to a database through the first view control, the thumbnail loading request is used to obtain the first group of thumbnails from the database. In this way, the electronic device 100 can load the thumbnails required to be carried by the view control through the view control request.
[0370] In one possible implementation, before the electronic device 100 receives and responds to the user's first operation on the gallery application and obtains the first group of thumbnails, the method may also include: the electronic device 100 obtains the first picture; the electronic device 100 downsamples the first picture to obtain a thumbnail of the first picture; the electronic device 100 saves the date, time and ID corresponding to the thumbnail of the first picture; the electronic device 100 saves the thumbnails of the first picture to the database in the order of the date, time and ID corresponding to the thumbnails of the first picture.
[0371] In combination with the first aspect, in a possible implementation method, the electronic device 100 saves the thumbnail of the first picture to the database in the order of the date, time and ID corresponding to the thumbnail of the first picture, which may include: the electronic device 100 performs texture compression on the thumbnail of the first picture to obtain texture data; the electronic device 100 saves the texture data to the database in the order of the date, time and ID corresponding to the thumbnail of the first picture.
[0372] The first set of thumbnails can be Figure 8 k thumbnails of .
[0373] For details on how the electronic device 100 obtains the first group of thumbnails, please refer to the description in the above steps S801 to S808, which will not be repeated here.
[0374] S1102. The electronic device 100 stitches the first group of thumbnails into a first large image in display order.
[0375] In a possible implementation, the electronic device 100 stitches the first group of thumbnails into a large picture in the order of display, which may include: the electronic device 100 applies for a first memory; the database of the electronic device 100 fills the first group of thumbnails into the first memory in sequence in the order of display, and stitches them into a large picture in the first memory.
[0376] Among them, the first memory is a shared memory.
[0377] For details on how the electronic device 100 specifically splices together to obtain a large image, please refer to the description in step S809 above. Fig.10 , I will not go into details here.
[0378] S1103. The electronic device 100 renders the first large image and displays a thumbnail display interface of the first application, in which the first large image is displayed.
[0379] In a possible implementation, the electronic device 100 renders the first large image, which may include: a rendering process of the electronic device 100 reads the first large image from the first memory and renders the first large image.
[0380] In a possible implementation, before displaying the thumbnail display interface of the gallery application, the method may include: the electronic device 100 creates a first view control, and carries the first large image through the first view control.
[0381] In a possible implementation, the method may also include: the electronic device 100 obtains a second group of thumbnails in response to the first operation, the second group of thumbnails including at least two thumbnails; the electronic device 100 splices the second group of thumbnails into a second large image in display order; the electronic device 100 renders the second large image and displays the second large image on the thumbnail display interface.
[0382] In one possible implementation, after the second large image is displayed on the thumbnail display interface, the method may further include: the electronic device 100 receives and responds to a second operation, and displays a portion of the content of the first large image and the entire content of the second large image on the thumbnail display interface, and the second operation is an operation of sliding upwards in the thumbnail display interface.
[0383] In a possible implementation, before the thumbnail display interface displays the second large image, the method may further include: the electronic device 100 creates a second view control, and carries the second large image through the second view control.
[0384] In one possible implementation, after the electronic device 100 displays the thumbnail display interface of the gallery application, the method may further include: the electronic device 100 receives and responds to a third operation to obtain a third group of thumbnails, the third group of thumbnails including at least two thumbnails; the electronic device 100 splices the third group of thumbnails into a third large image in the display order; the electronic device 100 creates a third view control, and carries the third large image through the third view control; the electronic device 100 renders the third large image, and displays the third large image on the thumbnail display interface.
[0385] In one possible implementation, the third operation is a sliding operation, and obtaining the third group of thumbnails may include: the electronic device 100 determines the date, time, and ID of the third group of thumbnails based on the third operation; the electronic device 100 determines the second query range of the third group of thumbnails based on the date, time, and ID of the third group of thumbnails; the electronic device 100 obtains the third group of thumbnails within the second query range from the database at one time based on the second query range.
[0386] The first view control can be Fig.9A In the middle view control 901, the second view control can be Fig.9A In the view control 902, the third view control can be Fig.9A View control 903 in.
[0387] The description of step S1103 may refer to the above step S810 and will not be repeated here.
[0388] By the picture display method provided by the embodiment of the present application, when the electronic device 100 stores the thumbnails corresponding to the photographed or saved pictures, the thumbnails are stored in the order in which the thumbnails are arranged in the thumbnail display interface. In this way, the electronic device 100 has the ability to query and obtain thumbnails in batches. Then, when the electronic device displays the thumbnail display interface, the electronic device 100 can query and obtain thumbnails in batches. The electronic device 100 can splice the multiple thumbnails obtained to obtain the spliced thumbnails, and then the electronic device 100 can send the spliced thumbnails through the view control. The thumbnails displayed in the thumbnail display interface are spliced into one or more large pictures. A view control can carry a large picture. In this way, the electronic device 100 only needs a small number of view controls (for example, 1 or 2, etc.) to display a large number of thumbnails. In addition, the electronic device 100 can query and obtain thumbnails in batches, which can reduce the number of times the IO interface is called. In this way, the performance and frame rate of electronic devices loading and displaying a large number of thumbnails can be improved, thereby avoiding or reducing the white blocks and freeze problems that occur when users browse a large number of thumbnails.
[0389] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored. When the processor executes the computer program code, the communication device executes the method in any of the aforementioned embodiments.
[0390] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer executes the method in any of the aforementioned embodiments.
[0391] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0392] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0393] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0394] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A method for displaying a picture, wherein the electronic device includes a picture gallery application, the picture includes metadata information, and the thumbnail is stored in the electronic device; characterized in that: include: The electronic device receives and obtains a first group of thumbnails in response to a first operation of the user on the gallery application, wherein the first group of thumbnails includes at least two of the thumbnails; The electronic device stitches the first group of thumbnails into a first large image in a display order; The electronic device displays a thumbnail display interface of the gallery application, and the first large image is displayed in the thumbnail display interface.
2. The method according to claim 1, characterized in that Before displaying the thumbnail display interface of the gallery application, the method further includes: The electronic device creates a first view control and carries the first large image through the first view control.
3. The method according to claim 2, characterized in that The method further comprises: In response to the first operation, the electronic device acquires a second group of thumbnails, where the second group of thumbnails includes at least two thumbnails; The electronic device stitches the second group of thumbnails into a second large image in a display order; The electronic device displays the second large image on the thumbnail display interface.
4. The method according to claim 3, characterized in that After the second large image is displayed on the thumbnail display interface, the method further includes: The electronic device receives and responds to a second operation, and displays a portion of the content of the first large image and the entire content of the second large image in the thumbnail display interface, where the second operation is an operation of sliding upward in the thumbnail display interface.
5. The method according to claim 4, characterized in that Before the thumbnail display interface displays the second large image, the method further includes: The electronic device creates a second view control and carries the second large image through the second view control.
6. The method according to claim 5, characterized in that After displaying the thumbnail display interface of the gallery application, the method further includes: The electronic device receives and obtains a third group of thumbnails in response to the third operation, wherein the third group of thumbnails includes at least two thumbnails; The electronic device stitches the third group of thumbnail images into a third large image according to the display order; The electronic device creates a third view control, and carries the third large image through the third view control; The electronic device displays the third large image on the thumbnail display interface.
7. The method according to any one of claims 1 to 6, characterized in that: The thumbnails are stored in order in the database according to the metadata information, and the storage order of the first group of thumbnails in the database is consistent with the display order of the first group of thumbnails, or the display order of the first group of thumbnails is determined according to the metadata information.
8. The method according to claim 7, characterized in that The electronic device stitches the first group of thumbnails into a large picture according to the display order, including: The electronic device applies for a first memory; The database of the electronic device fills the first group of thumbnails into the first memory in sequence according to the display order, and splices them into a large picture in the first memory.
9. The method according to claim 8, characterized in that The method further comprises: The rendering process of the electronic device reads the first large image from the first memory and renders the first large image.
10. The method according to claim 9, characterized in that The first operation includes any one of an operation of a user opening a gallery application, an operation of a user switching a view scene on a thumbnail display interface, and a user sliding on a thumbnail display interface.
11. The method according to claim 10, characterized in that The database stores metadata of the first group of thumbnails, and the metadata includes date and time and identity IDs corresponding to the first group of thumbnails.
12. The method according to claim 11, characterized in that The first group of thumbnails includes a first thumbnail, the date and time corresponding to the first thumbnail is a first date and time, the ID corresponding to the first thumbnail is a first ID, the first date and time is the date and time when the electronic device saves the first thumbnail, and the first ID is a number generated by the electronic device when saving the first thumbnail for identifying the first thumbnail.
13. The method according to claim 12, characterized in that Get the first set of thumbnails, including: The electronic device obtains metadata of the first group of thumbnails; The electronic device acquires a first query range based on the date, time and ID in the metadata of the first group of thumbnails; The electronic device obtains the first group of thumbnails within the first query range from the database at one time based on the first query range.
14. The method according to claim 13, characterized in that The electronic device acquires a query range based on the date, time and ID in the metadata of the first group of thumbnails, including: The electronic device assembles the date, time and ID of the first group of thumbnails to obtain a plurality of character strings, the number of which is equal to the number of the first group of thumbnails; The electronic device determines a maximum value and a minimum value among the plurality of character strings, and sets the first query range based on the maximum value and the minimum value.
15. The method according to claim 14, characterized in that The third operation is a sliding operation, and obtaining the third group of thumbnails includes: the electronic device determining the date, time and ID of the third group of thumbnails based on the third operation; The electronic device determines a second query range of the third group of thumbnails based on the date, time and ID of the third group of thumbnails; The electronic device obtains the third group of thumbnails within the second query range from the database at one time based on the second query range.
16. The method according to claim 2, characterized in that The electronic device obtains a first group of thumbnails, including: The electronic device assigns the first view control to carry the first group of thumbnails; The electronic device sends a thumbnail loading request to the database through the first view control, where the thumbnail loading request is used to obtain the first group of thumbnails from the database.
17. The method according to any one of claims 8 to 16, characterized in that: The number of view controls required in the thumbnail display interface is determined by the total number of thumbnails stored in the electronic device and the number of thumbnails read in batches.
18. The method according to claim 17, characterized in that Before the electronic device receives and responds to the first operation of the user on the gallery application and obtains the first group of thumbnails, the method further includes: The electronic device acquires a first picture; The electronic device downsamples the first picture to obtain a thumbnail of the first picture; The electronic device stores the date, time and ID corresponding to the thumbnail of the first picture; The electronic device saves the thumbnails of the first pictures to the database in the order of the date and time and ID corresponding to the thumbnails of the first pictures.
19. The method according to claim 18, characterized in that The electronic device saves the thumbnails of the first pictures to the database in the order of date and time and IDs corresponding to the thumbnails of the first pictures, including: The electronic device performs texture compression on the thumbnail of the first picture to obtain texture data; The electronic device saves the texture data to the database in the order of the date and time and ID corresponding to the thumbnails of the first pictures.
20. An electronic device, characterized in that: The electronic device comprises: one or more processors; and a memory, wherein codes are stored in the memory; when the codes are executed by the processor, the electronic device executes the method according to claims 1-19.
21. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to claims 1 to 19.
22. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 19.
Citation Information
Patent Citations
Method for viewing photos in photo album and mobile terminal
CN106156313A
Picture display method and computing equipment
CN111966262A
Picture display method and device, equipment and storage medium
CN113014993A
Thumbnail display method and device, electronic equipment and readable storage medium
CN113836335A
Image splicing method
CN113900612A