Image loading method and apparatus, and terminal device

By acquiring and sorting the image list, selecting images with high priority based on network bandwidth and capacity information for loading, the lack of image preloading logic in the existing technology in loading speed and resource utilization is solved, and the user experience and resource utilization efficiency is improved .

WO2024240182A1PCT designated stage expired Publication Date: 2024-11-28BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
PCT/CN2024/094686
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-22
Filing Date
2024-05-22
Publication Date
2024-11-28

AI Technical Summary

Technical Problem

The existing image preload logic has insufficient loading speed and network resource utilization, especially under different network environments and user interaction, which cannot effectively distinguish the importance of images, resulting in reduced user experience and waste of resources.

Method used

By obtaining the network bandwidth of the current round and the priority of the image to be loaded, sorting the image list, and selecting images with high priority as the target image for loading based on the network bandwidth and capacity information, ensuring that the priority of the target image is higher than other images. And select the optimal number of solutions within the network bandwidth range to improve loading efficiency.

Benefits of technology

It improves the user's experience of accessing image lists, reduces the time-consuming display of important images, and reduces the waste of network traffic, achieving more efficient image loading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024094686_28112024_PF_FP_ABST
    Figure CN2024094686_28112024_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image loading method and apparatus, and a terminal device. The method comprises: acquiring a network bandwidth of a current round, and acquiring the priority of each image in an image list to be loaded; according to the priority of each image, sorting images in said image list to acquire a sorting list; and according to capacity information of each pre-acquired image and the network bandwidth, selecting at least one image from the sorting list as a target image, and loading the target image.
Need to check novelty before this filing date? Find Prior Art

Description

Image loading method, device and terminal equipment

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on and claims priority to the Chinese patent application with application number 202310582822.4 and application date May 22, 2023. The disclosed content of the Chinese patent application is hereby introduced as a whole into this application. Technical Field

[0003] The present disclosure relates to the field of computer technology, and in particular to an image loading method, apparatus, and terminal device. Background Art

[0004] Loading images in applications is a common business scenario. Preloading logic is often implemented to ensure that users can quickly view images. However, in scenarios such as configuring an image list within an application and displaying images from that list, preloading some images is often necessary.

[0005] Summary of the Invention

[0006] The present disclosure provides an image loading method, apparatus, and terminal device to solve some or all of the technical problems in the prior art.

[0007] In a first aspect, the present disclosure provides an image loading method, comprising:

[0008] Get the network bandwidth for the current round and the priority of each image in the list of images to be loaded. The priority is determined based on the image loading properties and the user's current interaction with the list of images to be loaded. The current round is the round corresponding to the current moment in the cyclic loading process.

[0009] Sort the images in the image list to be loaded according to the priority of each image, and obtain the sorted list;

[0010] According to the pre-acquired capacity information of each image and the network bandwidth, at least one image is selected from the sorted list as a target image and loaded, wherein the priority of each target image is greater than the priority of other images in the list of images to be loaded except the target image.

[0011] The method provided by the disclosed embodiment obtains the current round's network bandwidth and the priority of each image in the list of images to be loaded. First, the images in the list of images to be loaded are sorted according to their priority. Then, based on the network bandwidth and image capacity information, the image with the highest priority is selected from the sorted list as the target image. The selected target image must also meet the following constraints: the priority of the target image must be higher than that of all other images in the list of images to be loaded, except the target image.

[0012] In a second aspect, the present disclosure provides an image loading device, the device comprising:

[0013] An acquisition module is used to obtain the network bandwidth of the current round and the priority of each image in the list of images to be loaded, wherein the priority is determined based on the image loading properties and the user's current interaction with the list of images to be loaded. The current round is the round corresponding to the current moment in the cyclic loading process of images;

[0014] A sorting module is used to sort the images in the image list to be loaded according to the priority of each image and obtain a sorted list;

[0015] The selection module is used to select at least one image from the sorted list as a target image and load it based on the pre-acquired capacity information of each image and the network bandwidth, wherein the priority of each target image is greater than the priority of other images in the list of images to be loaded except the target image.

[0016] The image loading device provided by the disclosed embodiment obtains the current network bandwidth and the priority of each image in the list of images to be loaded. First, the images in the list of images to be loaded are sorted according to their priority. Then, based on the network bandwidth and image capacity information, the image with the highest priority is selected from the sorted list as the target image. The selected target image must also meet the following constraints: the priority of the target image is higher than that of all other images in the list of images to be loaded, except the target image.

