Small program loading method and device, storage medium and electronic equipment

By obtaining a unique identifier when the mini-program loads to determine the first load and retrieve snapshot files and resources, the white screen issue on the first load of the mini-program is resolved, improving the user experience and optimizing storage resource usage.

CN120670048APending Publication Date: 2025-09-19ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510709293.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

In existing technologies, mini-programs experience a blank screen waiting time when they are first loaded, which affects the user experience, and cached mini-program resources occupy terminal storage space.

Method used

By obtaining the unique identifier of the mini-program, it is determined whether it is the first time it is loaded. If it is the first time it is loaded, a snapshot file and mini-program resources are obtained from the server, the first screen image is displayed, and the mini-program interface is replaced after the resources are loaded.

Benefits of technology

It reduces the white screen waiting time during the loading process of mini programs, improves the user experience, and optimizes the use of terminal storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670048A_ABST
    Figure CN120670048A_ABST
Patent Text Reader

Abstract

In the applet loading method provided by the specification, the applet platform responds to a loading request of the applet, determines a unique identifier of the applet, determines whether the applet is loaded in the terminal for the first time or not according to the unique identifier, and loads the applet in the terminal for the first time according to the unique identifier when the applet is loaded in the terminal for the first time. And respectively obtaining a preset snapshot file and applet resources of the applet from the server. And then, according to the snapshot file, displaying a first screen picture of the applet to the user. And when the applet resource loading is completed, running the applet and replacing the first screen picture with an interface of the applet. When the applet resource of the applet is loaded, the snapshot file which is used for rendering the first screen of the applet and is far smaller than the applet resource is loaded, so that the applet platform displays the first screen of the applet to a user at a higher speed, the white screen waiting time of the applet is shortened, and the use experience of the user on the applet is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computers, and in particular to a method, device, storage medium, and electronic device for loading a small program. Background Art

[0002] With the development of computer technology, mini programs have become widely used by developers and users due to their low development costs and convenient user access. However, when users open a mini program, they currently experience a white screen wait time due to the loading and rendering processes, impacting the user experience.

[0003] In the prior art, to improve the user experience, the client providing the mini-program service on the user's terminal caches the mini-program's code file after the mini-program is loaded. When the user opens the mini-program again, the code file corresponding to the mini-program in the terminal cache is called and displayed to the user, allowing the mini-program to be opened quickly even in poor network conditions.

[0004] However, when a user opens a mini-program for the first time, there will still be a white screen waiting time because the mini-program code is not cached in the terminal. Based on this, this specification provides a mini-program loading method, device, storage medium and electronic device. Summary of the Invention

[0005] This specification provides a method, device, storage medium and electronic device for loading a small program to partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions:

[0007] A method for loading a mini-program, the method being applied to a mini-program platform in a terminal, comprising:

[0008] In response to a request to load the mini-program, determining a unique identifier of the mini-program;

[0009] Determining, based on the unique identifier, whether the mini-program is loaded in the terminal for the first time;

[0010] When the mini-program is loaded in the terminal for the first time, obtaining a preset snapshot file and mini-program resources of the mini-program from the server according to the unique identifier;

[0011] Displaying the home screen image of the mini program to the user according to the snapshot file;

[0012] When the mini program resources are loaded, the mini program is run and the home screen image is replaced with the mini program interface.

[0013] Optionally, determining whether the mini-program is loaded in the terminal for the first time based on the unique identifier specifically includes:

[0014] Retrieving the unique identifier in the terminal;

[0015] When the unique identifier is retrieved in the terminal, it is determined that it is not the first time that the mini program is opened in the terminal;

[0016] When the unique identifier is not retrieved in the terminal, it is determined that the mini program is opened for the first time in the terminal.

[0017] Optionally, obtaining a preset snapshot file of the mini-program from a server according to the unique identifier specifically includes:

[0018] Determining the device model of the terminal;

[0019] Send a query request carrying the device model and the unique identifier to the server, and obtain a snapshot file of the mini-program corresponding to the device model returned by the server.

[0020] Optionally, the snapshot file is a file in Hypertext Markup Language format;

[0021] Displaying the home screen image of the mini program to the user according to the snapshot file specifically includes:

[0022] The snapshot file is rendered through the web page container to obtain the home screen interface of the mini program and display it.

[0023] Optionally, the snapshot file of the mini-program is preset using the following method, wherein:

[0024] Receive mini-program resources sent by the development side;

[0025] The mini-program resources are sent to a test device through an automated testing tool to run the mini-program and obtain a snapshot file of the mini-program.

[0026] Optionally, the applet resource is sent to a test device for execution through an automated testing tool to obtain a snapshot file of the applet.

[0027] Determine each device model for which the snapshot file needs to be generated, and screen parameters corresponding to each device model;

[0028] For each device model, the applet is run on the test device using an automated testing tool according to the screen parameters corresponding to the device model, and a snapshot file of the applet corresponding to the device model is obtained and stored.

[0029] Optionally, obtaining a snapshot file of the mini-program specifically includes:

[0030] Running the mini program on the test device to determine resources included in the first screen displayed by the mini program;

[0031] Determining whether the capacity of the resource is greater than a threshold;

[0032] If so, a snapshot file is generated in the format of an image;

[0033] If not, a snapshot file is generated in the hypertext markup language format.

[0034] This specification provides a device for loading a small program, which is applied to a user terminal and includes:

[0035] A response module, configured to determine a unique identifier of the mini-program in response to a loading request of the mini-program;

[0036] a determination module, configured to determine, based on the unique identifier, whether the mini-program is loaded in the terminal for the first time;

[0037] A loading module is used to obtain the preset snapshot file and mini-program resources of the mini-program from the server according to the unique identifier when the mini-program is loaded for the first time in the terminal; based on the snapshot file, the home screen image of the mini-program is displayed to the user; when the mini-program resources are loaded, the mini-program is run and the home screen image is replaced with the interface of the mini-program.

[0038] This specification provides a computer program product, including a computer program, which implements the above-mentioned loading method when executed by a processor.

[0039] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned loading method is implemented.

[0040] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0041] In a mini-program loading method provided in this specification, a mini-program platform is applied to a terminal. The mini-program platform responds to the mini-program loading request and determines the unique identifier of the mini-program. Based on the unique identifier, it is determined whether it is the first time that the mini-program is loaded in the terminal. When it is the first time that the mini-program is loaded in the terminal, the preset snapshot file and mini-program resources of the mini-program are obtained from the server respectively according to the unique identifier. Then, based on the snapshot file, the home screen image of the mini-program is displayed to the user. When the loading of the mini-program resources is completed, the mini-program is run and the home screen image is replaced with the interface of the mini-program.

[0042] Through the above method, while loading the mini program resources of the mini program, a snapshot file that is much smaller than the mini program resources and is used to render the mini program's first screen is loaded, so that the mini program platform can display the mini program's first screen to the user at a faster speed, reduce the white screen waiting time of the mini program, and improve the user's experience of the mini program. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The exemplary embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation of this specification. In the drawings:

[0044] Figure 1 This is a schematic diagram of the applet opening process provided in this manual;

[0045] Figure 2 A schematic diagram of a small program loading process provided in this manual;

[0046] Figure 3 A schematic diagram of a process for generating a snapshot file provided in this manual;

[0047] Figure 4 A schematic diagram of a small program loading device provided in this manual;

[0048] Figure 5 The corresponding Figure 2 Schematic diagram of electronic equipment. DETAILED DESCRIPTION

[0049] To make the purpose, technical solutions, and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this invention.

[0050] With the development of computer technology, mini programs have been widely used by developers and users due to their advantages such as low development cost and convenient access to users. Figure 1 As shown, Figure 1This is a schematic diagram of the mini-program opening process provided in this manual. When currently published, mini-programs usually package resources such as code and images into a compressed file, namely the mini-program resources. Then, when the client in the terminal opens the mini-program, it will first initialize a container and then load the mini-program resources corresponding to the mini-program. Then, when rendering the mini-program in the container, for security and control considerations, the code logic will be executed in an independent thread, and then the page data to be rendered will be passed to the rendering process through the data channel for rendering.

[0051] Since the above processes of loading the mini program resources and rendering the mini program in an independent thread based on the mini program resources require a certain amount of time, the mini program will have a white screen during this period, affecting the user experience.

[0052] At present, in order to optimize the user's mini-program opening experience, the mini-program resources of the mini-program will be stored in the user terminal after the mini-program is opened for the first time, so that when the user subsequently opens the mini-program again through the terminal, the mini-program resources of the mini-program can be directly obtained from the terminal, reducing the white screen waiting time caused by obtaining the mini-program resources from the server. However, although this method can optimize the user's mini-program usage experience at a certain time, the user will still have a long waiting time when opening the mini-program for the first time, which affects the user experience. In addition, when the number of mini-programs opened by the user is large, it may also cause a large number of mini-program resources to be stored in the terminal, occupying more storage resources, affecting the user's experience of providing the mini-program platform. Based on this, this specification discloses a mini-program opening method.

[0053] It should be noted that the mini-program loading method provided in this specification is applied to the mini-program platform in the terminal. The mini-program platform refers to the application ecosystem that provides developers with the ability to create, publish, and manage mini-programs, as well as the client that provides mini-program services to users, allowing users to directly access and use mini-programs through the mini-program platform. In one or more embodiments of this specification, the mini-program platform generally refers to the client installed in the terminal that provides mini-program services. In addition, the specific type of the terminal is not limited. It can be a mobile terminal, such as a mobile phone, tablet, etc., or a computer, etc., and this specification does not impose any restrictions on this.

[0054] The technical solutions provided by the embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0055] Figure 2 This is a flowchart of a method for loading a small program provided in this manual, which includes the following steps:

[0056] S200: In response to a loading request of a mini-program, determining a unique identifier of the mini-program.

[0057] When a client receives a loading request for a mini-program, in order to obtain the mini-program resources required to run the mini-program, the client may first obtain the mini-program unique identifier, so that the client can obtain the mini-program resources of the mini-program based on the unique identifier.

[0058] It should be noted that in one or more embodiments of this specification, there is no restriction on how the client obtains the loading request of the mini program. The loading request of the mini program may be determined based on the user's click operation on the client, or it may be determined in response to the near field communication signal (NFC) received by the terminal. The loading request of the mini program may also be determined according to other methods. This specification does not impose any restrictions on this and it can be set according to actual needs.

[0059] In addition, in one or more embodiments of this specification, the unique identifier of the mini program generally refers to the unique identity identifier assigned to the mini program by the mini program platform when the developer publishes the mini program on the mini program platform to distinguish the mini program from other mini programs. Of course, in one or more embodiments of this application, there is no restriction on the specific method used by the platform to generate the unique identifier, and it can be set according to actual needs.

[0060] S202: Determine, based on the unique identifier, whether the mini-program is loaded in the terminal for the first time.

[0061] Since the terminal will store at least part of the rendering resources of a mini-program after loading it, the client can first determine whether it is the first time to open the mini-program in the terminal based on the unique identifier of the mini-program before loading the rendering resources of the mini-program, so as to reduce the loading amount of the rendering resources of the mini-program, thereby further improving the loading efficiency of the mini-program.

[0062] Specifically, the client can search for the unique identifier in the terminal. When the unique identifier is stored in the terminal, it is determined that this is not the first time the terminal opens the mini program. When the unique identifier is not stored in the terminal, it is determined that this is the first time the terminal opens the mini program.

[0063] It should be noted that if the user has opened the mini program but has cleared the cache data of the mini program platform in the terminal, resulting in the terminal not storing the unique identifier and rendering resources corresponding to the mini program, this situation can also be regarded as the first time the terminal has opened the mini program.

[0064] In addition, the above method for determining whether a mini program is being opened for the first time on a terminal is only one embodiment provided in this specification. The mini program platform can also determine this using other methods. For example, based on the unique identifier, the timestamp corresponding to the unique identifier is determined in the terminal. If the unique identifier is not found or the interval between the timestamp corresponding to the unique identifier and the current time exceeds a threshold, the mini program is determined to be the first mini program to be opened on the terminal. There are many optional methods, and this specification does not limit them. You can set them according to your actual needs.

[0065] S204: When the mini-program is loaded in the terminal for the first time, a preset snapshot file and mini-program resources of the mini-program are obtained from a server according to the unique identifier.

[0066] S206: Displaying the home screen image of the mini program to the user according to the snapshot file.

[0067] If the mini program is loaded for the first time in the terminal, in order to reduce the white screen time caused by loading and rendering the mini program, the mini program platform can obtain the preset mini program snapshot file and the mini program resources of the mini program from the server according to the unique identifier. Since the snapshot file is a pre-set file used to display the mini program first screen picture to the user, and the snapshot file is much smaller than the mini program resources, although the snapshot file and the mini program resources are loaded at the same time, the snapshot file will load faster, so that the first screen picture of the mini program can be displayed to the user faster, reducing the display time of the white screen and the waiting time of the user. However, the first screen picture cannot realize the full function of the mini program, so the snapshot file of the mini program and the mini program resources of the mini program can be recorded separately at the same time. When the snapshot file is loaded, the mini program is loaded and rendered while the first screen picture of the mini program is displayed to the user.

[0068] It should be noted that in one or more embodiments of this specification, there is no restriction on the specific method used to determine the snapshot file. The snapshot file can be a file generated by the developer based on the home screen of the mini program before the mini program is released, and then the generated snapshot file is released together with the mini program resources of the mini program. The snapshot file can also be a snapshot file generated by the mini program platform based on the mini program resources after the developer releases the mini program to the mini program platform. Of course, other methods can also be used to determine it. This specification does not limit this and can be set according to actual needs.

[0069] S208: When the mini-program resources are loaded, the mini-program is run and the home screen image is replaced with the mini-program interface.

[0070] Because the homepage image of a mini-program cannot realize most of the mini-program's functions, the mini-program platform runs the mini-program and replaces the homepage image with the mini-program interface after the mini-program resources are loaded. This allows users to experience the full functionality of the mini-program. The platform also stores a unique representation of the mini-program in the terminal, indicating that the mini-program has been loaded in the terminal.

[0071] based on Figure 2 In the loading method, the mini-program platform responds to a mini-program loading request by determining the mini-program's unique identifier. Based on the unique identifier, it determines whether this is the first time the mini-program is loaded in the terminal. If this is the first time the mini-program is loaded in the terminal, the platform retrieves a preset snapshot file and mini-program resources from the server based on the unique identifier. Then, based on the snapshot file, the mini-program's home screen image is displayed to the user. When the mini-program resources are loaded, the mini-program is run and the home screen image is replaced with the mini-program's interface.

[0072] Through the above method, while loading the mini program resources of the mini program, a snapshot file that is much smaller than the mini program resources and is used to render the mini program's first screen is loaded, so that the mini program platform can display the mini program's first screen to the user at a faster speed, reduce the white screen waiting time of the mini program, and improve the user's experience of the mini program.

[0073] Furthermore, in step S204, when the mini program platform generates a corresponding snapshot file based on the mini program resources, after receiving the mini program resources sent by the development side, it can send the mini program resources to the test equipment for execution through the automated testing tool, thereby generating a snapshot file of the mini program.

[0074] In addition, since general mini-programs have the function of adjusting the interface structure according to the device model of the terminal to adapt to the terminal display screen, but the generated snapshot files often do not have this adaptive function, therefore, in order to optimize the user experience when displaying the first screen picture to the user, the mini-program platform can also generate corresponding snapshot files according to each device model when setting the snapshot file.

[0075] Specifically, determine the device models for which snapshot files need to be generated, as well as the screen parameters corresponding to each device model. For each device model, use an automated testing tool to run the mini program on the test device according to the screen parameters corresponding to the device model, obtain and store the snapshot file of the mini program corresponding to the device model.

[0076] Therefore, when obtaining the snapshot file of the preset mini program from the server based on the unique identifier in step S204, the mini program platform can also determine the device model of the terminal, and then send a query request carrying the device model and the unique identifier to the server to obtain the snapshot file of the device model corresponding to the mini program returned by the server.

[0077] In addition, when generating a snapshot file of the mini program, in order to further reduce the size of the snapshot file and further reduce the white screen time of the mini program, the mini program platform can also determine the resources contained in the first screen displayed by the mini program when the test device runs the mini program, and then determine whether the capacity of the resources is greater than the threshold. If so, a snapshot file is generated in the format of a picture; if not, a snapshot file is generated in the format of a hypertext markup language.

