CN111562913B - Method, device and equipment for pre-creating view component and computer readable medium - Google Patents

Method, device and equipment for pre-creating view component and computer readable medium Download PDF

Info

Publication number
CN111562913B
CN111562913B CN202010352454.0A CN202010352454A CN111562913B CN 111562913 B CN111562913 B CN 111562913B CN 202010352454 A CN202010352454 A CN 202010352454A CN 111562913 B CN111562913 B CN 111562913B
Authority
CN
China
Prior art keywords
view component
creation
view
list
hotspot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010352454.0A
Other languages
Chinese (zh)
Other versions
CN111562913A (en
Inventor
张韩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN202010352454.0A priority Critical patent/CN111562913B/en
Publication of CN111562913A publication Critical patent/CN111562913A/en
Application granted granted Critical
Publication of CN111562913B publication Critical patent/CN111562913B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the disclosure provides a method and a device for pre-creating a view component, electronic equipment and a computer readable medium, wherein the method comprises the following steps: detecting the creation of each view component, and determining the number of creation times of each view component; when the number of times of creation of each view component is larger than a preset first threshold value, adding each view component into a first hot spot view component list to obtain a second hot spot view component list; and pre-creating at least one view component on the second hotspot view component list. According to the method, the pre-creation time of the view component and the pre-creation list of the view component are not required to be controlled by a user, the creation of each view component is detected in real time, the obtained times of creation of each view component are compared with a preset first threshold value, a second hotspot view component list, namely the pre-creation list of the view component, can be obtained, and the pre-creation efficiency of the view component is improved.

Description

Method, device and equipment for pre-creating view component and computer readable medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for pre-creating a view component, an electronic device, and a computer-readable medium.
Background
In the prior art, performance optimization is an important direction for improving the use experience of an application program Android App of an Android system, the starting time and the page fluency are important performance optimization focused indexes, wherein the time consumption caused by the creation of a view component is an important factor influencing related performance indexes; many companies take some means in application App development to reduce the time consumption of the view invert.
In a traditional optimization scheme, a required view component view is pre-created mostly in an asynchronous method of creating an invite, the pre-created view in the traditional scheme needs a user to control a pre-creation opportunity of the view and a pre-creation list of the view, for example, the user is a research and development worker, but the actual operation of the research and development worker to control the pre-creation opportunity of the view and the pre-creation list of the view is very complicated, the pre-creation opportunity of the view is not well controlled, and each pre-creation request needs to be researched, developed and submitted, so that the efficiency of pre-creation of the view is low.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The present disclosure provides a method and an apparatus for pre-creating a view component, an electronic device, and a computer-readable medium to solve the problem of how to improve efficiency of pre-creating a view component.
In a first aspect, the present disclosure provides a method for pre-creating a view component, including:
detecting the creation of each view component, and determining the creation times of each view component;
when the creating times of each view component are larger than a preset first threshold value, adding each view component into a first hot spot view component list to obtain a second hot spot view component list;
and pre-creating at least one view component on the second hotspot view component list.
In a second aspect, the present disclosure provides an apparatus for pre-creating a view component, including:
the first processing module is used for detecting the creation of each view component and determining the creation times of each view component;
the second processing module is used for adding each view component into the first hot spot view component list to obtain a second hot spot view component list when the creation times of each view component are larger than a preset first threshold;
and the third processing module is used for pre-creating at least one view component on the second hotspot view component list.
In a third aspect, the present disclosure provides an electronic device, comprising: a processor, a memory, and a bus;
a bus for connecting the processor and the memory;
a memory for storing operating instructions;
and the processor is used for executing the pre-creation method of the view component of the first aspect of the disclosure by calling the operation instruction.
In a fourth aspect, the present disclosure provides a computer-readable medium storing a computer program for executing the method for pre-creating a view component of the first aspect of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least has the following beneficial effects:
detecting the creation of each view component, and determining the creation times of each view component; when the number of times of creation of each view component is larger than a preset first threshold value, adding each view component into a first hot spot view component list to obtain a second hot spot view component list; and pre-creating at least one view component on the second hotspot view component list. Therefore, the user is not required to control the pre-creation time of the view component and the pre-creation list of the view component, the creation of each view component is detected in real time, the obtained times of creation of each view component are compared with the preset first threshold value, the second hotspot view component list, namely the pre-creation list of the view component, can be obtained, and the pre-creation efficiency of the view component is improved.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings used in the description of the embodiments of the present disclosure will be briefly described below.
Fig. 1 is a schematic flowchart of a method for pre-creating a view component according to an embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating another method for pre-creating a view component according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a pre-creation apparatus for view components according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing the devices, modules, or units, and are not used for limiting the devices, modules, or units to be determined as different devices, modules, or units, and are not used for limiting the sequence or interdependence of the functions performed by the devices, modules, or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The embodiment of the present disclosure provides a method for pre-creating a view component, a flowchart of the method is shown in fig. 1, and the method includes:
s101, the creation of each view component is detected, and the number of times of creation of each view component is determined.
In the embodiment of the present disclosure, detecting creation of each view component, and determining the number of times of creation of each view component includes:
detecting byte codes related to the creation of each view component, and determining context information corresponding to each view component;
and determining the times of creation of each view component according to the context information corresponding to each view component.
In the embodiment of the present disclosure, detecting a bytecode related to creation of each view component, and determining context information corresponding to each view component includes:
reading the byte codes related to the creation of each view component, and detecting the signature related to the creation of each view component according to the byte codes;
when the signature is detected, obtaining a parameter corresponding to the parameter application instruction through a preset parameter application instruction;
and determining context information corresponding to each view component according to the parameters.
In the embodiment of the disclosure, a byte code related to creation of a view component is detected through a self-development byte code tool, call addition callback of the view component is detected, and creation callback detection is performed through the callback inserted in a compiling process during running.
In the embodiment of the present disclosure, detecting a byte code related to view invalidate, and detecting a call addition callback of view invalidate include: reading byte codes through an ASM tool, and detecting a signature of view invalidate; detecting a signature of the view invert, and acquiring a parameter corresponding to the parameter application instruction through the parameter application instruction; and inserting a callback method when the view invert is detected.
In the embodiment of the present disclosure, the runtime detecting the flap through the callback inserted in the compiling process includes: hot spot detection is started at runtime through code inserted at compile time.
S102, when the creating times of each view component is larger than a preset first threshold value, each view component is added into a first hot spot view component list, and a second hot spot view component list is obtained.
In an embodiment of the present disclosure, adding each view component to a first hotspot view component list includes:
and adding each view component and the context information corresponding to each view component into a first hot spot view component list.
In the embodiment of the present disclosure, obtaining the second hotspot view component list includes:
and updating the first hot spot view component list added with the view component to obtain a second hot spot view component list.
In the embodiment of the present disclosure, updating the first hotspot view component list added to the view component to obtain a second hotspot view component list includes:
and when a preset time condition is reached, performing persistence processing on the first hot spot view component list added with the view component to obtain a second hot spot view component list.
In the embodiment of the disclosure, a terminal App generates view info, and when the number of times of the view component view info in context is 3 or more than 3, the view and context information is added to a first hotspot view component list, namely a hotspot list, wherein a first threshold is 2.
In the embodiment of the present disclosure, detecting that App of a terminal has executed an invert view includes: detecting the call of the view update through a byte code tool, and acquiring the context information of the updated view according to the parameters.
In the embodiment of the present disclosure, the recording the number of times of instantiating a view under context includes: and recording context to which the view belongs through a mapping table of a byte code tool, and counting the view update.
In the embodiment of the present disclosure, adding the view and context information into a hotspot list includes: and when the number of times of view inventory is larger than a first threshold value, adding the view component view to a first hotspot view component list, namely a hotspot list, and performing persistence processing on the hotspot list at a proper time.
In the disclosed embodiment, the persistence process is a mechanism for transferring program data between a persistent state and a transient state; the transient data is persistent data, for example, the transient data is data in a memory, the transient data cannot be permanently stored, the data in the memory is persistent data, the persistent data is stored in a database, and the persistent data can be permanently stored.
In the embodiment of the present disclosure, the list of the second hotspot view components is output in a file or memory manner.
S103, at least one view component on the second hotspot view component list is pre-created.
In the embodiment of the present disclosure, the pre-creating at least one view component on the second hotspot view component list includes:
and pre-creating at least one view component on the second hot spot view component list according to the second hot spot view component list and the cache state of the view component on the second hot spot view component list, wherein the creation times of the at least one view component are larger than a second threshold value.
In the embodiment of the present disclosure, when there are multiple view components on the second hotspot view component list, a view component whose creation frequency of view component creation is greater than the second threshold is selected from the multiple view components to perform pre-creation.
In the embodiment of the disclosure, in an idle time, according to the second hotspot view component list, the view components on the second hotspot view component list are pre-created, for example, the idle time is a time when a cpu load of the processor is not high or all tasks of the view inventory scheduling framework have been completed.
In the embodiment of the disclosure, after the App is started, a thread is started on a background to load a view list input from the outside, and meanwhile, when the user is idle, the user does not need to pay attention to when to pre-create the view, and a view inventory scheduling framework can automatically pre-create the view when the user is idle according to a second hot view component list and the cache state of the current view.
In the embodiment of the disclosure, the creation of each view component is detected, and the number of times of creation of each view component is determined; when the creating times of each view component are larger than a preset first threshold value, adding each view component into a first hot spot view component list to obtain a second hot spot view component list; and pre-creating at least one view component on the second hotspot view component list. Therefore, the user is not required to control the pre-creation time of the view component and the pre-creation list of the view component, the creation of each view component is detected in real time, the obtained times of creation of each view component are compared with the preset first threshold value, the second hotspot view component list, namely the pre-creation list of the view component, can be obtained, and the pre-creation efficiency of the view component is improved.
Another method for pre-creating a view component is provided in the embodiments of the present disclosure, and a flowchart of the method is shown in fig. 2, where the method includes:
s201, detecting the view invert.
In the embodiment of the disclosure, the creation of view instantiates of a plurality of view components is detected, wherein the view represents the view components, and the view instantiates represents the creation of the view components.
S202, recording the frequency of view invert.
S203, judging whether the frequency of the view invert is more than 3, and if the frequency of the view invert is more than 3, turning to the step S204 for processing; when the number of view updates is not more than 3, the process goes to step S208.
In the embodiment of the present disclosure, the first threshold is 3.
S204, adding the view to a first hotspot view component list.
In an embodiment of the present disclosure, the first hotspot view component list is a hotspot list.
S205, judging whether to carry out persistence processing on the hotspot list, and when carrying out persistence processing on the hotspot list, turning to the step S206 for processing; when the persistence processing is not performed on the hotspot list, the process goes to step S208.
S206, the first hot spot view component list is subjected to persistence processing to obtain a second hot spot view component list.
In the embodiment of the disclosure, a hotspot list is subjected to persistence processing to obtain a second hotspot view component list.
And S207, automatically pre-creating the view in an idle time according to the second hotspot view component list and the caching condition of the current view.
And S208, ending the process.
The application of the embodiment of the disclosure has at least the following beneficial effects:
the method comprises the steps of detecting the creation of the view in real time, comparing the number of times of the created view with a preset first threshold value to obtain a second hot spot view component list, and automatically pre-creating the view in an idle time according to the second hot spot view component list and the cache condition of the current view, so that the efficiency of pre-creating the view is improved.
Based on the same inventive concept, the embodiment of the present disclosure further provides a pre-creation apparatus for view components, a schematic structural diagram of the apparatus is shown in fig. 3, and the pre-creation apparatus 30 for view components includes a first processing module 301, a second processing module 302, and a third processing module 303.
A first processing module 301, configured to detect creation of each view component, and determine the number of times of creation of each view component;
a second processing module 302, configured to add each view component to the first hot spot view component list to obtain a second hot spot view component list when the number of times of creation of each view component is greater than a preset first threshold;
a third processing module 303, configured to pre-create at least one view component on the second hotspot view component list.
In the embodiment of the present disclosure, the first processing module 301 is specifically configured to detect a bytecode related to creation of each view component, and determine context information corresponding to each view component; and determining the times of creation of each view component according to the context information corresponding to each view component.
In this embodiment of the present disclosure, the second processing module 302 is specifically configured to add each view component and context information corresponding to each view component to the first hotspot view component list.
In the embodiment of the present disclosure, the first processing module 301 is specifically configured to read a bytecode related to creation of each view component, and detect a signature related to creation of each view component according to the bytecode; when the signature is detected, obtaining a parameter corresponding to the parameter application instruction through a preset parameter application instruction; and determining the context information corresponding to each view component according to the parameters.
In this embodiment of the present disclosure, the second processing module 302 is specifically configured to update the first hotspot view component list added to the view component, so as to obtain a second hotspot view component list.
In this embodiment of the present disclosure, the second processing module 302 is specifically configured to perform persistence processing on the first hotspot view component list added to the view component when a preset time condition is reached, so as to obtain a second hotspot view component list.
In this embodiment of the present disclosure, the third processing module 303 is configured to pre-create at least one view component on the second hot spot view component list according to the second hot spot view component list and the cache state of the view component on the second hot spot view component list, where a number of times of creating the at least one view component is greater than a second threshold.
The application of the embodiment of the disclosure has at least the following beneficial effects:
detecting the creation of each view component, and determining the number of creation times of each view component; when the number of times of creation of each view component is larger than a preset first threshold value, adding each view component into a first hot spot view component list to obtain a second hot spot view component list; and pre-creating at least one view component on the second hotspot view component list. Therefore, the user is not required to control the pre-creation time of the view component and the pre-creation list of the view component, the creation of each view component is detected in real time, the obtained times of creation of each view component are compared with the preset first threshold value, the second hotspot view component list, namely the pre-creation list of the view component, can be obtained, and the pre-creation efficiency of the view component is improved.
For the content that is not described in detail in the pre-creation apparatus of the view component provided in the embodiment of the present disclosure, reference may be made to the pre-creation method of the view component provided in the above embodiment, and the beneficial effects that can be achieved by the pre-creation apparatus of the view component provided in the embodiment of the present disclosure are the same as the pre-creation method of the view component provided in the above embodiment, and are not described again here.
Referring now to FIG. 4, a block diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
The electronic device includes: a memory and a processor, wherein the processor may be referred to as a processing device 801 described below, the memory may include at least one of a Read Only Memory (ROM) 802, a Random Access Memory (RAM) 803, and a storage device 808, as shown in fig. 4:
the electronic device 800 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 4 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be alternatively implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: detecting the creation of each view component, and determining the creation times of each view component; when the creating times of each view component are larger than a preset first threshold value, adding each view component into a first hot spot view component list to obtain a second hot spot view component list; and pre-creating at least one view component on the second hotspot view component list.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C + +, including conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the designation of a module or unit does not in some cases constitute a limitation on the unit itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems on a chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, an embodiment provides a method for pre-creating a view component, including:
detecting the creation of each view component, and determining the creation times of each view component;
when the creating times of each view component are larger than a preset first threshold value, adding each view component into a first hot spot view component list to obtain a second hot spot view component list;
and pre-creating at least one view component on the second hotspot view component list.
In the embodiment of the present disclosure, detecting creation of each view component, and determining the number of times of creation of each view component includes:
detecting byte codes related to the creation of each view component, and determining context information corresponding to each view component;
determining the times of creation of each view component according to the context information corresponding to each view component;
adding each view component to a first hotspot view component list, comprising:
and adding each view component and the context information corresponding to each view component into a first hotspot view component list.
In the embodiment of the present disclosure, detecting the bytecode related to the creation of each view component, and determining the context information corresponding to each view component includes:
reading the byte codes related to the creation of each view component, and detecting the signature related to the creation of each view component according to the byte codes;
when the signature is detected, obtaining a parameter corresponding to the parameter application instruction through a preset parameter application instruction;
and determining context information corresponding to each view component according to the parameters.
In an embodiment of the present disclosure, obtaining the list of the second hotspot view components includes:
and updating the first hotspot view component list added with the view component to obtain a second hotspot view component list.
In the embodiment of the present disclosure, updating the first hotspot view component list added to the view component to obtain a second hotspot view component list includes:
and when a preset time condition is reached, performing persistence processing on the first hot spot view component list added with the view component to obtain a second hot spot view component list.
In the embodiment of the present disclosure, the pre-creating at least one view component on the second hotspot view component list includes:
and pre-creating at least one view component on the second hot spot view component list according to the second hot spot view component list and the cache state of the view component on the second hot spot view component list, wherein the creation times of the at least one view component are greater than a second threshold value.
According to one or more embodiments of the present disclosure, an embodiment provides a pre-creation apparatus of a view component, including:
the first processing module is used for detecting the creation of each view component and determining the creation times of each view component;
the second processing module is used for adding each view component into the first hot spot view component list to obtain a second hot spot view component list when the creation times of each view component are larger than a preset first threshold;
and the third processing module is used for pre-creating at least one view component on the second hotspot view component list.
In an embodiment of the present disclosure, the first processing module is specifically configured to detect a bytecode related to creation of each view component, and determine context information corresponding to each view component; and determining the times of creation of each view component according to the context information corresponding to each view component.
In an embodiment of the present disclosure, the second processing module is specifically configured to add each view component and context information corresponding to each view component to the first hotspot view component list.
In an embodiment of the present disclosure, the first processing module is specifically configured to read a bytecode related to creation of each view component, and detect a signature related to creation of each view component according to the bytecode; when the signature is detected, obtaining a parameter corresponding to the parameter application instruction through a preset parameter application instruction; and determining the context information corresponding to each view component according to the parameters.
In an embodiment of the present disclosure, the second processing module is specifically configured to update the first hot spot view component list added to the view component to obtain a second hot spot view component list.
In an embodiment of the present disclosure, the second processing module is specifically configured to, when a preset time condition is reached, perform persistence processing on the first hotspot view component list added to the view component, to obtain a second hotspot view component list.
In this embodiment of the disclosure, the third processing module is configured to pre-create at least one view component on the second hot spot view component list according to the second hot spot view component list and the cache state of the view component on the second hot spot view component list, where the number of times of creating the at least one view component is greater than a second threshold.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (9)

1. A method for pre-creating a view component, comprising:
detecting the creation of each view component, and determining the creation times of each view component;
when the number of times of creation of each view component is larger than a preset first threshold value, adding each view component into a first hot spot view component list to obtain a second hot spot view component list;
pre-creating at least one view component on the second hotspot view component list;
the detecting the creation of each view component and determining the number of the creation of each view component includes:
detecting byte codes related to the creation of each view component, and determining context information corresponding to each view component;
determining the times of creation of each view component according to the context information corresponding to each view component;
the adding the view components to a first hotspot view component list comprises:
and adding the view components and the context information corresponding to the view components into a first hot spot view component list.
2. The method of claim 1, wherein detecting the bytecode related to the creation of each view component and determining the context information corresponding to each view component comprises:
reading byte codes related to the creation of each view component, and detecting signatures related to the creation of each view component according to the byte codes;
when the signature is detected, obtaining a parameter corresponding to a parameter application instruction through a preset parameter application instruction;
and determining context information corresponding to each view component according to the parameters.
3. The method of claim 1, wherein obtaining the second hotspot view component list comprises:
and updating the first hotspot view component list added with the view component to obtain a second hotspot view component list.
4. The method of claim 3, wherein updating the first list of hotspot view components added to the view component to obtain a second list of hotspot view components comprises:
and when a preset time condition is reached, performing persistence processing on the first hotspot view component list added into the view component to obtain a second hotspot view component list.
5. The method of claim 1, wherein pre-creating at least one view component on the second hotspot view component list comprises:
and according to the second hot spot view component list and the cache state of the view components on the second hot spot view component list, pre-creating at least one view component on the second hot spot view component list, wherein the creation times of the at least one view component are greater than a second threshold value.
6. An apparatus for pre-creating a view component, comprising:
the first processing module is used for detecting the creation of each view component and determining the number of creation times of each view component;
the second processing module is used for adding each view component into the first hot spot view component list to obtain a second hot spot view component list when the creation times of each view component are larger than a preset first threshold value;
the third processing module is used for pre-creating at least one view component on the second hotspot view component list;
wherein the first processing module is further configured to:
detecting byte codes related to the creation of each view component, and determining context information corresponding to each view component;
determining the times of creation of each view component according to the context information corresponding to each view component;
the second processing module is further to:
and adding the view components and the context information corresponding to the view components into a first hot spot view component list.
7. The apparatus of claim 6, comprising:
the second processing module is specifically configured to update the first hotspot view component list added to the view component to obtain a second hotspot view component list.
8. An electronic device, comprising: a processor, a memory;
the memory for storing a computer program;
the processor, configured to execute the pre-creation method of a view component according to any of the claims 1-5 by calling the computer program.
9. A computer-readable medium, characterized in that a computer program is stored which, when being executed by a processor, is adapted to carry out the method of pre-creation of a view component according to any of the claims 1-5.
CN202010352454.0A 2020-04-28 2020-04-28 Method, device and equipment for pre-creating view component and computer readable medium Active CN111562913B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010352454.0A CN111562913B (en) 2020-04-28 2020-04-28 Method, device and equipment for pre-creating view component and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010352454.0A CN111562913B (en) 2020-04-28 2020-04-28 Method, device and equipment for pre-creating view component and computer readable medium

Publications (2)

Publication Number Publication Date
CN111562913A CN111562913A (en) 2020-08-21
CN111562913B true CN111562913B (en) 2023-03-14

Family

ID=72071562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010352454.0A Active CN111562913B (en) 2020-04-28 2020-04-28 Method, device and equipment for pre-creating view component and computer readable medium

Country Status (1)

Country Link
CN (1) CN111562913B (en)

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7467137B1 (en) * 1994-09-02 2008-12-16 Wolfe Mark A System and method for information retrieval employing a preloading procedure
CN102446222B (en) * 2011-12-22 2014-12-10 华为技术有限公司 Method, device and system of webpage content preloading
CN103729438B (en) * 2013-12-30 2017-06-16 优视科技有限公司 Webpage preloads method and device
JP6548379B2 (en) * 2014-10-23 2019-07-24 キヤノン株式会社 INFORMATION PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND PROGRAM
CN108196929B (en) * 2018-01-09 2020-10-16 武汉斗鱼网络科技有限公司 Intelligent loading system, method, storage medium and equipment
CN108733756B (en) * 2018-04-11 2021-04-23 北京三快在线科技有限公司 Data preloading method and device, electronic equipment and readable storage medium
CN108762837B (en) * 2018-05-21 2020-07-10 Oppo广东移动通信有限公司 Application program preloading method and device, storage medium and terminal
CN109814941A (en) * 2018-11-27 2019-05-28 努比亚技术有限公司 A kind of application starting method, terminal and computer readable storage medium
CN110209967B (en) * 2019-04-17 2022-05-03 北京奇艺世纪科技有限公司 Page loading method and device, terminal equipment and computer readable medium
CN110069693B (en) * 2019-04-29 2021-12-24 百度在线网络技术(北京)有限公司 Method and device for determining target page
CN110471709B (en) * 2019-07-15 2022-12-06 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for accelerating webpage opening speed
CN110704184B (en) * 2019-09-19 2022-09-06 海南车智易通信息技术有限公司 Application memory optimization method and device and mobile terminal

Also Published As

Publication number Publication date
CN111562913A (en) 2020-08-21

Similar Documents

Publication Publication Date Title
CN110851139B (en) Method and device for checking codes and electronic equipment
CN111581563A (en) Page response method and device, storage medium and electronic equipment
CN110865852B (en) Webpage component loading method and device, electronic equipment and storage medium
CN113741756A (en) Information processing method, device, terminal and storage medium
CN111581555A (en) Document loading method, device, equipment and storage medium
CN111857720B (en) User interface state information generation method and device, electronic equipment and medium
CN111367516A (en) Application interface generation method and device and electronic equipment
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
CN111506904B (en) Method and device for online bug repair
CN113220281A (en) Information generation method and device, terminal equipment and storage medium
CN110888773B (en) Method, device, medium and electronic equipment for acquiring thread identification
CN111240801A (en) Method, device, medium and electronic equipment for generating heap memory snapshot file
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable medium
CN111796865B (en) Byte code file modification method, device, terminal equipment and medium
CN111459893B (en) File processing method and device and electronic equipment
CN114741686A (en) Method and device for detecting program white list and related equipment
CN111309323A (en) Parameter initialization method and device and electronic equipment
CN111538577A (en) Program execution control device and method, terminal and storage medium
CN111209042B (en) Method, device, medium and electronic equipment for establishing function stack
CN111367555B (en) Assertion method, assertion device, electronic equipment and computer readable medium
CN113138883B (en) Message processing method and device, storage medium and electronic equipment
CN112214408B (en) Dependency conflict detection method, dependency conflict detection device, electronic equipment and computer readable medium
CN115827415B (en) System process performance test method, device, equipment and computer medium
CN115374320B (en) Text matching method and device, electronic equipment and computer medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant