CN113377378A - Processing method, device and equipment for small program and storage medium - Google Patents

Processing method, device and equipment for small program and storage medium Download PDF

Info

Publication number
CN113377378A
CN113377378A CN202110754240.0A CN202110754240A CN113377378A CN 113377378 A CN113377378 A CN 113377378A CN 202110754240 A CN202110754240 A CN 202110754240A CN 113377378 A CN113377378 A CN 113377378A
Authority
CN
China
Prior art keywords
code
codes
applet
information
hot spot
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.)
Pending
Application number
CN202110754240.0A
Other languages
Chinese (zh)
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110754240.0A priority Critical patent/CN113377378A/en
Publication of CN113377378A publication Critical patent/CN113377378A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Abstract

The disclosure discloses a processing method for an applet, relates to the technical field of computers, and particularly relates to the field of intelligent applets. The specific implementation scheme is as follows: acquiring code information pushed by a server aiming at a target applet, wherein the target applet comprises: a framework code and a service code; compiling the codes indicated by the code information into corresponding machine codes in advance; wherein the code indicated by the code information includes at least one of the following: key codes in the frame codes and hot spot codes in the service codes. The present disclosure also provides a processing apparatus for an applet, an electronic device, a non-transitory computer-readable storage medium having stored thereon computer instructions, and a computer program product.

Description