[0078] It should be noted that in one or more embodiments of this specification, in order to further save resources, the mini program platform may not need to count the full amount of resources on the mini program's home screen when determining the format for generating a snapshot file, and may determine the snapshot file format only for the amount of specific resources. For example, specific resources may be larger resources such as pictures and videos. That is, if the mini program's home screen has a relatively large number of picture resources, when generating a snapshot file, the snapshot file can be generated by taking a screenshot. If the mini program's home page structure is relatively simple and has fewer picture resources, a snapshot file can also be generated in Hypertext Markup Language format. Of course, other methods can also be used to determine the snapshot file, and this specification does not limit this, and it can be set according to actual needs.

[0079] Furthermore, since snapshot files in the Hypertext Markup Language format cannot be displayed directly, if the snapshot file is in the Hypertext Markup Language format, the mini program platform can render the snapshot file through the web page container when displaying the first screen to the user, obtain the first screen interface of the mini program, and display it.

[0080] In addition, after the client completes loading the loading resources of the mini program, it can also store the rendering resources and unique identifier of the mini program to the terminal, so that when the user subsequently opens the mini program again, the rendering resources corresponding to the unique identifier in the terminal can be called and displayed according to the unique identifier, and displayed to the user.

[0081] In order to further reduce the occupation of terminal storage resources, the client may also only store the snapshot file of the mini program without storing the rendering resources of the mini program. When the user opens the mini program again, the snapshot file corresponding to the unique identifier in the terminal is called and displayed according to the unique identifier, and the first screen of the mini program is displayed to the user, and the rendering resources of the mini program are loaded at the same time.

[0082] In addition, if the mini program has been loaded in the terminal, the terminal also stores the unique identifier of the mini program, but the terminal does not store the snapshot file and / or mini program resources of the mini program, or the mini program snapshot file and / or mini program resources stored in the terminal are damaged, the above-mentioned loading method can also be used to load the snapshot file and mini program resources of the mini program from the server at the same time.

[0083] like Figure 3 As shown, Figure 3 This is a schematic diagram of a process for generating a snapshot file provided in this manual, where:

[0084] S300: Determine each device model for which the snapshot file needs to be generated, and screen parameters corresponding to each device model.

[0085] S302: For each device model, run the mini program on the test device using an automated testing tool according to the screen parameters corresponding to the device model, and determine the resources included in the first screen displayed by the mini program.

[0086] S304: Determine whether the capacity of the resource is greater than a threshold; if so, execute step S306; if not, execute step S308.

[0087] S306: Generate a snapshot file in the format of an image.

[0088] S308: Generate a snapshot file in a hypertext markup language format.

[0089] S310: Determine and store the snapshot file of the mini-program corresponding to each device model.

[0090] Based on the same idea as the applet loading method provided in one or more embodiments of this specification, this specification also provides a corresponding applet loading device, such as Figure 4 shown.

[0091] Figure 4 A schematic diagram of a small program loading device provided in this manual, specifically including:

[0092] A response module 400 is configured to determine a unique identifier of the mini-program in response to a request to load the mini-program;

[0093] Determination module 401, configured to determine whether the mini-program is loaded in the terminal for the first time based on the unique identifier;

[0094] The loading module 402 is used to obtain the preset snapshot file and mini-program resources of the mini-program from the server according to the unique identifier when the mini-program is loaded for the first time in the terminal; according to the snapshot file, the first screen picture of the mini-program is displayed to the user; when the mini-program resources are loaded, the mini-program is run and the first screen picture is replaced with the interface of the mini-program.

[0095] Optionally, the determination module 401 is used to retrieve the unique identifier in the terminal; when the unique identifier is retrieved in the terminal, it is determined that it is not the first time that the mini program is opened in the terminal; when the unique identifier is not retrieved in the terminal, it is determined that it is the first time that the mini program is opened in the terminal.

[0096] Optionally, the loading module 402 is configured to determine the device model of the terminal; send a query request carrying the device model and the unique identifier to the server, and obtain a snapshot file of the mini-program corresponding to the device model returned by the server.

[0097] Optionally, the snapshot file is a file in the Hypertext Markup Language format; the loading module 402 is used to render the snapshot file through a web page container, obtain the home screen interface of the mini program, and display it.

[0098] Optionally, the apparatus further includes a generation module 403 for receiving applet resources sent by the development side; sending the applet resources to a test device for execution through an automated testing tool to obtain a snapshot file of the applet.

