Lazy loading implementation method and device, electronic equipment and storage medium

An implementation method and lazy loading technology, applied in the field of communication, can solve problems such as limited application scope, increase development workload, affect loading service access, etc., and achieve the effect of improving applicable scenarios.

Pending Publication Date: 2022-07-19
WUHAN DOUYU NETWORK TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The inheritance of entity classes and entity methods will be limited to a certain extent, which will affect the access of different loading services. Therefore, the lazy loading in the traditional solution only adapts to the supported version of Android, and the traditional solution under AndroidX is not suitable. Matching, that is, the lazy loading implementation method in the traditional solution has limitations on the Android version, and the scope of application is not wide. Developers need to develop separately for different Android versions, which increases the development workload.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Lazy loading implementation method and device, electronic equipment and storage medium
  • Lazy loading implementation method and device, electronic equipment and storage medium
  • Lazy loading implementation method and device, electronic equipment and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0025] figure 1 This is a flowchart of the method for implementing lazy loading in Embodiment 1 of the present invention, and this embodiment is applicable to the situation where lazy loading is implemented in the AndroidX version. The method may be performed by a lazy loading implementation apparatus, which may be implemented in software and / or hardware, and may be configured in an electronic device, for example, the electronic device may be a background server or other device with communication and computing capabilities. like figure 1 As shown, the method specifically includes:

[0026] Step 101: Determine the lazy-loading class defined as an abstract class to implement the lazy-loading logic function, and define a target abstract method in the lazy-loading class to realize the target logic. At least two target business classes inherit the lazy-loading logic by inheriting the lazy-loading class Function.

[0027] Among them, lazy loading refers to the situation where the...

Embodiment 2

[0042] figure 2 This is a flowchart of the method for implementing lazy loading in the second embodiment of the present invention, and the second embodiment is further optimized on the basis of the first embodiment. like figure 2 As shown, the method includes:

[0043] Step 201: Determine the lazy loading class defined as an abstract class to realize the lazy loading logic function, and define the target abstract method in the lazy loading class to realize the target logic. At least two target business classes inherit the lazy loading logic by inheriting the lazy loading class Function.

[0044] Step 202 , when the page is loaded, by overriding the onCreateView function provided by the system, so as to call back the onCreateView function when the page is loaded to realize the specific page layout loading logic.

[0045] Among them, page loading is the initial process in the page implementation process. When the page is lazy loaded, the first page is loaded. When the page ...

Embodiment 3

[0080] image 3 This is a schematic structural diagram of the device for implementing lazy loading in Embodiment 3 of the present invention, and this embodiment is applicable to the situation where lazy loading is implemented in the AndroidX version. like image 3 As shown, the device includes:

[0081] The abstract definition module 310 is configured to determine a lazy loading class defined as an abstract class to realize the lazy loading logic function, and define a target abstract method in the lazy loading class to realize the target logic, and at least two target business classes inherit the The lazy loading class inherits the lazy loading logic function;

[0082] The function rewriting module 320 is used to implement the logical function of the target function when calling back the target function by rewriting the target function provided by the system during the page realization process;

[0083] The method inputting module 330 is used to input the target abstract m...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention discloses a lazy loading implementation method and device, electronic equipment and a storage medium. The lazy loading implementation method comprises the steps that a lazy loading class defined as an abstract class is determined to achieve a lazy loading logic function, a target abstract method is defined in the lazy loading class to achieve target logic, and at least two target service classes inherit the lazy loading logic function by inheriting the lazy loading class; in a page implementation process, a target function provided by a rewriting system is used for realizing a logic function of the target function when the target function is called back; and transmitting a duplicated target function into the target abstraction method to realize the realization of the same target logic in the at least two target business classes. According to the embodiment of the invention, lazy loading is realized through definition of the abstract class and the abstract method and is prevented from being limited by a system version, and the application scene of lazy loading realization is improved.

Description

technical field [0001] Embodiments of the present invention relate to the field of communication technologies, and in particular, to a lazy loading implementation method, apparatus, electronic device, and storage medium. Background technique [0002] Lazy loading can automatically obtain more data when the user scrolls the page, and the newly obtained data will not affect the display of the original data, and at the same time reduce the resource consumption on the server side to the greatest extent. [0003] The implementation of lazy loading business logic in the traditional lazy loading scheme is in the form of defining entity classes, and the implementation of specific logic methods in entity classes is also in the form of defining entities. The inheritance of entity classes and entity methods will be limited to a certain extent, which will affect the access of different loading services. Therefore, the lazy loading in the traditional solution only adapts to the support v...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/957G06F9/445
CPCG06F16/9574G06F9/44521
Inventor 张磊
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products