Processing method, device and equipment for small program and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of smart applet technology. In particular to a processing method, a device, equipment and a storage medium for small programs.
Background
An applet is an application that can be used without download installation. An applet can run in an application or operating system, and the application needs to have a corresponding infrastructure to provide the necessary environment for the applet to run. The applet may have multiple functions and may provide multiple services to the user.
Disclosure of Invention
The present disclosure provides a processing method, apparatus, device, storage medium, and computer program product for an applet.
According to an aspect of the present disclosure, there is provided a processing method for an applet, including: acquiring code information pushed by a server aiming at a target applet, wherein the target applet comprises: a framework code and a service code; compiling the codes indicated by the code information into corresponding machine codes in advance; wherein the code indicated by the code information includes at least one of the following: key codes in the frame codes and hot spot codes in the service codes.
According to another aspect of the present disclosure, there is provided a processing method for an applet, including: acquiring log information generated when a sample user uses a target applet; determining a hotspot contained by the target applet based on the log information, wherein the hotspot comprises: a hotspot function and/or hotspot page; and using the applet code associated with the hot spot as a hot spot code in the service code indicated by the code information; generating code information for the target applet based on the hotspot code; and pushing the code information to a client so that the client compiles the code indicated by the code information into a corresponding machine code in advance.
According to another aspect of the present disclosure, there is provided a processing apparatus for an applet, including: a first obtaining module, configured to obtain code information pushed by a server for a target applet, where the target applet includes: a framework code and a service code; the compiling module is used for compiling the codes indicated by the code information into corresponding machine codes in advance; wherein the code indicated by the code information includes at least one of the following: key codes in the frame codes and hot spot codes in the service codes.
According to another aspect of the present disclosure, there is provided a processing apparatus for an applet, including: the second acquisition module is used for acquiring log information generated when the sample user uses the target applet; a second determining module, configured to determine, based on the log information, a hotspot included in the target applet, where the hotspot includes: a hotspot function and/or hotspot page; a third determining module, configured to use an applet code associated with the hot spot as a hot spot code in the service code indicated by the code information; a first generation module, configured to generate code information for the target applet based on the hotspot code; and the first pushing module is used for pushing the code information to a client so that the client can compile the code indicated by the code information into a corresponding machine code in advance.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided by the embodiment of the disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform a method provided according to an embodiment of the present disclosure.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements a method provided according to an embodiment of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 illustrates a system architecture of a processing method and apparatus for an applet suitable for embodiments of the present disclosure;
FIG. 2 is a flow diagram of a processing method for an applet, according to one embodiment of the present disclosure;
FIG. 3 is a flow diagram of a processing method for an applet, according to another embodiment of the disclosure;
FIG. 4 is a schematic diagram of a processing method for an applet, according to one embodiment of the present disclosure;
FIG. 5 is a block diagram of a processing device for an applet according to one embodiment of the present disclosure;
FIG. 6 is a block diagram of a processing device for an applet according to another embodiment of the present disclosure;
FIG. 7 shows a schematic block diagram of an electronic device that may be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
With the rapid development of applets, more and more services are carried in an applet manner. Users can use a large number of applets each day. The starting speed and the use fluency of the small program are improved, so that the user experience can be improved, and the good feeling of the user to the small program is improved.
For example, a JIT (Just In Time) strategy may be employed to increase the startup speed and fluency of use of the applet. In the process that the user uses the applet, the behavior data of the user can be recorded, for example, the frequency of using each function in the applet by the user is recorded, and then the code corresponding to the function with high use frequency is compiled into the machine code and stored in the memory. Then, when the user uses the applet again, if the code corresponding to the used function is compiled into the machine code, the fluency of the function can be greatly improved.
However, when a user uses a applet for the first time, it is not possible to obtain which function the user uses frequently, so that the user feels that each function is not smooth when using the applet for the first time.
The present disclosure will be described in detail below with reference to the drawings and specific embodiments.
A system architecture of a processing method and apparatus for an applet suitable for the embodiments of the present disclosure is introduced as follows.
Fig. 1 illustrates a system architecture of a processing method and apparatus for an applet suitable for an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be used in other environments or scenarios.
As shown in fig. 1, the system architecture 100 may include a plurality of clients (e.g., client 101, client 102, client 103), a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the above clients and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
A user may use the above clients to interact with the server 105 over the network 104 to receive or send messages or the like. The above clients may be a variety of electronic devices including, but not limited to, smart phones, tablet computers, laptop computers, and the like. The application running on the above client may provide an environment in which the applet runs.
The processing method for the applet provided by the embodiment of the disclosure can be generally executed by the server 105. Accordingly, the processing device for the applet provided by the embodiment of the present disclosure may be generally disposed in the server 105. The processing method for the applet provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the above plurality of clients and/or the server 105. Accordingly, the processing device for the applet provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the above plurality of clients and/or the server 105.
It should be understood that the number of clients and servers in fig. 1 is merely illustrative. There may be any number of clients and servers, as desired for implementation.
According to an embodiment of the present disclosure, there is provided a processing method for an applet.
FIG. 2 is a flow diagram of a processing method for an applet, according to one embodiment of the present disclosure.
As shown in fig. 2, the processing method for an applet may include operations S210 to S220. The method can be applied to a client.
In operation S210, code information pushed by a server for a target applet is obtained, where the target applet includes: a framework code and a service code.
According to the embodiment of the disclosure, the client can obtain the code information of the target applet from the information push server or the applet package download platform server.
For example, when a user searches for a target applet on a client or an application program running on the client, the code information of the target applet is included in the information returned from the information push server or the applet package download platform server.
In operation S220, the code indicated by the code information is compiled into a corresponding machine code in advance. Wherein the code indicated by the code information includes at least one of the following: key codes in the frame codes and hot spot codes in the service codes.
According to the embodiment of the disclosure, a virtual machine running on a client may compile the code indicated by the code information into machine code.
For example, the virtual machine on the client may compile the code indicated by the code information into the corresponding machine code in advance based on the JIT policy, and store the compiled machine code in the memory.
According to an embodiment of the present disclosure, the code indicated by the code information may include a key code in the framework code.
For example, a client or an application running on the client may provide a base framework for a target applet, and key code in the framework code may include some parameter information based on the base framework. Pre-compiling the key code in the framework code may increase the boot speed of the target applet.
For example, the key code of the framework code may be specified by the designer of the target applet, may be empirically specified by one skilled in the art, or may be generated in a certain manner and periodically updated.
According to the embodiment of the present disclosure, the code indicated by the code information may include a hot spot code in the service code.
For example, hot spot codes in the service codes may be generated in a certain manner and periodically updated, stored in the server, and may be acquired by the client. The hot spot codes and the key codes are compiled in advance, so that the use fluency of the target small program can be improved, and the use fluency of partial functions in the target small program can be at least improved. In one example, a user may use a corresponding function by clicking on a business module in an applet.
According to the embodiment of the disclosure, the hot spot code is acquired from the server, and the client can compile the hot spot code into the machine code in advance. In addition, the present disclosure may also pre-compile key code in the applet framework into machine code. Thus, the present disclosure may enable a user to quickly start an applet or smoothly use an applet for the first use of a target applet.
Those skilled in the art can understand that through the embodiment of the disclosure, not only can the user use the target applet for the first time to quickly start the applet or smoothly use the applet, but also the user can use the target applet again and still quickly start the applet or smoothly use the applet. In one example, the user's client may not have the capability of acquiring the user behavior data, and the user's client may not be able to improve the start-up speed or the smoothness of the applet by the JIT policy when the applet is started again, so that the user can still quickly start the applet or smoothly use the applet by using the target applet again through the above operations 210 to 220. In other examples, a user's client may have the ability and authority to obtain user behavior data.
In some embodiments, pre-compiling the code indicated by the code information into a corresponding machine code includes: and compiling the codes indicated by the code information into corresponding machine codes in a preloading stage before the target applet is started.
In the embodiment of the disclosure, the key code of the framework code and the hot spot code of the business code can be compiled into the machine code in the preloading period.
For example, in response to a user searching for applet a, the client compiles the key code of the framework code and the hot spot code of the business code into machine code before the user attempts to click on the icon of applet a to launch the applet. When a user clicks the icon of the applet A to try to start the applet, the applet can be started quickly, and meanwhile, when the user uses the hot spot code corresponding function, the response can be quickly carried out, so that the use smoothness of the applet is improved. In one example, the framework code of applet a is simpler or less functional, and critical code or hot spot code can be compiled quickly.
In some embodiments, pre-compiling the code indicated by the code information into a corresponding machine code includes at least one of the following operations.
And compiling the key codes in the frame codes indicated by the code information into corresponding machine codes in a preloading stage before the target applet is started.
And compiling the hot spot codes in the service codes indicated by the code information into corresponding machine codes after the target applet is started.
According to an embodiment of the disclosure, in the preloading stage, the key code of the framework code may be compiled into the corresponding machine code.
For example, the code information may include a key code of the frame code, or may include other information. The client compiles the key code of the frame code into machine code before the user clicks the icon of the applet B in an attempt to launch the applet, in response to the user searching for the applet B. The applet can be started quickly when the user clicks on the icon of applet B in an attempt to start the applet. In one example, the applet B has more functions or the framework code is more complex, and the key code and the hot spot code may not be compiled at the preloading stage at the same time.
According to the embodiment of the disclosure, after the target applet is started, the hot spot code of the service code can be compiled into the corresponding machine code.
For example, the code information may include a hot spot code of the service code, or may include other information. And the client responds to the fact that the user clicks the icon of the small program C, starts the small program C, and compiles the hot spot codes in the service codes into machine codes after the small program C is started. When the user uses the hot spot code corresponding function, the quick response can be realized, and the use fluency of the small program is improved. In one example, the hot spot code of the applet C is complex, and it takes a lot of time to compile into the corresponding machine code before starting, which affects the starting speed of the applet C.
According to the embodiment of the disclosure, in the preloading stage, the key codes of the framework codes can be compiled into corresponding machine codes; after the target applet is started, the hot spot code of the service code can be compiled into a corresponding machine code.
For example, the code information may include a key code of the framework code and a hot spot code of the service code. The client side responds to the small program D searched by the user, and before the user clicks an icon of the small program D to try to start the small program, key codes of the frame codes are compiled into machine codes; and then responding to the fact that the user clicks the icon of the small program D, starting the small program D, and compiling the hot spot codes in the service codes into machine codes after the small program D is started. In one example, the key code or hot spot code of applet D is complex and cannot be compiled at the same time during the preload phase. The two parts of codes are compiled in stages, so that the starting speed of the applet can be improved, and the using fluency of the applet can be improved.
In some embodiments, pre-compiling the code indicated by the code information into a corresponding machine code includes at least one of the following operations.
And compiling the key codes in the frame codes indicated by the code information into corresponding machine codes in a preloading stage before the target applet is started.
After the target applet is started, determining a hot spot function and/or a hot spot page which a user wants to use subsequently and compiling a hot spot code corresponding to the hot spot function and/or the hot spot page in the service code indicated by the code information into a corresponding machine code based on behavior data generated by the user by using the target applet.
According to the embodiment of the disclosure, after the target applet is started, after the user is authorized, behavior data of the user can be collected, and based on the behavior data of the user, a part or all of hot spot codes in the service codes are compiled into machine codes.
For example, after the applet E is started, the user may generate some behavior data during the course of using the applet, such as staying on a certain page or using functions related to several hot spot functions. According to the behavior data, hot spot functions related to the page where the user stays or hot spot codes corresponding to the hot spot pages can be compiled. In one example, the hot spot code of applet E is complex and takes a long time to compile all. The method can be compiled in a targeted manner according to the behavior data of the user, and the smoothness of use of the small program can be improved according to the characteristics of the user.
In some embodiments, the hot spot code in the service code indicated by the code information is determined by the following operations.
And acquiring log information generated when the sample user uses the target applet.
And determining a hot spot contained in the target applet based on the log information, wherein the hot spot comprises a hot spot function and/or a hot spot page.
And using the applet codes associated with the hot spots as hot spot codes in the service codes indicated by the code information.
According to the embodiment of the present disclosure, the client or the server may determine the hot spot code in the service code indicated by the code information through the above operation, which is not limited in the present disclosure.
For example, the client of the sample user may upload the log information to a database of the server, and the server determines the hotspot code according to the data set of the log information.
For example, the client of the sample user may perform all the above operations to obtain a hot spot code in the service code of an applet, and then upload the information of the hot spot code to the server.
For example, the server may collect log information from sample users to determine the hotspot code.
According to embodiments of the present disclosure, a sample user may have similar user attributes to a user about to use a target applet.
For example, a user who is going to use the applet F often views certain information, and a user who has also viewed the information and used the target applet F can be used as a sample user.
According to an embodiment of the present disclosure, the log information may include information of the target applet and may also include information of the user.
For example, the information of the target applet may include the name of the applet, the time point of use of a certain function in the applet, the time point at which a certain page in the applet starts to be displayed or/and ends to be displayed, the version, and the like. The information of the user includes an identification of the user client and the like.
According to the embodiment of the disclosure, the frequency of using each function or page in the target applet by the sample user can be determined according to the log information.
For example, the applet F has four functions, function 1 to function 4. The sample user often uses function 1 and function 2 of applet F. The log information uploaded by a certain sample user describes a plurality of time points at which the function 1 is used and a time point at which the function 2 is used. Further, the frequency with which the function 1 and the function 2 are used in a certain period of time can be obtained. Further, function 1 may be a hotspot function, or both functions 1 and 2 may be hotspot functions.
For example, the applet F has four functions, functions 5 to 8, respectively, and two pages, page 1 and page 2, respectively. The used frequencies of the functions 5 to 8, the page 1 and the page 2 can be determined in the above-described manner of determining the used frequency of the function 1. The frequency with which the sample user uses the function 5 and the frequency with which he stays on the page 2 are higher for a certain period of time. Function 5 may be considered a hot spot function and page 2 may be considered a hot spot page.
According to the embodiment of the disclosure, the small program code associated with the hot spot may be a part or all of code for implementing the hot spot function.
For example, function 1 is a hot spot function, and a part of the code for implementing function 1 is easy to compile and takes a short time, and this part of the code may not be compiled in advance. The other part of the code for realizing the function 1 is complex and has long compiling time consumption, and the part of the code can be used as hot spot code.
FIG. 3 is a flow diagram of a processing method for an applet, according to one embodiment of the present disclosure.
As shown in fig. 3, the processing method 300 for an applet may include operations S310 to S350. The processing method 300 for an applet can be applied to a server side.
In operation S310, log information generated when a sample user uses a target applet is acquired.
According to embodiments of the present disclosure, a sample user may have similar user attributes to a user about to use a target applet.
For example, the server may obtain attributes of the user who is going to use the applet G, e.g. the user often browses certain information, and may use the user who has also browsed the information and used the target applet G as a sample user.
In operation S320, a hotspot included in the target applet is determined based on the log information, where the hotspot includes: a hotspot function and/or a hotspot page.
According to an embodiment of the present disclosure, the log information may include information of the target applet and may also include information of the user.
For example, the information of the target applet may include the name of the applet, the time point of use of a certain function in the applet, the time point at which a certain page in the applet starts to be displayed or/and ends to be displayed, the version, and the like. The user's information includes the identity of the user's client, hardware configuration, etc.
According to the embodiment of the disclosure, the frequency of using each function or page in the target applet by the sample user can be determined according to the log information.
For example, the applet G has four functions, functions 9 to 12, respectively, and two pages, page 3 and page 4, respectively. The sample user often uses function 1 and function 2 of applet F. The log information uploaded by a certain sample user includes a plurality of time points at which the function 9 is used, a plurality of time points at which the function 10 is used, and a plurality of time points at which the user stays on the page 3. Further, it is possible to obtain the frequency with which the functions 9, 10 and the page 3 are used in a certain period of time. Further, function 1 may be used as a hot spot function, functions 1 and 2 may be both used as hot spot functions, and page 3 may be used as a hot spot page.
In operation S330, an applet code associated with the hot spot is used as a hot spot code in the service code indicated by the code information.
The small program code associated with the hot spot can be part or all of the code for realizing the hot spot function.
For example, the function 9 is a hot spot function, and a part of the code for implementing the function 9 is easy to compile and takes a short time, and the part of the code may not be compiled in advance. Another part of the code for realizing the function 9 is complex and takes a long time for compiling, and the code can be used as a hot spot code.
In operation S340, code information for the target applet is generated based on the hot spot code.
According to the embodiment of the disclosure, the code information may be the hotspot code itself or the identifier of the hotspot code.
For example, the server may package the hot spot code separately, or add a start identifier and an end identifier to the code of the target applet, so as to facilitate the hot spot code to be extracted.
In operation S350, the code information is pushed to a client, so that the client compiles a code indicated by the code information into a corresponding machine code in advance.
According to the embodiment of the disclosure, the code information can be pushed according to the request of the client.
For example, in response to a client-initiated instruction to search for a target applet, all code and code information of the target applet is pushed to the client.
By the method and the system, the server can provide code information for the user using the target applet for the first time, so that the client of the user can compile the hot spot code into the machine code in advance at the beginning, and the user can quickly start the applet or smoothly use the applet by using the target applet for the first time.
In some embodiments, the processing method for an applet may further include the following operations.
Determining key codes in the frame codes of the target small program.
And adding the key code information to the code information so as to be pushed to the client together with the code information generated based on the hot spot code.
According to the embodiment of the disclosure, the key code may be determined before determining the hot spot code, may be determined after determining the hot spot code, or may be determined while determining the hot spot code.
For example, the server determines the key code in the framework code required to run the applet H before obtaining log information of the applet H used by the sample user.
According to the embodiment of the present disclosure, the information indicating the key code may be the key code itself or an identifier of the key code.
For example, the server may encapsulate the key-code separately. The server can also add a start identifier and an end identifier in the frame code of the target applet, and the start identifier and the end identifier are used as key code information, so that the key code can be conveniently extracted.
In some embodiments, the processing method for the applet may further include the operations of:
and generating file fingerprint information associated with the code information.
And pushing the code information associated with the file fingerprint information to the client after the file fingerprint information changes.
According to the embodiment of the disclosure, the code information may be packaged into a file, and the fingerprint information may be generated for the file.
For example, the code information is packaged as a file, and the file fingerprint information is generated by using MD5 information Digest Algorithm (MD5 Message-Digest Algorithm).
According to the embodiment of the disclosure, log information of a sample user can be collected according to a certain period, new code information can be generated according to the log information, and further new file fingerprint information can be obtained.
For example, the server may collect log information of a sample user at a period of 7 days, generate code information from the log information collected at one period, and further generate file fingerprint information corresponding to the code information generated at the period. In the next period, the target applet is added with a new function, the use frequency of the function is high, the server generates code information according to the log information collected again, and then another file fingerprint information corresponding to the code information generated in the new period can be generated. The server may send new code information to the client in response to a change in the file fingerprint information. The hot spot function or the hot spot page can be updated, and the user experience is improved.
FIG. 4 is a schematic diagram of a processing method for an applet, according to one embodiment of the present disclosure.
As shown in fig. 4, a plurality of sample clients are included in the sample client cluster 410, and each sample client includes an application 411 that can run the applet 401, and a storage module 412. The application 411 may provide a runtime environment for the applet 401 to run. The applet 401 running within the application 411 produces run data 402. The storage module 412 collects the operation data 402 and forms a log 403. The plurality of sample clients upload the generated logs to the server 420, respectively. In one example, applet 401 has a plurality of business modules therein, each of which may implement at least one function.
The server 420 includes a database module 421, a hotspot determination module 422, and a code information determination module. The database module 421 stores and summarizes the logs uploaded by the sample clients, and generates a log data set 404. The hot spot determination module 422 determines a hot spot for the applet 401 according to the log data set, and takes the applet code associated with the hot spot as the hot spot code 405. The code information determination module 423 generates code information 407 from the hot spot code 405 and the key code 406 of the framework code.
The client 430 runs the applet 401 according to the code information 407. The client 401 compiles the hot spot code 405 and the key code 407 indicated by the code information 407 into corresponding machine codes in advance. In one example, the code of the applet 401 is stored in another server from which the client 430 may retrieve the applet 401 and the code information 407 from the server 420. In one example, client 430 may provide a runtime environment for applet 401. In one example, client 430 may run an application that may provide a runtime environment for applet 401.
According to an embodiment of the present disclosure, the present disclosure also provides a processing apparatus for an applet.
Fig. 5 is a block diagram of a processing device for an applet according to one embodiment of the disclosure.
As shown in fig. 5, the processing means for the applet may include: a first obtaining module 510 and a compiling module 520.
A first obtaining module 510, configured to obtain code information pushed by a server for a target applet, where the target applet includes: a framework code and a service code.
And a compiling module 520, configured to compile the code indicated by the code information into a corresponding machine code in advance.
Wherein the code indicated by the code information includes at least one of the following: key codes in the frame codes and hot spot codes in the service codes.
In some embodiments, the compiling module is configured to: and compiling the codes indicated by the code information into corresponding machine codes in a preloading stage before the target applet is started.
In some embodiments, the compiling module includes at least one of the following: a first compiling unit, configured to compile a key code in the frame code indicated by the code information into a corresponding machine code at a preloading stage before starting the target applet; and a second compiling unit, configured to compile a hot spot code in the service code indicated by the code information into a corresponding machine code after the target applet is started.
In some embodiments, the compiling module includes at least one of the following: a third compiling unit, configured to compile a key code in the frame code indicated by the code information into a corresponding machine code at a preloading stage before starting the target applet; the system comprises a first determining unit used for determining a hot spot function which a user wants to use subsequently and/or a hot spot page which the user wants to browse based on behavior data generated by the user by using the target applet after the target applet is started, and a fourth compiling unit used for compiling the hot spot code corresponding to the hot spot function and/or the hot spot page in the service code indicated by the code information into a corresponding machine code.
In some embodiments, the method further includes a first determining module, configured to determine a hotspot code in the service code indicated by the code information by: the acquisition unit is used for acquiring log information generated when the sample user uses the target applet; a second determining unit, configured to determine, based on the log information, a hotspot included in the target applet, where the hotspot includes a hotspot function and/or a hotspot page; and a third determining unit, configured to use an applet code associated with the hot spot as a hot spot code in the service code indicated by the code information.
Fig. 6 is a block diagram of a processing device for an applet according to one embodiment of the disclosure.
As shown in fig. 6, the processing means for the applet may include a second obtaining module 610, a second determining module 620, a third determining module 630, a first generating module 640, and a first pushing module 650.
And a second obtaining module 610, configured to obtain log information generated when the sample user uses the target applet.
A second determining module 620, configured to determine, based on the log information, a hotspot included in the target applet, where the hotspot includes: a hotspot function and/or a hotspot page.
A third determining module 630, configured to use the applet code associated with the hot spot as a hot spot code in the service code indicated by the code information.
A first generating module 640, configured to generate code information for the target applet based on the hotspot code.
The first pushing module 650 is configured to push the code information to a client, so that the client compiles a code indicated by the code information into a corresponding machine code in advance.
In some embodiments, further comprising: a fourth determining module, configured to determine a key code in the frame code of the target applet; and an adding module, configured to add the key code information to the code information, so as to push the key code information and the code information generated based on the hotspot code to the client.
In some embodiments, further comprising: the second generation module is used for generating file fingerprint information associated with the code information; and the second pushing module is used for pushing the code information associated with the file fingerprint information to the client after the file fingerprint information changes.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the electronic device 700 includes a computing unit 701, which may perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
A number of components in the electronic device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 701 executes the respective methods and processes described above, such as the processing method for the applet. For example, in some embodiments, the processing method for an applet may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the processing method for applets described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured by any other suitable means (e.g., by means of firmware) to perform the processing method for the applet.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in a traditional physical host and a VPS service ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server incorporating a blockchain.
In the technical scheme of the disclosure, the record, storage, application and the like of the related user behavior data all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (19)