[0017] In a third aspect, a terminal device is provided, including a processor and a memory, wherein:

[0018] Memory for storing computer programs;

[0019] The processor is used to implement the image loading method of any embodiment of the first aspect when executing the program stored in the memory.

[0020] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a terminal device, the image loading method of any embodiment of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] FIG1 is a flow chart of an image loading method provided by an embodiment of the present disclosure;

[0022] FIG2 is a schematic diagram of a tile list generated by tiling a “history” target image according to loading start time provided by the present disclosure;

[0023] FIG3 is a flow chart of another image loading method provided by an embodiment of the present disclosure;

[0024] FIG4 is a flow chart of another image loading method provided by an embodiment of the present disclosure;

[0025] FIG5 is a flowchart of an image loading method provided by the present disclosure;

[0026] FIG6 is a schematic structural diagram of an image loading device provided by an embodiment of the present disclosure;

[0027] FIG7 is a schematic structural diagram of a terminal device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0029] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0030] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0031] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0032] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0033] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.

[0034] To facilitate understanding of the embodiments of the present disclosure, further explanation will be given below with reference to specific embodiments in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present disclosure.

[0035] Current image preloading logic often has some drawbacks. For example, preloading may affect the loading of the image currently to be displayed. Alternatively, batch loading according to a preset number may also affect the loading speed in some cases and even cause a waste of network resources.

[0036] In related technologies, there are some solutions for image preloading, including the following:

[0037] The first one is to load images based on the preloading of the list view binding;

[0038] The implementation process can be summarized as follows: when there are n1 list items left at the bottom of the list, n2 images in the next list are preloaded in advance.

[0039] The second is a preloading solution based on interface data callback;

[0040] The implementation process can be summarized as follows: when the list interface is called back, preload n images in advance.

[0041] The third method is to preload based on the list sliding position;

[0042] The implementation process can be summarized as follows: when the list slides to a certain position, preload the images before and after the current position.

[0043] All three of the above solutions preload a preset number of images indiscriminately. If a large number of images are preloaded, this can affect the loading of the image currently at the current location, reducing the user experience. Furthermore, in some solutions, multiple images may need to be loaded from a single list. However, none of these solutions consider the varying importance of different images to users. Indiscriminate preloading can actually slow down the loading of images that are most important to the user.

[0044] For example, when browsing images, users preview them by scrolling through a list. If they scroll quickly, many images may not be of interest to them. Conversely, the images they want to view appear only after they stop scrolling. However, the above solution loads all images indiscriminately, regardless of whether they are of interest to the user. This not only slows down the loading of images that are important to the user, but also wastes network resources.

[0045] Furthermore, loading a fixed number of images isn't the optimal solution for each user's varying network conditions. For example, a faster connection might allow for more images to be loaded, while a slower connection might require loading fewer images at a time. Indiscriminately loading a fixed number of images can also lead to a poor user experience depending on the network environment.

[0046] In response to the above technical problems, embodiments of the present disclosure provide an image loading method, apparatus, and terminal device.

[0047] For details, please refer to FIG1 provided in the embodiment of the present disclosure, which is a flow chart of an image loading method provided in the embodiment of the present disclosure. The method includes:

[0048] Operation S110 : obtaining the network bandwidth of the current round, and obtaining the priority of each image in the list of images to be loaded.

[0049] In some embodiments, an image's priority indicates its importance to the user. Priority is determined based on the image's loading attributes and the user's current interaction with the list of loaded images. An image with a higher importance should be displayed first, thus receiving a higher priority.

[0050] The current round is the round corresponding to the current moment in the cyclic loading process of the image. In some embodiments, there are two cases for obtaining the network bandwidth of the current round.

[0051] One of them is that, when the current round is the first round, it can be determined that the target image has not been loaded before the current round, and the estimated network bandwidth can be used as the network bandwidth of the current round.

[0052] Another method is that when the current round is not the first round, after the previous round has loaded a preset number of target images, the total loading time of the preset number of target images can be obtained, and then the network bandwidth of the current round can be determined based on the total capacity information of the preset number of target images and the total loading time.