[0099] Optionally, the generation module 403 is used to determine the device models for which the snapshot file needs to be generated, and the screen parameters corresponding to the device models; for each device model, through an automated testing tool, according to the screen parameters corresponding to the device model, the applet is run on the test device, and the snapshot file of the applet corresponding to the device model is obtained and stored.

[0100] Optionally, the generation module 403 is used to run the mini program on the test device to determine the resources contained in the first screen displayed by the mini program; determine whether the capacity of the resources is greater than a threshold; if so, generate a snapshot file in the format of a picture; if not, generate a snapshot file in the format of a hypertext markup language.

[0101] This specification also provides a computer program product, which, when executed by a processor, implements the above Figure 1 Provided applet loading method.

[0102] This manual also provides Figure 5 The schematic structure diagram of the electronic device shown in FIG. Figure 5 As mentioned above, at the hardware level, the electronic driving device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0103] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD through their own programming, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages ​​and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.

[0104] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.

[0105] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0106] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0107] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0108] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0109] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0111] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0112] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0113] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0114] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0115] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Thus, this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0116] This specification may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media, including storage devices.

[0117] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0118] The foregoing is merely an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations may be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A method for loading a mini-program, the method being applied to a mini-program platform in a terminal, comprising: In response to a request to load the mini-program, determining a unique identifier of the mini-program; Determining, based on the unique identifier, whether the mini-program is loaded in the terminal for the first time; When the mini-program is loaded in the terminal for the first time, obtaining a preset snapshot file and mini-program resources of the mini-program from a server according to the unique identifier; Displaying the home screen image of the mini program to the user according to the snapshot file; When the mini program resources are loaded, the mini program is run and the home screen image is replaced with the mini program interface.

2. The method of claim 1, wherein determining whether the mini-program is loaded in the terminal for the first time based on the unique identifier comprises: Retrieving the unique identifier in the terminal; When the unique identifier is retrieved in the terminal, it is determined that it is not the first time that the mini program is opened in the terminal; When the unique identifier is not retrieved in the terminal, it is determined that the mini program is opened for the first time in the terminal.

3. The method of claim 1, wherein obtaining a preset snapshot file of the mini-program from a server according to the unique identifier comprises: Determining the device model of the terminal; Send a query request carrying the device model and the unique identifier to the server, and obtain a snapshot file of the mini-program corresponding to the device model returned by the server.

4. The method according to claim 1, wherein the snapshot file is a file in the Hypertext Markup Language format; Displaying the home screen image of the mini program to the user according to the snapshot file specifically includes: The snapshot file is rendered through the web page container to obtain the home screen interface of the mini program and display it.

5. The method according to claim 1, wherein the snapshot file of the mini-program is preset by the following method: Receive mini-program resources sent by the development side; The mini-program resources are sent to a test device through an automated testing tool to run the mini-program and obtain a snapshot file of the mini-program.

6. The method according to claim 5, wherein the mini-program resource is sent to a test device for execution by an automated testing tool to obtain a snapshot file of the mini-program, specifically comprising: Determine each device model for which the snapshot file needs to be generated, and screen parameters corresponding to each device model; For each device model, the applet is run on the test device using an automated testing tool according to the screen parameters corresponding to the device model, and a snapshot file of the applet corresponding to the device model is obtained and stored.

7. The method of claim 5, wherein obtaining a snapshot file of the mini-program comprises: Running the mini program on the test device to determine resources included in the first screen displayed by the mini program; Determining whether the capacity of the resource is greater than a threshold; If so, a snapshot file is generated in the format of an image; If not, a snapshot file is generated in the hypertext markup language format.

8. A mini-program loading device, the device being applied to a mini-program platform in a terminal, comprising: A response module, configured to determine a unique identifier of the mini-program in response to a loading request of the mini-program; a determination module, configured to determine, based on the unique identifier, whether the mini-program is loaded in the terminal for the first time; A loading module is used to obtain the preset snapshot file and mini-program resources of the mini-program from the server according to the unique identifier when the mini-program is loaded for the first time in the terminal; based on the snapshot file, the home screen image of the mini-program is displayed to the user; when the mini-program resources are loaded, the mini-program is run and the home screen image is replaced with the interface of the mini-program.

9. A computer program product, wherein when the computer program product is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.