1. A processing method for an applet, comprising:
code information pushed by a server aiming at a target applet is obtained, wherein the target applet comprises: a framework code and a service code;
compiling codes indicated by the code information into corresponding machine codes in advance;
wherein the code indicated by the code information includes at least one of: key codes in the frame codes and hot spot codes in the service codes.
2. The method of claim 1, wherein pre-compiling the code indicated by the code information into a corresponding machine code comprises:
and compiling the codes indicated by the code information into corresponding machine codes in a preloading stage before the target applet is started.
3. The method of claim 1, wherein pre-compiling the code indicated by the code information into a corresponding machine code comprises at least one of:
compiling key codes in the frame codes indicated by the code information into corresponding machine codes in a preloading stage before starting the target applet;
and compiling the hot spot codes in the service codes indicated by the code information into corresponding machine codes after the target applet is started.
4. The method of claim 1, wherein pre-compiling the code indicated by the code information into a corresponding machine code comprises at least one of:
compiling key codes in the frame codes indicated by the code information into corresponding machine codes in a preloading stage before starting the target applet;
after the target applet is started, determining a hot spot function and/or a hot spot page which a user wants to use subsequently based on behavior data generated by the user by using the target applet, and compiling a hot spot code corresponding to the hot spot function and/or the hot spot page in the service code indicated by the code information into a corresponding machine code.
5. The method of any of claims 1 to 4, further comprising determining a hotspot code in the traffic code indicated by the code information by:
acquiring log information generated when a sample user uses the target applet;
determining a hotspot contained by the target applet based on the log information, wherein the hotspot comprises a hotspot function and/or a hotspot page; and
and using the applet codes associated with the hot spots as hot spot codes in the service codes indicated by the code information.
6. A processing method for an applet, comprising:
acquiring log information generated when a sample user uses a target applet;
determining a hotspot contained by the target applet based on the log information, wherein the hotspot comprises: a hotspot function and/or hotspot page;
using the applet codes associated with the hot spots as hot spot codes in the service codes indicated by the code information;
generating code information for the target applet based on the hotspot code; and
and pushing the code information to a client so that the client compiles the code indicated by the code information into a corresponding machine code in advance.
7. The method of claim 6, further comprising:
determining a key code in the frame code of the target applet; and
adding the key code information to the code information so as to push the key code information and the code information generated based on the hot spot code to the client.
8. The method of claim 6 or 7, further comprising:
generating file fingerprint information associated with the code information; and
and after the file fingerprint information changes, pushing code information associated with the file fingerprint information to the client.
9. A processing apparatus for an applet, comprising:
the first obtaining module is configured to obtain code information pushed by a server for a target applet, where the target applet includes: a framework code and a service code;
the compiling module is used for compiling the codes indicated by the code information into corresponding machine codes in advance;
wherein the code indicated by the code information includes at least one of: key codes in the frame codes and hot spot codes in the service codes.
10. The apparatus of claim 9, wherein the compiling module is to:
and compiling the codes indicated by the code information into corresponding machine codes in a preloading stage before the target applet is started.
11. The apparatus of claim 9, wherein the compiling module includes at least one of:
a first compiling unit, configured to compile a key code in the framework code indicated by the code information into a corresponding machine code in a preloading stage before starting the target applet;
and the second compiling unit is used for compiling the hot spot codes in the service codes indicated by the code information into corresponding machine codes after the target applet is started.
12. The apparatus of claim 9, wherein the compiling module includes at least one of:
a third compiling unit, configured to compile a key code in the framework code indicated by the code information into a corresponding machine code in a preloading stage before starting the target applet;
the system comprises a first determining unit and a fourth compiling unit, wherein the first determining unit is used for determining a hot spot function which is required to be used subsequently by a user and/or a hot spot page which is required to be browsed based on behavior data generated by the user by using the target applet after the target applet is started, and the fourth compiling unit is used for compiling the hot spot code which corresponds to the hot spot function and/or the hot spot page in the service code indicated by the code information into a corresponding machine code.
13. The apparatus according to any one of claims 9 to 12, further comprising a first determining module configured to determine a hotspot code in the service code indicated by the code information by:
the acquisition unit is used for acquiring log information generated when the sample user uses the target applet;
a second determining unit, configured to determine, based on the log information, a hotspot included in the target applet, where the hotspot includes a hotspot function and/or a hotspot page; and
a third determining unit, configured to use an applet code associated with the hot spot as a hot spot code in the service code indicated by the code information.
14. A processing apparatus for an applet, comprising:
the second acquisition module is used for acquiring log information generated when the sample user uses the target applet;
a second determining module, configured to determine, based on the log information, a hotspot included in the target applet, where the hotspot includes: a hotspot function and/or hotspot page; and
a third determining module, configured to use an applet code associated with the hot spot as a hot spot code in the service code indicated by the code information;
a first generation module, configured to generate code information for the target applet based on the hotspot code; and
the first pushing module is used for pushing the code information to a client so that the client can compile the code indicated by the code information into a corresponding machine code in advance.
15. The apparatus of claim 14, further comprising:
a fourth determining module, configured to determine a key code in the frame code of the target applet; and
and the adding module is used for adding the key code information into the code information so as to push the key code information and the code information generated based on the hot spot code to the client.
16. The apparatus of claim 14 or 15, further comprising:
the second generation module is used for generating file fingerprint information associated with the code information; and
and the second pushing module is used for pushing the code information associated with the file fingerprint information to the client after the file fingerprint information changes.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-8.
CN202110754240.0A 2021-07-02 2021-07-02 Processing method, device and equipment for small program and storage medium Pending CN113377378A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110754240.0A CN113377378A (en) 2021-07-02 2021-07-02 Processing method, device and equipment for small program and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110754240.0A CN113377378A (en) 2021-07-02 2021-07-02 Processing method, device and equipment for small program and storage medium

