CN113791988B - Rendering method and device for reducing volume of small program package and storage medium - Google Patents

Rendering method and device for reducing volume of small program package and storage medium Download PDF

Info

Publication number
CN113791988B
CN113791988B CN202111358693.8A CN202111358693A CN113791988B CN 113791988 B CN113791988 B CN 113791988B CN 202111358693 A CN202111358693 A CN 202111358693A CN 113791988 B CN113791988 B CN 113791988B
Authority
CN
China
Prior art keywords
memory space
topic
video
type
data object
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
CN202111358693.8A
Other languages
Chinese (zh)
Other versions
CN113791988A (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.)
CHANJET INFORMATION TECHNOLOGY CO LTD
Original Assignee
CHANJET INFORMATION TECHNOLOGY 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 CHANJET INFORMATION TECHNOLOGY CO LTD filed Critical CHANJET INFORMATION TECHNOLOGY CO LTD
Priority to CN202111358693.8A priority Critical patent/CN113791988B/en
Publication of CN113791988A publication Critical patent/CN113791988A/en
Application granted granted Critical
Publication of CN113791988B publication Critical patent/CN113791988B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

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

Abstract

The invention provides a rendering method, a device and a storage medium for reducing the volume of a small program package, wherein the method comprises the following steps: when a user operates on an interface of an applet on the electronic equipment, acquiring a data object type operated by the user in the electronic equipment; applying for a first memory space in a memory of the electronic equipment and acquiring a first pointer of the first memory space; if the data object type is a first type, adjusting the first memory space based on the first type to obtain a first adjusted memory space, if the data object type is a second type, adjusting the first memory space based on the second type to obtain a second adjusted memory space, loading the content of the data object to the first or second adjusted memory space according to the data object type, and rendering the content from the first or second adjusted memory space to a view layer of a display interface for a user to view. The volume of the package of the applet and the influence on the host program are reduced.

Description

Rendering method and device for reducing volume of small program package and storage medium
Technical Field
The invention relates to the technical field of computer programs, in particular to a rendering method and a rendering device for reducing the volume of a small program package and a storage medium.
Background
The applet is a program which can be operated without downloading, and is dependent on other programs, also called a hosted program, a commonly used WeChat applet, which is an application that can be used without downloading, and is also an innovation, through the development of nearly two years, a new WeChat applet development environment and a developer ecology have been constructed, along with the increasing complexity of the applet functions, such as supporting functions of data display, video playing and the like, the volume of the applet is larger and larger, the memory occupied in operation is larger and larger, and the slow operation of the host program is inevitably caused, which is a defect in the prior art.
In the prior art, the management mode of the memory is complex, and the complex memory management method also causes the increase of the volume of the small program, so that the memory management needs to be considered in the process of program design for reducing the volume of the small program.
Disclosure of Invention
The present invention proposes the following technical solutions to address one or more technical defects in the prior art.
A rendering method for reducing a volume of a small package, the method being performed in an electronic device, the method comprising:
the method comprises the steps of obtaining the type of a data object operated by a user in the electronic equipment when the user operates on an interface of an applet on the electronic equipment;
an application step, namely applying a first memory space in a memory of the electronic equipment and acquiring a first pointer of the first memory space;
and a rendering step, wherein if the data object type is a first type, the first memory space is adjusted based on the first type to obtain a first adjusted memory space, if the data object type is a second type, the first memory space is adjusted based on the second type to obtain a second adjusted memory space, the content of the data object is loaded to the first adjusted memory space or the second adjusted memory space according to the data object type, and the content is rendered from the first adjusted memory space or the second adjusted memory space to a view layer of a display interface for a user to view based on the first pointer.
Further, the first type is video, and the second type is topic.
Further, in the acquiring step, based on the data object operated by the user in the electronic device, the applet acquires an identifier of the data object, and connects to the server to query the data object type of the data object based on the identifier.
Further, in the rendering step: if the first type is a video, the applet requests the server to obtain basic information of the video, obtains a representative frame of the video based on the basic information of the video, loads the representative frame of the video as first content into a first adjustment memory space, and renders the first content from the first adjustment memory space to a view layer of a display interface based on the first pointer to form a video interface for a user to view.
Further, in the rendering step: if the second type is a topic, the applet requests the server to obtain basic information of the topic, whether the topic comprises a plurality of topic videos is judged based on the basic information of the topic, if so, an array Arr [ n ] is created to store the URL of each topic video, the corresponding topic of each topic video is obtained based on each URL, the content representing the topic is obtained from the basic information of the topic, the content of the topic and the topic of each topic video are loaded into a second adjustment memory space as second content, and then the second content is rendered from the second adjustment memory space to a view layer of a display interface based on the first pointer to form a topic interface for a user to view.
Furthermore, when a user clicks a topic of a topic video on a topic interface, a corresponding topic video URL is obtained based on the array Arr [ n ], the applet requests the server to obtain basic information of the topic video, the size of a representative frame of the topic video is obtained based on the basic information, the second adjustment memory space is adjusted again based on the size of the representative frame of the topic video to obtain a third adjustment memory space, the representative frame of the topic video is obtained based on the basic information of the topic video, and the representative frame of the video is loaded into the third adjustment memory space as content.
The invention also provides a rendering device for reducing the volume of the small program package, which is arranged in the electronic equipment to execute, and the device comprises:
the acquisition unit is used for acquiring the data object type operated by the user in the electronic equipment when the user operates on the interface of the small program on the electronic equipment;
the application unit is used for applying for a first memory space in the memory of the electronic equipment and acquiring a first pointer of the first memory space;
and the rendering unit is used for adjusting the first memory space based on the first type to obtain a first adjusted memory space if the data object type is the first type, adjusting the first memory space based on the second type to obtain a second adjusted memory space if the data object type is the second type, loading the content of the data object to the first adjusted memory space or the second adjusted memory space according to the data object type, and rendering the content from the first adjusted memory space or the second adjusted memory space to a view layer of a display interface for a user to view based on the first pointer.
Further, the first type is video, and the second type is topic.
Still further, in the acquiring unit, based on a data object operated by a user in the electronic device, the applet acquires an identifier of the data object, and connects to the server to query a data object type of the data object based on the identifier.
Further, in the rendering unit: if the first type is a video, the applet requests the server to obtain basic information of the video, obtains a representative frame of the video based on the basic information of the video, loads the representative frame of the video as first content into a first adjustment memory space, and renders the first content from the first adjustment memory space to a view layer of a display interface based on the first pointer to form a video interface for a user to view.
Further, in the rendering unit: if the second type is a topic, the applet requests the server to obtain basic information of the topic, whether the topic comprises a plurality of topic videos is judged based on the basic information of the topic, if so, an array Arr [ n ] is created to store the URL of each topic video, the corresponding topic of each topic video is obtained based on each URL, the content representing the topic is obtained from the basic information of the topic, the content of the topic and the topic of each topic video are loaded into a second adjustment memory space as second content, and then the second content is rendered from the second adjustment memory space to a view layer of a display interface based on the first pointer to form a topic interface for a user to view.
Furthermore, when a user clicks a topic of a topic video on a topic interface, a corresponding topic video URL is obtained based on the array Arr [ n ], the applet requests the server to obtain basic information of the topic video, the size of a representative frame of the topic video is obtained based on the basic information, the second adjustment memory space is adjusted again based on the size of the representative frame of the topic video to obtain a third adjustment memory space, the representative frame of the topic video is obtained based on the basic information of the topic video, and the representative frame of the video is loaded into the third adjustment memory space as content.
The invention also proposes a computer-readable storage medium having stored thereon computer program code which, when executed by a computer, performs any of the methods described above.
The invention has the technical effects that: the invention discloses a rendering method, a device, equipment and a storage medium for reducing the volume of a small program package, wherein the method comprises the following steps: the method comprises the steps of obtaining the type of a data object operated by a user in the electronic equipment when the user operates on an interface of an applet on the electronic equipment; an application step, namely applying a first memory space in a memory of the electronic equipment and acquiring a first pointer of the first memory space; and a rendering step, wherein if the data object type is a first type, the first memory space is adjusted based on the first type to obtain a first adjusted memory space, if the data object type is a second type, the first memory space is adjusted based on the second type to obtain a second adjusted memory space, the content of the data object is loaded to the first adjusted memory space or the second adjusted memory space according to the data object type, and the content is rendered from the first adjusted memory space or the second adjusted memory space to a view layer of a display interface for a user to view based on the first pointer. In the invention, the first memory space is applied by the host program according to the type of the applet, namely, the memory relation tables corresponding to different applets are established in the host program, when a user starts one applet, the host program applies the corresponding first memory space according to the relation, the efficiency of memory application is improved due to the establishment of the relation tables, the content of the applet is reduced due to the setting of the relation tables in the host program, and the packet volume of the applet is reduced; in the invention, in order to improve the system performance, the applied first memory is relatively small, in the subsequent operation process, the first memory space needs to be adjusted according to the data object of the actual operation of the user on the small program, the initial address of the adjusted memory space is kept unchanged, namely the pointer of the adjusted memory space is unchanged, thus reducing the complex memory application mechanism in the small program, reducing the code of the small program and reducing the volume of the small program; in the invention, the display interface of the small program only needs to be provided with a basic initial interface, so that the volume of the small program package is reduced, and the content displayed on the small program package at the later stage is matched with the adjustment of the memory according to the type of the content, so that the content display is quick, the memory consumption is low, the operation efficiency of the small program is improved, the influence on the host program is reduced, and the user experience is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings.
Fig. 1 is a flowchart of a rendering method for reducing a small package volume according to an embodiment of the present invention.
Fig. 2 is a block diagram of a rendering apparatus for reducing a small package volume according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows a rendering method for reducing the volume of a small program package according to the present invention, which is executed in an electronic device, where a small program refers to a program that can be run without downloading, and depends on other programs, also called hosted programs, and commonly used small program with little trust, where the small program is an application that can be used without downloading, and is also an innovation, and through the development of nearly two years, a new small program development environment and a new developer ecology have been constructed, and as the functions of the small program become more complex, such as supporting functions of data display, video playing, etc., the volume of the small program is larger and larger, and the memory occupied during running is also larger and larger, which inevitably results in slow running of the host program, which is a defect in the prior art.
The method comprises the following steps:
an obtaining step S101, when a user operates on an interface of an applet on the electronic equipment, obtaining a data object type operated by the user in the electronic equipment;
an application step S102, of applying for a first memory space in a memory of the electronic device, and acquiring a first pointer of the first memory space;
a rendering step S103, if the data object type is a first type, adjusting the first memory space based on the first type to obtain a first adjusted memory space, if the data object type is a second type, adjusting the first memory space based on the second type to obtain a second adjusted memory space, loading the content of the data object to the first adjusted memory space or the second adjusted memory space according to the data object type, and rendering the content from the first adjusted memory space or the second adjusted memory space to a view layer of a display interface for a user to view based on the first pointer.
In the invention, the first memory space is applied by the host program according to the type of the applet, namely, the memory relation tables corresponding to different applets are established in the host program, when a user starts one applet, the host program applies the corresponding first memory space according to the relation, the efficiency of memory application is improved due to the establishment of the relation tables, the content of the applet is reduced due to the fact that the relation tables are arranged in the host program, and the packet volume of the applet is reduced, which is an important invention point of the invention.
In the invention, in order to improve the system performance, the applied first memory is relatively small, in the subsequent operation process, the first memory space needs to be adjusted according to the data object of the actual operation of the user on the applet, the initial address of the adjusted memory space is kept unchanged, namely the pointer of the adjusted memory space is unchanged, so that the complex memory application mechanism in the applet is reduced, the code of the applet is reduced, and the volume of the applet is reduced, which is another important invention point of the invention.
In one embodiment, the first data type is video and the second data type is topical. In the obtaining step S101, based on a data object operated by a user in an electronic device, the applet obtains an identifier of the data object, and connects to a server to query a data object type of the data object based on the identifier. The identification of the data object may be an ID, URL, or the like.
In one embodiment, in the rendering step S103: if the first data type is a video, the applet requests the server to obtain basic information of the video, obtains a representative frame of the video based on the basic information of the video, loads the representative frame of the video as first content into a first adjustment memory space, and renders the first content from the first adjustment memory space to a view layer of a display interface based on the first pointer to form a video interface for a user to view.
In the invention, after the data object type is determined to be a first type, that is, the first type is a video, the first memory space is adjusted based on the first type to obtain a first adjusted memory space, because the content of the video is large, in order to smoothly play the video, the first memory space needs to be increased so that the video can be smoothly played, then a representative frame of the video is obtained and loaded into the first adjusted memory space as a first content, and then the first content is rendered from the first adjusted memory space to a view layer of a display interface based on the first pointer to form a video interface for a user to view, so that the problem that the video playing is not smooth due to slow and small running of other applications due to excessively large memory space applied in advance is solved, and the invention belongs to another important invention point of the invention.
In one embodiment, in the rendering step S103: and if the second data type is a topic, the applet requests the server to obtain basic information of the topic, judges whether the topic comprises a plurality of topic videos based on the basic information of the topic, if so, creates an array Arr [ n ] to store the URL of each topic video, obtains the corresponding topic of each topic video based on each URL, obtains the content representing the topic from the basic information of the topic, loads the content of the topic and the topic of each topic video into a second adjustment memory space as second content, and renders the second content from the second adjustment memory space to a view layer of a display interface based on the first pointer to form a topic interface for a user to view, wherein n is the number of the topic videos. The topic may be a page including a plurality of topic videos, and the page includes a topic of the topic and a topic of the plurality of topic videos, for example, a topic is an 'accounting training lecture', and links of the plurality of topic videos are included below the page, and each link is displayed on the topic of the topic video.
In one embodiment, when a user clicks a topic of a topic video on a topic interface, a corresponding topic video URL is acquired based on the array Arr [ n ], the applet requests the server to acquire basic information of the topic video, acquires a size of a representative frame of the topic video based on the basic information, readjusts the second adjusted memory space based on the size of the representative frame of the topic video to obtain a third adjusted memory space, acquires the representative frame of the topic video based on the basic information of the topic video, and loads the representative frame of the video as content into the third adjusted memory space.
In the invention, as the memory required for only displaying one thematic interface is smaller, the second adjustment memory space is smaller than the first adjustment memory space of the video, thus, when a user browses a thematic page, if the user needs to check the thematic video, the second adjustment memory space is adjusted again, the second adjustment memory space can be adjusted to be multiple times, such as 10-20 times and the like, of the size of a representative frame of the thematic video, then the thematic video is rendered from the second adjustment memory space to a view layer of a display interface based on the first pointer to form a thematic video interface for the user to check, and the URL of the corresponding thematic video is recorded by an array, so that the user can conveniently click the corresponding thematic video and quickly obtain the link of the thematic video, in the invention, the display interface of a small program only needs to be provided with a basic initial interface, thereby reducing the volume of a small program package, and the content displayed on the post-stage is matched with the adjustment of the memory according to the type of the content, so that the content is displayed quickly, the memory consumption is small, the running efficiency of the small program is improved, the influence on the host program is reduced, and the user experience is improved.
Fig. 2 shows a rendering apparatus for reducing the volume of a small program package according to the present invention, which is disposed in an electronic device, where the small program refers to a program that can be run without downloading, and depends on other programs, also called hosted programs, and commonly used small program with little trust, where the small program is an application that can be used without downloading, and is also an innovation, and through the development of nearly two years, a new small program development environment and a new developer ecology have been constructed, and as the functions of the small program become more complex, such as supporting functions of data display, video playing, etc., the volume of the small program is larger and larger, and the memory occupied during running is also larger and larger, which inevitably results in slow running of the host program, which is a defect in the prior art. The device includes:
an acquisition unit 201, which acquires the data object type operated by the user in the electronic device when the user operates on the interface of the small program on the electronic device;
an applying unit 202, configured to apply for a first memory space in a memory of the electronic device, and obtain a first pointer of the first memory space;
a rendering unit 203, configured to, if the data object type is a first type, adjust the first memory space based on the first type to obtain a first adjusted memory space, if the data object type is a second type, adjust the first memory space based on the second type to obtain a second adjusted memory space, load the content of the data object to the first adjusted memory space or the second adjusted memory space according to the data object type, and render the content from the first adjusted memory space or the second adjusted memory space to a view layer of a display interface for a user to view based on the first pointer.
In the invention, the first memory space is applied by the host program according to the type of the applet, namely, the memory relation tables corresponding to different applets are established in the host program, when a user starts one applet, the host program applies the corresponding first memory space according to the relation, the efficiency of memory application is improved due to the establishment of the relation tables, the content of the applet is reduced due to the fact that the relation tables are arranged in the host program, and the packet volume of the applet is reduced, which is an important invention point of the invention.
In the invention, in order to improve the system performance, the applied first memory is relatively small, in the subsequent operation process, the first memory space needs to be adjusted according to the data object of the actual operation of the user on the applet, the initial address of the adjusted memory space is kept unchanged, namely the pointer of the adjusted memory space is unchanged, so that the complex memory application mechanism in the applet is reduced, the code of the applet is reduced, and the volume of the applet is reduced, which is another important invention point of the invention.
In one embodiment, the first data type is video and the second data type is topical. In the obtaining unit 201, based on a data object operated by a user in an electronic device, the applet obtains an identifier of the data object, and connects to a server to query a data object type of the data object based on the identifier. The identification of the data object may be an ID, URL, or the like.
In one embodiment, in the rendering unit 203: if the first data type is a video, the applet requests the server to obtain basic information of the video, obtains a representative frame of the video based on the basic information of the video, loads the representative frame of the video as first content into a first adjustment memory space, and renders the first content from the first adjustment memory space to a view layer of a display interface based on the first pointer to form a video interface for a user to view.
In the invention, after the data object type is determined to be a first type, that is, the first type is a video, the first memory space is adjusted based on the first type to obtain a first adjusted memory space, because the content of the video is large, in order to smoothly play the video, the first memory space needs to be increased so that the video can be smoothly played, then a representative frame of the video is obtained and loaded into the first adjusted memory space as a first content, and then the first content is rendered from the first adjusted memory space to a view layer of a display interface based on the first pointer to form a video interface for a user to view, so that the problem that the video playing is not smooth due to slow and small running of other applications due to excessively large memory space applied in advance is solved, and the invention belongs to another important invention point of the invention.
In one embodiment, in the rendering unit 203: and if the second data type is a topic, the applet requests the server to obtain basic information of the topic, judges whether the topic comprises a plurality of topic videos based on the basic information of the topic, if so, creates an array Arr [ n ] to store the URL of each topic video, obtains the corresponding topic of each topic video based on each URL, obtains the content representing the topic from the basic information of the topic, loads the content of the topic and the topic of each topic video into a second adjustment memory space as second content, and renders the second content from the second adjustment memory space to a view layer of a display interface based on the first pointer to form a topic interface for a user to view, wherein n is the number of the topic videos. The topic may be a page including a plurality of topic videos, and the page includes a topic of the topic and a topic of the plurality of topic videos, for example, a topic is an 'accounting training lecture', and links of the plurality of topic videos are included below the page, and each link is displayed on the topic of the topic video.
In one embodiment, when a user clicks a topic of a topic video on a topic interface, a corresponding topic video URL is acquired based on the array Arr [ n ], the applet requests the server to acquire basic information of the topic video, acquires a size of a representative frame of the topic video based on the basic information, readjusts the second adjusted memory space based on the size of the representative frame of the topic video to obtain a third adjusted memory space, acquires the representative frame of the topic video based on the basic information of the topic video, and loads the representative frame of the video as content into the third adjusted memory space.
In the invention, as the memory required for only displaying one thematic interface is smaller, the second adjustment memory space is smaller than the first adjustment memory space of the video, thus, when a user browses a thematic page, if the user needs to check the thematic video, the second adjustment memory space is adjusted again, the second adjustment memory space can be adjusted to be multiple times, such as 10-20 times and the like, of the size of a representative frame of the thematic video, then the thematic video is rendered from the second adjustment memory space to a view layer of a display interface based on the first pointer to form a thematic video interface for the user to check, and the URL of the corresponding thematic video is recorded by an array, so that the user can conveniently click the corresponding thematic video and quickly obtain the link of the thematic video, in the invention, the display interface of a small program only needs to be provided with a basic initial interface, thereby reducing the volume of a small program package, and the content displayed on the post-stage is matched with the adjustment of the memory according to the type of the content, so that the content is displayed quickly, the memory consumption is small, the running efficiency of the small program is improved, the influence on the host program is reduced, and the user experience is improved.
The invention provides a rendering device for reducing the volume of a small program package, which comprises a processor and a memory, wherein the processor is connected with the processor through a bus, the memory is stored with a computer program, the processor executes the computer program on the memory to realize the method, and the device can be a desktop computer, a server, a notebook, an intelligent terminal and the like.
An embodiment of the present invention provides a computer storage medium, on which a computer program is stored, which when executed by a processor implements the above-mentioned method, and the computer storage medium can be a hard disk, a DVD, a CD, a flash memory, or the like.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially implemented or the portions that contribute to the prior art may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the apparatuses described in the embodiments or some portions of the embodiments of the present application.
Finally, it should be noted that: although the present invention has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that: modifications and equivalents may be made thereto without departing from the spirit and scope of the invention and it is intended to cover in the claims the invention as defined in the appended claims.