[0053] In some embodiments, the "sliding window, moving average" algorithm can be used for estimation. First, the loading start time and total capacity information of the target images loaded in the previous round are counted. Then all statistical records are flattened into a list according to the loading start time. It should be noted that, assuming that there is at least one round of target image loading records before the current round, the flattened list includes all "historical" target images loaded from the first round to the previous round. Moreover, all "historical" target images will be flattened into a list according to the loading start time, and the target images loaded subsequently will also be further updated on this flattened list. Please refer to Figure 2 for details. Figure 2 shows a list of multiple "historical" target images sorted by loading start time. In addition to the loading start time (for example, T0, T1...T n-x+1 ...T n-1 and T n ) also includes image capacity information (such as S0, S1...S n-x+1 ……S n-1 and S n ). In addition, a sliding window is also shown in Figure 2. The data in the sliding window represents the loading start time and capacity information corresponding to the "historical" target image of the previous round.

[0054] Then, based on the total capacity information and total loading time of the target image, when determining the network bandwidth of the current round, it is only necessary to calculate based on the data in the sliding window.

[0055] In some embodiments, it can be calculated according to the following formula:

[0056] Where C is the network bandwidth of the current round, n-x+1 represents the first target image in the target images loaded in the previous round, and n represents the last target image loaded in the previous round. T represents the current time, S i Indicates the capacity information of the i-th image, T n-x+1 Indicates the loading start time of the first target image in the target images loaded in the previous round.

[0057] In operation S120 , the images in the list of images to be loaded are sorted according to the priority of each image to obtain a sorted list.

[0058] In some embodiments, the sorting order can be based on the priority level, from high to low, or from low to high. The specific sorting order is not limited. The sorting list referred to here is a priority sorting list.

[0059] In operation S130 , at least one image is selected from the sorted list as a target image and loaded according to the pre-acquired capacity information of each image and the network bandwidth.

[0060] In some embodiments, when selecting images, the following constraint condition needs to be met, that is, the priority of each target image is greater than the priority of other images in the list of images to be loaded except the target image.

[0061] In other words, images with higher priority are selected from the priority sorting list as target images. This further verifies what was introduced above: images with higher importance to the user are selected for priority loading according to their importance.

[0062] Furthermore, considering different network environments and the different network bandwidths at the current moment, it is necessary to determine the optimal number of target images based on the network bandwidth and the capacity information of each image.

[0063] In some embodiments, based on the pre-acquired capacity information of each image and the network bandwidth, a method process for selecting at least one image from the sorted list as a target image and loading the image may include the following:

[0064] Select n images from the sorted list as target images and load them, where the total capacity of the n images is less than or equal to the network bandwidth, and the sum of the total capacity of the n images and the capacity of the n+1th image is greater than the network bandwidth. The n+1th image is the image with the highest priority among the images in the sorted list excluding the n images, and n is a positive integer.

[0065] Specifically, the n images selected as target images from the sorted list must not only meet the requirement that their priorities are greater than the priorities of other images in the list of images to be loaded except the target image, but also meet the requirement that the total capacity of the n images is less than or equal to the network bandwidth, and the sum of the total capacity of the n images and the capacity of the (n+1)th image is greater than the network bandwidth, and the (n+1)th image is the image with the highest priority among the images in the sorted list except the n images.

[0066] For details, please refer to the following expression:

[0067] Among them, f is the function for solving the importance of the image, C is the current network bandwidth, t p is the capacity information of the i-th image, which can also be understood as the network throughput occupied by the image, A is the list of images to be loaded, b i is the i-th image in set B, t i is the i-th image in the set R, B and R constitute the set A, B is the target image set to be determined in the present disclosure, and R is the set composed of other images in the image list A to be loaded except the target image.

[0068] The reason for setting the total capacity of n images to be less than or equal to the network bandwidth, and the sum of the capacity of n images plus the capacity of the (n+1)th image to be greater than the network bandwidth, is to ensure that the network bandwidth is fully utilized without causing network lag due to loading n images. This reduces the waste of network resources while maximizing image loading speed. In this case, the number of target images obtained will be the optimal solution.

[0069] In other embodiments, if the capacity information of all images is the same, it will be simpler to select at least one image from the sorted list as the target image and load it based on the pre-acquired capacity information of each image and the network bandwidth. Specifically, as shown in FIG3 , the method process includes the following:

[0070] In operation S310 , the number of images to be loaded is determined according to network bandwidth and capacity information.

[0071] The specific determination method can be found in the following formula:

[0072] N=C / S

[0073] Where N is the number of images loaded, C is the current network bandwidth, and S is the capacity information corresponding to each image.

[0074] In operation S320 , an image corresponding to the number of images to be loaded is selected from the sorted list as a target image and loaded.

[0075] Because the priority of each target image is higher than the priority of other images in the list of images to be loaded, the above definition is not repeated here. The specific selection method has also been described in detail above and will not be repeated here.

[0076] The process of loading images can refer to the more conventional loading technology currently available, and will not be explained in detail here.

[0077] The image loading method provided by the embodiment of the present disclosure obtains the network bandwidth of the current round and the priority of each image in the list of images to be loaded. First, the images in the list of images to be loaded are sorted according to their priority. Then, based on the network bandwidth and the capacity information of the image, the image with a higher priority is selected from the sorted list as the target image. The selected target image also needs to meet the following constraints: the priority of the target image is greater than that of other images in the list of images to be loaded except the target image. In this way, the user experience of accessing the image list can be improved, and the time consumption of displaying important images can be reduced, while also reducing the waste of network traffic.

[0078] In some embodiments, before obtaining the network bandwidth of the current round and obtaining the priority of each image in the list of images to be loaded, the method further includes the following method flow. Specifically, referring to FIG4 , the method flow includes:

[0079] Operation S410: Obtain image information of each image in the list of images to be loaded.

[0080] In operation S420 , the priority of the first image is determined according to the priority influencing factor corresponding to the first image.

[0081] The image information includes a priority influencing factor and image capacity information. The first image is any image in the list of images to be loaded.

[0082] In some embodiments, the priority influencing factors include one or more of the following:

[0083] The view type corresponding to the first image, the loading trigger mechanism, the distance between the image and the center of the current visible area of ​​the terminal device, and the list sliding state corresponding to the list of images to be loaded. In some embodiments, each priority influencing factor corresponds to a different type of priority coefficient.

[0084] The view type corresponds to the image loading priority coefficient. The image loading attributes corresponding to the view type are different from the image type and other attributes of the loading priority. The image loading attributes can also be understood as the business attributes described below.

[0085] The priority coefficient V corresponding to the view type can be defined according to the business attributes. For example, the priority coefficient corresponding to the avatar is 2, and the priority coefficient corresponding to the photo is 1.

[0086] The loading trigger mechanism, the distance between the image and the center of the current visible area of ​​the terminal device, and the list sliding state corresponding to the list of images to be loaded all correspond to the user's current interaction operation on the list of images to be loaded.

[0087] For example, the loading trigger mechanism includes at least one of the following: a view data binding trigger mechanism, and a list loading completion trigger preloading mechanism, etc. The priority coefficient S corresponding to the view data binding trigger mechanism may be, for example, 2, and the priority coefficient S corresponding to the list loading completion trigger preloading mechanism may be 1.

[0088] The distance P between the image at the center of the current visible area of ​​the terminal device is determined by the number of images between the first image and the image at the center of the current visible area. It can also be understood as being determined by the position of the image in the list of images to be loaded. The priority decreases radiating outwards. The priority coefficient P of the image currently being displayed at the center of the screen is 10, and it decreases sequentially according to the list pointer. For example, the priority coefficients P of the two images adjacent to the image at the center of the screen are both 9, and the priority coefficient P of the images adjacent to the left and right that are separated by one image is 8, and so on.

[0089] The sliding state of the list can be divided into but not limited to the following situations:

[0090] a. If the image is still or following a hand, the highest priority coefficient Z can be defined as 10.

[0091] b. If the image sliding speed is less than or equal to the first preset speed threshold v1, it is defined as browsing sliding, and the priority coefficient Z is 5.

[0092] c. The image sliding speed is greater than the first preset speed threshold v1, which is defined as moving sliding, and the priority coefficient Z is 1.

[0093] The hand-following state is a state in which the object maintains triggering the first image for a time period exceeding a preset time threshold, and in the process of triggering the first image, the sliding speed is less than a second preset speed threshold v2, wherein v2 is less than v1.

[0094] The priority of each image can be determined according to the priority coefficients corresponding to the four priority influencing factors.

[0095] The specific priority calculation formula is as follows:

[0096] Priority=V×S×P×Z

[0097] Among them, Priority represents the priority of the image, and V, S, P, and Z respectively represent the priority coefficients corresponding to the four different priority influencing factors introduced above.

[0098] In some embodiments, after each round of target image loading is completed, the method further includes the following method flow:

[0099] When it is determined that the target image has been loaded, a callback message is generated, and the callback message is used to indicate the start of the next round of image loading task.

[0100] In other words, the callback information indicates the start of the next loading task. This continues until all target images that the user is expecting to load are loaded. The specific determination of whether loading is complete can be based on user input, for example, if the user chooses to exit, then loading is stopped. Of course, other instructions can also be used to determine whether loading is complete, and this is not limited here.

[0101] Figure 5 illustrates an example of image loading. For details, please refer to the schematic diagram shown in Figure 5. Figure 5 includes the three image loading scenarios introduced above, such as list sliding, list view binding, and image list data loading completion. Regardless of the application scenario, a preloading task can be constructed according to the embodiments of the present disclosure, and then the image preloading operation can be triggered. Specifically, the preloading management module can generate an image loading instruction, and then the image loading module begins loading. In the first round, the number of images to be loaded is determined based on the estimated network bandwidth. Then, the target image is determined using the image loading method introduced above and loaded. The time consumption information for loading the target image is calculated and input into the testing module. The testing module calculates the current network bandwidth based on the time consumption information of the target image and the capacity information of the images already loaded. The current network bandwidth is then input into the preloading management module to calculate the number of images to be loaded in the next round. In addition, after the image loading is completed, a callback information needs to be generated to indicate the start of the next round of image loading tasks.

[0102] The specific implementation process has been introduced in detail in the previous article, so I will not explain it in detail here.

[0103] The above is an embodiment of the method corresponding to image loading provided by the present disclosure. The following describes other embodiments corresponding to image loading provided by the present disclosure. Please refer to the following for details.

[0104] FIG6 is a schematic structural diagram of an image loading device provided by an embodiment of the present disclosure. The device includes: an acquisition module 601 , a sorting module 602 , a selection module 603 , and a loading module 604 .

[0105] Acquisition module 601 is used to obtain the network bandwidth of the current round and obtain the priority of each image in the list of images to be loaded, wherein the priority is determined based on the image loading properties and the user's current interaction with the list of images to be loaded. The current round is the round corresponding to the current moment in the cyclic loading process of images;

[0106] A sorting module 602 is used to sort the images in the image list to be loaded according to the priority of each image, and obtain a sorted list;

[0107] A selection module 603 is configured to select at least one image from the sorted list as a target image based on the pre-acquired capacity information of each image and the network bandwidth, wherein the priority of each target image is greater than the priority of other images in the list of images to be loaded except the target image;

[0108] The loading module 604 is used to load the target image.

[0109] In some embodiments, the acquisition module 601 is further configured to acquire image information of each image in the list of images to be loaded, wherein the image information includes a priority influencing factor and image capacity information;

[0110] The priority of the first image is determined according to a priority influencing factor corresponding to the first image, wherein the first image is any image in the list of images to be loaded.

[0111] In some embodiments, the priority influencing factors include one or more of the following:

[0112] The view type corresponding to the first image, the loading trigger mechanism, the distance between the image and the center of the current visible area of ​​the terminal device, and the list sliding state corresponding to the list of images to be loaded.

[0113] In some embodiments, the view type corresponds to an image loading priority factor.

[0114] In some embodiments, the loading trigger mechanism includes at least one of the following:

[0115] View data binding triggers the loading mechanism, and list loading completion triggers the preloading mechanism.

[0116] In some embodiments, the distance between the first image and the image at the center of the current visible area of ​​the terminal device is determined by the number of images between the first image and the image at the center of the current visible area.

[0117] In some embodiments, the list sliding state corresponding to the list of images to be loaded includes at least one of the following:

[0118] A stationary state, a following hand state, a state in which the sliding speed is less than or equal to a first preset speed threshold, and a state in which the sliding speed is greater than the first preset speed threshold. The following hand state is a state in which the object maintains the time for triggering the first image exceeding the preset time threshold, and in the process of triggering the first image, the sliding speed is less than a second preset speed threshold, wherein the second preset speed threshold is less than the first preset speed threshold.