Publications (1)

Publication Number Publication Date
CN113377378A true CN113377378A (en) 2021-09-10

Family

ID=77580802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110754240.0A Pending CN113377378A (en) 2021-07-02 2021-07-02 Processing method, device and equipment for small program and storage medium

Country Status (1)

Country Link
CN (1) CN113377378A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6463582B1 (en) * 1998-10-21 2002-10-08 Fujitsu Limited Dynamic optimizing object code translator for architecture emulation and dynamic optimizing object code translation method
JP2003316584A (en) * 2002-04-24 2003-11-07 Matsushita Electric Ind Co Ltd Device and method for generating/updating preload class
US6842894B1 (en) * 1999-04-05 2005-01-11 Gateway, Inc. Dynamic Compiling
US20090285376A1 (en) * 2008-05-13 2009-11-19 Ibm Method and tooling for the development of telecom services
CN111061484A (en) * 2019-11-28 2020-04-24 Oppo广东移动通信有限公司 Code compiling method, device, server, user terminal and readable medium
CN111061483A (en) * 2019-11-28 2020-04-24 Oppo广东移动通信有限公司 Compiling optimization method and device and electronic equipment
CN111124576A (en) * 2019-12-23 2020-05-08 焦点科技股份有限公司 Multi-platform applet and H5 page adaptation method and system
CN111625289A (en) * 2020-05-06 2020-09-04 小船出海教育科技(北京)有限公司 Method and device for quickly starting application program and electronic equipment
CN111651141A (en) * 2020-05-25 2020-09-11 北京百度网讯科技有限公司 Method and device for showing landing page of applet, electronic equipment and storage medium
CN112948026A (en) * 2019-11-26 2021-06-11 Oppo广东移动通信有限公司 Hotspot code processing method and device, server, electronic equipment and storage medium
WO2021115177A1 (en) * 2019-12-13 2021-06-17 Oppo广东移动通信有限公司 Application installation method and apparatus, terminal device, server and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6463582B1 (en) * 1998-10-21 2002-10-08 Fujitsu Limited Dynamic optimizing object code translator for architecture emulation and dynamic optimizing object code translation method
US6842894B1 (en) * 1999-04-05 2005-01-11 Gateway, Inc. Dynamic Compiling
JP2003316584A (en) * 2002-04-24 2003-11-07 Matsushita Electric Ind Co Ltd Device and method for generating/updating preload class
US20090285376A1 (en) * 2008-05-13 2009-11-19 Ibm Method and tooling for the development of telecom services
CN112948026A (en) * 2019-11-26 2021-06-11 Oppo广东移动通信有限公司 Hotspot code processing method and device, server, electronic equipment and storage medium
CN111061484A (en) * 2019-11-28 2020-04-24 Oppo广东移动通信有限公司 Code compiling method, device, server, user terminal and readable medium
CN111061483A (en) * 2019-11-28 2020-04-24 Oppo广东移动通信有限公司 Compiling optimization method and device and electronic equipment
WO2021115177A1 (en) * 2019-12-13 2021-06-17 Oppo广东移动通信有限公司 Application installation method and apparatus, terminal device, server and storage medium
CN111124576A (en) * 2019-12-23 2020-05-08 焦点科技股份有限公司 Multi-platform applet and H5 page adaptation method and system
CN111625289A (en) * 2020-05-06 2020-09-04 小船出海教育科技(北京)有限公司 Method and device for quickly starting application program and electronic equipment
CN111651141A (en) * 2020-05-25 2020-09-11 北京百度网讯科技有限公司 Method and device for showing landing page of applet, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
韩栋;刘珂;: "Web***安全性探析", 天中学刊, no. 02, pages 77 - 78 *

