Picture data loading method and device, equipment and storage medium

By dynamically adjusting the sorting based on the interactive information and storage structure of the image data, preloading is achieved, solving the problem of slow loading when browsing a large number of pictures in the Android system, and improving device performance and user experience.

CN120470140APending Publication Date: 2025-08-12SHENZHEN ZHIXIAN VISION SOFTWARE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510605176.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

When browsing large amounts of images in Android, slow loading leads to excessive consumption of device resources.

Method used

Data weights are allocated according to the interactive information of the picture data, the first sort is determined, and the target sort is dynamically adjusted based on the storage structure, and the loading order of the picture data is optimized by preloading.

Benefits of technology

It improves the hit rate of data loading, reduces the consumption of device resources, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120470140A_ABST
    Figure CN120470140A_ABST
Patent Text Reader

Abstract

The invention discloses a picture data loading method and device, equipment and a storage medium, and the method comprises the steps: distributing a data weight according to the interaction information of each piece of picture data, and determining a first order of each piece of picture data; dynamically adjusting the first sequence based on the storage structure of each piece of picture data to obtain a target sequence of each piece of picture data; and preloading the picture data according to the target sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, apparatus, device and storage medium for loading image data. Background Art

[0002] On Android, users often store large numbers of images on USB flash drives. However, when users try to browse these images on their devices, they may experience slow loading times, especially when the number of images is large. This delay not only affects the user experience but can also lead to excessive consumption of device resources. Summary of the Invention

[0003] The main purpose of this application is to provide a method, device, equipment and storage medium for loading image data, aiming to solve the technical problem in the prior art of slow loading when browsing a large number of images, resulting in excessive consumption of device resources.

[0004] To achieve the above objectives, this application proposes a method for loading image data, including:

[0005] Allocating data weights according to the interactive information of each image data, and determining a first ranking of each image data;

[0006] Dynamically adjusting the first sorting based on the storage structure of each of the image data to obtain a target sorting of each of the image data;

[0007] The image data are preloaded according to the target sorting.

[0008] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for loading image data, which includes:

[0009] A weight sorting module, configured to assign a data weight according to the interactive information of each image data, and determine a first sorting of each image data;

[0010] a sorting adjustment module, configured to dynamically adjust the first sorting based on the storage structure of each of the image data to obtain a target sorting of each of the image data;

[0011] A data loading module is used to preload each of the picture data according to the target sorting.

[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a picture data loading device, which includes: a memory, a processor, and a computer program stored in the memory and runnable on the processor, and the computer program is configured to implement the steps of the picture data loading method as described above.

[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the image data loading method as described above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0016] Figure 1 A flowchart of the first embodiment of the method for loading image data of this application is provided;

[0017] Figure 2 A flowchart of the second embodiment of the method for loading image data of this application is provided;

[0018] Figure 3 A flowchart of access frequency analysis provided in Example 2 of the image data loading method of this application;

[0019] Figure 4 A flowchart of the third embodiment of the method for loading image data of this application is provided;

[0020] Figure 5 A flowchart of image loading provided in Example 3 of the image data loading method of this application;

[0021] Figure 6 This is a schematic diagram of the module structure of the image data loading device according to an embodiment of the present application;

[0022] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the image data loading method in the embodiment of the present application.

[0023] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0024] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0025] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0026] The main solution of the embodiment of the present application is: assigning data weights according to the interactive information of each image data to determine the first ranking of each image data; dynamically adjusting the first ranking based on the storage structure of each image data to obtain the target ranking of each image data; and preloading each image data according to the target ranking.

[0027] In the prior art, when a user attempts to browse a large number of stored images on a device, they may encounter a slow loading problem. This delay not only affects the user experience but may also lead to excessive consumption of device resources.

[0028] The present application provides a solution that can assign data weights based on the interactive information of each image data to determine the first ranking of each image data; dynamically adjust the first ranking based on the storage structure of each image data to obtain the target ranking of each image data; and preload each image data according to the target ranking. The loading order of cached images is constructed by allocating data weights and updating them in real time, and cache replacement is performed according to the storage structure. The preloading order of image data is constructed, and preloading is performed according to the order to improve the hit rate of data loading. This solves the technical problem in the prior art of slow loading when browsing a large number of images, which leads to excessive consumption of device resources.

[0029] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device capable of implementing the above functions, an image data loading device, etc. The following uses an image data loading device as an example (hereinafter referred to as the device) to illustrate this embodiment and the following embodiments.

[0030] Based on this, the embodiment of the present application provides a method for loading image data, referring to Figure 1 , Figure 1 A flowchart illustrating the first embodiment of the image data loading method of the present application.

[0031] In this embodiment, the image data loading method includes steps S10 to S30:

[0032] Step S10: allocating data weights according to the interactive information of each image data, and determining the first ranking of each image data.

[0033] It should be noted that the image data can be data in an image format stored in a hardware device (such as a USB flash drive or live storage). The image data loading method proposed in the present invention can also be applied to cloud storage and content delivery networks (CDN) to optimize data distribution and storage efficiency, reduce latency and bandwidth consumption. Or it can be applied to optimize query performance in a database system, and improve database response speed by caching commonly used query results and data. Or it can be applied to Internet of Things (IoT) devices: in resource-constrained IoT devices, it can help manage limited storage and computing resources and improve data processing efficiency. Or it can be applied to video streaming services to optimize video loading and playback experience and reduce buffering time.

[0034] It should be understood that the interactive information of image data can be information generated when a user interacts with an image, such as access frequency information (for example, the number of times an image has been accessed), business logic information (for example, in an album application, the images that a user has recently viewed or edited), user behavior information (for example, information recording user editing, sharing, and other behaviors), and context-aware information (for example, the geographic location, time, and device status of the image taken). Data weight can be a parameter for evaluating the importance of each image data, and is used to define the importance of different image data. The first ranking can be obtained by sorting the image data according to the data weight.

[0035] Step S20: dynamically adjusting the first sorting based on the storage structure of each picture data to obtain a target sorting of each picture data.

[0036] It should be noted that the image data storage structure can be the format in which the image is stored as a file on disk or flash memory, and can include a compressed and encoded structure including a file header, pixel data, and a file footer. The stored usage data items and key data can be updated based on real-time usage, ensuring fast access to key data and supporting short-term access patterns.

[0037] It should be understood that the target order can be an image loading order that meets user needs. The first order is adjusted and updated according to the importance of the real-time updated image data and the short-term usage status to obtain the target order of the image data.

[0038] Step S30: Preload each image data according to the target sorting.

[0039] It's important to note that in Android or front-end applications, the main thread (UI thread) handles user interactions and interface rendering. Image data preloading can be performed in a background thread. If time-consuming operations (such as loading large images or making network requests) are performed directly in the main thread, it can cause interface lag or even crashes. Offloading time-consuming tasks to a background thread ensures that the main thread remains responsive to user actions.

[0040] Furthermore, you can set an expiration time (Time-To-Live, TTL) for each image data item. By obtaining the storage time of each image data item in the target sort order, determine whether the storage time has exceeded the expiration time. If so, remove the image data that has exceeded the expiration time and store the remaining image data in the target sort order in the cache for preloading. The expiration time is a TTL timestamp (e.g., 1 hour, 1 day, etc.) attached to each cached image data item when it is stored. It indicates the length of time the data remains valid in the cache, starting from the time it was stored or last updated. This expiration mechanism automatically eliminates infrequently used or expired data, preventing the cache from expanding indefinitely and preventing users from receiving outdated or incorrect information due to long-term cache storage. Regularly check the image data in the cache and remove any that has exceeded the expiration time. You can use a background task, JobScheduler, to periodically refresh the cache. This can be implemented in Android. Monitor changes in the data source (such as database updates or file changes) and update the cached data in real time. Implement real-time updates using the Observer pattern. Ensure that the data in the cache is consistent with the data source. When the data source is updated, update or clear the corresponding data in the cache promptly.