[0119] In some embodiments, the priority is used to indicate the importance of the image, and the importance is determined based on the image loading attributes and the user's current interaction operation on the list of images to be loaded.

[0120] In some embodiments, the acquisition module 601 is specifically configured to acquire a pre-estimated network bandwidth as the network bandwidth of the current round in response to the target image not being loaded before the current round; or

[0121] Get the network bandwidth of the current round, including:

[0122] In response to a preset number of target images having been loaded in a round before the current round, obtaining a total loading time of the preset number of target images;

[0123] The network bandwidth of the current round is determined based on the total capacity information and total loading time of a preset number of target images.

[0124] In some embodiments, the selection module 603 is specifically used to select n images from the sorted list as target images and load them, wherein the total capacity of the n images is less than or equal to the network bandwidth, and the sum of the total capacity of the n images and the capacity of the n+1th image is greater than the network bandwidth, the n+1th image is the image with the highest priority among the images in the sorted list except the n images, and n is a positive integer.

[0125] In some embodiments, when the capacity information of all images is the same, the acquisition module 601 is specifically configured to determine the number of images to be loaded based on the network bandwidth and capacity information;

[0126] From the sorted list, select the image corresponding to the number of loaded images as the target image;

[0127] The loading module 604 is specifically configured to load target images corresponding to the image loading quantity.

[0128] In some embodiments, the apparatus further includes: a generating module 605, configured to generate callback information when it is determined that the target image has been loaded, the callback information being used to indicate the start of the next round of image loading tasks.

[0129] The functions performed by the various components in the image loading device provided by the embodiments of the present disclosure have been described in detail in the above embodiments, and therefore will not be repeated here.

[0130] An image loading device provided by an embodiment of the present disclosure obtains the network bandwidth of the current round and the priority of each image in the list of images to be loaded. First, the images in the list of images to be loaded are sorted according to their priority. Then, based on the network bandwidth and the capacity information of the image, an image with a higher priority is selected from the sorted list as the target image. The selected target image also needs to meet the following constraints: the priority of the target image is greater than that of other images in the list of images to be loaded except the target image. In this way, the user experience of accessing the image list can be improved, and the time consumption of displaying important images can be reduced, while also reducing the waste of network traffic.

[0131] It is worth noting that in the above-mentioned embodiments of the image loading device, the modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as they can realize the corresponding functions; in addition, the specific names of the functional modules are only for the convenience of distinguishing each other and are not intended to limit the scope of protection of this disclosure. The image loading device can be implemented using software and / or hardware. Specifically, the modules of the image loading device can be implemented as software components executed on one or more general-purpose processors, or as hardware for performing certain functions, such as programmable logic devices and / or application-specific integrated circuits. In some embodiments, these modules can be embodied in the form of a software product, which can be stored in a non-volatile storage medium. These non-volatile storage media include computer devices (such as personal computers, servers, network devices, mobile terminals, etc.) to execute the methods described in the embodiments of this disclosure. In some embodiments, the above-mentioned modules can also be implemented on a single device or distributed across multiple devices. The functions of these modules can be combined with each other or further divided into multiple sub-modules.

[0132] As shown in FIG. 7 , an embodiment of the present disclosure provides a terminal device including a processor 111 and a memory 112 .

[0133] Memory 112, for storing computer programs;

[0134] In some embodiments of the present disclosure, the processor 111 is configured to implement the image loading method provided by any one of the aforementioned method embodiments when executing a program stored in the memory 112. The method includes:

[0135] Get the network bandwidth for the current round and the priority of each image in the list of images to be loaded. The priority is determined based on the image loading properties and the user's current interaction with the list of images to be loaded. The current round is the round corresponding to the current moment in the cyclic loading process.

[0136] Sort the images in the image list to be loaded according to the priority of each image, and obtain the sorted list;

[0137] According to the pre-acquired capacity information of each image and the network bandwidth, at least one image is selected from the sorted list as a target image and loaded, wherein the priority of each target image is greater than the priority of other images in the list of images to be loaded except the target image.

[0138] In some embodiments, before obtaining the network bandwidth of the current round and the priority of each image in the list of images to be loaded, the method further includes:

[0139] Obtaining image information of each image in the list of images to be loaded, wherein the image information includes a priority influencing factor and image capacity information;