Claims (10)

1. A rendering method for reducing a volume of a small program package, the method being performed in an electronic device, the method comprising:
the method comprises the steps of obtaining the type of a data object operated by a user in the electronic equipment when the user operates on an interface of an applet on the electronic equipment;
applying, namely applying a first memory space in a memory of the electronic device and acquiring a first pointer of the first memory space, wherein the first memory space is applied by a host program according to the type of an applet, namely, establishing memory relationship tables corresponding to different applets in the host program, when a user starts an applet, the host program applies for the corresponding first memory space according to the relationship tables, the applied first memory space is relatively small, in a subsequent operation process, the first memory space needs to be adjusted according to a data object of actual operation of the user on the applet, and an initial address of the adjusted memory space is kept unchanged, namely, the pointer of the adjusted memory space is unchanged;
and a rendering step, wherein if the data object type is a first type, the first memory space is adjusted based on the first type to obtain a first adjusted memory space, if the data object type is a second type, the first memory space is adjusted based on the second type to obtain a second adjusted memory space, the content of the data object is loaded to the first adjusted memory space or the second adjusted memory space according to the data object type, and the content is rendered to a view layer of a display interface from the first adjusted memory space or the second adjusted memory space based on the first pointer for a user to view.
2. The method of claim 1, wherein the first type is video and the second type is topic.
3. The method according to claim 2, wherein in the step of obtaining, the applet obtains an identification of the data object based on the data object operated by the user in the electronic device, and connects to the server to query the data object for the data object type based on the identification.
4. A method according to claim 3, wherein in the rendering step: if the first type is a video, the applet requests the server to obtain basic information of the video, obtains a representative frame of the video based on the basic information of the video, loads the representative frame of the video as first content into a first adjustment memory space, and renders the first content from the first adjustment memory space to a view layer of a display interface based on the first pointer to form a video interface for a user to view.
5. The method according to claim 4, wherein in the rendering step: and if the second type is a topic, the applet requests the server to obtain basic information of the topic, whether the topic comprises a plurality of topic videos is judged based on the basic information of the topic, if so, an array Arr [ n ] is created to store the URL of each topic video, the corresponding topic of each topic video is obtained based on each URL, the content representing the topic is obtained from the basic information of the topic, the content of the topic and the topic of each topic video are loaded into a second adjustment memory space as second content, then the second content is rendered from the second adjustment memory space to a view layer of a display interface based on the first pointer to form a topic interface for a user to view, wherein n is the number of the topic videos.
6. A rendering apparatus for reducing a volume of a small program package, the apparatus being configured to be executed in an electronic device, the apparatus comprising:
the acquisition unit is used for acquiring the data object type operated by the user in the electronic equipment when the user operates on the interface of the small program on the electronic equipment;
the application unit is used for applying for a first memory space in a memory of the electronic equipment and acquiring a first pointer of the first memory space, wherein the first memory space is applied by a host program according to the type of an applet, namely, memory relation tables corresponding to different applets are established in the host program;
and the rendering unit is used for adjusting the first memory space based on the first type to obtain a first adjusted memory space if the data object type is the first type, adjusting the first memory space based on the second type to obtain a second adjusted memory space if the data object type is the second type, loading the content of the data object to the first adjusted memory space or the second adjusted memory space according to the data object type, and rendering the content from the first adjusted memory space or the second adjusted memory space to a view layer of a display interface for a user to view based on the first pointer.
7. The apparatus according to claim 6, wherein in the obtaining unit, based on a data object operated by a user in an electronic device, the applet obtains an identification of the data object, and based on the identification, the connection server queries a data object type of the data object.
8. The apparatus according to claim 7, wherein in the rendering unit: if the first type is a video, the applet requests the server to obtain basic information of the video, obtains a representative frame of the video based on the basic information of the video, loads the representative frame of the video as first content into a first adjustment memory space, and renders the first content from the first adjustment memory space to a view layer of a display interface based on the first pointer to form a video interface for a user to view.
9. The apparatus according to claim 8, wherein in the rendering unit: and if the second type is a topic, the applet requests the server to obtain basic information of the topic, whether the topic comprises a plurality of topic videos is judged based on the basic information of the topic, if so, an array Arr [ n ] is created to store the URL of each topic video, the corresponding topic of each topic video is obtained based on each URL, the content representing the topic is obtained from the basic information of the topic, the content of the topic and the topic of each topic video are loaded into a second adjustment memory space as second content, then the second content is rendered from the second adjustment memory space to a view layer of a display interface based on the first pointer to form a topic interface for a user to view, wherein n is the number of the topic videos.
10. A computer storage medium having a computer program stored thereon, the computer program on the computer storage medium, when executed by a processor, implementing the method of any one of claims 1-5.
CN202111358693.8A 2021-11-17 2021-11-17 Rendering method and device for reducing volume of small program package and storage medium Active CN113791988B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111358693.8A CN113791988B (en) 2021-11-17 2021-11-17 Rendering method and device for reducing volume of small program package and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111358693.8A CN113791988B (en) 2021-11-17 2021-11-17 Rendering method and device for reducing volume of small program package and storage medium