[0041] This embodiment provides a method for loading image data, which discloses allocating data weights based on the interactive information of each image data to determine the first ranking of each image data; dynamically adjusting the first ranking based on the storage structure of each image data to obtain the target ranking of each image data; and preloading each image data according to the target ranking. Since this implementation can construct the loading order of cached images through the allocation and real-time update of data weights, and perform cache replacement according to the storage structure, the preloading order of image data is constructed, and preloading is performed according to the order to improve the hit rate of data loading. This solves the technical problem in the prior art of slow loading when browsing a large number of images, which leads to excessive consumption of device resources.

[0042] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 2 , Figure 2 A flow chart illustrating the second embodiment of the image data loading method of this application.

[0043] In this embodiment, step S10 includes steps S101 to S102:

[0044] Step S201: performing score assignment and weight assignment based on the interaction information of each image data to obtain the interaction score and interaction weight corresponding to each image data.

[0045] Step S202: summing the interaction score and interaction weight corresponding to each image data to obtain a weighted total score corresponding to each image data.

[0046] Step S203: Determine the first ranking of each image data according to the weighted total score from large to small.

[0047] It should be noted that which image data is more important can be determined based on the specific business logic of the application. For example, in a photo album application, pictures that the user has recently viewed or edited are more important. Define the standards and rules of importance in combination with the application scenario. You can also record the user's interaction with pictures, such as viewing, editing, sharing, etc. By analyzing the interaction behavior, the importance of each picture data block is evaluated. For example, pictures that are frequently viewed or edited are more important. Sensors and system APIs (such as GPS, clock, network status) can also be used to collect user contextual information, including geographic location, time, device status, etc. At the same time, weights are assigned to contextual factors and included in the importance score calculation. For example, when a user is traveling, travel-related pictures may be more important, so the weight of geographic location can be increased.

[0048] In specific implementations, using geolocation as an example, weighting can include obtaining the user's location and time information through GPS sensors and system APIs. In the scoring calculation, location and time each account for a 15% weight. The score is dynamically adjusted based on the user's real-time context to ensure accurate importance assessment.

[0049] Furthermore, the scoring and evaluation for each image data may include factors affecting the score: access frequency, last access time, user interaction behavior (such as editing, sharing), file size, creation time, and contextual information (such as geographic location, time, and device status). Each influencing factor is assigned a weight (the weight reflects the degree of influence of the factor on the overall importance, and the sum of all weights is 100%). The total score is then obtained by weighted summation using the scoring formula:

[0050] ws=w1×f1+w2×f2+…+wn×fn

[0051] Where ws is the weighted total score, wi is the weight of the i-th factor, and fi is the value of the i-th factor.

[0052] It should be understood that weights can be adjusted based on actual application scenarios and user feedback. They can also be combined: multiple contextual factors can be used together to provide a more comprehensive assessment. For example, combining location and time can identify specific holiday events during a user's travel. The system can also dynamically adjust these weights based on real-time contextual information to ensure accurate and timely importance assessments.

[0053] In specific implementations, examples of weight assignment include: geographic location weights include travel locations: If the user is currently at a travel destination, travel-related images are more important, and the weight can be set to 0.2. If the user is currently at home or work, daily or work-related images may be more important in these locations, and the weight can be set to 0.1. Time weights include holidays: During holidays, holiday-related images may be more important, and the weight can be set to 0.15. Time weights also include work hours: During work hours, work-related images may be more important, and the weight can be set to 0.1. Device status weights include battery status: When the device battery is low, unnecessary cache updates are reduced to save power, and the weight can be set to 0.05. Network connection type: When connected to Wi-Fi, cache updates and preloading can be more aggressive, and the weight can be set to 0.1. User activity weights include exercise status: If the user is exercising (such as running or cycling), they may pay more attention to exercise-related images, and the weight can be set to 0.1. User activity weights also include stationary status: When the user is stationary, they may pay more attention to leisure or reading-related images, and the weight can be set to 0.05. The weight of social interaction includes recent sharing: if the user has shared certain pictures recently, these pictures may be more important, and the weight can be set to 0.15. The weight of social interaction also includes comments and likes: user interactions with pictures (such as comments and likes) can increase the importance of pictures, and the weight can be set to 0.1.