[0140] The priority of the first image is determined according to a priority influencing factor corresponding to the first image, wherein the first image is any image in the list of images to be loaded.

[0141] In some embodiments, the priority influencing factors include one or more of the following:

[0142] The view type corresponding to the first image, the loading trigger mechanism, the distance between the image and the center of the current visible area of ​​the terminal device, and the list sliding state corresponding to the list of images to be loaded.

[0143] In some embodiments, the view type corresponds to an image loading priority factor.

[0144] In some embodiments, the loading trigger mechanism includes at least one of the following:

[0145] View data binding triggers the loading mechanism, and list loading completion triggers the preloading mechanism.

[0146] In some embodiments, the distance between the first image and the image at the center of the current visible area of ​​the terminal device is determined by the number of images between the first image and the image at the center of the current visible area.

[0147] In some embodiments, the list sliding state corresponding to the list of images to be loaded includes at least one of the following:

[0148] A stationary state, a following hand state, a state in which the sliding speed is less than or equal to a first preset speed threshold, and a state in which the sliding speed is greater than the first preset speed threshold. The following hand state is a state in which the object maintains the time for triggering the first image exceeding the preset time threshold, and in the process of triggering the first image, the sliding speed is less than a second preset speed threshold, wherein the second preset speed threshold is less than the first preset speed threshold.

[0149] In some embodiments, the priority is used to indicate the importance of the image, and the importance is determined based on the image loading attributes and the user's current interaction operation on the list of images to be loaded.

[0150] In some embodiments, obtaining the network bandwidth of the current round includes:

[0151] In response to the target image not being loaded before the current round, a pre-estimated network bandwidth is obtained as the network bandwidth of the current round.

[0152] In some embodiments, obtaining the network bandwidth of the current round includes:

[0153] In response to a preset number of target images having been loaded in a round before the current round, obtaining a total loading time of the preset number of target images; and

[0154] The network bandwidth of the current round is determined based on the total capacity information and total loading time of a preset number of target images.

[0155] In some embodiments, based on the pre-acquired capacity information of each image and the network bandwidth, selecting at least one image from the sorted list as the target image and loading the image includes:

[0156] Select n images from the sorted list as target images and load them, where the total capacity of the n images is less than or equal to the network bandwidth, and the sum of the total capacity of the n images and the capacity of the n+1th image is greater than the network bandwidth. The n+1th image is the image with the highest priority among the images in the sorted list excluding the n images, and n is a positive integer.

[0157] In some embodiments, when the capacity information of all images is the same, at least one image is selected from the sorted list as the target image and loaded based on the pre-acquired capacity information of each image and the network bandwidth, including:

[0158] Determine the number of images to be loaded based on network bandwidth and capacity information;

[0159] From the sorted list, select the image corresponding to the number of images to be loaded as the target image and load it.

[0160] In some embodiments, the method further comprises:

[0161] When it is determined that the target image has been loaded, a callback message is generated, and the callback message is used to indicate the start of the next round of image loading task.

[0162] The embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a terminal device, the steps of the image loading method provided in the aforementioned method embodiment are implemented.

[0163] The embodiment of the present disclosure further provides a computer program, which, when executed by a processor, implements the steps of the image loading method provided in the aforementioned method embodiment.

[0164] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.

[0165] The foregoing are merely specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not to be limited to the embodiments shown herein, but is to be construed in the broadest manner consistent with the principles and novel features claimed herein.

Claims

1. A method for loading an image, include: Obtaining the network bandwidth of the current round, and obtaining the priority of each image in the list of images to be loaded, wherein the priority is determined based on the image loading attribute and the user's current interactive operation on the list of images to be loaded, and the current round is the round corresponding to the current moment in the process of cyclically loading images; Sort the images in the list of images to be loaded according to the priority of each image to obtain a sorted list; and According to the pre-acquired capacity information of each image and the network bandwidth, at least one image is selected from the sorted list as a target image and loaded, wherein the priority of each of the target images is greater than the priority of other images in the list of images to be loaded except the target image.

2. The method according to claim 1, in, Before obtaining the network bandwidth of the current round and obtaining the priority of each image in the list of images to be loaded, the method further includes: Acquire image information of each image in the list of images to be loaded, wherein the image information includes a priority influencing factor and image capacity information; and The priority of the first image is determined according to the priority influencing factor corresponding to the first image, wherein the first image is any image in the list of images to be loaded.

