Slide thumbnail loading control method and device, electronic equipment and storage medium
By obtaining the image loading list of slide thumbnails and the preset rendering mechanism, dynamically controlling thumbnail loading, solving the problem of excessive memory usage of slides and improving loading efficiency and rendering performance.
Patent Information
- Application Number
- CN202510298585.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, the loading of thumbnails in the slides leads to excessive memory usage, which easily leads to system instability and slow operation, and frequent DOM operations and GPU burdens lead to lag.
By obtaining the image loading list of slide thumbnails, determine the current location of the thumbnails, and dynamically control the loading and rendering of thumbnails according to the preset image rendering mechanism to reduce unnecessary memory usage and DOM operations.
It realizes loading control of slide thumbnails, reduces memory usage, improves loading efficiency, optimizes rendering performance, and avoids system instability and lag.
Smart Images

Figure CN120372025A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image caching technology, and particularly relates to a method, device, electronic device, and storage medium for controlling the loading of slide thumbnails. Background Art
[0002] A slide usually consists of a large display image and a list of thumbnail images. Currently, when loading the large display image, only the image corresponding to the currently displayed thumbnail is rendered, that is, only one DOM node is occupied, and one memory space is occupied. For the thumbnail list, which includes multiple thumbnails, when loading a slide, usually all thumbnails are loaded. Each time a thumbnail is loaded, a new memory occupancy for the picture, a memory occupancy for the HTMLDivElement, and a memory occupancy for the DOM node listening event are added. When there are too many thumbnails in the slide, it will occupy a large amount of memory, easily causing system instability, such as program crashes and slow operation.
[0003] Therefore, the above technical problems need to be solved urgently. Summary of the Invention
[0004] The main purpose of the embodiments of this application is to propose a method, device, electronic device, and storage medium for controlling the loading of slide thumbnails, which can achieve the control of the loading of slide thumbnails, reduce memory occupancy, and optimize memory.
[0005] On the one hand, the embodiments of this application propose a method for controlling the loading of slide thumbnails, and the method includes the following steps:
[0006] Obtain the image loading list corresponding to the slide thumbnails;
[0007] Obtain the currently displayed thumbnail, and according to the image loading list, determine the current image position corresponding to the currently displayed thumbnail in the image loading list;
[0008] According to the current image position and a preset image rendering mechanism, determine multiple target slide thumbnails from the image loading list, and load and render the multiple target slide thumbnails.
[0009] In some embodiments, the obtaining the image loading list corresponding to the slide thumbnails specifically includes:
[0010] Obtain the image loading list;
[0011] According to the image loading list, determine the number of pre-loaded thumbnails, multiple pre-loaded slide thumbnails, and the image list positions corresponding to each of the pre-loaded slide thumbnails in the image loading list.
[0012] In some embodiments, obtaining the currently displayed thumbnail and determining the current image position corresponding to the currently displayed thumbnail in the image loading list specifically includes:
[0013] In response to a thumbnail selection operation, determining the currently displayed thumbnail from multiple pre-loaded slide thumbnails, where the thumbnail selection operation is an operation in which a user selects a thumbnail using a slide control focus;
[0014] Obtaining the image list position corresponding to the currently displayed thumbnail in the image loading list as the current image position.
[0015] In some embodiments, the method further includes:
[0016] In response to a user's thumbnail switching operation, determining a first image position and a thumbnail stay time corresponding to the currently switched thumbnail, and determining whether to obtain the currently switched thumbnail as the currently displayed thumbnail according to a preset rendering judgment mechanism.
[0017] In some embodiments, determining multiple target slide thumbnails from the image loading list according to the current image position and a preset image rendering mechanism, and loading and rendering the multiple target slide thumbnails specifically includes:
[0018] Obtaining the maximum number of currently rendered thumbnails;
[0019] Determining an image loading position range according to the current image position and the maximum number of currently rendered thumbnails;
[0020] Determining multiple target slide thumbnails from the image loading list according to the image loading position range, where the image list position corresponding to the target slide thumbnail is within the image loading position range.
[0021] In some embodiments, in response to a user's thumbnail switching operation, determining a first image position and a thumbnail stay time corresponding to the currently switched thumbnail, and determining whether to obtain the currently switched thumbnail as the currently displayed thumbnail according to a preset rendering judgment mechanism specifically includes:
[0022] In response to the thumbnail switching operation, determining the currently switched thumbnail and dynamically calculating the thumbnail stay time, where the currently switched thumbnail is the thumbnail selected after switching the currently displayed thumbnail using the slide control focus, and the thumbnail stay time is the time elapsed after the currently switched thumbnail is selected through the slide control focus;
[0023] Determine the first image position according to the image loading list, where the first image position is the image position of the current switching thumbnail in the image loading list;
[0024] Determine the image position difference according to the first image position and the current image position;
[0025] Determine whether to obtain the current switching thumbnail as the current displayed thumbnail according to the thumbnail stay time and the image position difference.
[0026] In some embodiments, the determining whether to obtain the current switching thumbnail as the current displayed thumbnail according to the thumbnail stay time and the image position difference specifically includes:
[0027] Obtain a preset rendering judgment threshold and a rendering judgment time;
[0028] Determine a first judgment result according to the image position difference and the rendering judgment threshold;
[0029] Determine a second judgment result according to the thumbnail stay time and the rendering judgment time;
[0030] When the first judgment result is that the image position difference is greater than the rendering judgment threshold, or the second judgment result is that the thumbnail stay time is greater than the rendering judgment time, determine to obtain the current switching thumbnail as the current displayed thumbnail; otherwise, determine not to obtain the current switching thumbnail as the current displayed thumbnail.
[0031] In some embodiments, the determining the image loading position range according to the current image position and the maximum number of rendered current thumbnails specifically includes:
[0032] Determine the minimum image loading position and the maximum image loading position according to the current image position and the maximum number of rendered current thumbnails;
[0033] Determine the image loading position range according to the minimum image loading position and the maximum image loading position.
[0034] On the other hand, an embodiment of the present application provides a slide thumbnail loading control device, and the device includes:
[0035] A first module, configured to obtain an image loading list corresponding to a slide thumbnail;
[0036] A second module, configured to obtain a current displayed thumbnail, and determine a current image position corresponding to the current displayed thumbnail in the image loading list according to the image loading list;
[0037] A third module, configured to determine multiple target slide thumbnails from the image loading list according to the current image position and a preset image rendering mechanism, and load and render the multiple target slide thumbnails.
[0038] On the other hand, an embodiment of the present application provides an electronic device, including at least one control processor and a memory communicatively connected to the at least one control processor; the memory stores instructions executable by the at least one control processor, and when the instructions are executed by the at least one control processor, the at least one control processor is enabled to execute the slide thumbnail loading control method as described above.
[0039] On the other hand, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the slide thumbnail loading control method as described above.
[0040] The embodiments of the present application at least include the following beneficial effects: A slide thumbnail loading control method, device, electronic device, and storage medium provided by the present application determine a current image position corresponding to a currently displayed thumbnail in an image loading list according to the image loading list corresponding to the slide thumbnail and the currently displayed thumbnail, determine multiple target slide thumbnails from the image loading list according to the current image position and a preset image rendering mechanism, and load and render the multiple target slide thumbnails. The present application can dynamically control the number of thumbnails rendered during the loading of slide thumbnails, achieve the loading control of slide thumbnails, reduce memory occupancy, optimize memory, and improve the slide loading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 is a flowchart of a slide thumbnail loading control method provided by an embodiment of the present application;
[0044] Figure 2 is a schematic diagram of an image loading list in an embodiment of the present application;
[0045] Figure 3 is the flowchart of step S103 in the embodiment of the present application;
[0046] Figure 4 is a schematic diagram of the minimum image loading position and the maximum image loading position in the embodiment of the present application;
[0047] Figure 5 is a schematic diagram of multiple target slide thumbnails in the embodiment of the present application;
[0048] Figure 6 is the flowchart of step S501 in the embodiment of the present application;
[0049] Figure 7 is the flowchart of step S604 in the embodiment of the present application;
[0050] Figure 8 is a schematic diagram of the switching of the currently displayed thumbnail in the embodiment of the present application;
[0051] Figure 9 is a schematic structural diagram of a slide thumbnail loading control device provided in the embodiment of the present application;
[0052] Figure 10 is a schematic hardware structure diagram of an electronic device provided in the embodiment of the present application. Detailed implementation manners
[0053] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application detailed in the appended claims.
[0054] It can be understood that the terms "first", "second", etc. used in the present application can be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information. Depending on the context, the words "if", "when" as used herein can be interpreted as "when...", "while...", or "in response to determining".
[0055] As used in this application, the terms "at least one", "a plurality", "each", "any one", etc. The "at least one" includes one, two or more than two. The "a plurality" includes two or more than two. "Each" refers to each one of the corresponding plurality. "Any one" refers to any one of the plurality.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0057] It should be noted that in each specific embodiment of this application, when it comes to relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiments of this application need to obtain the user's sensitive personal information, the user's separate permission or separate consent will be obtained through methods such as pop-up windows or jumping to a confirmation page. After clearly obtaining the user's separate permission or separate consent, the necessary user-related data for the normal operation of the embodiments of this application will be obtained.
[0058] Before elaborating on the embodiments of this application in detail, some nouns and terms involved in the embodiments of this application are first explained, and the nouns and terms involved in the embodiments of this application are applicable to the following explanations.
[0059] 1) DOM (Document Object Model): DOM is a standard programming interface recommended by the W3C (World Wide Web Consortium) for processing Extensible Markup Language. It is a platform- and language-independent application programming interface (API) that allows programs and scripts to dynamically access and update the content, structure, and style of a document. DOM defines how to access and manipulate the structure and content of HTML and XML documents through programs and scripts. DOM treats an HTML document or an XML document as a structured tree composed of multiple layers of nodes (such as element nodes, text nodes, and attribute nodes), and this structure is called a DOM tree.
[0060] 2) API: Refers to an application programming interface. API (Application Programming Interface) is a collection of predefined functions, procedures, methods, or classes that allows developers to create applications that access and manipulate software applications, operating systems, or other services. By providing a standardized interface, APIs enable different software systems, services, and applications to communicate and interact with each other, realizing the sharing of data and functions.
[0061] 3) GPU (Graphics Processing Unit): A microprocessor specifically designed to handle image and graphics computing tasks. It is widely used in personal computers, workstations, and some mobile devices (such as smartphones, tablets, etc.), mainly for accelerating graphics rendering and parallel computing tasks.
[0062] 4) HTMLDivElement: An interface in the DOM (Document Object Model) that represents in an HTML document Element. It is a sub-interface of HTMLElement, inheriting all the properties and methods of HTMLElement without adding any additional properties or methods.
[0063] A slide usually consists of a large display image and a list of thumbnail images. Currently, when loading the large display image, only the image corresponding to the currently displayed thumbnail is rendered, which only occupies one DOM node and one memory space. For the thumbnail list, which includes multiple thumbnails, when loading a slide, usually all thumbnails are loaded. Each time a thumbnail is loaded, a new memory occupation for the image, HTMLDivElement, and DOM node listening events is added. When there are too many thumbnails in the slide, it will occupy a large amount of memory, easily causing system instability, such as program crashes and slow operation. In addition, each time the DOM element is operated to cause a page repaint, the burden on the GPU is also quite large because there are too many DOM nodes occupied by the page, resulting in a very low frame rate during rendering and obvious frame drops and stuttering.
[0064] Based on this, the embodiments of the present application propose a method, device, electronic device, and storage medium for controlling the loading of slide thumbnails, which can combine a preset rendering judgment mechanism and an image rendering mechanism to dynamically control the rendering of slide thumbnails, reduce memory occupation, achieve memory optimization, improve the slide loading efficiency, and optimize the rendering performance of slide thumbnails.
[0065] Refer to Figure 1 , Figure 1 is an optional flowchart of a method for controlling the loading of slide thumbnails provided by the embodiments of the present application. The method may include but is not limited to steps S101 to S103:
[0066] Step S101, obtain an image loading list corresponding to the slide thumbnails;
[0067] Step S102, obtain the currently displayed thumbnail, and determine the current image position corresponding to the currently displayed thumbnail in the image loading list according to the image loading list;
[0068] Step S103, determine multiple target slide thumbnails from the image loading list according to the current image position and a preset image rendering mechanism, and load and render the multiple target slide thumbnails.
[0069] In some embodiments, step S101 may include but is not limited to steps S201 to S202:
[0070] Step S201, obtain the image loading list;
[0071] Step S202: Determine the number of pre-loaded thumbnail images, multiple pre-loaded slide thumbnails, and the corresponding positions of each pre-loaded slide thumbnail in the image loading list according to the image loading list.
[0072] In some embodiments, obtain the data list corresponding to the thumbnail images, i.e., the above-mentioned image loading list, from the background system or database through the backend API, and determine the position of each pre-loaded slide thumbnail in the image loading list, that is, the sorting position of the pre-loaded slide thumbnail in the corresponding image list.
[0073] Exemplarily, referring to Figure 2 , Figure 2 is an optional schematic diagram of the image loading list in the embodiments of the present application. Assume that the image loading list includes 25 pre-loaded slide thumbnails, and each pre-loaded slide thumbnail has a corresponding position subscript, which is any number from 1 to 25. When the position subscript corresponding to the pre-loaded slide thumbnail is 3, it means that the position of the pre-loaded slide thumbnail in the image loading list is 3, that is, the pre-loaded slide thumbnail is the third sorted slide thumbnail in the image loading list, and so on.
[0074] In some embodiments, step S102 may include but is not limited to steps S301 to S302:
[0075] Step S301: In response to a thumbnail selection operation, determine the currently displayed thumbnail from multiple pre-loaded slide thumbnails. The thumbnail selection operation is an operation in which the user selects a thumbnail using the slide control focus.
[0076] Step S302: Obtain the position of the currently displayed thumbnail in the image loading list as the current image position.
[0077] In some embodiments, the user performs a thumbnail selection operation through an external input device, such as a touch screen, a mouse, or a graphics tablet, etc., to determine the currently displayed thumbnail from multiple pre-loaded slide thumbnails. Optionally, when the image loading list is initially loaded, set the first sorted slide thumbnail in the image loading list as the currently displayed thumbnail, and perform the initial loading and rendering of the thumbnail according to the currently displayed thumbnail. Then, the user performs a thumbnail selection operation to re-select the currently displayed thumbnail from the multiple slide thumbnails that have been initially loaded and rendered.
[0078] In some embodiments, referring to Figure 3 , Figure 3 is an optional flowchart of step S103 in the embodiments of the present application. Step S103 may include but is not limited to steps S401 to S403:
[0079] Step S401, obtain the maximum number of currently rendered thumbnails;
[0080] Step S402, determine the image loading position range according to the current image position and the maximum number of currently rendered thumbnails;
[0081] Step S403, determine multiple target slide thumbnails from the image loading list according to the image loading position range, where the image list positions corresponding to the target slide thumbnails are within the image loading position range.
[0082] In some embodiments, the thumbnails are displayed in a landscape or portrait orientation or other display modes, and the maximum number of currently rendered thumbnails is determined according to the display mode.
[0083] Exemplarily, assume that the thumbnails are displayed in landscape orientation, obtain the first preset display width value of the thumbnail, then obtain the second preset display width value corresponding to the display device, and determine the maximum number of currently rendered thumbnails according to the first preset display width value and the second preset display width value. The maximum number of currently rendered thumbnails is calculated by the following formula:
[0084] maxNum = window.innerWidth / defaultWidth;
[0085] where maxNum is the maximum number of currently rendered thumbnails, window.innerWidth is the second preset display width value, and defaultWidth is the first preset display width value.
[0086] In some embodiments, according to the current image position and the maximum number of currently rendered thumbnails, determine the minimum image loading position and the maximum image loading position, and then determine the image loading position range according to the minimum image loading position and the maximum image loading position. Optionally, the minimum image loading position and the maximum image loading position are calculated by the following formula:
[0087] MinIndex = initIndex - maxNum;
[0088] MaxIndex = initIndex + maxNum;
[0089] where MinIndex is the minimum image loading position, MaxIndex is the maximum image loading position, initIndex is the current image position, and maxNum is the maximum number of currently rendered thumbnails.
[0090] Exemplarily, refer to Figure 4 , Figure 4 This is an optional schematic diagram of the minimum image loading position and the maximum image loading position in the embodiments of the present application. Assume that there are 30 pre-loaded slide thumbnails in the image loading list. Then, the image list positions corresponding to the pre-loaded slide thumbnails in the image loading list are from 1 to 30. The user performs a thumbnail selection operation and selects the pre-loaded slide thumbnail at image list position 10 as the currently displayed thumbnail, determines the current image position as 10, and obtains that the maximum rendering count of the current thumbnail is 15. Then, the minimum image loading position is determined as 10 - 15 = -5. Since -5 < 1, it means that the number of pre-loaded slide thumbnails before the currently displayed thumbnail in the image loading list is less than the maximum rendering count of the current thumbnail. The rendering of the thumbnail does not perform list rotation. When the number of pre-loaded slide thumbnails before the currently displayed thumbnail in the image loading list is less than the maximum rendering count of the current thumbnail, the image list position corresponding to the first pre-loaded slide thumbnail in the image loading list is determined as the minimum image loading position. At this time, the minimum image loading position is determined as 1, that is Figure 4 the image position subscript within the blue frame in. Then, the maximum image loading position is determined as 10 + 15 = 25. Since 25 < 30, it means that the number of pre-loaded slide thumbnails after the currently displayed thumbnail in the image loading list is greater than the maximum rendering count of the current thumbnail. At this time, the maximum image loading position is determined as 25, that is Figure 4 the image position subscript within the green frame in. According to the minimum image loading position and the maximum image loading position, the image loading position range is determined as [1, 25]. Refer to Figure 5 , Figure 5 This is an optional schematic diagram of multiple target slide thumbnails in the embodiments of the present application. According to the image loading position range, multiple target slide thumbnails are determined. The target slide thumbnails are the Figure 5 thumbnails within the red frame in. When the number of pre-loaded slide thumbnails after the currently displayed thumbnail in the image loading list is less than the maximum rendering count of the current thumbnail, that is, the maximum image loading position > 40. Similarly, the rendering of the thumbnail does not perform list rotation. The image list position corresponding to the last pre-loaded slide thumbnail in the image loading list is determined as the maximum image loading position. The non-rotation of the thumbnail rendering can keep the thumbnail position fixed, which helps to maintain the stability of the page layout, avoid visual chaos, optimize the user's browsing experience, and at the same time avoid more DOM operations and image renderings, reduce calculations and memory consumption, improve page performance, and save network and memory resources.
[0091] In some embodiments, the above method further includes step S501:
[0092] Step S501: In response to the user's thumbnail switching operation, determine the first image position corresponding to the currently switched thumbnail and the thumbnail stay time, and determine whether to obtain the currently switched thumbnail as the currently displayed thumbnail according to a preset rendering judgment mechanism.
[0093] In some embodiments, due to the user's accidental click or frequent short-term switching, etc., it is easy to cause frequent rendering and loading of thumbnails, reducing the rendering performance. Therefore, in order to avoid the situation of frequent rendering and loading of thumbnails, a rendering judgment mechanism is introduced to effectively judge whether to reload and render thumbnails, reduce the number of thumbnail renderings, and improve the rendering performance and efficiency.
[0094] In some embodiments, referring to Figure 6 , Figure 6 is an optional flowchart of step S501 in the embodiments of the present application. Step S501 may include but is not limited to steps S601 to S604:
[0095] Step S601: In response to the thumbnail switching operation, determine the currently switched thumbnail and dynamically calculate the thumbnail stay time. Among them, the currently switched thumbnail is the thumbnail selected after switching the currently displayed thumbnail using the slide control focus, and the thumbnail stay time is the time elapsed after selecting the currently switched thumbnail through the slide control focus;
[0096] Step S602: Determine the first image position according to the image loading list. Among them, the first image position is the image position of the currently switched thumbnail in the image loading list;
[0097] Step S603: Determine the image position difference according to the first image position and the current image position;
[0098] Step S604: Determine whether to obtain the currently switched thumbnail as the currently displayed thumbnail according to the thumbnail stay time and the image position difference.
[0099] In some embodiments, from two aspects of time span and space span, the switching of the currently displayed thumbnail is judged. The time span corresponds to the above-mentioned thumbnail stay time, and the space span corresponds to the above-mentioned image position difference. When the thumbnail stay time meets the preset time span condition or the image position difference meets the preset space span condition, the switching of the currently displayed thumbnail is performed.
[0100] In some embodiments, referring to Figure 7 , Figure 7 is an optional flowchart of step S604 in the embodiments of the present application. Step S604 may include but is not limited to steps S701 to S704:
[0101] Step S701, obtain a preset rendering judgment threshold and a rendering judgment time;
[0102] Step S702, determine a first judgment result according to the image position difference and the rendering judgment threshold;
[0103] Step S703, determine a second judgment result according to the thumbnail stay time and the rendering judgment time;
[0104] Step S704, when the first judgment result is that the image position difference is greater than the rendering judgment threshold, or the second judgment result is that the thumbnail stay time is greater than the rendering judgment time, determine to obtain the current switched thumbnail as the current displayed thumbnail; otherwise, determine not to obtain the current switched thumbnail as the current displayed thumbnail.
[0105] In some embodiments, a rendering judgment threshold X and a rendering judgment time T are preset. Assume that for the currently displayed thumbnail, its corresponding current image position is A. If the user performs a thumbnail switching operation, triggering the rendering judgment mechanism, and determines that the first image position corresponding to the current switched thumbnail is B, and the thumbnail stay time is T x , then the image position difference is |A - B|. When it is determined that |A - B| > X or T x > T, obtain the current switched thumbnail as the current displayed thumbnail, that is, update the current image position from A to B. Then, according to the updated current image position, reload and render the thumbnail again.
[0106] Exemplarily, referring to Figure 8 , Figure 8 is an optional schematic diagram of the switching of the currently displayed thumbnail in an embodiment of the present application. Among them, the current image position is 5, that is, the currently displayed thumbnail is Figure 8 the thumbnail within the yellow frame in. The image loading position range is [1, 10]. Assume that the rendering judgment threshold is 3. When the first image position corresponding to the current switched thumbnail is 7, that is, the current switched thumbnail is Figure 8 the thumbnail within the green frame in. Since |5 - 7| < 3, the switching of the currently displayed thumbnail is not performed. When the first image position corresponding to the current switched thumbnail is 9, that is, the current switched thumbnail is Figure 8 the thumbnail within the red frame in, that is, the current switched thumbnail is Figure 8 the thumbnail within the red frame in. Since |5 - 9| > 3, the switching of the currently displayed thumbnail is performed, and the current image position is updated from 5 to 9.
[0107] Referring to Figure 9 , Figure 9 is an optional structural schematic diagram of a slide thumbnail loading control device provided in an embodiment of the present application. This device is used to implement the above slide thumbnail loading control method. This device may include:
[0108] The first module is used to obtain an image loading list corresponding to the slide thumbnail;
[0109] The second module is used to obtain the currently displayed thumbnail, and determine the current image position corresponding to the currently displayed thumbnail in the image loading list according to the image loading list;
[0110] The third module is used to determine multiple target slide thumbnails from the image loading list according to the current image position and a preset image rendering mechanism, and load and render the multiple target slide thumbnails.
[0111] It can be understood that the content in the above method embodiments is applicable to the device embodiments of the present application. The functions specifically implemented by the device embodiments of the present application are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0112] An embodiment of the present application further provides an electronic device, which includes at least one control processor and a memory for communicating with at least one control processor. The memory stores instructions executable by at least one control processor. When the instructions are executed by at least one control processor, at least one control processor can execute the above slide thumbnail loading control method. The electronic device can be any intelligent terminal including a tablet computer, etc.
[0113] It can be understood that the content in the above method embodiments is applicable to the device embodiments of the present application. The functions specifically implemented by the device embodiments of the present application are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0114] Please refer to Figure 10 , Figure 10 which illustrates the hardware structure of an electronic device according to another embodiment. The electronic device includes:
[0115] A processor 901, which can be implemented in ways such as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present application;
[0116] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 902 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 902, and the processor 901 is used to call and execute the slide thumbnail loading control method of the embodiments of this application;
[0117] The input / output interface 903 is used to implement information input and output;
[0118] The communication interface 904 is used to implement communication and interaction between this device and other devices. It can implement communication through a wired method (such as USB, network cable, etc.), or can also implement communication through a wireless method (such as mobile network, WIFI, Bluetooth, etc.);
[0119] The bus 905 transmits information between various components of the device (such as the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0120] Among them, the processor 901, the memory 902, the input / output interface 903, and the communication interface 904 are communicatively connected to each other inside the device through the bus 905.
[0121] The embodiments of this application also provide a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause a computer to execute the above-mentioned slide thumbnail loading control method.
[0122] It can be understood that the content in the above method embodiments is applicable to the embodiments of this storage medium. The functions specifically implemented by the embodiments of this storage medium are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.
[0123] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a memory remotely provided relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0124] A method, device, electronic device, and storage medium for controlling the loading of slide thumbnails provided by an embodiment of the present application can dynamically control the number of thumbnail renderings during the loading of slide thumbnails, achieve the control of the loading of slide thumbnails, reduce memory occupancy, achieve memory optimization, and improve the slide loading efficiency.
[0125] The embodiments described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0126] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown, or combine certain steps, or different steps.
[0127] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0128] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations.
[0129] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0130] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. " / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expressions refer to any combination of these items, including any combination of single items (one) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0131] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical or other forms.
[0132] The units described above as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] In addition, each functional unit in each embodiment of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0134] It should be recognized that embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method can be implemented in a computer program using standard programming techniques including a non-transitory computer-readable storage medium configured with the computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, for this purpose the program is capable of running on a programmed application-specific integrated circuit.
[0135] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs that can store programs.
[0136] The preferred embodiments of the embodiments of this application have been described above with reference to the accompanying drawings, and thus do not limit the scope of the rights of the embodiments of this application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of this application shall be within the scope of the rights of the embodiments of this application.
Claims
1. A method for controlling the loading of slide thumbnails, characterized in that, The method includes the following steps: Obtain an image loading list corresponding to the slide thumbnails; Obtain the currently displayed thumbnail, and determine the current image position corresponding to the currently displayed thumbnail in the image loading list according to the image loading list; Determine multiple target slide thumbnails from the image loading list according to the current image position and a preset image rendering mechanism, and load and render the multiple target slide thumbnails.
2. The slide thumbnail loading control method according to claim 1, characterized in that, The obtaining of the image loading list corresponding to the slide thumbnails specifically includes: Obtain the image loading list; Determine the number of pre-loaded thumbnails, multiple pre-loaded slide thumbnails, and the image list positions corresponding to the pre-loaded slide thumbnails in the image loading list according to the image loading list.
3. The slide thumbnail loading control method according to claim 2, wherein The obtaining of the currently displayed thumbnail and determining the current image position corresponding to the currently displayed thumbnail in the image loading list according to the image loading list specifically includes: In response to a thumbnail selection operation, determine the currently displayed thumbnail from the multiple pre-loaded slide thumbnails, where the thumbnail selection operation is an operation in which the user selects a thumbnail using the slide control focus; Obtain the image list position corresponding to the currently displayed thumbnail in the image loading list as the current image position.
4. The slide thumbnail loading control method according to claim 3, wherein The method further includes: In response to the user's thumbnail switching operation, determine the first image position corresponding to the currently switched thumbnail and the thumbnail stay time, and determine whether to obtain the currently switched thumbnail as the currently displayed thumbnail according to a preset rendering judgment mechanism.
5. The slide thumbnail loading control method according to claim 2, wherein The determining of multiple target slide thumbnails from the image loading list according to the current image position and a preset image rendering mechanism, and loading and rendering the multiple target slide thumbnails specifically includes: Obtain the maximum number of currently rendered thumbnails; Determine the image loading position range according to the current image position and the maximum number of currently rendered thumbnails; Determine multiple target slide thumbnails from the image loading list according to the image loading position range, where the image list positions corresponding to the target slide thumbnails are within the image loading position range.
6. The slide thumbnail loading control method according to claim 4, wherein The response to the user's thumbnail switching operation, determining the first image position corresponding to the currently switched thumbnail and the thumbnail stay time, and determining whether to obtain the currently switched thumbnail as the currently displayed thumbnail according to a preset rendering judgment mechanism specifically includes: In response to the thumbnail switching operation, determine the currently switched thumbnail and dynamically calculate the thumbnail stay time, where the currently switched thumbnail is the thumbnail selected after switching the currently displayed thumbnail using the slide control focus, and the thumbnail stay time is the time elapsed after selecting the currently switched thumbnail using the slide control focus; Determine the first image position according to the image loading list, where the first image position is the image position of the currently switched thumbnail in the image loading list; Determine an image position difference based on the first image position and the current image position; Determine whether to obtain the current switched thumbnail as the current displayed thumbnail according to the thumbnail stay time and the image position difference.
7. The method for controlling the loading of slide thumbnails according to claim 6, wherein The step of determining whether to obtain the current switched thumbnail as the current displayed thumbnail according to the thumbnail stay time and the image position difference specifically includes: Obtain a preset rendering judgment threshold and a rendering judgment time; Determine a first judgment result according to the image position difference and the rendering judgment threshold; Determine a second judgment result according to the thumbnail stay time and the rendering judgment time; When the first judgment result is that the image position difference is greater than the rendering judgment threshold, or the second judgment result is that the thumbnail stay time is greater than the rendering judgment time, determine to obtain the current switched thumbnail as the current displayed thumbnail; otherwise, determine not to obtain the current switched thumbnail as the current displayed thumbnail.
8. The slide thumbnail loading control method according to claim 5, wherein The step of determining an image loading position range according to the current image position and the maximum number of current thumbnail renderings specifically includes: Determine a minimum image loading position and a maximum image loading position according to the current image position and the maximum number of current thumbnail renderings; Determine the image loading position range according to the minimum image loading position and the maximum image loading position.
9. A slide thumbnail loading control device, characterized in that, The apparatus includes: A first module, configured to obtain an image loading list corresponding to a slide thumbnail; A second module, configured to obtain a current displayed thumbnail, and determine a current image position corresponding to the current displayed thumbnail in the image loading list according to the image loading list; A third module, configured to determine a plurality of target slide thumbnails from the image loading list according to the current image position and a preset image rendering mechanism, and load and render the plurality of target slide thumbnails.
10. An electronic device, characterized in that, Comprising at least one control processor and a memory communicatively connected to the at least one control processor; the memory stores instructions executable by the at least one control processor, and when the instructions are executed by the at least one control processor, the at least one control processor is enabled to execute the slide thumbnail loading control method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to execute the slide thumbnail loading control method according to any one of claims 1 to 8.