Publications (2)

Publication Number Publication Date
CN113791988A CN113791988A (en) 2021-12-14
CN113791988B true CN113791988B (en) 2022-02-18

Family

ID=78877358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111358693.8A Active CN113791988B (en) 2021-11-17 2021-11-17 Rendering method and device for reducing volume of small program package and storage medium

Country Status (1)

Country Link
CN (1) CN113791988B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109471671A (en) * 2017-09-06 2019-03-15 武汉斗鱼网络科技有限公司 A kind of program cold start-up method and system
CN109740085A (en) * 2019-01-10 2019-05-10 北京字节跳动网络技术有限公司 A kind of methods of exhibiting of content of pages, device, equipment and storage medium
CN109947504A (en) * 2019-03-29 2019-06-28 上海连尚网络科技有限公司 A kind of method and apparatus executing boarding program in host program
CN110888740A (en) * 2019-11-22 2020-03-17 腾讯科技(深圳)有限公司 Incremental memory determining method, device and equipment of small program and storage medium
US10699368B1 (en) * 2017-08-30 2020-06-30 Apple Inc. Memory allocation techniques for graphics shader
CN111475246A (en) * 2020-04-10 2020-07-31 腾讯科技(深圳)有限公司 Applet page display method, device, terminal and storage medium
CN112214329A (en) * 2020-11-04 2021-01-12 腾讯科技(深圳)有限公司 Memory management method, device, equipment and computer readable storage medium
CN112331235A (en) * 2021-01-04 2021-02-05 腾讯科技(深圳)有限公司 Multimedia content editing control method and device, electronic equipment and storage medium
CN112650692A (en) * 2019-10-12 2021-04-13 北京华为数字技术有限公司 Heap memory allocation method, device and storage medium
CN112861057A (en) * 2021-02-10 2021-05-28 北京百度网讯科技有限公司 Page rendering method, device and equipment based on small program and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8001336B2 (en) * 2007-03-02 2011-08-16 International Business Machines Corporation Deterministic memory management in a computing environment
US10162500B2 (en) * 2016-08-24 2018-12-25 Microsoft Technology Licensing, Llc Dynamically render large dataset in client application
CN110928737B (en) * 2018-09-19 2021-05-18 华为技术有限公司 Method and device for monitoring memory access behavior of sample process
CN109800020B (en) * 2019-02-02 2023-02-10 北京字节跳动网络技术有限公司 Automatic code adjusting method, device, equipment and medium for program development
CN110113407B (en) * 2019-04-30 2021-08-17 上海连尚网络科技有限公司 Applet state synchronization method, apparatus and computer storage medium
CN111061652B (en) * 2019-12-18 2021-12-31 中山大学 Nonvolatile memory management method and system based on MPI-IO middleware

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10699368B1 (en) * 2017-08-30 2020-06-30 Apple Inc. Memory allocation techniques for graphics shader
CN109471671A (en) * 2017-09-06 2019-03-15 武汉斗鱼网络科技有限公司 A kind of program cold start-up method and system
CN109740085A (en) * 2019-01-10 2019-05-10 北京字节跳动网络技术有限公司 A kind of methods of exhibiting of content of pages, device, equipment and storage medium
CN109947504A (en) * 2019-03-29 2019-06-28 上海连尚网络科技有限公司 A kind of method and apparatus executing boarding program in host program
CN112650692A (en) * 2019-10-12 2021-04-13 北京华为数字技术有限公司 Heap memory allocation method, device and storage medium
CN110888740A (en) * 2019-11-22 2020-03-17 腾讯科技(深圳)有限公司 Incremental memory determining method, device and equipment of small program and storage medium
CN111475246A (en) * 2020-04-10 2020-07-31 腾讯科技(深圳)有限公司 Applet page display method, device, terminal and storage medium
CN112214329A (en) * 2020-11-04 2021-01-12 腾讯科技(深圳)有限公司 Memory management method, device, equipment and computer readable storage medium
CN112331235A (en) * 2021-01-04 2021-02-05 腾讯科技(深圳)有限公司 Multimedia content editing control method and device, electronic equipment and storage medium
CN112861057A (en) * 2021-02-10 2021-05-28 北京百度网讯科技有限公司 Page rendering method, device and equipment based on small program and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Implementation of Elementary Chinese Language Learning Application in WeChat Mini Programs;Xijie Wang 等;《2019 IEEE 4th International Conference on Big Data Analytics (ICBDA)》;20190513;第394-398页 *
基于微信小程序的气象服务系统;陆卫荣 等;《电脑编程技巧与维护》;20190630;第74-77页 *