Similar Documents

Publication Publication Date Title
CN109976667B (en) Mirror image management method, device and system
CN107506256B (en) Method and device for monitoring crash data
CN110858172A (en) Automatic test code generation method and device
US11244153B2 (en) Method and apparatus for processing information
CN112328301B (en) Method and device for maintaining consistency of operating environments, storage medium and electronic equipment
CN112685671A (en) Page display method, device, equipment and storage medium
JP7369229B2 (en) How to change the skin of the mini program page, devices and electronic devices
CN112905805A (en) Knowledge graph construction method and device, computer equipment and storage medium
CN113297287B (en) Automatic user policy deployment method and device and electronic equipment
CN107633080B (en) User task processing method and device
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
JP2024507029A (en) Web page identification methods, devices, electronic devices, media and computer programs
CN113377378A (en) Processing method, device and equipment for small program and storage medium
CN110781375A (en) User state identification determining method and device
CN111488286B (en) Method and device for independently developing Android modules
CN112783500B (en) Method and device for generating compiling optimization information and electronic equipment
CN110457632B (en) Webpage loading processing method and device
CN110555053B (en) Method and apparatus for outputting information
CN113220367A (en) Applet running method and device, electronic equipment and storage medium
CN113282489A (en) Interface testing method and device
CN111984839A (en) Method and apparatus for rendering a user representation
CN110209914B (en) Information query method and related device
CN110795424B (en) Characteristic engineering variable data request processing method and device and electronic equipment
CN114679468B (en) File transmission method and device, electronic equipment and computer readable 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