3. The method according to claim 2, in, The priority influencing factors include one or more of the following: The view type corresponding to the first image, the loading trigger mechanism, the distance between the image and the center of the current visible area of ​​the terminal device, and the list sliding state corresponding to the list of images to be loaded.

4. The method according to claim 3, in, The view type corresponds to an image loading priority coefficient.

5. The method according to claim 3, wherein the loading trigger mechanism comprises at least one of the following: View data binding triggers the loading mechanism, and list loading completion triggers the preloading mechanism.

6. The method according to claim 3, in, The distance between the first image and the image at the center of the current visible area of ​​the terminal device is determined by the number of images spaced between the first image and the image at the center of the current visible area.

7. The method according to claim 3, in, The list sliding state corresponding to the list of images to be loaded includes at least one of the following: The following state is a state in which the sliding speed is less than or equal to a first preset speed threshold, and a state in which the sliding speed is greater than the first preset speed threshold. The following state is a state in which the object maintains the triggering of the first image for a time exceeding a preset time threshold, and in the process of triggering the first image, the sliding speed is less than a second preset speed threshold. The state of the speed threshold, wherein the second preset speed threshold is less than the first preset speed threshold.

8. The method according to any one of claims 1 to 7, in, The obtaining of the network bandwidth of the current round includes: In response to the target image not being loaded before the current round, a pre-estimated network bandwidth is obtained as the network bandwidth of the current round.

9. The method according to any one of claims 1 to 7, in, The obtaining of the network bandwidth of the current round includes: In response to a preset number of target images having been loaded in a previous round of the current round, obtaining a total loading time of the preset number of target images; and The network bandwidth of the current round is determined according to the total capacity information of the preset number of target images and the total loading time.

10. The method according to any one of claims 1 to 7, in, The step of selecting at least one image from the sorted list as a target image and loading the image according to the pre-acquired capacity information of each image and the network bandwidth includes: Select n images from the sorted list as the target images and load them, wherein the total capacity of the n images is less than or equal to the network bandwidth, and the sum of the total capacity of the n images and the capacity of the n+1th image is greater than the network bandwidth, the n+1th image is the image with the highest priority among the images in the sorted list except the n images, and n is a positive integer.

11. The method according to any one of claims 1 to 7, in, The step of selecting at least one image from the sorted list as a target image and loading the image according to the pre-acquired capacity information of each image and the network bandwidth includes: In response to the capacity information of each image being the same, determining the number of images to be loaded according to the network bandwidth and the capacity information; and From the sorted list, images corresponding to the number of images to be loaded are selected as the target images and loaded.

12. The method according to any one of claims 1 to 7, further comprising: include: When it is determined that the target image has been loaded, callback information is generated, and the callback information is used to indicate the start of the next round of image loading task.

13. An image loading device, include: The acquisition module is used to obtain the priority of each image in the list of images to be loaded, and to obtain the network bandwidth of the current round, wherein the priority is based on the image loading attribute and the user's current preference for the image to be loaded. The interactive operation of the list is determined, and the current round is the round corresponding to the current moment in the process of cyclically loading images; A sorting module, used to sort the images in the list of images to be loaded according to the priority of each image, and obtain a sorted list; and A selection module is used to select at least one image from the sorted list as a target image and load it according to the pre-acquired capacity information of each image and the network bandwidth, wherein the priority of each of the target images is greater than the priority of other images in the list of images to be loaded except the target image.

14. A terminal device comprising a processor and a memory, in, Memory, used to store computer programs; The processor is used to implement the image loading method according to any one of claims 1 to 12 when executing the program stored in the memory.

15. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a terminal device, implements the image loading method according to any one of claims 1 to 12.

16. A computer program, which, when executed by a processor, implements the image loading method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Network file requesting and processing methods, television terminal, file server and network file requesting system

    CN107734045A

  • Method and apparatus for caching videos, and computer readable storage medium

    CN109640161A

  • Media content loading method and device, equipment and medium

    CN112135169A

  • Picture loading method and device, and readable storage medium

    CN112272226A

  • Interface loading method and device and storage medium

    CN113535307A

Cited By

  • WPF picture list adaptive preloading method and device, equipment and medium

    CN122691710A