[0054] It should be understood that, based on the weighted total score, each data block is assigned a cache priority, and a priority queue is used to manage these data blocks, ensuring that high-priority data blocks enter the cache first, which constitutes the first sorting.

[0055] Reference Figure 3 , Figure 3 This is a flow chart of access frequency analysis provided in Example 2 of the image data loading method of this application. The above step S201 also includes:

[0056] Step S301: Construct a hash table using the identifier of each image data and the number of accesses.

[0057] It's important to note that a hash table can be used to record the number of times each image file has been accessed. The key can be the image file's unique identifier (file path or Uniform Resource Identifier), and the value is the number of times it has been accessed. The key and value of a hash table are the elements that make up a key-value pair. The key's hash value can be used to find the storage location and store the key-value pair.

[0058] Step S302: Update the access count corresponding to the identifier in the hash table according to the access record of each image data.

[0059] It's important to note that each time an image is accessed, its access count is updated. For example, you can insert access logging logic into the image loading process and update the access count in the loading callback. Furthermore, you can use JobScheduler to periodically trigger analysis tasks. In these analysis tasks, you can traverse the access logs and identify frequently accessed image files.

[0060] Step S303: assigning scores and weights to each piece of image data based on the updated number of visits, and obtaining interaction scores and interaction weights corresponding to each piece of image data.

[0061] It should be noted that the importance of the image data can be scored and weighted based on the number of times the image data is accessed and the frequency of access, in combination with the above-mentioned importance assessment. The scoring can be based on access frequency, last access time, user interaction behavior (such as editing, sharing), file size, creation time, and contextual information (such as geographic location, time, and device status). An interaction weight is assigned to each influencing factor (the weight reflects the degree of influence of the factor on the overall importance, and the sum of all weights is 100%).

[0062] In this embodiment, score distribution and weight distribution based on the interactive information of each image data are disclosed; the weighted total score of each image data is calculated, and the first ranking of each image data is determined in descending order according to the weighted total score. A hash table is constructed using the identifier of each image data and the number of accesses; the number of accesses corresponding to the identifier of the image in the hash table is updated according to the access records of the image; and score distribution and weight distribution are performed based on the number of accesses. Through the data importance scoring strategy, an importance score is assigned to each image data block through flexible combination and dynamic adjustment. Ensure that high-priority data blocks enter the cache first. At the same time, an access frequency analysis is designed to record the number of accesses to each image file, and identify frequently accessed image files to further improve cache efficiency.

[0063] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction and will not be described in detail later. Figure 4 , Figure 4A flowchart illustrating the third embodiment of the image data loading method of this application is provided.

[0064] In this embodiment, step S20 includes steps S401 to S402:

[0065] Step S401: performing a first-level cache adjustment on the first sort based on the importance of each image data in the storage structure.

[0066] It should be noted that the first-level cache adjustment can be performed based on the least frequently used (LFU) data structure. A scoring chain table is constructed based on the importance of the storage structure of each image data; the importance of the storage structure of each image data is re-scored based on the scoring interval, and the image data with the same re-scoring are stored in the same scoring chain table; and the first-level cache is adjusted for the first ranking based on the scoring chain table. The scoring interval can be the interval time for regularly updating the data structure of the image according to usage requirements (for example, it can be set to 1 hour or one day, etc.).