Also Published As

Publication number Publication date
CN113791988A (en) 2021-12-14

Similar Documents

Publication Publication Date Title
US9773069B2 (en) Pre-fetching of network page content in a browser application
US10474693B2 (en) Resolving conflicts within saved state data
US9940119B2 (en) Providing limited versions of applications
US9672022B2 (en) Applications including multiple experience modules
WO2017166447A1 (en) Method and device for loading kernel module
US11579902B2 (en) User interface rendering performance
US9367211B1 (en) Interface tab generation
US8516041B1 (en) Pre-fetching asynchronously requested content
EP2820541A1 (en) Persistent storage of profile data for script compilation
CN110209975B (en) Method, apparatus, device and storage medium for providing object
US20090132359A1 (en) Advertisement-Controlled Web Page Customization
CN109656670B (en) Page rendering method and device
CN113791988B (en) Rendering method and device for reducing volume of small program package and storage medium
CN111597102A (en) Page performance testing method, terminal and storage medium
CN110188297B (en) Resource information display method, computing device and computer storage medium
US9972109B2 (en) Implementing out of order access to reversal operations in images
CN109857966A (en) A kind of optimization method and browser of browser dynamically load web page resources
CN115186207A (en) Method and device for loading page resources and electronic equipment
CN109542531B (en) File layout adjustment method and device
WO2016183795A1 (en) Method, apparatus for loading a resource in a web page on a device
CN113297515A (en) Resource information processing method and device, computer storage medium and electronic equipment
CN112434233A (en) Method and equipment for accelerating first screen rendering of secondary page
US9917788B2 (en) Speculative generation of network page components
US11375445B2 (en) Technologies for detecting and analyzing user interaction tests for network-accessible content
CN111641867B (en) Video output method, device, electronic equipment and storage 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
GR01 Patent grant
GR01 Patent grant