Electronic device and method for image viewing
By using the processor in the image viewer to intelligently preload images into the cache and prioritize subsequent images based on image order and range restrictions, the loading time delay problem caused by multiple image displays is solved and the user experience is improved.
Patent Information
- Application Number
- CN202510216059.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-01-17
- Filing Date
- 2025-02-26
- Publication Date
- 2025-09-05
AI Technical Summary
In image viewers, displaying multiple images causes delayed loading times and a poor user experience, especially when switching pages.
By using a processor to preload images into a cache in an electronic device for image viewing, intelligent preloading is performed based on the order and range restrictions of the images, and subsequent images that the user may view are loaded first, thereby reducing delays.
It improves image loading speed and user experience, reduces delays when switching pages, and improves overall user satisfaction.
Smart Images

Figure CN120595979A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to image processing technology, and more particularly to an electronic device and method for image viewing. Background Art
[0002] When using an image viewer, displaying multiple images simultaneously on a single page can often result in noticeable loading times. As users switch between pages within the image viewer, the loading process can be delayed, resulting in a poor user experience due to interruptions. Since improving the speed and smoothness of image transitions is crucial to improving overall user satisfaction, reducing image loading times has become a key challenge in this area. Summary of the Invention
[0003] The present disclosure is directed to an electronic device and method for image viewing.
[0004] An electronic device for viewing images according to the present invention includes a transceiver, a cache, and a processor. The processor is coupled to the transceiver and the cache, wherein the processor is configured to: obtain a plurality of images through the transceiver, wherein the plurality of images includes a first image, wherein the first image includes a first value and a second value; generate a data directory by assigning the first image to a first directory of a data directory according to the first value and assigning the first image to a first subdirectory of the first directory according to the second value; in response to the first image being selected, preload a second image in a second directory of the data directory into the cache according to the data directory; and output a graphical user interface through the transceiver, wherein the graphical user interface displays the first image in response to the first image being selected.
[0005] In one embodiment of the present invention, the processor is further configured to: determine an offset between the order of the first directory in the data directory and the order of the second directory in the data directory; determine whether the offset is less than or equal to a first range limit; and in response to the offset being less than or equal to the first range limit, preload the second image in the second directory.
[0006] In one embodiment of the present invention, the processor is further configured to preload a third image in a third directory of the data directory into the cache, wherein the third directory is placed before the second directory in the data directory.
[0007] In one embodiment of the present invention, the processor is further configured to: in response to the first image being selected, preload the fourth image in the first sub-directory into the cache according to the data directory.
[0008] In one embodiment of the present invention, the above-mentioned processor is further configured to: determine the offset between the order of the first image in the first sub-directory and the order of the fourth image in the first sub-directory; determine whether the offset is less than or equal to the second range limit; and preload the fourth image in response to the offset being less than or equal to the second range limit.
[0009] In one embodiment of the present invention, the processor is further configured to: output a graphical user interface through the transceiver, wherein the graphical user interface displays a plurality of images according to the count value.
[0010] In one embodiment of the present invention, the processor is further configured to determine a second range limit according to the count value.
[0011] In one embodiment of the present invention, the processor is further configured to: in response to the offset being less than the second range limit but the fourth image being the first or last image in the first subdirectory, or in response to the first image being the first or last image in the first subdirectory, save the preload quota; determine the number of preloaded images in the first directory; and in response to the number of preloaded images being less than or equal to the count limit, preload the second image in the second directory using the preload quota.
[0012] In one embodiment of the present invention, the above-mentioned processor is further configured to: preload the fifth image in the first subdirectory to the cache after the fourth image is preloaded, wherein the order of the fifth image in the first subdirectory is before the order of the fourth image in the first subdirectory.
[0013] In one embodiment of the present invention, the first image further includes a third value, wherein the processor is further configured to: sort the first images in the first sub-directory according to the third value to generate a data directory.
[0014] A method for viewing an image of the present invention comprises: obtaining a plurality of images, wherein the plurality of images comprises a first image, wherein the first image comprises a first value and a second value; generating a data directory by assigning the first image to a first directory of the data directory according to the first value and assigning the first image to a first subdirectory of the first directory according to the second value; in response to the first image being selected, preloading a second image in a second directory of the data directory into a cache according to the data directory; and outputting a graphical user interface, wherein the graphical user interface displays the first image in response to the first image being selected.
[0015] In one embodiment of the present invention, the step of preloading the second image in the second directory of the data directory into the cache according to the data directory includes: determining the offset between the order of the first directory in the data directory and the order of the second directory in the data directory; determining whether the offset is less than or equal to a first range limit; and in response to the offset being less than or equal to the first range limit, preloading the second image in the second directory.
[0016] In one embodiment of the present invention, the method further comprises: preloading a third image in a third directory of the data directory into the cache, wherein the order of the third directory in the data directory is before the order of the second directory in the data directory.
[0017] In one embodiment of the present invention, the method further comprises: in response to the first image being selected, preloading the fourth image in the first sub-directory into the cache according to the data directory.
[0018] In one embodiment of the present invention, the step of preloading the fourth image in the first sub-directory to the cache according to the data directory includes: determining the offset between the order of the first image in the first sub-directory and the order of the fourth image in the first sub-directory; determining whether the offset is less than or equal to a second range limit; and preloading the fourth image in response to the offset being less than or equal to the second range limit.
[0019] In one embodiment of the present invention, the method further includes: outputting a graphical user interface, wherein the graphical user interface displays a plurality of images according to the count value.
[0020] In one embodiment of the present invention, the above method further includes: determining a second range limit according to the count value.
[0021] In one embodiment of the present invention, the step of preloading the second image in the second directory of the data directory into the cache according to the data directory includes: in response to the offset being less than the second range limit but the fourth image being the first or last of the images in the first subdirectory, or in response to the first image being the first or last of the images in the first subdirectory, saving the preload quota; determining the number of preloaded images in the first directory; and in response to the number of preloaded images being less than or equal to the count limit, preloading the second image in the second directory using the preload quota.
[0022] In one embodiment of the present invention, the above method further includes: after the fourth image is preloaded, preloading the fifth image in the first subdirectory to the cache, wherein the order of the fifth image in the first subdirectory is before the order of the fourth image in the first subdirectory.
[0023] In one embodiment of the present invention, the first image further comprises a third value, wherein the method further comprises: sorting the first images in the first subdirectory according to the third value to generate a data directory.
[0024] Based on the above description, the present disclosure designs a special format for images to create a data directory. The electronic device can preload multiple images according to the image currently being viewed by the user.
[0025] To make the above content easier to understand, several embodiments will be described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are included to provide a further understanding of the present disclosure and constitute a part of this specification. These drawings illustrate exemplary embodiments of the present disclosure and together with the embodiments serve to explain the principles of the present disclosure.
[0027] Figure 1 A schematic diagram illustrating an electronic device for image viewing according to one embodiment of the present disclosure.
[0028] Figure 2 A schematic diagram illustrating the format of an image file according to one embodiment of the present disclosure.
[0029] Figure 3 The data structure of an image archive according to one embodiment of the present disclosure is described.
[0030] Figure 4 A graphical user interface of an image viewer according to one embodiment of the present disclosure is described.
[0031] Figure 5 A flowchart illustrating image preloading according to one embodiment of the present disclosure.
[0032] Figure 6 An example of image preloading according to an embodiment of the present disclosure is described.
[0033] Figure 7 Another image preloading example according to an embodiment of the present disclosure is described.
[0034] Figure 8 Another image preloading example according to an embodiment of the present disclosure is described.
[0035] Figure 9 A flowchart illustrating a method for image viewing according to one embodiment of the present disclosure is provided. DETAILED DESCRIPTION
[0036] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0037] Figure 1 A schematic diagram illustrates an electronic device 100 for image viewing according to one embodiment of the present disclosure. The electronic device 100 may include a processor 110, a storage medium 120, and a transceiver 130. The processor 110 may be, for example, a central processing unit (CPU), or other programmable general-purpose or special-purpose microcontroller unit (MCU), a microprocessor, a digital signal processor (DSP), a programmable controller, an application-specific integrated circuit (ASIC), a graphics processing unit (GPU), an arithmetic logic unit (ALU), a complex programmable logic device (CPLD), a field programmable gate array (FPGA), or other similar devices or combinations thereof. The processor 110 may be coupled to the storage medium 120 and the transceiver 130.
[0038] The storage medium 120 may be, for example, any type of fixed or removable random-access memory (RAM), read-only memory (ROM), flash memory, a hard disk drive (HDD), a solid-state drive (SSD), or similar elements, or a combination thereof. The storage medium 120 may be a non-transitory computer-readable storage medium configured to store a plurality of executable computer programs, modules, or applications that are loaded by the processor 110 to perform the functions of the electronic device 100. The storage medium 120 may include a cache 121. The processor 110 may preload one or more images (or image sets) or images into the cache 121 for image viewing purposes.
[0039] Transceiver 130 can be configured to transmit or receive wired / wireless signals. Transceiver 130 can also perform operations such as low-noise amplification, impedance matching, frequency mixing, up- or down-conversion, and filtering and amplification. Processor 110 can communicate with other devices via transceiver 130. For example, processor 110 can obtain one or more images, graphics, or user commands via transceiver 130. For another example, processor 110 can output a graphical user interface (GUI) to a display via transceiver 130.
[0040] Figure 2 A schematic diagram illustrating the format of an image archive according to one embodiment of the present disclosure. Image 20 may include information 21, which may be defined as level 1 information, information 22, which may be defined as level 2 information, and information 23, which may be defined as level 3 information. Information 21 may include values such as a level_1 identification code (ID) or a level_1 order. Information 22 may include values such as a level_2 ID or a level_2 order. Information 23 may include values such as a level_3 ID or a level_3 order.
[0041] One or more level_2 IDs can belong to the same level_1 ID, and one or more level_3 IDs can belong to the same level_2 ID. Figure 3 For example, images 311 and 312 with different level_3 IDs but the same level_2 ID may belong to the same level_2 image group 310. Image groups 310 and 320 with different level_2 IDs but the same level_3 ID may belong to the same level_1 image group 300.
[0042] In one embodiment, a level_1 ID may represent an index into a directory in an operating system, where the corresponding level_1 sequence may represent the order of the level_1 ID among multiple level_1 IDs. A level_2 ID may represent an index into a subdirectory within a directory, where the corresponding level_2 sequence may represent the order of the level_2 ID among multiple level_2 IDs belonging to the same level_1 ID. A level_3 ID may represent an index into an image within a subdirectory, where the corresponding level_3 sequence may represent the order of the level_3 ID among multiple level_3 IDs belonging to the same level_2 ID.
[0043] For example, assume that the multiple images acquired by processor 110 are related to transthoracic echocardiography (TTE) images of a patient. Images with the same level_1 ID may correspond to the same patient. Images with the same level_1 ID but different level_2 IDs may correspond to different electrodes attached to the same patient. In other words, images with different level_2 IDs may correspond to different TTE images of the same patient. Images with the same level_2 ID but different level_3 IDs may correspond to different frames (or timestamps, or TTE images) of the same TTE image.
[0044] Figure 4 A graphical user interface 400 of an image viewer according to one embodiment of the present disclosure is illustrated. GUI 400 can simultaneously select and display one or more images (or pictures) 410, 420, 430, 440, 450, and 460 corresponding to the same level_1 ID based on a count value (e.g., count value C) and the level_2 order of each image. For example, because the count value is 6, GUI 400 can simultaneously display six images, where images 410, 420, 430, 440, 450, and 460 can be positioned on GUI 400 based on the level_2 order of each image. For example, image 410 with the lowest level_2 order can be positioned in the upper left corner of GUI 400, while image 460 with the highest level_2 order can be positioned in the lower right corner of GUI 400. In one embodiment, displayed images 410, 420, 430, 440, 450, and 460 can correspond to different level_2 IDs but the same level_3 ID. That is, the timestamps of the different images 410 , 420 , 430 , 440 , 450 , and 460 displayed simultaneously may be the same.
[0045] In one embodiment, a user may input an instruction to the electronic device 100 to manipulate the slider 42 of the GUI 400, thereby changing the timestamp of the displayed image. For example, assume that the images 410-460 currently displayed by the GUI 400 correspond to frame Y. If the user drags the slider 42 to the right, the GUI 400 may switch the displayed images 410-460 from frame Y to frame Y+1.
[0046] In one embodiment, a user can input a command to the electronic device 100 to manipulate button 41 of the GUI 400, thereby changing the displayed image. For example, assuming that the GUI 400 is displaying images 410-460 corresponding to TTE acoustic windows 1-6, respectively, if the user clicks button 41, the GUI 400 may switch the displayed images from images 410-460 to images corresponding to TTE acoustic windows 7-12.
[0047] In one embodiment, if an image is selected (eg, the image currently displayed by GUI 400 ), processor 110 may preload one or more images related to the selected image based on the parameters shown in Table 1 .
[0048] Table 1
[0049]
[0050] Figure 5 A flowchart illustrating image preloading according to an embodiment of the present disclosure, wherein the flowchart can be Figure 1 The electronic device 100 shown implements.
[0051] In step S501, the processor 110 may obtain a plurality of images through the transceiver 130, wherein each image may include: Figure 2 The information shown is information 21 , 22 or 23 (ie, level 1 information, level 2 information or level 3 information). The acquired image can be stored in the storage medium 120 .
[0052] In step S502, the processor 110 may generate a data directory, wherein the data directory may include one or more directories, and each directory may include one or more subdirectories. The processor 110 may generate the data directory by assigning images to directories according to information 21 and assigning the images to subdirectories of the directories according to information 22. The processor 110 may sort the images in the subdirectories according to information 23.
[0053] For example, image X may include values i, j, and k corresponding to information 21, 22, and 23, respectively. Processor 110 may assign the path X(i,j,k) of image X to the kth image in the jth subdirectory of the i-th directory in the data directory. That is, index i may be associated with the level_1 ID or level_1 sequence of image X, index j may be associated with the level_2 ID or level_2 sequence of image X, and index k may be associated with the level_3 ID or level_3 sequence of image X. In one example, the path X(i,j,k) may represent the kth frame (or kth timestamp) of the jth TTE image (or jth electrode) of the i-th patient.
[0054] In step S503, the user may select an image, wherein the selected image may be preloaded into the cache 121 or displayed in the GUI 400. In the following paragraphs, it is assumed that the selected image is the image X corresponding to the path X(i,j,k).
[0055] In step S504 , the processor 110 may preload one or more acquired images into the cache 121 according to the data directory.
[0056] In one embodiment, the processor 110 may preload one or more images in the j-th subdirectory (e.g., the j-th TTE image of the patient) into the cache 121 according to a range limit R or L. The processor 110 may determine whether to refer to the range limit R or L based on a count value C. It should be noted that, in one embodiment, the number of preloaded images with the same level_1 ID (including the currently selected image X(i,j,k)) cannot be greater than a count limit O=2R+1, and the total number of preloaded images (including image X(i,j,k)) cannot be greater than a count limit A, where the count limit A can be user-defined as A=2O+1=4R+3.
[0057] Assume C = 1 (i.e., GUI 400 displays only one image or picture at a time). Processor 110 may determine an offset K between the level_3 order of image X(i,j,k) in the jth subdirectory and the level_3 order of image X(i,j,k±K) in the jth subdirectory, where K is a positive integer. If offset K ≤ range limit R, processor 110 may preload image X(i,j,k±K) into cache 121. The order of the preloaded images X(i,j,k±K) in the jth subdirectory may satisfy the following formula: max(1,kR) ≤ k±K ≤ min(k+R, maximum level_3 order of images with the same level_2 ID).
[0058] by Figure 6For example, assume that the design value C = 1, the range limit R = 2, and image 624 is currently selected or displayed by GUI 400. Processor 110 may determine that the offsets K between the level_3 order (e.g., 4) of image 624 and the level_3 orders (e.g., 2, 3, 5, and 6) of images 622, 623, 625, and 626 are 2, 1, 1, and 2, respectively, and that these offsets are less than or equal to the range limit R = 2. Therefore, processor 110 may preload image 622, 623, 625, or 626 into cache 121. On the other hand, processor 110 may determine that the offsets K between the level_3 order (e.g., 4) of image 624 and the level_3 orders (e.g., 1 and 7) of images 621 and 627 are 3 and 3, respectively, and that these offsets are greater than the range limit R = 2. Therefore, processor 110 may not preload image 621 or 627 into cache 121. The level_3 order 4±K of the image to be preloaded (eg, 622, 623, 625, or 626) may satisfy the following formula: max(1,4-2)≤4±K≤min(4+2,7).
[0059] Assume that C>1 (i.e., the GUI 400 displays multiple images or pictures simultaneously). The processor 110 may determine the offset K between the level_3 order of the image X(i,j,k) in the jth subdirectory and the level_3 order of the image X(i,j,k±K) in the jth subdirectory, where K is a positive integer. If the offset K ≤ the range limit The processor 110 may preload the image X(i, j, k±K) into the cache 121. The level_3 order of the preloaded image X(i, j, k±K) in the jth subdirectory may satisfy the following formula: max(1, kL)≤k±K≤min(k+L, maximum level_3 order belonging to the same level_2 ID).
[0060] by Figure 8 For example, suppose the design value C = 2, the range limit R = 3, the count limit O = 2R + 1 = 7, and the range limit Image 822 is currently selected or displayed by GUI 400. Processor 110 may determine that the offsets K between the level_3 order of image 822 (e.g., 2) and the level_3 orders of images 821 and 823 (e.g., 1 and 3) are 1 and 1, respectively, and that these offsets are equal to the range limit L = 1. Therefore, processor 110 may preload images 821 and 823 into cache 121. On the other hand, processor 110 may determine that the offset K between the level_3 order of image 822 (e.g., 2) and the level_3 order of image 824 (e.g., 4) is 2, which is greater than the range limit L = 1. Therefore, processor 110 may not preload image 824 into cache 121. The level_3 order k±K of the image to be preloaded (e.g., 821 or 823) may satisfy the following formula: max(1, 2-1)≤4±K≤min(2+1, 7).
[0061] In one embodiment, the processor 110 may preload the image X(i,j,kK) after the image X(i,j,k+K) is preloaded in response to the fact that the level_3 order of the image X(i,j,kK) in the jth subdirectory is before the level_3 order of the image X(i,j,k+K) in the jth subdirectory. Figure 6 For example, since the level_3 sequence of the image 623 is before the level_3 sequence of the image 625 , the processor 110 may preload the image 623 after the image 625 is preloaded.
[0062] In one embodiment, the processor 110 may preload the image X(i,j,k+(K+n)) after the image X(i,j,k+K) is preloaded in response to the offset K between the level_3 order of the image X(i,j,k+K) and the level_3 order of the image X(i,j,k) being less than the offset (K+n) between the level_3 order of the image X(i,j,k+(K+n)) and the level_3 order of the image X(i,j,k), where n is a positive integer. Figure 6 For example, since the offset “1” between the level_3 sequence of image 624 and the level_3 sequence of image 623 is smaller than the offset “2” between image 622 and image 624 , the processor 110 may preload image 622 after preloading image 623 .
[0063] In one embodiment, if the offset K between the level_3 order of the image X(i,j,k) and the level_3 order of the image X(i,j,k±K) is less than a range limit (e.g., a range limit R or L depending on the value of the count value C), and the image X(i,j,k±K) is not the first or last image in the j-th subdirectory (i.e., the image X(i,j,k±K) is not the image X(i,j,1) or X(i,j, the maximum level_3 order (e.g., 7)), the processor 110 may preload the image X(i,j,k±K). However, if the offset K between the level_3 order of the image X(i,j,k) and the level_3 order of the image X(i,j,k±K) is less than a range limit (e.g., a range limit R or L), but the image X(i,j,k±K) is the first or last image in the j-th subdirectory, The first or last image in the directory, the processor 110 may save one or more preload quotas to preload other images, where the number of saved preload quotas may be equal to the difference between the range limit R and the offset K (i.e., the number of saved preload quotas = R - offset K). After determining the image to be preloaded corresponding to the i-th directory, the processor 110 may determine the number of preloaded images of the i-th directory, where the more preload quotas, the fewer preloaded images. If the number of preloaded images of the i-th directory is greater than or equal to the count limit O = 2R + 1, the processor 110 may determine that no preload quotas are saved. If the number of preloaded images of the i-th directory is less than the count limit O, the processor 110 may determine that one or more preload quotas have been saved. The processor 110 may use the saved preload quotas to preload images of the directories within the range limit B until all preload quotas are used.
[0064] by Figure 7 For example, assume that design value C = 1, range limit R = 3, range limit B = 2, count limit O = 7, and image 722 is currently selected or displayed in graphical user interface 400. Processor 110 may determine that the offset "1" between the level_3 order of image 722 (e.g., 2) and the level_3 order of image 721 (e.g., 1) is less than range limit R = 3, but image 721 is the first image in a subdirectory of directory 720 (i.e., the subdirectory contains images corresponding to the same level_2 ID or order). Therefore, processor 110 may reserve two preload quotas for preloading additional images according to the formula: R - offset "1" = 3 - 1 = 2. Because directory 740 is within range limit B, the reserved preload quota can be used to preload images in directory 740, for example.
[0065] In one embodiment, the processor 110 may preload one or more images from the (i±I)th directory into the cache 121 based on a range limit B, where I is a positive integer and I ≤ the range limit B. Specifically, the processor 110 may determine an offset I between the level_1 sequence of the i-th directory and the level_1 sequence of the (i±I)th directory. If the offset I ≤ B, the processor 110 may preload the image X(i+I,j,1+K) from the (i+I)th directory and / or the image X(iI,j,mK) from the (iI)th directory, where m is the maximum level_3 sequence belonging to the (iI)th directory, K is a non-negative integer, and K ≤ the range limit R. The level_1 order of image X(i+I,j,1+K) satisfies the following formula: i+I ≤ min(i+B, the maximum level_1 order belonging to the data directory), and the level_3 order of image X(i+I,j,1+K) satisfies the following formula: 1+K ≤ min(1+R, the maximum level_3 order belonging to the (i+I)th directory). The level_1 order of image X(iI,j,mK) satisfies the following formula: max(1,iB) ≤ iI, and the level_3 order of image X(iI,j,mK) satisfies the following formula: max(1,mR) ≤ mK.
[0066] by Figure 6 For example, assume that range limit B=1 and image 624 is currently selected or displayed by graphical user interface 400. Processor 110 may determine that the offset I between the level_1 order (e.g., 2) of image 624 and the level_1 order (e.g., 3) of image 631 (or 632, 633) is 1, which is less than or equal to range limit B=1. Therefore, processor 110 may preload image 631 (or 632, 633) into cache 121. On the other hand, processor 110 may determine that the offset I between the level_1 order (e.g., 2) of image 624 and the level_1 order (e.g., 1) of image 617 (or 616, 615) is 1, which is less than or equal to range limit B=1. Therefore, processor 110 may preload image 617 (or 616, 615) into cache 121.
[0067] In one embodiment, the processor 110 may preload the image X(iI,j,mK) after the image X(i+I,j,1+K) is preloaded in response to the fact that the level_1 order of the image X(iI,j,mK) is before the level_3 order of the image X(i+I,j,1+K), where m is the maximum level_3 order belonging to the (iI)th directory, K is a positive integer, and K ≤ the range limit R. Figure 6As an example, since the level_1 order of images 617, 616, or 615 is before the level_1 order of images 631, 632, or 633, the processor 110 may preload images 617, 616, or 615 after images 631, 632, or 633 are preloaded.
[0068] In one embodiment, assume that n and m are positive integers and n < m. The processor 110 may, in response to the offset "n" between the level_1 order of the (i + n)th directory and the level_1 order of the ith directory being less than the offset "m" between the level_1 order of the (i + m)th directory and the level_1 order of the ith directory, preload images belonging to the (i + m)th directory after images belonging to the (i + n)th directory are preloaded. For Figure 7 example, since the offset "1" between directory 730 and directory 720 is less than the offset "2" between directory 740 and directory 720, the processor 110 may preload images in directory 740 after images in directory 730 are preloaded.
[0069] In one embodiment, the processor 110 may determine the number of preloaded images. If the number of preloaded images is less than the count limit A = 2O + 1 = 4R + 3, the processor 110 may preload more images in the (i + n)th directory, where n is a positive integer and n ≤ the range limit B. For Figure 7 example, assume that the range limit R = 3, the range limit B = 2, and the count limit A = 15. After images in directory 710 are preloaded, the processor 110 may determine that the number of preloaded images in directories 710, 720, and 730 (i.e., images 714, 715, 716, 717, 721, 722, 723, 724, 725, 731, and 732) is 13, which is less than the count limit A = 15. Therefore, the processor 110 may preload images in directory 740.
[0070] In one embodiment, if the difference between the count limit A and the number of preloaded images is less than the count value C, the processor 110 may stop preloading images. For Figure 8 example. Assume that the count limit A = 15 and the count value C = 2, and images in two subdirectories in each of directories 810, 820, and 830 (e.g., images 816 and 817 in a subdirectory of directory 810, images 821, 822, and 823 in a subdirectory of directory 820, or images 831 and 832 in a subdirectory of directory 830) have been preloaded into the cache 121. The processor 110 may determine that the number of preloaded images is equal to "14". Since the difference between the count limit A = 15 and the number of preloaded images "14" is less than the count value C = 2, the processor ills0 may stop preloading images.
[0071] Back to Figure 2 In step S505, the processor 110 may display one or more images through the graphical user interface 400. The processor 110 may sequentially display one or more images (or pictures) corresponding to the same level_1 ID based on the count value C and the level_2 of each image.
[0072] In step S506, processor 110 may determine whether the user switches pages of graphical user interface 400 via a user command, where each page may include one or more selected images (or graphics). If the page is switched, processor 110 may select one or more new images (or graphics) to be displayed on graphical user interface 400. After the new images (or graphics) are selected, processor 110 may execute step S503 again. If the page is not switched, the image preloading process may terminate.
[0073] Figure 6 An example of image preloading according to an embodiment of the present disclosure is described. Assume that range limit R = 2, range limit B = 2, count value C = 1, count limit O = 2R+1 = 5, count limit A = 4R+3 = 11, and image 624 in directory 620 is currently selected or displayed by graphical user interface 400. Processor 110 may determine that the offsets between the level_3 order of image 624 (e.g., 4) and the level_3 orders of images 622, 623, 625, and 626 (e.g., 2, 3, 5, and 6) are 2, 1, 1, and 2, respectively, and that these offsets are less than or equal to range limit R = 2. Therefore, processor 110 may preload image 622, 623, 625, or 626 into cache 121. Because the offset between image 624 and images 623 and 625 is the smallest, processor 110 may preload images 623 and 625 first. In response to the fact that the level_3 order of image 623 precedes the level_3 order of image 625, processor 110 may preload image 625 before preloading image 623. On the other hand, processor 110 may determine that the offsets K between the level_3 order of image 624 (e.g., 4) and the level_3 orders of images 621 and 627 (e.g., 1 and 7) are 3 and 3, respectively, and that these offsets are greater than the range limit R=2. Therefore, processor 110 may not preload images 621 or 627 into cache 121.
[0074] Processor 110 may determine that the number of preloaded images is "5," which is less than the count limit A = 11. Therefore, processor 110 may preload more images from directories other than directory 620. Since the level_1 order of directory 610 precedes the level_1 order of directory 630, processor 110 may preload images from directory 630 first. Processor 110 may preload images 631, 632, and 633 because the level_3 order of these images satisfies the formula 1+K≤min(1+R, the maximum level_3 order belonging to the (i+I)th directory) as described above.
[0075] Processor 110 may determine that the number of preloaded images belonging to directories 620 and 630 is "8", which is less than the count limit A = 11. Therefore, processor 110 may preload more images from directory 610. Processor 110 may preload images 617, 616, and 615 because the level_3 order of these images satisfies the formula max(1,mR)≤mK as described above.
[0076] Figure 7 Another example of image preloading according to an embodiment of the present disclosure is described. Assume that range limit R = 3, range limit B = 2, count value C = 1, count limit O = 2R+1 = 7, count limit A = 4R+3 = 15, and image 722 in directory 720 is currently selected or displayed by graphical user interface 400. Processor 110 may determine that the offsets between the level_3 order of image 722 (e.g., 2) and the level_3 orders of images 721, 723, 724, and 725 (e.g., 1, 3, 4, and 5) are 1, 1, 2, and 3, respectively, and that these offsets are less than or equal to range limit R = 3. Therefore, processor 110 may preload image 721, 723, 724, or 725 into cache 121. Because the offset between image 722 and images 721 and 723 is the smallest, processor 110 may preload images 721 and 723 first. In response to the fact that the level_3 order of the image 721 is before the level_3 order of the image 723 , the processor 110 may preload the image 723 first and then preload the image 721 .
[0077] Processor 110 may determine that the offset "1" between the level_3 order of image 722 (e.g., 2) and the level_3 order of image 721 (e.g., 1) is less than the range limit R=3, but image 721 is the first image in a subdirectory of directory 720 (i.e., the subdirectory contains images corresponding to the same level_2 ID or order). Therefore, processor 110 may reserve two preload quotas for preloading other images based on the formula: R - offset "1" = 3 - 1 = 2 as described above.
[0078] Processor 110 may determine that the number of preloaded images is "5," which is less than the count limit A = 15. Therefore, processor 110 may continue to preload additional images. Because the offset between directory 720 and directories 710 and 730 is the smallest offset and is within the range limit B = 2, processor 110 may select one of directories 710 and 730 for preloading images. In response to the fact that the level_1 order of directory 710 precedes the level_1 order of directory 730, processor 110 may preload images from directory 730 first. Processor 110 may preload images 731, 732, 733, and 734 because the level_3 order of these images satisfies the formula 1+K≤min(1+R, the maximum level_3 order belonging to the (i+1)th directory) as described above. Then, because the number of preloaded images is "9," which is less than the count limit A = 15, processor 110 may preload images from directory 710. The processor 110 may preload the images 717 , 716 , 715 , and 714 because the level_3 order of these images satisfies the formula max(1,mR)≤mK as described above.
[0079] Processor 110 may determine that the number of preloaded images in directories 710, 720, and 730 is "13," which is less than count limit A = 15. Therefore, processor 110 may use the saved preload quota to preload images within range limit B. For example, processor 110 may use two preload quotas to preload two images in directory 740.
[0080] Figure 8 Another example of image preloading according to one embodiment of the present disclosure is described. Assume that the range limit R=3, the range limit B=1, the count value C=2, the count limit O=2R+1=7, the count limit A=4R+3=15, and two images corresponding to two sub-directories of the directory 820 (for example, the image 822 and another image sharing the same level_3 and level_1 order but with a different level_2 order) are currently selected or displayed by the graphical user interface 400. Since the count value C>1, the processor 110 may determine that the range limit Processor 110 may determine that the offsets between the level_3 order of image 822 (e.g., 2) and the level_3 orders of images 821 and 823 (e.g., 1 and 3) are 1 and 1, which is equal to the range limit L=1. Therefore, processor 110 may preload images 821 and 823 into cache 121. In response to the fact that the level_3 order of image 821 is earlier than the level_3 order of image 823, processor 110 may preload image 823 before preloading image 821.
[0081] Processor 110 may determine that the number of preloaded images in directory 820 is "6," which is less than the count limit A = 15. Therefore, processor 110 may continue to preload additional images. Because the offset between directory 820 and directories 810 and 830 is within the range limit B = 1, processor 110 may preload images from directories 810 and 830. In response to the fact that the level_1 order of directory 810 precedes the level_1 order of directory 830, processor 110 may preload images from directory 830 before preloading images from directory 810. Processor 110 may preload images 831 and 832 because the level_3 order of these images satisfies the aforementioned formula 1+K≤min(1+R, the maximum level_3 order belonging to the (i+1)th directory). Subsequently, because the number of preloaded images is "10," which is less than the count limit A = 15, processor 110 may preload images from directory 810. Processor 110 can preload images 817 and 816 because the level_3 order of these images satisfies the aforementioned formula max(1,mR)≤mK. Processor 110 can determine that the number of preloaded images is "14." Although the number of preloaded images, "14," is less than the count limit A=15, the difference between the count limit A=15 and "14" is less than the count value C=2. Therefore, processor 110 can stop preloading images.
[0082] Figure 9 A flowchart illustrating a method for image viewing according to an embodiment of the present disclosure, wherein the method may be performed by Figure 1 The electronic device 100 shown is implemented as follows. In step S901, a plurality of images are obtained, wherein the plurality of images includes a first image, wherein the first image includes a first value and a second value. In step S902, a data directory is generated by assigning the first image to a first directory of a data directory based on the first value and assigning the first image to a first subdirectory of the first directory based on the second value. In step S903, in response to the first image being selected, a second image in a second directory of the data directory is preloaded into a cache based on the data directory. In step S904, a graphical user interface is output, wherein the graphical user interface displays the first image in response to the first image being selected.
[0083] In summary, the electronic device can create a data directory based on the values contained in each image. When the user selects (or views) an image, the electronic device can preload one or more images adjacent to the selected image in a specific order. For example, the electronic device can preload images in the same image as the selected image, or images in the same or adjacent directories (or subdirectories) as the selected image. Since the user is more likely to view images that are later than the selected image rather than images that are earlier than the selected image, the electronic device can preload later images with a higher priority. If the selected image is close to the first or last image in the directory, so that fewer images need to be preloaded in the directory, the saved preloading quota can be used to preload images in directories adjacent to the selected image.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An electronic device for viewing an image, characterized in that: include: transceiver; Cache; as well as a processor coupled to the transceiver and the cache, wherein the processor is configured to: acquiring, by the transceiver, a plurality of images, wherein the plurality of images includes a first image, wherein the first image includes a first value and a second value; generating the data directory by assigning the first image to a first directory of a data directory according to the first value and assigning the first image to a first subdirectory of the first directory according to the second value; In response to the first image being selected, preloading a second image in a second directory of the data directory into the cache according to the data directory; as well as A graphical user interface is outputted via the transceiver, wherein the graphical user interface displays the first image in response to the first image being selected.
2. The electronic device of claim 1 , wherein the processor is further configured to: Determine an offset between an order of the first directory in the data directory and an order of the second directory in the data directory; determining whether the offset is less than or equal to a first range limit; and In response to the offset being less than or equal to the first range limit, preloading the second image in the second directory.
3. The electronic device of claim 2, wherein the processor is further configured to: A third image in a third directory of the data directory is preloaded into the cache, wherein the third directory is placed before the second directory in the data directory.
4. The electronic device of claim 1 , wherein the processor is further configured to: In response to the first image being selected, a fourth image in the first sub-directory is preloaded into the cache according to the data directory.
5. The electronic device of claim 4, wherein the processor is further configured to: determining an offset between an order of the first images in the first subdirectory and an order of the fourth images in the first subdirectory; determining whether the offset is less than or equal to a second range limit; and In response to the offset being less than or equal to the second range limit, preloading the fourth image.
6. The electronic device of claim 5, wherein the processor is further configured to: A graphical user interface is outputted through the transceiver, wherein the graphical user interface displays a plurality of images according to the count value.
7. The electronic device of claim 6, wherein the processor is further configured to: The second range limit is determined according to the count value.
8. The electronic device of claim 5, wherein the processor is further configured to: In response to the offset being less than the second range limit but the fourth image being the first or last of the images in the first subdirectory, or in response to the first image being the first or last of the images in the first subdirectory, saving a preload quota; Determining the number of preloaded images in the first directory; and In response to the number of preloaded images being less than or equal to a count limit, preloading the second image in the second directory using the preload quota.
9. The electronic device of claim 5, wherein the processor is further configured to: After the fourth image is preloaded, the fifth image in the first subdirectory is preloaded into the cache, wherein the fifth image is placed before the fourth image in the first subdirectory.
10. The electronic device of claim 1, wherein the first image further comprises a third value, wherein the processor is further configured to: The first images in the first sub-directory are sorted according to the third value to generate the data directory.
11. A method for viewing an image, characterized in that: include: obtaining a plurality of images, wherein the plurality of images includes a first image, wherein the first image includes a first value and a second value; generating the data directory by assigning the first image to a first directory of a data directory according to the first value and assigning the first image to a first subdirectory of the first directory according to the second value; In response to the first image being selected, preloading a second image in a second directory of the data directory into a cache according to the data directory; as well as A graphical user interface is output, wherein the graphical user interface displays the first image in response to the first image being selected.
12. The method according to claim 11, wherein the step of preloading the second image in the second directory of the data directory into the cache according to the data directory comprises: Determine an offset between an order of the first directory in the data directory and an order of the second directory in the data directory; determining whether the offset is less than or equal to a first range limit; as well as In response to the offset being less than or equal to the first range limit, preloading the second image in the second directory.
13. The method according to claim 12, further comprising: A third image in a third directory of the data directory is preloaded into the cache, wherein the third directory precedes the second directory in the data directory.
14. The method according to claim 11, further comprising: In response to the first image being selected, a fourth image in the first sub-directory is preloaded into the cache according to the data directory.