[0067] It should be understood that when designing the data structure, a single score and multiple linked lists can be used. Each data item has a score that stores its current importance score. Data items are grouped by importance score, with items with the same score placed in the same linked list. When operating on the score linked lists, the importance scores of data items are periodically recalculated and moved to the corresponding linked list based on the new score. When data needs to be removed, it is removed from the lowest-scoring linked list. The frequency of score updates is dynamically adjusted based on system load and user behavior to reduce unnecessary calculations.

[0068] Step S402: performing a second-level cache adjustment on the first order after the first-level cache adjustment according to the access time of each picture data to obtain a target order of each picture data.

[0069] It should be noted that the second-level cache adjustment can be performed based on the Least Recently Used (LRU) data structure. A two-way linked list is constructed based on the access time of each image data; the image data with access time close to the current time is stored at the head of the two-way linked list, and the image data with access time far from the current time is stored at the end of the two-way linked list; the first sort after the first-level cache adjustment is adjusted at the second level according to the two-way linked list. Based on the first-level cache adjustment LFU, an execution plan is designed based on the data structure with importance scoring; based on the second-level cache adjustment LRU (Least Recently Used), cache adjustment is performed based on short-term and long-term access patterns. A two-layer cache mechanism of LFU+LRU is adopted to optimize data distribution and storage efficiency, reduce latency and bandwidth consumption.

[0070] It should be understood that when designing data structures, a combination of a doubly linked list and a hash table can be used. The doubly linked list is used to maintain the order in which data items are used, with the most recently used items placed at the head of the list and the least used items placed at the tail of the list. The hash table is used to quickly access data items in the cache. When operating on a doubly linked list, each time data is accessed, the data item is moved to the head of the list. When data needs to be removed, it is removed from the tail of the list. Based on LRU, cache adjustments are made in combination with short-term and long-term access patterns. By analyzing access patterns (such as burst access and periodic access), the LRU strategy is dynamically adjusted to improve the cache hit rate.

[0071] Reference Figure 5 , Figure 5 A flowchart of image loading is provided for Example 3 of the image data loading method of this application. Through access frequency analysis, access records are traversed to identify frequently accessed image files. Through data importance assessment, according to the importance score, cache priority is assigned to each image data to ensure that high-priority data blocks enter the cache first. Data items with high importance scores are stored through dynamic cache adjustment (double-layer cache mechanism) to ensure fast access to critical data. At the same time, the most recently used data items are stored to provide support for short-term access patterns. Preloading operations are performed in the background thread through the preloading strategy to avoid affecting the performance of the main thread. The cache refresh mechanism ensures that the data in the target sort of the cache is consistent with the data source. When the data source is updated, the corresponding data in the cache is updated or cleared in time.

[0072] In this embodiment, a first-level cache adjustment is disclosed for the first sort based on the importance of the storage structure of each image data; a second-level adjustment is performed on the first sort after the first-level cache adjustment according to the access time of each image data to obtain the target sort of each image data. A scoring linked list is constructed according to the importance of the storage structure of each image data; based on the real-time score of the image data at the current moment, each image data with the same real-time score is stored in the same scoring linked list; a first-level cache adjustment is performed on the first sort according to the scoring linked list. A bidirectional linked list is constructed according to the access time of each image data; image data with an access time close to the current moment is stored at the head of the bidirectional linked list, and image data with an access time far from the current moment is stored at the end of the bidirectional linked list; a second-level adjustment is performed on the first sort after the first-level cache adjustment according to the bidirectional linked list. A two-layer cache mechanism of LFU and LRU is adopted, and an execution scheme of a data structure scored by importance is designed based on the cache replacement algorithm LFU; cache adjustment is performed based on the cache replacement algorithm LRU in combination with short-term and long-term access modes.

[0073] It should be noted that the above examples are only used to understand this application and do not constitute a limitation on the image data loading method of this application. More forms of simple transformations based on this technical concept are all within the scope of protection of this application.

[0074] This application also provides a device for loading image data. Figure 6 , the image data loading device includes:

[0075] A weight sorting module 10 is used to assign data weights according to the interactive information of each image data and determine the first sorting of each image data;

[0076] A sorting adjustment module 20 is configured to dynamically adjust the first sorting based on the storage structure of each image data to obtain a target sorting of each image data;

[0077] The data loading module 30 is used to preload each picture data according to the target sorting.

[0078] Optionally, the weight sorting module 10 is also used to assign scores and weights based on the interaction information of each image data to obtain the interaction score and interaction weight corresponding to each image data; sum the interaction score and interaction weight corresponding to each image data to obtain the weighted total score corresponding to each image data; determine the first sorting of each image data according to the order of the weighted total score from large to small.

[0079] Optionally, the weight sorting module 10 is further used to construct a hash table using the identifier and access count of each image data; update the access count corresponding to the identifier in the hash table according to the access record of each image data; and assign a score and a weight to each image data based on the updated access count to obtain the interaction score and interaction weight corresponding to each image data.

[0080] Optionally, the sorting adjustment module 20 is also used to perform a first-level cache adjustment on the first sort based on the importance of each image data in the storage structure; and perform a second-level cache adjustment on the first sort after the first-level cache adjustment according to the access time of each image data to obtain the target sort of each image data.

[0081] Optionally, the sorting adjustment module 20 is further used to construct a scoring chain table according to the importance of the storage structure of each image data; re-score the importance of the storage structure of each image data based on the scoring interval time, and store each image data with the same re-score in the same scoring chain table; and perform a first-level cache adjustment on the first sort according to the scoring chain table.

[0082] Optionally, the sorting adjustment module 20 is also used to construct a bidirectional linked list based on the access time of each image data; store the image data whose access time is close to the current time at the head of the bidirectional linked list, and store the image data whose access time is far from the current time at the end of the bidirectional linked list; and perform a second-level cache adjustment on the first sort after the first-level cache adjustment according to the bidirectional linked list.

[0083] Optionally, set an expiration time for each image data; obtain the storage time of each image data in the target sorting, and determine whether the storage time exceeds the expiration time; if so, remove the image data corresponding to the image data that exceeds the expiration time; store the remaining image data in the target sorting in the cache space for preloading.

[0084] The image data loading device provided by this application, which utilizes the image data loading method of the above-described embodiment, can resolve the technical problem in the prior art of slow loading when browsing a large number of images, resulting in excessive consumption of device resources. Compared with the prior art, the beneficial effects of the image data loading device provided by this application are the same as those of the image data loading method provided by the above-described embodiment, and the other technical features of the image data loading device are the same as those disclosed in the above-described embodiment method, and are not further described here.

[0085] The present application provides an image data loading device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the image data loading method in the above-mentioned embodiment one.

[0086] Reference below Figure 7 , which shows a schematic structural diagram of a picture data loading device suitable for implementing an embodiment of the present application. The picture data loading device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The picture data loading device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.

[0087] like Figure 7As shown, the image data loading device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the image data loading device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003 including, for example, a magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the image data loading device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows an image data loading device with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or provided instead.

[0088] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0089] The image data loading device provided by this application utilizes the image data loading method of the above-mentioned embodiment to solve the technical problem of image data loading. Compared with the prior art, the beneficial effects of the image data loading device provided by this application are the same as those of the image data loading method provided by the above-mentioned embodiment. The other technical features of the image data loading device are the same as those disclosed in the above-mentioned embodiment and are not further described here.

[0090] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0091] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0092] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, and the computer-readable program instructions are used to execute the image data loading method in the above-mentioned embodiment.

[0093] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0094] The computer-readable storage medium may be included in the image data loading device; or may exist independently without being assembled into the image data loading device.

[0095] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the image data loading device, the image data loading device: assigns data weights based on the interactive information of each image data to determine the first sorting of each image data; dynamically adjusts the first sorting based on the storage structure of each image data to obtain the target sorting of each image data; and preloads each image data according to the target sorting.

[0096] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0097] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0098] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0099] The readable storage medium provided in this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., a computer program) for executing the above-mentioned image data loading method. This computer-readable storage medium can solve the technical problem in the prior art of slow loading when browsing a large number of images, resulting in excessive consumption of device resources. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the image data loading method provided in the above-mentioned embodiment, and will not be elaborated here.

[0100] The above are only some embodiments of the present application and are not intended to limit the scope of protection of the present application. All equivalent structural transformations made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the scope of protection of the present application.

Claims

1. A method for loading image data, characterized in that: The image data loading method includes: Allocating data weights according to the interactive information of each image data, and determining a first ranking of each image data; Dynamically adjusting the first sorting based on the storage structure of each of the image data to obtain a target sorting of each of the image data; The image data are preloaded according to the target sorting.

2. The image data loading method according to claim 1, wherein: The step of assigning data weights according to the interactive information of each image data and determining the first ranking of each image data includes: Perform score assignment and weight assignment based on the interaction information of each of the image data to obtain an interaction score and interaction weight corresponding to each of the image data; Summing the interaction score and the interaction weight corresponding to each piece of image data to obtain a weighted total score corresponding to each piece of image data; The first ranking of each of the picture data is determined according to the order of the weighted total scores from large to small.

3. The image data loading method according to claim 2, wherein: The interaction information includes: an identifier, a number of visits, and an access record. The step of assigning a score and a weight based on the interaction information of each image data to obtain an interaction score and an interaction weight corresponding to each image data includes: Constructing a hash table using the identifiers and access times of each of the image data; updating the access count corresponding to the identifier in the hash table according to the access record of each image data; Scoring and weighting are performed on each piece of image data based on the updated number of visits to obtain an interaction score and interaction weight corresponding to each piece of image data.

4. The image data loading method according to claim 1, wherein: The step of dynamically adjusting the first sorting based on the storage structure of each of the image data to obtain a target sorting of each of the image data includes: Performing a first-level cache adjustment on the first sorting based on the importance of each image data in the storage structure; According to the access time of each of the picture data, the first order after the first-level cache adjustment is adjusted to obtain the target order of each of the picture data.

5. The image data loading method according to claim 4, wherein: The step of performing first-level cache adjustment on the first sorting based on the importance parameter size in the storage structure of each of the picture data includes: Constructing a scoring chain table according to the importance of the storage structure of each of the image data; Re-scoring the importance of the storage structure of each of the image data based on a scoring interval, and storing the image data having the same re-scoring into the same scoring linked list; Performing a first-level cache adjustment on the first sorting according to the scoring linked list.

6. The image data loading method according to claim 4, wherein: The step of performing L2 cache adjustment on the first sorting after L1 cache adjustment includes: Constructing a bidirectional linked list according to the access time of each of the image data; The picture data whose access time is close to the current time is stored in the head of the bidirectional linked list, and the picture data whose access time is far from the current time is stored in the tail of the bidirectional linked list; Performing a second-level cache adjustment on the first sorting after the first-level cache adjustment according to the bidirectional linked list.

7. The image data loading method according to claim 1, wherein: The step of preloading each of the image data according to the target sorting includes: Setting the expiration time of each of the image data; Obtaining the storage time of each of the image data in the target sorting, and determining whether the storage time exceeds the expiration time; If so, remove the image data corresponding to the expiration time; The remaining picture data in the target sorting is stored in a cache space for preloading.

8. A device for loading image data, characterized in that: The device comprises: A weight sorting module, configured to assign a data weight according to the interactive information of each image data, and determine a first sorting of each image data; a sorting adjustment module, configured to dynamically adjust the first sorting based on the storage structure of each of the image data to obtain a target sorting of each of the image data; A data loading module is used to preload each of the picture data according to the target sorting.

9. A picture data loading device, characterized in that: The image data loading device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the image data loading method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the image data loading method according to any one of claims 1 to 7 are implemented.